Gossamer Forum
Home : Products : Gossamer Links : Discussions :

tempate global top 10 question

Quote Reply
tempate global top 10 question
Hi, I am still using link sql 2.2.0 not sure if it matters:

I have a template global that displays the top 10 links with the most hits:

I don't want to display any link from a specific category called "Free Stuff Sites" with ID "24" under lsql_Category table. How should I change the code?

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) {
if(length $link->{Title}> 26 ){
$link->{Title} = substr ($link->{Title}, 0, 26 );
$link->{Title} =~ s/\s\S+?$//;
$link->{Title} .= " ...";
}
$output .= Links::SiteHTML::display ('top_ten', $link);
}
return $output;
}
Quote Reply
Re: [flybuzz] tempate global top 10 question In reply to
Never mind... I figurered out. Mad
Quote Reply
Re: [flybuzz] tempate global top 10 question In reply to
In Reply To:
Never mind... I figurered out. Mad


Would love it if you would be kind enough to share the global.

Vishal
-------------------------------------------------------