Hi,
You can write a simple function like below and put it into the global :
my $tags = shift;
if ($tags->{Member} eq 'No') {
my $today = GT::Date::date_get();
my $days_used = GT::Date::date_diff($today,$tag->{date_registered}) ;
return ($days_used < 30)?'Your account will expire in '.(30-$days_used).' days':'Your account has expired';
}
return;
}I am not sure what value you put in your "date_exp" field but you can change "date_registered" field a little bit.
Also, you can do the same thing with SQL but I think using GT::Date is the best way in this case.
Cheers,
jean@gossamer-threads.com
You can write a simple function like below and put it into the global :
Code:
sub { my $tags = shift;
if ($tags->{Member} eq 'No') {
my $today = GT::Date::date_get();
my $days_used = GT::Date::date_diff($today,$tag->{date_registered}) ;
return ($days_used < 30)?'Your account will expire in '.(30-$days_used).' days':'Your account has expired';
}
return;
}
Also, you can do the same thing with SQL but I think using GT::Date is the best way in this case.
Cheers,
jean@gossamer-threads.com