Gossamer Forum
Home : Products : Links 2.0 : Customization :

Top 100 on many pages

Quote Reply
Top 100 on many pages
Hello,

I've installing a mod for change the top 10 on a top 100. But All the links are on the same page. How ca, I put this on different pages, like in the different categories or serach....

Thank you

laurent

Quote Reply
Re: Top 100 on many pages In reply to
If you are using the sub top_ten routine and the <%top_ten%> tag defined in the %globals variable section, then all you have to do is change the following codes in the sub top_ten routine in your site_html_templates.pl file:

Code:

if ($count <= 10) {


to the following codes:

Code:

if ($count <= 100) {


Regards,

Eliot Lee
Quote Reply
Re: Top 100 on many pages In reply to
hello,

I use this mod... I d'like to spann the results... 50 sites it's to much for a single page. How can I do ?

sub build_rate_page {
# --------------------------------------------------------
# Creates a Top 10 ratings page.my (@values, $id, $votes, $rate, @top_votes, %top_votes, @top_rate, %top_rate);
local ($top_rated, $top_votes);
my $count=1;
if ($build_ratings_path =~ m,^$build_root_path/(.*)$,) {
&build_dir ($1);
}

$total = 0;

$min_vote_rate = 1; ## the cut off for entry to top 10
$max_number_to_return = 50; ## allow x number of items returned
open (LINKS, $db_links_name) or &cgierr ("unable to open links database: $db_links_name. Reason: $!");
LINE: while (<LINKS> ) {
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp;
@values = &split_decode ($_);
$id = $values[$db_key_pos];
$votes = $values[$db_votes];
$rate = $values[$db_rating];
next if ($votes < $min_vote_rate);
if (($#top_votes < $max_number_to_return-1) or ($votes > $top_votes[$#top_votes])) {
push (@{$top_votes{$votes}}, @values);
if ($#top_votes <= $max_number_to_return) {
push (@top_votes, $votes);
@top_votes = sort { $b <=> $a } @top_votes;
}
else {
splice (@{$top_votes{$#top_votes}}, 0, $#db_cols);
$#{$top_votes{$#top_votes}} or delete $top_votes{$#top_votes};
delete $top_votes{$top_votes[$#top_votes]-$id};
$top_votes[$#top_votes] = $votes;
@top_votes = sort { $b <=> $a } @top_votes;
}
}
if (($#top_rate < $max_number_to_return-1) or ($rate > $top_rate[$#top_rate])) {
push (@{$top_rate{$rate}}, @values);
if ($#top_rate <= $max_number_to_return) {
push (@top_rate, $rate);
@top_rate = sort { $b <=> $a } @top_rate;
}
else {
splice (@{$top_rate{$#top_rate}}, 0, $#db_cols);
$#{$top_rate{$#top_rate}} or delete $top_rate{$#top_rate};
delete $top_rate{$top_rate[$#top_rate]-$id};
$top_rate[$#top_rate] = $rate;
@top_rate = sort { $b <=> $a } @top_rate;
}
}
}
close LINKS;

$top_rated = ''; $top_votes = '';

foreach (sort { $b <=> $a } @top_votes) {
$seen{$_}++;
%link = &array_to_hash ($seen{$_} - 1, @{$top_votes{$_}});
$top_votes .= qq~<div align="center">
<center>
<table border="0" width="460" bgcolor="#183152" cellspacing="0" cellpadding="0">
<tr>
<td width="120"><font color="#EDCCA0">($link{'Votes'}) </font></td>
</center>
<td width="340">
<p align="left"><a href="$db_cgi_url/jump.cgi?ID=$link{'ID'}">$link{'Title'}</a></p>
</td>
</tr>
<center>
<tr>
<td width="120"> </td>
</center>
<td width="340">
<p align="left"><font color="#EDCCA0" face="Geneva, Arial, Helvetica, sans-serif" size="2">$link{'Description'}</font></p>
</td>
</tr>
</table>
</div>
\n~;
}
foreach (sort { $b <=> $a } @top_rate) {
$seen{$_}++;
%link = &array_to_hash ($seen{$_} - 1, @{$top_rate{$_}});
$top_rated .= qq~<tr><td align=left>$link{'Rating'}</td><td align=left>$link{'Votes'}</td><td><a href="$db_cgi_url/jump.cgi?ID=$link{'ID'}">$link{'Title'}</a></td></tr>\n~;
}
open (RATE, ">$build_ratings_path/$build_index") or &cgierr ("unable to open top rated page: $build_ratings_path/$build_index. Reason: $!");
print "\tVote Range: $top_votes[0] .. $top_votes[$#top_votes]\n";
print "\tRate Range: $top_rate[0] .. $top_rate[$#top_rate]\n";
print RATE &site_html_ratings;
close RATE;
}

Quote Reply
Re: Top 100 on many pages In reply to
Hi guys,


Where's the top 100 mod? I really need it. Thanks in advance.



Kay