Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Auto delete link within certain days

Quote Reply
Auto delete link within certain days
I noticed this sub routine in Build.pm, Link 2.X

sub build_reset_hits {
# ------------------------------------------------------------------
# Remove old hit and rate tracking information.
#
Links::init_date();
my $delete_by = GT::Date::date_get ( time() - 172800 ); # 2 days old
my $click_db = $DB->table ('ClickTrack');
$click_db->delete ( GT::SQL::Condition->new ( 'Created', '<', $delete_by ));
}

I changed to this:

sub build_reset_hits {
# ------------------------------------------------------------------
# Remove old hit and rate tracking information.
#
Links::init_date();
my $delete_by = GT::Date::date_get ( time() - 172800 ); # 2 days old
my $link_db = $DB->table ('Links');
$link_db->delete ( GT::SQL::Condition->new ( 'Created', '<', $delete_by ));
}



So when I do a build it will remove old links. I also made a new table "Created" and in Add.cgi use NOW to generate the timestamp.

I did everything right but when i build change, it won't delete the link with old timestamp. Please help.
Subject Author Views Date
Thread Auto delete link within certain days mrcry11 10381 Mar 10, 2003, 10:56 PM
Thread Re: [mrcry11] Auto delete link within certain days
Andy 10297 Mar 11, 2003, 12:35 AM
Thread Re: [Andy] Auto delete link within certain days
mrcry11 10193 Mar 11, 2003, 8:59 AM
Thread Re: [mrcry11] Auto delete link within certain days
Andy 10248 Mar 11, 2003, 9:09 AM
Thread Re: [Andy] Auto delete link within certain days
mrcry11 10250 Mar 11, 2003, 9:25 AM
Thread Re: [mrcry11] Auto delete link within certain days
Paul 10146 Mar 13, 2003, 4:06 PM
Thread Re: [Paul] Auto delete link within certain days
webmaster33 10057 Mar 13, 2003, 4:11 PM
Thread Re: [webmaster33] Auto delete link within certain days
mrcry11 10083 Mar 13, 2003, 5:54 PM
Post Re: [mrcry11] Auto delete link within certain days
webmaster33 10068 Mar 13, 2003, 6:08 PM
Thread Re: [Paul] Auto delete link within certain days
mrcry11 10085 Mar 16, 2003, 8:55 AM
Post Re: [mrcry11] Auto delete link within certain days
afinlr 9989 Mar 16, 2003, 6:28 PM
Thread Re: [mrcry11] Auto delete link within certain days
webmaster33 10168 Mar 12, 2003, 1:32 PM
Thread Re: [webmaster33] Auto delete link within certain days
mrcry11 10154 Mar 12, 2003, 9:48 PM
Thread Re: [mrcry11] Auto delete link within certain days
xpert 10143 Mar 12, 2003, 10:53 PM
Thread Re: [xpert] Auto delete link within certain days
webmaster33 10137 Mar 13, 2003, 2:50 AM
Thread Re: [webmaster33] Auto delete link within certain days
Paul 10155 Mar 13, 2003, 3:02 AM
Post Re: [Paul] Auto delete link within certain days
webmaster33 10117 Mar 13, 2003, 3:10 AM
Thread Re: [mrcry11] Auto delete link within certain days
webmaster33 10087 Mar 13, 2003, 3:05 AM
Thread Re: [webmaster33] Auto delete link within certain days
mrcry11 10151 Mar 13, 2003, 10:22 AM
Post Re: [mrcry11] Auto delete link within certain days
webmaster33 10080 Mar 13, 2003, 10:58 AM
Post Re: [mrcry11] Auto delete link within certain days
afinlr 10132 Mar 13, 2003, 3:38 PM