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

Products: Gossamer Links: Development, Plugins and Globals: Re: [kzap] Get category linked as global: Edit Log

Here is the list of edits for this post
Re: [kzap] Get category linked as global
Create a new global... called link_cat, with the following codes;

Code:
sub {

my $ID = $_[0];
my ($CatID,$CatName);

my $sth = $DB->table('CatLinks')->select( { LinkID => $ID } );
while (my $hit = $sth->fetchrow_hashref) {
$CatID = $hit->{CategoryID};
}

my $sth = $DB->table('Category')->select( { ID => $CatID } );
while (my $hit = $sth->fetchrow_hashref) {
$CatName = $hit->{Full_Name};
}

$CatName ? return $CatName : return;
}

Call this with: <%link_cat($ID)%>

Untested, but it 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!

Last edited by:

Andy: Sep 26, 2003, 1:39 AM

Edit Log: