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

Need help with Drop Down subcategory link list

Quote Reply
Need help with Drop Down subcategory link list
I am trying to make a drop down list for each category that shows all the links in that category's sub-categories.

From reading the boards and resource area I came up with this global:

----------------------------------------------------

sub {
my $tags = shift;
my $cat = $tags->{'Full_Name'};
my $output;
my $sth;
my $link;

use GT::SQL::Condition;

my $search_db = $DB->table('Links','CatLinks','Category');
$search_db->select_options ('GROUP BY LinkID ORDER BY Add_Date DESC Limit 5');
$sth = $search_db->select (['Links.ID', 'Links.Description', 'Links.Title', 'Links.Add_Date', 'Category.Full_Name', 'Category.Name'], GT::SQL::Condition->new(['Full_Name', 'LIKE', $cat .'%'], ['isValidated', '=', 'Yes']));

while ($link = $sth->fetchrow_hashref)
{


# Set the detailed_url
my $detailed_url = "http://mylink.com/cgi-bin/page.cgi?g=Detailed-$link->{'ID'}.html&d=1";

$output .= qq~<option value="$detailed_url"> $link->{'Name'} :: $link->{'Title'} ~;
}

return $output;
}

------------------------------------

This only shows the last 5 links in the category and subcategories. I need it to show all in only the subcategories. The limit 5 makes it so only 5 show up, but if I take it out I get ALL links in the whole database. If I make it limit 20 then it shows the last 20 links in the whole database, you get the idea.

Anyone know how to fix this... basicly I just need it to spit out a list of all subcategory links and url's for whatever category I am in.

Thanks for any help you can give.
Subject Author Views Date
Thread Need help with Drop Down subcategory link list tyranny 8200 Feb 23, 2003, 10:46 PM
Thread Re: [tyranny] Need help with Drop Down subcategory link list
afinlr 8037 Feb 25, 2003, 5:46 AM
Thread Re: [afinlr] Need help with Drop Down subcategory link list
tyranny 8087 Feb 25, 2003, 6:37 AM
Thread Re: [tyranny] Need help with Drop Down subcategory link list
afinlr 8066 Feb 25, 2003, 6:46 AM
Thread Re: [afinlr] Need help with Drop Down subcategory link list
tyranny 8049 Feb 25, 2003, 6:54 AM
Thread Re: [tyranny] Need help with Drop Down subcategory link list
afinlr 8018 Feb 25, 2003, 7:15 AM
Thread Re: [afinlr] Need help with Drop Down subcategory link list
tyranny 8021 Feb 25, 2003, 8:31 AM
Thread Re: [tyranny] Need help with Drop Down subcategory link list
afinlr 8056 Feb 25, 2003, 8:50 AM
Thread Re: [afinlr] Need help with Drop Down subcategory link list
tyranny 8076 Feb 25, 2003, 9:10 AM
Thread Re: [tyranny] Need help with Drop Down subcategory link list
afinlr 8045 Feb 25, 2003, 9:49 AM
Post Re: [afinlr] Need help with Drop Down subcategory link list
tyranny 8025 Feb 25, 2003, 10:11 AM
Thread Re: [afinlr] Need help with Drop Down subcategory link list
ajiimd 7790 Nov 24, 2004, 8:02 AM
Thread Re: [ajiimd] Need help with Drop Down subcategory link list
afinlr 7761 Nov 24, 2004, 8:19 AM
Thread Re: [afinlr] Need help with Drop Down subcategory link list
ajiimd 7800 Nov 24, 2004, 10:28 AM
Thread Re: [ajiimd] Need help with Drop Down subcategory link list
afinlr 7702 Nov 24, 2004, 10:34 AM
Post Re: [afinlr] Need help with Drop Down subcategory link list
ajiimd 7678 Nov 24, 2004, 11:56 AM
Post Re: [tyranny] Need help with Drop Down subcategory link list
afinlr 8072 Feb 25, 2003, 6:51 AM