Try this:
You will need:
1/ Global > “top_10”
2/ Template > “top_ten.html”
3/ Modify > “home.html” template.
Place the following into your “Template Globals” in the Admin area.
NB: Change the “LIMIT 10” in the global to the amount you want to display.
sub {
#Top 10 sites by hits.
my ($output,$sth,$link);
my $id = shift;
my $db = $DB->table ('Links');
$db->select_options ('ORDER BY Hits DESC', 'LIMIT 10');
my $sth = $db->select ( { isValidated => 'Yes'} );
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display (top_ten, $link);
}
return $output;
}
Make up a template top_ten.html which has the following in it:
<table>
<tr>
<td width="100%">
<a href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>" target="_blank">
<%Title%>:</a><br>
<font size="1" color="#FF0000">
<span style="background-color: #E6E6E6">
<font color="#FF0000">with <%Hits%> hits.</font></span></font></td>
</tr>
</table>
This shows the Title and Hits, change to suit.
Then upload that template to your "local" template directory.
Place the following tag in your home.html template.
<%top_10%>
The global will pull the info from the top_ten.html template and display them where you place the <%top_10%> tag.
Regards
minesite
You will need:
1/ Global > “top_10”
2/ Template > “top_ten.html”
3/ Modify > “home.html” template.
Place the following into your “Template Globals” in the Admin area.
NB: Change the “LIMIT 10” in the global to the amount you want to display.
sub {
#Top 10 sites by hits.
my ($output,$sth,$link);
my $id = shift;
my $db = $DB->table ('Links');
$db->select_options ('ORDER BY Hits DESC', 'LIMIT 10');
my $sth = $db->select ( { isValidated => 'Yes'} );
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display (top_ten, $link);
}
return $output;
}
Make up a template top_ten.html which has the following in it:
<table>
<tr>
<td width="100%">
<a href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>" target="_blank">
<%Title%>:</a><br>
<font size="1" color="#FF0000">
<span style="background-color: #E6E6E6">
<font color="#FF0000">with <%Hits%> hits.</font></span></font></td>
</tr>
</table>
This shows the Title and Hits, change to suit.
Then upload that template to your "local" template directory.
Place the following tag in your home.html template.
<%top_10%>
The global will pull the info from the top_ten.html template and display them where you place the <%top_10%> tag.
Regards
minesite