Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Category path in categoey.html

Quote Reply
Category path in categoey.html
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> &nbsp;"; $output .= " > "; $i++; next; } #
my $path = "/" . $cattable->as_url( join "/", @dirs[0 .. $_] );
$output .= " <a href=\"http://www.mysite/$path/$CFG->{'build_index'}\">$dirs[$_]</a> &nbsp;";
$output .= " > " if $i < $#dirs;
$i++;
}
return $output;
}
Subject Author Views Date
Thread Category path in categoey.html nir 4980 May 18, 2009, 7:42 AM
Thread Re: [nir] Category path in categoey.html
Andy 4965 May 18, 2009, 8:36 AM
Thread Re: [Andy] Category path in categoey.html
nir 4903 May 19, 2009, 1:16 AM
Thread Re: [nir] Category path in categoey.html
Andy 4880 May 19, 2009, 2:03 AM
Thread Re: [Andy] Category path in categoey.html
nir 4868 May 19, 2009, 4:40 AM
Thread Re: [nir] Category path in categoey.html
Andy 4874 May 19, 2009, 5:02 AM
Post Re: [Andy] Category path in categoey.html
nir 4850 May 19, 2009, 5:45 AM