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

Products: Gossamer Links: Development, Plugins and Globals: Global to show certain cats: Edit Log

Here is the list of edits for this post
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

Edit Log: