Gossamer Forum
Quote Reply
category list
I`m working with next global.

sub {

my $show_count = $_[0];

my $category;

my $db = $DB->table('Category') || return $GT::SQL::error;

$db->select_options('ORDER BY Full_Name') || return $GT::SQL::error;

my $sth = $db->select( ['ID','Full_Name','Number_of_Links'] ) || return $GT::SQL::error;

my $back;



while (my ($id,$full_name,$numberoflinks) = $sth->fetchrow_array) {



my $full_name2;

my @cut = split /\//, $full_name;

for (my $i=0; $i < $#cut; $i++) {

$full_name2 .= "&nbsp;&nbsp;";

}



$full_name2 .= $cut[$#cut];



if ($show_count) {

$full_name2 .= " ($numberoflinks)</a></b><br>";

}



my $cid =$IN->param('catid') || $IN->param('CatLinks/CategoryID') || 0;


if ($cid == $id) {

$back .= qq{$id - $full_name2};



} else {

$back .= qq{<b>$id - <a href=\"$CFG->{build_root_url}\">$full_name2};

}



}



my $send_back = qq|$back|;



return $send_back;



}

It generates
category
subcat1
subcat2

list.
I`m trying to generate a link to category.
<a href="full url to the category">category</a>
<a href="full url to the category">subcat1</a>
etc

please help to modify this global.
Quote Reply
Re: [hmc] category list In reply to
Hi,

Please format the code in your posts with the [code][/code] tags Pirate

Where was this global from? Theres quite a few things in it that would stop it from doing what you want :/

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!
Quote Reply
Re: [Andy] category list In reply to
oops, I can`t modify my own posts?!

Andy, it was drop down grobal.
I`m trying to create something like that: ezinearticles.com/rss (categories list)

there is a code in
Code:
tag:

Code:
sub {

my $show_count = $_[0];

my $category;

my $db = $DB->table('Category') || return $GT::SQL::error;

$db->select_options('ORDER BY Full_Name') || return $GT::SQL::error;

my $sth = $db->select( ['ID','Full_Name','Number_of_Links'] ) || return $GT::SQL::error;

my $back;



while (my ($id,$full_name,$numberoflinks) = $sth->fetchrow_array) {



my $full_name2;

my @cut = split /\//, $full_name;

for (my $i=0; $i < $#cut; $i++) {

$full_name2 .= "&nbsp;&nbsp;";

}



$full_name2 .= $cut[$#cut];



if ($show_count) {

$full_name2 .= " ($numberoflinks)</a></b><br>";

}



my $cid =$IN->param('catid') || $IN->param('CatLinks/CategoryID') || 0;


if ($cid == $id) {

$back .= qq{$id - $full_name2};



} else {

$back .= qq{<b>$id - <a href=\"$CFG->{build_root_url}\">$full_name2};

}



}



my $send_back = qq|$back|;



return $send_back;



}