ops I mean the Template Globals in Admin panel >> Templates where you can set a global tag (i.e. something => a value) or a simple function (return a value) then you can simply get a new tag <%something%> to display that value in your templates.
So you can replace the code above with :
my $date_exp_num = GT::Date::date_diff($tag->{date_exp},$today) ; # which returns number of days difference between date_exp and today.
and customize things like :
if ($date_exp_num < 0) {
....expired....
}
elsif ($date_exp_num < 30) {
...will expire within the next $date_exp_num days
}
Cheers,
jean@gossamer-threads.com
Quote:
What I have in the "date_exp" field is the date of expiration in the form of "2001-11-26".my $date_exp_num = GT::Date::date_diff($tag->{date_exp},$today) ; # which returns number of days difference between date_exp and today.
and customize things like :
if ($date_exp_num < 0) {
....expired....
}
elsif ($date_exp_num < 30) {
...will expire within the next $date_exp_num days
}
Cheers,
jean@gossamer-threads.com