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;
}
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;
}