Gossamer Forum
Quote Reply
Addin Expiration Date
Hi,
I am trying to make a plugin for adding/calculating an expiration date for links. Therefore, when you are adding your link, based on the date_posted and the duration you select, expiration date field is calculated and updated.
So, I started from the 'user_link_add' hook, and decided to have a PRE hook on 'user_link_add' that takes looks like:
###################
use strict;
use GT::Plugins qw/STOP CONTINUE/;
use Links qw/$IN $DB $USER $CFG $TPL/;
use GT::Date;

sub set_expiration {


my $input = $IN->get_hash;
my $duration = $input->{'AdDuration'};
Links::init_date();
my $today = GT::Date::date_get();
$input->{Add_Date} = $today;
$input->{Exp_Date} = add_date($today, $duration);
$input->{AdRenew} = 0;

return $input;

}
################
Guess what - it does not work - and I figured that I'm not getting/passing the right arguments/hash...what now?

Thanks - any help very appreciated.

Masamoda :)


Subject Author Views Date
Thread Addin Expiration Date masamoda 4027 Feb 13, 2001, 4:15 PM
Thread Re: Addin Expiration Date
pugdog 3909 Feb 13, 2001, 7:29 PM
Post Re: Addin Expiration Date
masamoda 3896 Feb 13, 2001, 11:04 PM
Thread Re: Addin Expiration Date
Alex 3903 Feb 13, 2001, 8:07 PM
Thread Re: Addin Expiration Date
masamoda 3957 Feb 13, 2001, 11:01 PM
Thread Re: Addin Expiration Date
ryel01 3837 Feb 23, 2001, 5:12 PM
Post Re: Addin Expiration Date
pugdog 3831 Feb 23, 2001, 11:59 PM
Post Re: Addin Expiration Date
Paul 3843 Feb 24, 2001, 5:27 AM
Post Post deleted by Evoir
Evoir 3686 Feb 7, 2002, 7:56 PM