Home : Products : Gossamer Links : Development, Plugins and Globals :

Products: Gossamer Links: Development, Plugins and Globals: Re: [afinlr] Category Sponsor Question: Edit Log

Here is the list of edits for this post
Re: [afinlr] Category Sponsor Question
I just ran into a small problem with the cat_sponsor global.

On the root category it displays 19 links and all subcats display 9. It is set to LIMIT 10 so I have no clue why this is happening.

It is also repeating links too. The exact same link was displayed 3 times in the list of sponsors. Is there a way to get it to stop listing the same link multiple times?

sub {
# Displays the sponsored links on every page.
my ($output,$sth,$link,$cond);
my $catid = shift;
my $search_db = $DB->table('Links','CatLinks');
$search_db->select_options ("ORDER BY rand()", "LIMIT 10");
if ($catid){
my $cat_db = $DB->table('Category');
my $all_ids = $cat_db->children($catid);
push @$all_ids, $catid;
$cond = GT::SQL::Condition->new('Sponsor', '=', 'Yes', 'isValidated','=','Yes', 'CategoryID', 'IN', $all_ids);
}
else {
$cond = GT::SQL::Condition->new('Sponsor', '=', 'Yes', 'isValidated','=','Yes');
}
$sth = $search_db->select ($cond);
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('linktop10', $link);
}
return $output;
}

Last edited by:

craven32: Mar 8, 2004, 10:37 AM

Edit Log: