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

Global to show certain cats

Quote Reply
Global to show certain cats
Hi all, have a problem with this global. It should select all cats with FatherID = 0 and field Menu = 'Links'
sorted by another field named 'Sorter':
It seems it is sorted by ID instead:

Code:
sub {
my $tags = shift;
my $cat_db = $DB->table ('Category');
my $sth = $cat_db->select (['Full_Name','Number_of_Links','Has_New_Links'], { FatherID => 0, Menu => 'Links' });
$cat_db->select_options ('ORDER BY Full_Name ASC');
my $output;
while (my ($name,$links,$new) = $sth->fetchrow_array) {
my $url = $cat_db->as_url($name);
if ($new eq 'Yes')
{$new = "<span class=new>NEU</span>"}
else {$new = ""}
$output .= qq~<a href="/$url">$name</a> ($links) $new<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#9595FF"><img src="/img/b.gif" width="1" height="1"></td>
</tr>
</table>
~;
}
return $output;
}

Last edited by:

Robert: Feb 28, 2002, 1:55 PM
Subject Author Views Date
Thread Global to show certain cats Robert 3432 Feb 28, 2002, 1:54 PM
Thread Re: [Robert] Global to show certain cats
Paul 3350 Feb 28, 2002, 1:56 PM
Thread Re: [RedRum] Global to show certain cats
Robert 3359 Feb 28, 2002, 3:10 PM
Post Re: [Robert] Global to show certain cats
pugdog 3328 Feb 28, 2002, 5:37 PM
Thread Re: [Robert] Global to show certain cats
Alex 3344 Feb 28, 2002, 9:38 PM
Post Re: [Alex] Global to show certain cats
pugdog 3383 Feb 28, 2002, 10:40 PM