Hi All!
I just recently upgraded from Links SQL 2.2.1 => 3.0.3 without many major problems. The only thing I'm still having a issue with is the Days_Old plugin. After the upgrade it's no longer working. I've played with the code, searched the forums, and had no luck.
Anyone ran into the same problem? Know of a fix and/or have and clue as to what might be wrong?
Thanks for any help!
Code Snip:
package Plugins::Days_Old;
# ==================================================================
use strict;
use GT::Plugins qw/STOP CONTINUE/;
use Links qw/$IN $DB $TPL/;
use GT::Date;
sub link {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'site_html_link'
# is run. You should return STOP if you don't want
# the regular code to run, or CONTINUE if you want
# the regular code to run.
#
my $link = shift;
# added line to preserve Add_Date from Links table row
$link->{Add_Date1} = $link->{Add_Date} ;
# Links Days_Old calculate
# Figure out how many days old it is if it's a new link.
if ($link->{'isNew'} eq 'Yes') {
$link->{'Days_Old'} = GT::Date::date_diff ( GT::Date::date_get(), $link->{'Add_Date1'});
}
else {
$link->{'Days_Old'} = '';
}
return $link;
}
sub subcategory {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'site_html_print_cat'
# is run. You should return STOP if you don't want
# the regular code to run, or CONTINUE if you want
# the regular code to run.
#
my $subcat = shift;
my $cat_db = $DB->table('Category');
for (my $x=0;$x<scalar(@$subcat);$x++) {
my $cat_r=$subcat->[$x];
# Calculate the number of days old.
if ($cat_r->{'Has_New_Links'}) {
$cat_r->{'Days_Old'} = GT::Date::date_diff (GT::Date::date_get(), $cat_r->{'Newest_Link'});
}
else { $cat_r->{'Days_Old'} = ''; }
}
return $subcat;
}
I just recently upgraded from Links SQL 2.2.1 => 3.0.3 without many major problems. The only thing I'm still having a issue with is the Days_Old plugin. After the upgrade it's no longer working. I've played with the code, searched the forums, and had no luck.
Anyone ran into the same problem? Know of a fix and/or have and clue as to what might be wrong?
Thanks for any help!
Code Snip:
package Plugins::Days_Old;
# ==================================================================
use strict;
use GT::Plugins qw/STOP CONTINUE/;
use Links qw/$IN $DB $TPL/;
use GT::Date;
sub link {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'site_html_link'
# is run. You should return STOP if you don't want
# the regular code to run, or CONTINUE if you want
# the regular code to run.
#
my $link = shift;
# added line to preserve Add_Date from Links table row
$link->{Add_Date1} = $link->{Add_Date} ;
# Links Days_Old calculate
# Figure out how many days old it is if it's a new link.
if ($link->{'isNew'} eq 'Yes') {
$link->{'Days_Old'} = GT::Date::date_diff ( GT::Date::date_get(), $link->{'Add_Date1'});
}
else {
$link->{'Days_Old'} = '';
}
return $link;
}
sub subcategory {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'site_html_print_cat'
# is run. You should return STOP if you don't want
# the regular code to run, or CONTINUE if you want
# the regular code to run.
#
my $subcat = shift;
my $cat_db = $DB->table('Category');
for (my $x=0;$x<scalar(@$subcat);$x++) {
my $cat_r=$subcat->[$x];
# Calculate the number of days old.
if ($cat_r->{'Has_New_Links'}) {
$cat_r->{'Days_Old'} = GT::Date::date_diff (GT::Date::date_get(), $cat_r->{'Newest_Link'});
}
else { $cat_r->{'Days_Old'} = ''; }
}
return $subcat;
}