Funny this thread bubbled up again.
I was just playing with the Days_Old.pm file to see if I could get it to be run from inside the templates, rather than as a display hook.
I'm getting very odd results, which leads me to believe there might be a nesting problem, or other limitation in 'depth', in the template parser.
Doesn't look like GT::Date is being called properly when GT::Plugins::link is called from the template. I tried the simple things like re-initializing the Links::date_init but that didn't work.
Just odd this thread popped up :)
Also, you can do something like:
$link->{'Days_Old'} = GT::Date::date_diff ( GT::Date::date_get(), $link->{'Add_Date1'});
}
else {
$link->{'Days_Old'} = '';
}to catch where the field is 'Yes' or '1'. Might not be an issue for most people, but it catches both positive values which is important if you call it before the 'isNew' flag is changed over.
PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Plugins:http://LinkSQL.com/plugin
I was just playing with the Days_Old.pm file to see if I could get it to be run from inside the templates, rather than as a display hook.
I'm getting very odd results, which leads me to believe there might be a nesting problem, or other limitation in 'depth', in the template parser.
Doesn't look like GT::Date is being called properly when GT::Plugins::link is called from the template. I tried the simple things like re-initializing the Links::date_init but that didn't work.
Just odd this thread popped up :)
Also, you can do something like:
Code:
if (($link->{'isNew'} eq 'Yes') or ($link->{'isNew'} == 1)){ $link->{'Days_Old'} = GT::Date::date_diff ( GT::Date::date_get(), $link->{'Add_Date1'});
}
else {
$link->{'Days_Old'} = '';
}
PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Plugins:http://LinkSQL.com/plugin