sub {
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY full_name');
my $sth = $cat_db->select ( { FatherID => 0}, ['Full_Name','ID'] );
my $output="<table>";
while (my ($root_cat,$ID) = $sth->fetchrow_array) {
$output.="<tr><td colspan=2>$root_cat</td></tr>";
my $sth2 = $cat_db->select ( { FatherID => $ID}, ['Full_Name','Name','ID'] );
while (my ($cat,$short,$id) = $sth2->fetchrow_array) {
my $link_count = $DB->table('CatLinks')->count ( {CategoryID => $id});
my $url = $cat_db->as_url($cat);
$output .= qq~<tr><td>$link_count</td><td><a href="$CFG->{build_root_url}/$url" class="toc"><b>$short</b></a></td></tr>~;
}
}
return $output;
}
The UK High Street
my $tags = shift;
my $cat_db = $DB->table('Category');
$cat_db->select_options ('ORDER BY full_name');
my $sth = $cat_db->select ( { FatherID => 0}, ['Full_Name','ID'] );
my $output="<table>";
while (my ($root_cat,$ID) = $sth->fetchrow_array) {
$output.="<tr><td colspan=2>$root_cat</td></tr>";
my $sth2 = $cat_db->select ( { FatherID => $ID}, ['Full_Name','Name','ID'] );
while (my ($cat,$short,$id) = $sth2->fetchrow_array) {
my $link_count = $DB->table('CatLinks')->count ( {CategoryID => $id});
my $url = $cat_db->as_url($cat);
$output .= qq~<tr><td>$link_count</td><td><a href="$CFG->{build_root_url}/$url" class="toc"><b>$short</b></a></td></tr>~;
}
}
return $output;
}
The UK High Street