2
#-----------------------------------------------------------------------------
3
# TimeZone AWStats plugin
4
# Allow AWStats to correct a bad timezone for user of IIS that use strange
6
#-----------------------------------------------------------------------------
7
# Perl Required Modules: None
8
#-----------------------------------------------------------------------------
9
# $Revision: 1.9 $ - $Author: eldy $ - $Date: 2003/12/06 21:29:14 $
12
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
13
# !!!!! This plugin reduces AWStats speed by 40% !!!!!
14
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16
# ENTER HERE THE USE COMMAND FOR ALL REQUIRED PERL MODULES
17
#use Time::Local 'timelocal_nocheck';
19
use strict;no strict "refs";
23
#-----------------------------------------------------------------------------
25
#-----------------------------------------------------------------------------
27
# ENTER HERE THE MINIMUM AWSTATS VERSION REQUIRED BY YOUR PLUGIN
28
# AND THE NAME OF ALL FUNCTIONS THE PLUGIN MANAGE.
29
my $PluginNeedAWStatsVersion="5.1";
30
my $PluginHooksFunctions="ChangeTime GetTimeZoneTitle";
34
# IF YOUR PLUGIN NEED GLOBAL VARIABLES, THEY MUST BE DECLARED HERE.
36
$PluginTimeZoneSeconds
42
#-----------------------------------------------------------------------------
43
# PLUGIN FUNCTION: Init_pluginname
44
#-----------------------------------------------------------------------------
49
# ENTER HERE CODE TO DO INIT PLUGIN ACTIONS
50
if (! $InitParams || int($InitParams) == 0) { return "Error: Disable plugin if TimeZone is 0 (Plugin useless)"; } # We do not need this plugin if TZ=0
51
$PluginTimeZoneSeconds=(int($InitParams)*3600);
54
my $checkversion=&Check_Plugin_Version($PluginNeedAWStatsVersion);
55
return ($checkversion?$checkversion:"$PluginHooksFunctions");
60
#-----------------------------------------------------------------------------
61
# PLUGIN FUNCTION: ChangeTime_pluginname
62
# UNIQUE: YES (Only one plugin using this function can be loaded)
63
#-----------------------------------------------------------------------------
64
sub ChangeTime_timezone {
66
my ($nsec,$nmin,$nhour,$nmday,$nmon,$nyear,$nwday) = localtime(Time::Local::timelocal(@$dateparts[5], @$dateparts[4], @$dateparts[3], @$dateparts[0], @$dateparts[1]-1, @$dateparts[2]-1900) + $PluginTimeZoneSeconds);
67
return ($nmday, $nmon+1, $nyear+1900, $nhour, $nmin, $nsec);
71
#-----------------------------------------------------------------------------
72
# PLUGIN FUNCTION: GetTimeZoneTitle_pluginname
73
# UNIQUE: YES (Only one plugin using this function can be loaded)
74
#-----------------------------------------------------------------------------
75
sub GetTimeZoneTitle_timezone {
76
return ($PluginTimeZoneSeconds/3600);
80
1; # Do not remove this line