Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [flybuzz] Display top 10 most popular in home.html???

Quote Reply
Re: [flybuzz] Display top 10 most popular in home.html??? In reply to
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
Subject Author Views Date
Thread Display top 10 most popular in home.html??? flybuzz 2278 Aug 1, 2004, 12:16 PM
Thread Re: [flybuzz] Display top 10 most popular in home.html???
minesite 2216 Aug 1, 2004, 5:06 PM
Thread Re: [minesite] Display top 10 most popular in home.html???
flybuzz 2213 Aug 1, 2004, 5:48 PM
Thread Re: [flybuzz] Display top 10 most popular in home.html???
minesite 2188 Aug 2, 2004, 4:57 PM
Post Re: [minesite] Display top 10 most popular in home.html???
flybuzz 2192 Aug 2, 2004, 5:47 PM
Thread Re: [minesite] Display top 10 most popular in home.html???
flybuzz 2196 Aug 2, 2004, 6:53 PM
Thread Re: [flybuzz] Display top 10 most popular in home.html???
minesite 2215 Aug 2, 2004, 7:08 PM
Post Re: [minesite] Display top 10 most popular in home.html???
flybuzz 2174 Aug 2, 2004, 7:20 PM
Post Re: [minesite] Display top 10 most popular in home.html???
SSmeredith 2168 Oct 6, 2004, 7:48 AM
Post Re: [minesite] Display top 10 most popular in home.html???
flybuzz 2186 Aug 2, 2004, 7:15 PM