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

Re: [SWDevil.Com] Custom Display Based on Links Age

Quote Reply
Re: [SWDevil.Com] Custom Display Based on Links Age In reply to
In Reply To:
I created a global named linkage2 using above code and called it via <%linkage2($ID)%>. HOwever there is no output, simply shows nothing.

Hi,

This definatly works:

Code:
sub {
my $date = $DB->table('Links')->select( ['Add_Date'], { ID => $_[0] } )->fetchrow;
my $today = GT::Date::date_get();
my $diff = GT::Date::date_diff($today,$date);
return { diff => $diff };
}

Called with:

Code:
<%global_name($ID)%>

..then print out <%diff%>

..so:

Code:
<%global_name($ID)%>

Difference in days: <%diff%>

You can see it running here, with a hard-coded ID

http://www.myuksearch.co.uk/.../page.cgi?d=1;p=test

Out of interest, which template are you calling this in? You need to use it ONLY in link.html, or detailed.html (or category.html, inside the <%loop links_loop%> ..<%endloop%> section...)

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!
Subject Author Views Date
Thread Custom Display Based on Links Age VishalT 6527 Apr 11, 2007, 10:44 AM
Thread Re: [SWDevil.Com] Custom Display Based on Links Age
Andy 6346 Apr 12, 2007, 1:25 AM
Thread Re: [Andy] Custom Display Based on Links Age
VishalT 6371 Apr 12, 2007, 11:25 AM
Thread Re: [SWDevil.Com] Custom Display Based on Links Age
Andy 6336 Apr 13, 2007, 1:10 AM
Thread Re: [Andy] Custom Display Based on Links Age
VishalT 6318 Apr 13, 2007, 1:40 PM
Thread Re: [SWDevil.Com] Custom Display Based on Links Age
Andy 6383 Apr 13, 2007, 2:14 PM
Thread Re: [Andy] Custom Display Based on Links Age
VishalT 6353 Apr 13, 2007, 2:50 PM
Thread Re: [SWDevil.Com] Custom Display Based on Links Age
Andy 6320 Apr 14, 2007, 1:34 AM
Thread Re: [Andy] Custom Display Based on Links Age
VishalT 6321 Apr 14, 2007, 1:40 AM
Post Re: [SWDevil.Com] Custom Display Based on Links Age
Andy 6317 Apr 14, 2007, 1:56 AM
Thread Re: [SWDevil.Com] Custom Display Based on Links Age
Andy 6291 Apr 14, 2007, 10:24 AM
Thread Re: [Andy] Custom Display Based on Links Age
VishalT 6305 Apr 14, 2007, 4:40 PM
Post Re: [SWDevil.Com] Custom Display Based on Links Age
VishalT 6253 Apr 19, 2007, 10:09 AM