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

Products: Gossamer Links: Development, Plugins and Globals: Re: [Abusaki] Modified links with Category names: Edit Log

Here is the list of edits for this post
Re: [Abusaki] Modified links with Category names
This is what you want:

Code:
'last_modified' => '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);}}',


Now you must create a template called link_home.html

In you template you can put this:

<a href="<%build_root_url%>/<%category_url%>"><%category%></a> (for your category)
<a href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>"><%Title%></a> (for your link)

In home.html you can call the global by saying <%last_modified%> (you don't need any input)

Hope this works for you,

- Jonathan

Last edited by:

jdgamble: Sep 8, 2004, 4:30 PM

Edit Log: