I'm trying to use the days old plugin from a template used for a global name last_links, but however it does not work.
I tried to copy the sub from the days_old plugin and use it as a global, but however the global return nothing.. can someone help me?
sub link {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'site_html_link'
# is run. You should return STOP if you don't want
# the regular code to run, or CONTINUE if you want
# the regular code to run.
#
my $link = shift;
# added line to preserve Add_Date from Links table row
$link->{Add_Date1} = $link->{Add_Date} ;
# Links Days_Old calculate
# Figure out how many days old it is if it's a new link.
if ($link->{'isNew'} eq 'Yes') {
$link->{'Days_Old'} = GT::Date::date_diff ( GT::Date::date_get(), $link->{'Add_Date1'});
}
else {
$link->{'Days_Old'} = '';
}
return $link;
}
I tried to copy the sub from the days_old plugin and use it as a global, but however the global return nothing.. can someone help me?
sub link {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'site_html_link'
# is run. You should return STOP if you don't want
# the regular code to run, or CONTINUE if you want
# the regular code to run.
#
my $link = shift;
# added line to preserve Add_Date from Links table row
$link->{Add_Date1} = $link->{Add_Date} ;
# Links Days_Old calculate
# Figure out how many days old it is if it's a new link.
if ($link->{'isNew'} eq 'Yes') {
$link->{'Days_Old'} = GT::Date::date_diff ( GT::Date::date_get(), $link->{'Add_Date1'});
}
else {
$link->{'Days_Old'} = '';
}
return $link;
}