From: eldy <> Date: Sun, 8 Dec 2002 14:37:52 +0000 (+0000) Subject: Updated plugins code syntax. X-Git-Tag: AWSTATS_5_3_BETA~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae538fe1bc6d8084e887ef2bb0cf099a3507ed73;p=thirdparty%2FAWStats.git Updated plugins code syntax. --- diff --git a/wwwroot/cgi-bin/plugins/example/example.pm b/wwwroot/cgi-bin/plugins/example/example.pm index 657ebe40..582e685d 100644 --- a/wwwroot/cgi-bin/plugins/example/example.pm +++ b/wwwroot/cgi-bin/plugins/example/example.pm @@ -27,18 +27,14 @@ use strict;no strict "refs"; #----------------------------------------------------------------------------- # <----- # ENTER HERE THE MINIMUM AWSTATS VERSION REQUIRED BY YOUR PLUGIN -# SHOULD BE AT LEAST 5.1 +# AND THE NAME OF ALL FUNCTIONS THE PLUGIN MANAGE. +# EACH POSSIBLE FUNCTION AND GOAL ARE DESCRIBE LATER. my $PluginNeedAWStatsVersion="5.1"; -# -----> - -# <----- -# THIS VARIABLE MUST CONTAINS THE NAME OF ALL FUNCTIONS THE PLUGIN HANDLE -# EACH POSSIBLE FUNCTION AND GOAL ARE DESCRIBE LATER my $PluginHooksFunctions="xxx"; # -----> # <----- -# IF YOUR PLUGIN NEED GLOBAL VARIABLES, THEY MUST BE DECLARED HERE +# IF YOUR PLUGIN NEED GLOBAL VARIABLES, THEY MUST BE DECLARED HERE. use vars qw/ $PluginVariable1 /; diff --git a/wwwroot/cgi-bin/plugins/geoip.pm b/wwwroot/cgi-bin/plugins/geoip.pm index 8b751836..d18d0c42 100644 --- a/wwwroot/cgi-bin/plugins/geoip.pm +++ b/wwwroot/cgi-bin/plugins/geoip.pm @@ -23,17 +23,13 @@ use strict;no strict "refs"; #----------------------------------------------------------------------------- # <----- # ENTER HERE THE MINIMUM AWSTATS VERSION REQUIRED BY YOUR PLUGIN -# SHOULD BE AT LEAST 5.1 +# AND THE NAME OF ALL FUNCTIONS THE PLUGIN MANAGE. my $PluginNeedAWStatsVersion="5.2"; -# -----> - -# <----- -# THIS VARIABLE MUST CONTAINS THE NAME OF ALL FUNCTIONS THAT MANAGE THE PLUGIN my $PluginHooksFunctions="GetCountryCodeByAddr GetCountryCodeByName"; # -----> # <----- -# IF YOUR PLUGIN NEED GLOBAL VARIABLES, THEY MUST BE DECLARED HERE +# IF YOUR PLUGIN NEED GLOBAL VARIABLES, THEY MUST BE DECLARED HERE. use vars qw/ $gi /; @@ -50,11 +46,11 @@ sub Init_geoip { # <----- # YOU CAN ENTER HERE CODE TO INIT PLUGIN GLOBAL VARIABLES - debug("InitParams=$InitParams",1); + debug(" InitParams=$InitParams",1); # $gi = Geo::IP->new(GEOIP_STANDARD); $gi = Geo::IP->new(GEOIP_MEMORY_CACHE); - # -----> + return ($checkversion?$checkversion:"$PluginHooksFunctions"); } diff --git a/wwwroot/cgi-bin/plugins/graph3d.pm b/wwwroot/cgi-bin/plugins/graph3d.pm index ce878d6c..546c6798 100644 --- a/wwwroot/cgi-bin/plugins/graph3d.pm +++ b/wwwroot/cgi-bin/plugins/graph3d.pm @@ -19,8 +19,12 @@ use strict;no strict "refs"; #----------------------------------------------------------------------------- # PLUGIN VARIABLES #----------------------------------------------------------------------------- +# <----- +# ENTER HERE THE MINIMUM AWSTATS VERSION REQUIRED BY YOUR PLUGIN +# AND THE NAME OF ALL FUNCTIONS THE PLUGIN MANAGE. my $PluginNeedAWStatsVersion="5.1"; my $PluginHooksFunctions="ShowMonthGraph"; +# -----> @@ -30,6 +34,11 @@ my $PluginHooksFunctions="ShowMonthGraph"; sub Init_graph3d { my $InitParams=shift; my $checkversion=&Check_Plugin_Version($PluginNeedAWStatsVersion); + + # <----- + # YOU CAN ENTER HERE CODE TO INIT PLUGIN GLOBAL VARIABLES + # -----> + return ($checkversion?$checkversion:"$PluginHooksFunctions"); } diff --git a/wwwroot/cgi-bin/plugins/hashfiles.pm b/wwwroot/cgi-bin/plugins/hashfiles.pm index ece55fa0..1942e19f 100644 --- a/wwwroot/cgi-bin/plugins/hashfiles.pm +++ b/wwwroot/cgi-bin/plugins/hashfiles.pm @@ -20,11 +20,15 @@ use strict;no strict "refs"; #----------------------------------------------------------------------------- # PLUGIN VARIABLES #----------------------------------------------------------------------------- +# <----- +# ENTER HERE THE MINIMUM AWSTATS VERSION REQUIRED BY YOUR PLUGIN +# AND THE NAME OF ALL FUNCTIONS THE PLUGIN MANAGE. my $PluginNeedAWStatsVersion="5.1"; my $PluginHooksFunctions="SearchFile LoadCache SaveHash"; +# -----> # <----- -# IF YOUR PLUGIN NEED GLOBAL VARIABLES, THEY MUST BE DECLARED HERE +# IF YOUR PLUGIN NEED GLOBAL VARIABLES, THEY MUST BE DECLARED HERE. use vars qw/ $PluginHashfilesUpToDate /; diff --git a/wwwroot/cgi-bin/plugins/timehires.pm b/wwwroot/cgi-bin/plugins/timehires.pm index 332bbcf5..cbaae8bc 100644 --- a/wwwroot/cgi-bin/plugins/timehires.pm +++ b/wwwroot/cgi-bin/plugins/timehires.pm @@ -16,8 +16,12 @@ use strict;no strict "refs"; #----------------------------------------------------------------------------- # PLUGIN VARIABLES #----------------------------------------------------------------------------- +# <----- +# ENTER HERE THE MINIMUM AWSTATS VERSION REQUIRED BY YOUR PLUGIN +# AND THE NAME OF ALL FUNCTIONS THE PLUGIN MANAGE. my $PluginNeedAWStatsVersion="5.1"; my $PluginHooksFunctions="GetTime"; +# -----> @@ -27,6 +31,11 @@ my $PluginHooksFunctions="GetTime"; sub Init_timehires { my $InitParams=shift; my $checkversion=&Check_Plugin_Version($PluginNeedAWStatsVersion); + + # <----- + # YOU CAN ENTER HERE CODE TO INIT PLUGIN GLOBAL VARIABLES + # -----> + return ($checkversion?$checkversion:"$PluginHooksFunctions"); } diff --git a/wwwroot/cgi-bin/plugins/timezone.pm b/wwwroot/cgi-bin/plugins/timezone.pm index aaf806a3..fd32469b 100644 --- a/wwwroot/cgi-bin/plugins/timezone.pm +++ b/wwwroot/cgi-bin/plugins/timezone.pm @@ -9,9 +9,9 @@ # $Revision$ - $Author$ - $Date$ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# !!!!!!! This plugin reduces AWStats speed by 30% !!!!!!! -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# !!!!! This plugin reduces AWStats speed by 30% !!!!! +# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # <----- # ENTER HERE THE USE COMMAND FOR ALL REQUIRED PERL MODULES #use Time::Local 'timelocal_nocheck'; @@ -23,11 +23,15 @@ use strict;no strict "refs"; #----------------------------------------------------------------------------- # PLUGIN VARIABLES #----------------------------------------------------------------------------- +# <----- +# ENTER HERE THE MINIMUM AWSTATS VERSION REQUIRED BY YOUR PLUGIN +# AND THE NAME OF ALL FUNCTIONS THE PLUGIN MANAGE. my $PluginNeedAWStatsVersion="5.1"; my $PluginHooksFunctions="ChangeTime GetTimeZoneTitle"; +# -----> # <----- -# IF YOUR PLUGIN NEED GLOBAL VARIABLES, THEY MUST BE DECLARED HERE +# IF YOUR PLUGIN NEED GLOBAL VARIABLES, THEY MUST BE DECLARED HERE. use vars qw/ $PluginTimeZoneSeconds /; diff --git a/wwwroot/cgi-bin/plugins/urlalias.pm b/wwwroot/cgi-bin/plugins/urlalias.pm index 23bdf90c..876aabc9 100644 --- a/wwwroot/cgi-bin/plugins/urlalias.pm +++ b/wwwroot/cgi-bin/plugins/urlalias.pm @@ -24,17 +24,13 @@ use strict;no strict "refs"; #----------------------------------------------------------------------------- # <----- # ENTER HERE THE MINIMUM AWSTATS VERSION REQUIRED BY YOUR PLUGIN -# SHOULD BE AT LEAST 5.1 +# AND THE NAME OF ALL FUNCTIONS THE PLUGIN MANAGE. my $PluginNeedAWStatsVersion="5.2"; -# -----> - -# <----- -# THIS VARIABLE MUST CONTAINS THE NAME OF ALL FUNCTIONS THAT MANAGE THE PLUGIN my $PluginHooksFunctions="ReplaceURL"; # -----> # <----- -# IF YOUR PLUGIN NEED GLOBAL VARIABLES, THEY MUST BE DECLARED HERE +# IF YOUR PLUGIN NEED GLOBAL VARIABLES, THEY MUST BE DECLARED HERE. use vars qw/ $urlaliasloaded %UrlAliases @@ -52,10 +48,11 @@ sub Init_urlalias { # <----- # YOU CAN ENTER HERE CODE TO INIT PLUGIN GLOBAL VARIABLES - debug("InitParams=$InitParams",1); + debug(" InitParams=$InitParams",1); $urlaliasloaded=0; %UrlAliases=(); # -----> + return ($checkversion?$checkversion:"$PluginHooksFunctions"); }