Hi,
First, you have to edit the template top_rated.html to set the correct number of columns for the table where the links are shown.
Second, you have to change some lines in
admin/Links/Build.pm in
sub build_rating:
Code:
# Now build the html.
$top_rated = ''; $top_votes = '';
$min_v = 99999999; $max_v = 0;
my $topnumber = 1; while ($link = $voted->fetchrow_hashref) {
$min_v = $link->{'Votes'} if ($min_v > $link->{'Votes'});
$max_v = $link->{'Votes'} if ($max_v < $link->{'Votes'});
#-----> Modification: changed html in the following line(s) $top_votes .= qq~
<tr>
<td align="center" valign="top" rowspan="2"><b>$topnumber</b></td>
<td width="100%"><a href="${$link}{'URL'}" target="_blank">${$link}{'Title'}</a></td>
<td align="center" valign="top"><b>${$link}{'Votes'}</b></td>
<td align="right" valign="top">${$link}{'Rating'}</td>
</tr><tr>
<td colspan="3">${$link}{'Description'}</td>
</tr>\n~; $topnumber ++; }
$min_r = 99999999; $max_r = 0;
my $topnumber = 1; while ($link = $rated->fetchrow_hashref) {
$min_r = $link->{'Votes'} if ($min_r > $link->{'Votes'});
$max_r = $link->{'Votes'} if ($max_r < $link->{'Votes'});
#-----> Modification: changed html in the following line(s) $top_rated .= qq~
<tr>
<td align="center" valign="top" rowspan="2"><b>$topnumber</b></td>
<td width="100%"><a href="${$link}{'URL'}" target="_blank">${$link}{'Title'}</a></td>
<td align="right" valign="top"><b>${$link}{'Rating'}</b></td>
<td align="center" valign="top">${$link}{'Votes'}</td>
</tr><tr><td colspan="3">${$link}{'Description'}</td>
</tr>\n~; $topnumber ++; }
I added the code that is marked red to number the top rated links from 1 to 10. Also I inserted
${$link}{'Description'} to show the link description.
Note that this will not look
exactly like my top rated page because I removed some of the formatting which is done with style sheets and would not make sense to quote here.
Note also that the lines marked blue are indeed only one line in the original code. I broke them down for better readability in this forum.
To Alex:
It seems to me that this formatting should better be done in the template itself. Wouldn't it be possible to do that via tags and loops in the template?
Just a suggestion, don't know if that is possible at all
Andreas
http://www.archaeologie-online.de