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

Re: [Gorospe] Show Cat Names In MOD

Quote Reply
Re: [Gorospe] Show Cat Names In MOD In reply to
You can just use the link.html template like this:

sub {
my $tags = shift;
my $cat_id = $tags->{'ID'};
my $name = $tags->{'Name'};
my $link_db = $DB->table('Links','CatLinks');
$link_db->select_options ("ORDER BY Title ASC");
my $sth = $link_db->select ( { CategoryID => $cat_id, isValidated => 'Yes' });
my $output = qq~ <b>$name:</b><br> ~;
while (my $link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link);
}
my $cat_db = $DB->table('Category');
my $sth2 = $cat_db->select ( ['ID','Name'],{ FatherID => $cat_id });
while (my ($child_id,$subname) = $sth2->fetchrow_array){
$output .= qq~ <br><br><b>$subname:</b><br> ~;
$link_db->select_options ("ORDER BY Title ASC");
my $sth3 = $link_db->select ( { CategoryID => $child_id, isValidated => 'Yes' });
while (my $link2 = $sth3->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link2);
}
}
return $output;
}
Subject Author Views Date
Thread Show Cat Names In MOD Gorospe 2519 Dec 4, 2005, 11:27 AM
Thread Re: [Gorospe] Show Cat Names In MOD
afinlr 2460 Dec 8, 2005, 4:47 PM
Thread Re: [afinlr] Show Cat Names In MOD
Gorospe 2447 Dec 9, 2005, 7:43 AM
Thread Re: [Gorospe] Show Cat Names In MOD
afinlr 2437 Dec 9, 2005, 8:48 AM
Post Re: [afinlr] Show Cat Names In MOD
Gorospe 2420 Dec 9, 2005, 8:51 AM