Gossamer Forum
Quote Reply
Using as_url
 
sub {
my $tags = shift;
my $lnkid = $tags->{'ID'};
my $db = $DB->table ('Category','CatLinks');
my $catname = $db->select ( { LinkID => $lnkid }, ['Full_Name'] )->fetchrow;
return $CFG->{build_root_url} . "/" . $catname . "/";
}


That returns a full category name from a link ID. The only issue is the output is like:

site.com/Cars/Ford Cruger/


rather than a correct category output:

site.com/cars/ford-escort/


This code I believe gives the correct result, but I'd be damed if I can integrate this right!

return $CFG->{build_root_url} . "/" . $cat_table->as_url($cat->{Full_Name}) . "/";

Any help really appreciated.

~ ERASER


Free JavaScripts @ Insight Eye
Quote Reply
Re: [Eraser] Using as_url In reply to
Hi,

I believe tihs should work:

Code:
sub {
my $tags = shift;
my $lnkid = $tags->{'ID'};
my $db = $DB->table ('Category','CatLinks');
my $catname = $db->select ( { LinkID => $lnkid }, ['Full_Name'] )->fetchrow;
return $CFG->{build_root_url} . "/" . $DB->table ('Category')->as_url( { Full_Name => $catname } ) . "/";
}

If not, it may be you need to get the CategoryID, and then do:

Code:
return $CFG->{build_root_url} . "/" . $DB->table ('Category')->as_url( { ID => $catid } ) . "/";

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates