Gossamer Forum
Home : Products : Links 2.0 : Customization :

help w/ Top Rated mod

Quote Reply
help w/ Top Rated mod
Hi. I'm trying to change my Top 10 into a Top 50 (all on one page). I sifted through old posts and found this mod to add to site_html_templates.pl:

sub top_ten {
#-------------------------------------------
# Insert Top Ten Sites
open (NAME,"<$db_file_name") or &cgierr("error in numlinks. unable to open database:$db_links_name.\nReason: $!");
LINE: while(<NAME> ){
next LINE if (/^#/);
next LINE if (/^\s*$/);
@data=split (/\|/);
$tophits{$data[0]} = $data[8];
$name{$data[0]} = $data[1];
$url{$data[0]} = $data[2];
}
close (NAME);
my $count=1;
foreach $field (sort { $tophits{$b} <=> $tophits{$a} } keys %tophits) {if ($count <= 50) {
$output .= "$count. <a href=\"$url{$field}\" target=\"_blank\">$name{$field}</a>
\n";
}$count++;
}
return $output;
}

My rate_top.html currently looks like this:

<tr><th><strong>Rating</strong></th><th><strong># of Votes</strong></th><th align=left><strong>Site</strong></th></tr>
<%top_rated%>
</table>
</div>

<p><strong>Favorite 10 Sites by Votes</strong></p>
<div class=margin>
<table border=0>
<tr><th><strong>Rating</strong></th><th><strong># of Votes</strong></th><th align=left><strong>Site</strong></th></tr>
<%top_votes%>
</table>
</div>





Is there more I have to change? I am not running any other mods, other than Editor's Pick.

Thanks!
Rebecca

Quote Reply
Re: help w/ Top Rated mod In reply to
You are confusing MODS...the codes/mod you copied is used to create a separate page that can be inserted either as a global tag or SSI!

You need to hack the sub build_rate_page routine in the nph-build.cgi script.

Regards,

Eliot Lee
Quote Reply
Re: help w/ Top Rated mod In reply to
You could probably change the following line in nph-build.cgi:

Code:
if (($#top_rate < 9) or ($rate > $top_rate[$#top_rate])) {
to

Code:
if ($#top_rate < 49)) {


Installs:http://wiredon.net/gt
FAQ:http://www.perlmad.com