How I can use this code to work in categoey.html
sub {
my $tag = shift;
my ($table, $sth, $catID, $cattable, $sth2, $name, @dirs, $output, $i);
$table = $DB->table ('CatLinks');
$sth = $table->select ( { LinkID => $tag->{ID} }, ['CategoryID'] );
$catID = $sth->fetchrow();
$cattable = $DB->table('Category');
$sth2 = $cattable->select ( { ID => $catID }, ['Full_Name'] );
$name = $sth2->fetchrow_array;
@dirs = split (/\//, $name);
$i = 0;
for (0 .. $#dirs) {
if ( $i == '0') {my $path = "/" . $cattable->as_url( join "/", @dirs[0 .. $_] ); $output .= " <a href=\"=\"http://www.mysite/\">$dirs[$_]</a> "; $output .= " > "; $i++; next; } #
my $path = "/" . $cattable->as_url( join "/", @dirs[0 .. $_] );
$output .= " <a href=\"http://www.mysite/$path/$CFG->{'build_index'}\">$dirs[$_]</a> ";
$output .= " > " if $i < $#dirs;
$i++;
}
return $output;
}
sub {
my $tag = shift;
my ($table, $sth, $catID, $cattable, $sth2, $name, @dirs, $output, $i);
$table = $DB->table ('CatLinks');
$sth = $table->select ( { LinkID => $tag->{ID} }, ['CategoryID'] );
$catID = $sth->fetchrow();
$cattable = $DB->table('Category');
$sth2 = $cattable->select ( { ID => $catID }, ['Full_Name'] );
$name = $sth2->fetchrow_array;
@dirs = split (/\//, $name);
$i = 0;
for (0 .. $#dirs) {
if ( $i == '0') {my $path = "/" . $cattable->as_url( join "/", @dirs[0 .. $_] ); $output .= " <a href=\"=\"http://www.mysite/\">$dirs[$_]</a> "; $output .= " > "; $i++; next; } #
my $path = "/" . $cattable->as_url( join "/", @dirs[0 .. $_] );
$output .= " <a href=\"http://www.mysite/$path/$CFG->{'build_index'}\">$dirs[$_]</a> ";
$output .= " > " if $i < $#dirs;
$i++;
}
return $output;
}