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
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