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 4969 Feb 13, 2001, 4:15 PM
Thread Re: Addin Expiration Date
pugdog 4814 Feb 13, 2001, 7:29 PM
Post Re: Addin Expiration Date
masamoda 4802 Feb 13, 2001, 11:04 PM
Thread Re: Addin Expiration Date
Alex 4808 Feb 13, 2001, 8:07 PM
Thread Re: Addin Expiration Date
masamoda 4869 Feb 13, 2001, 11:01 PM
Thread Re: Addin Expiration Date
ryel01 4742 Feb 23, 2001, 5:12 PM
Post Re: Addin Expiration Date
pugdog 4736 Feb 23, 2001, 11:59 PM
Post Re: Addin Expiration Date
Paul 4748 Feb 24, 2001, 5:27 AM
Post Post deleted by Evoir
Evoir 4591 Feb 7, 2002, 7:56 PM