Gossamer Forum
Home : Products : Links 2.0 : Customization :

I don't want -- isPopular, Rating, Votes, and Hits.

Quote Reply
I don't want -- isPopular, Rating, Votes, and Hits.
Hi
For some reasons, i need to totally eliminate isPopular, Rating, Votes, Hits fields from Links 2.0.

I know how to delete those from 'links.def', but i still not sure what subroutine that i should delete in site_html.pl and nph_build.cgi.

If you know how to do it, please give me some clues.

Thanks you very much.
Pumin
Quote Reply
Re: I don't want -- isPopular, Rating, Votes, and Hits. In reply to
In 'site_html.pl' file, change this:

Code:

sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like. It's a little complex looking just because we have to
# check for blank entries..

my (%rec) = @_;

$build_detailed ?
($output = qq~<ul><li><a class="link" href="$build_detail_url/$rec{$db_key}$build_extension">$rec{'Title'}</a>~) :
($output = qq~<ul><li><a class="link" href="$build_jump_url?$db_key=$rec{$db_key}">$rec{'Title'}</a>~);

if ($rec{'Description'}) { $output .= qq~ <span class="descript">- $rec{'Description'}</span>\n~; }
if ($rec{'isNew'} eq "Yes") { $output .= qq~ <small><sup class="new">new</sup></small>~; }
if ($rec{'isPopular'} eq "Yes") { $output .= qq~ <small><sup class="pop">pop</sup></small>~; }

$output .= qq~ <small class="date">(Added: $rec{'Date'} Hits: $rec{'Hits'} Rating: $rec{'Rating'} Votes: $rec{'Votes'}) <a href="$build_rate_url?ID=$rec{'ID'}">Rate It</a></small>
</ul>
~;

return $output;
}


to this:


Code:

sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like. It's a little complex looking just because we have to
# check for blank entries..

my (%rec) = @_;

$build_detailed ?
($output = qq~<ul><li><a class="link" href="$build_detail_url/$rec{$db_key}$build_extension">$rec{'Title'}</a>~) :
($output = qq~<ul><li><a class="link" href="$build_jump_url?$db_key=$rec{$db_key}">$rec{'Title'}</a>~);

if ($rec{'Description'}) { $output .= qq~ <span class="descript">- $rec{'Description'}</span>\n~; }
if ($rec{'isNew'} eq "Yes") { $output .= qq~~; }
if ($rec{'isPopular'} eq "Yes") { $output .= qq~~; }

$output .= qq~
</ul>
~;

return $output;
}


It will give you just links with optional description, which you can modify in /admin/admin.cgi Smile


Regards,

Pasha

------------------
webmaster@find.virtualave.net
http://find.virtualave.net
Quote Reply
Re: I don't want -- isPopular, Rating, Votes, and Hits. In reply to
Dont listet to Pascha, it seems he cant read english :-)

You jst have to edit nph-build and links.def
I did it alsow, and I just used the search-function to find out!

And dont forget to back-up; just an example:

if you dont have db_new specified, and you use nph-build all your id numbers will be overwritten with Yes or No.

Quote Reply
Re: I don't want -- isPopular, Rating, Votes, and Hits. In reply to
In this particular situation, I actually think Pasha's solution is better. Just don't display the information or menu items, but let links still use it.

There are just too many places in the various scripts that would need to be modified to account for the lack of those fields in %db_def. Besides, a lot of the functionality of Links would be lost without that.

On the other hand, if you later wanted to include those items again, it would just be a matter of adding them back to sub site_html_link or the link.html template file.

To save time when building, you could comment-out the calls in nph-build.cgi for building the new, cool, and top rated pages. That way, they also could be easily restored if you ever decided to use them.
Quote Reply
Re: I don't want -- isPopular, Rating, Votes, and Hits. In reply to
i finally decided to keep all functions of Links as it is because my Links was screwed when i tried to delete those variable. As Bobsie said, there are too many places to be changed and i don't want to touch it again.

It seems like just changing output display is the easiest solution, but it's a bit annoying since i have to see those fields every times when i view database in 'admin.cgi'.

Thanks you very much for your time to Chrishint, Pasha, and Bobsie.

Pumin