I made a new global....
this was one of the reasons for detail_page.cgi, but that only went so far.
Code:
sub {
# ------------------------------------------------------------------
# Generate a linked title.
#
# call with <%linked_title ($LinkID, $Title, ':', 0, 0)%>
# where the first two parameters are required, and you can
# add parameters 3, 4 and 5 in order
#
my $id = $_[0];
my $input = $_[1];
my $separator = $_[2] || ':';
my $home = $_[3] || 0;
my $complete = $_[4] || 0;
my (@dirs, $dir, $output, $path, $last, $db, $top);
$db = $DB->table('Category');
$top = Links::language('LINKS_TOP') || 'Top';
my ($cat_id, $cat_name) = %{$DB->table('Links')->get_categories ($_[0])};
$input = "$cat_name/$_[1]";
@dirs = split (/\//, $input);
$last = pop @dirs unless ($complete);
$output = $home ? qq| <a href="$CFG->{build_root_url}/$CFG->{build_index}">$top</a> $separator| : '';
for (0 .. $#dirs) {
$path = "/" . $db->as_url ( join "/", @dirs[0 .. $_] );
$output .= qq| <a href="$CFG->{build_root_url}$path/$CFG->{build_index}">$dirs[$_]</a> $separator|;
}
if ($complete) {
chop $output; chop $output;
}
else {
$output .= " $last";
}
return $output;
}
PUGDOG� Enterprises, Inc. The best way to contact me is to
NOT use Email.
Please leave a PM here.