Gossamer Forum
Quote Reply
weekly_top_link global
Hi
When using the plug iI am using Andy's plug in to create a top weekly link..
When adding the global as described I am getting a 500 error ..
Any ideas?

sub {
# define the used modules...
use Date::Calc qw( Week_Number );
# Get the all the values for current time
my ($Second, $Minute, $Hour, $Day, $Month, $Year, $WeekDay, $DayOfYear, $IsDST) = localtime(time);
# do stuff to the numbers, to get the appripriate month/year figures...
$Year = $Year % 100 + 2000;
$Month += 1;
# format date accordingly...
my $date = sprintf("%02d-%02d-%04d", $Day, $Month, $Year);
# slice up, so we have all figures seperatly...
my @sliced_date = split("-",$date);
# now lets get our week-number....
my $week = Week_Number($sliced_date[2],$sliced_date[1],$sliced_date[0]);
# do some calcs, cos we need stats from the months before..
if ($week < 52) { $week = $week - 1; }
elsif ($week == 52){ $week = 1; } # catch beginning of years...
# setup DB connections...
my $db_con = $DB->table("TopWeek");
my $sth2 = $db_con->select();
# get the URL, so we can redirect in a second...
my ($data_in,$field);
while (my $hit = $sth2->fetchrow_hashref) {
$field = "week_" . $week;
$data_in = $hit->{$field};
}
# now lets cut up, so we got hits etc...
my ($id,$hits) = split(" ",$data_in);
# get the link details we need...
my $db = $DB->table('Links');
my $link = $db->select ('*', { ID => $id })->fetchrow_hashref;
# return the HTML appropriatly...
return Links::SiteHTML::display ('weekly_link', $link);
}
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory

Last edited by:

katabd: Apr 18, 2004, 4:12 PM
Quote Reply
Re: [katabd] weekly_top_link global In reply to
Do you have Data::Calc installed?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] weekly_top_link global In reply to
Actually Andy - it is "date::calc" ---->
I went through that when I set mine up....
Quote Reply
Re: [Gypsypup] weekly_top_link global In reply to
Yeah, your correct... it is Date::Calc.... It was early when I wrote my reply Tongue

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] weekly_top_link global In reply to
Its early - have another coffee...
Quote Reply
Re: [Andy] weekly_top_link global In reply to
Thanks Andy

I just got a word back.. I do not have it Frown
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] weekly_top_link global In reply to
Hi. You will need to get that installed before the plugin will work correctly Frown (the .cgi script in the admin panel probably won't work either, as that uses the same Perl module).

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!