件数0のカテゴリーはリンクしない ふるいむかし
lib\sb\Content.pm
sub _category_tree { # カテゴリーツリー
my %param = (
'cat' => [],
'branch' => undef,
'num' => {},
'no_num' => undef,
@_
);
my $list = '';
foreach my $cat ( @{$param{'cat'}} ) {
next if ($cat->get_option('list') == 1);
next if (!defined($param{'branch'}) and $cat->main ne '');
next if ( defined($param{'branch'}) and $cat->main ne $param{'branch'});
my $text = $cat->text; # code by Fuco. Thanks!
$text = ($text ne '') ? ' title="' . sb::Text->entitize($text) . '"' : '';
if ( int($param{'num'}->{$cat->id}) == 0 ) {
$list .= '<li><b>' . $cat->name . '</b>';
}
else {
$list .= '<li><a href="' . $cat->cat_url . '"' . $text . '>' . $cat->name . '</a>';
}
# $list .= ' (' . int($param{'num'}->{$cat->id}) . ')' if (!$param{'no_num'});
if ($cat->sub ne '') {
$list .= "\n" . '<ul>';
$list .= &_category_tree(
'cat' => $param{'cat'},
'branch' => $cat->id,
'num' => $param{'num'},
'no_num' => $param{'no_num'},
);
$list .= '</ul>';
}
$list .= '</li>' . "\n";
}
return($list);
}