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

Modified links with Category names

(Page 2 of 2)
> >
Quote Reply
Re: [Abusaki] Modified links with Category names In reply to
I don't know what you are doing wrong... lets start from the beginning:

1.) Go to your linksSQL admin under build => template globals...
2.) Scroll down to the bottom where it says new, and type in "modified1"
3.) In the text-box field copy and paste this EXACT code:

Code:


sub {
my ($sth,$tab,$output,$tabcat,$cat_id,$category,%rec,$rec,$sthcat);
$tab = $DB->table('Links');
$tab->select_options('ORDER BY MOD_DATE Desc', 'LIMIT 5');
$tabcat = $DB->table('CatLinks');
$category = $DB->table('Category');
$sth = $tab->select( { isValidated => 'Yes' } );
while ($rec = $sth->fetchrow_hashref) {
$cat_id = $tabcat->select(['CategoryID'],{ LinkID => $rec->{ID} })->fetchrow;
$sthcat = $category->select(['Full_Name'],{ ID => $cat_id })->fetchrow;
$rec->{category} = $sthcat;
$rec->{category_url} = $category->as_url($sthcat);
$output .= Links::SiteHTML::display('link_home', $rec);
}
return $output;
}


4.) Go to the admin, user-templates, and load the home.html template. Insert <%modifed1%> where ever you would like it to display your modified links.
5.) If you have not already done so, create a new template called link_home.html to display the modified links the way you want.

Good luck!!!

- Jonathan

Last edited by:

jdgamble: Sep 13, 2004, 11:00 PM
Quote Reply
Re: [jdgamble] Modified links with Category names In reply to
Thanks Jonathan,
works great now,

I did not place the return output properly
Quote Reply
Re: [Abusaki] Modified links with Category names In reply to
Glad I could finally help!Cool

- Jonathan
> >