You need a new global.
my ($table, $sth, $catID, $cattable, $sth2, $name, @dirs, $output, $i);
$cattable = $DB->table('Category');
$name = $cattable->select ( ['Full_Name'], { ID => $_[0] } )->fetchrow;
@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;
}
Call with:
<%global_name($ID)%>
Untested, but should work.
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Code:
sub { my ($table, $sth, $catID, $cattable, $sth2, $name, @dirs, $output, $i);
$cattable = $DB->table('Category');
$name = $cattable->select ( ['Full_Name'], { ID => $_[0] } )->fetchrow;
@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;
}
Call with:
<%global_name($ID)%>
Untested, but should work.
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!