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

count number of sub_categories

Quote Reply
count number of sub_categories
I searched the forum and never found the code for this. I would like to count the number of sub categories on my category pages. If this global is in this forum, I could not find it...

I can figure out how to write it, but its time consuming...

Here is what I have...

Code:

sub {
#---------------------------------------------------
# Display the number of sub categories

my $tag = shift;

my $title = $tag->{title};




my ($db, $sth, $names);
my $count;
my $title = "Magic Directories/Dealers";
$db = $DB->table("Category");
$db->select_options("ORDER BY Name");
$sth = $db->select( ["Full_Name"] );
$names = $sth->fetchrow_array;

# run a loop and $count++;

# somehow cross reference the $title with the category names and count them...

return $name;
}


I haven't tested any of this, but I image it would be something close to this. It seems like a lot of work for something so simple...

Any ideas?

- Jonathan
Subject Author Views Date
Thread count number of sub_categories jdgamble 4534 Jan 12, 2005, 9:38 PM
Thread Re: [jdgamble] count number of sub_categories
pugdog 4450 Jan 12, 2005, 10:20 PM
Thread Re: [pugdog] count number of sub_categories
jdgamble 4411 Jan 12, 2005, 11:42 PM
Thread Re: [jdgamble] count number of sub_categories
pugdog 4420 Jan 13, 2005, 2:06 AM
Thread Re: [pugdog] count number of sub_categories
jdgamble 4416 Jan 13, 2005, 3:51 AM
Post Re: [jdgamble] count number of sub_categories
Andy 4406 Jan 13, 2005, 4:11 AM
Thread Re: [jdgamble] count number of sub_categories
pugdog 4391 Jan 13, 2005, 10:55 AM
Post Re: [pugdog] count number of sub_categories
jdgamble 4367 Jan 20, 2005, 1:22 AM
Thread Re: [jdgamble] count number of sub_categories
VishalT 884 Jan 16, 2024, 2:03 PM
Thread Re: [VishalT] count number of sub_categories
Andy 499 Mar 15, 2024, 1:37 AM
Post Re: [Andy] count number of sub_categories
VishalT 478 Mar 16, 2024, 12:15 PM