~ubuntu-branches/ubuntu/dapper/awstats/dapper-updates

« back to all changes in this revision

Viewing changes to wwwroot/cgi-bin/plugins/example/example.pm

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2004-05-05 05:12:07 UTC
  • Revision ID: james.westby@ubuntu.com-20040505051207-wfi8hydpa89pvuoi
Tags: upstream-6.0
ImportĀ upstreamĀ versionĀ 6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
#-----------------------------------------------------------------------------
 
3
# AWStats axample plugin
 
4
# <-----
 
5
# THIS IS A SAMPLE OF AN EMPTY PLUGIN FILE WITH INSTRUCTIONS TO HELP YOU TO
 
6
# WRITE YOUR OWN WORKING PLUGIN. REPLACE THIS SENTENCE WITH THE PLUGIN GOAL.
 
7
# NOTE THAT A PLUGIN FILE example.pm MUST BE IN LOWER CASE.
 
8
# ----->
 
9
#-----------------------------------------------------------------------------
 
10
# Perl Required Modules: Put here list of all required plugins
 
11
#-----------------------------------------------------------------------------
 
12
# $Revision: 1.10 $ - $Author: eldy $ - $Date: 2003/11/15 19:39:01 $
 
13
 
 
14
 
 
15
# <-----
 
16
# ENTER HERE THE USE COMMAND FOR ALL REQUIRED PERL MODULES
 
17
#if (!eval ('require "TheModule.pm";')) { return $@?"Error: $@":"Error: Need Perl module TheModule"; }
 
18
# ----->
 
19
use strict;no strict "refs";
 
20
 
 
21
 
 
22
 
 
23
#-----------------------------------------------------------------------------
 
24
# PLUGIN VARIABLES
 
25
#-----------------------------------------------------------------------------
 
26
# <-----
 
27
# ENTER HERE THE MINIMUM AWSTATS VERSION REQUIRED BY YOUR PLUGIN
 
28
# AND THE NAME OF ALL FUNCTIONS THE PLUGIN MANAGE.
 
29
# EACH POSSIBLE FUNCTION AND GOAL ARE DESCRIBED LATER.
 
30
my $PluginNeedAWStatsVersion="5.6";
 
31
my $PluginHooksFunctions="xxx";
 
32
# ----->
 
33
 
 
34
# <-----
 
35
# IF YOUR PLUGIN NEED GLOBAL VARIABLES, THEY MUST BE DECLARED HERE.
 
36
use vars qw/
 
37
$PluginVariable1
 
38
/;
 
39
# ----->
 
40
 
 
41
 
 
42
 
 
43
#-----------------------------------------------------------------------------
 
44
# PLUGIN FUNCTION: Init_pluginname
 
45
#-----------------------------------------------------------------------------
 
46
sub Init_example {
 
47
        my $InitParams=shift;
 
48
        my $checkversion=&Check_Plugin_Version($PluginNeedAWStatsVersion);
 
49
 
 
50
        # <-----
 
51
        # ENTER HERE CODE TO DO INIT PLUGIN ACTIONS
 
52
        debug("InitParams=$InitParams",1);
 
53
        $PluginVariable1="";
 
54
        # ----->
 
55
 
 
56
        return ($checkversion?$checkversion:"$PluginHooksFunctions");
 
57
}
 
58
 
 
59
 
 
60
 
 
61
# HERE ARE ALL POSSIBLE HOOK FUNCTIONS. YOU MUST CHANGE THE NAME OF THE
 
62
# FUNCTION xxx_example INTO xxx_pluginname (pluginname in lower case).
 
63
# NOTE THAT IN PLUGINS' FUNCTIONS, YOU CAN USE ANY AWSTATS GLOBAL VARIALES.
 
64
 
 
65
 
 
66
#-----------------------------------------------------------------------------
 
67
# PLUGIN FUNCTION: AddHTMLStyles_pluginname
 
68
# UNIQUE: NO (Several plugins using this function can be loaded)
 
69
# Function called to Add HTML styles at beginning of BODY section.
 
70
#-----------------------------------------------------------------------------
 
71
sub AddHTMLStyles_example {
 
72
        # <-----
 
73
        # PERL CODE HERE
 
74
        # ----->
 
75
}
 
76
 
 
77
#-----------------------------------------------------------------------------
 
78
# PLUGIN FUNCTION: AddHTMLBodyHeader_pluginname
 
79
# UNIQUE: NO (Several plugins using this function can be loaded)
 
80
# Function called to Add HTML code at beginning of BODY section.
 
81
#-----------------------------------------------------------------------------
 
82
sub AddHTMLBodyHeader_example {
 
83
        # <-----
 
84
        # PERL CODE HERE
 
85
        # ----->
 
86
}
 
87
 
 
88
#-----------------------------------------------------------------------------
 
89
# PLUGIN FUNCTION: ShowInfoHost_pluginname
 
90
# UNIQUE: NO (Several plugins using this function can be loaded)
 
91
# Function called to add additionnal columns to the Hosts report.
 
92
# This function is called when building rows of the report (One call for each
 
93
# row). So it allows you to add a column in report, for example with code :
 
94
#   print "<TD>This is a new cell</TD>";
 
95
# Parameters: Host name or ip
 
96
#-----------------------------------------------------------------------------
 
97
sub ShowInfoHost_hostinfo {
 
98
        # <-----
 
99
        # PERL CODE HERE
 
100
        # ----->
 
101
}
 
102
 
 
103
#-----------------------------------------------------------------------------
 
104
# PLUGIN FUNCTION: ShowPagesAddField_pluginname
 
105
# UNIQUE: NO (Several plugins using this function can be loaded)
 
106
# Function used to add additionnal columns to the Top Pages-URL report.
 
107
# This function is called when building rows of the report (One call for each
 
108
# row). So it allows you to add a column in report, for example with code :
 
109
#   print "<TD>This is a new cell</TD>";
 
110
#-----------------------------------------------------------------------------
 
111
sub ShowPagesAddField_example {
 
112
        # <-----
 
113
        # PERL CODE HERE
 
114
        # ----->
 
115
}
 
116
 
 
117
#-----------------------------------------------------------------------------
 
118
# PLUGIN FUNCTION: ShowInfoURL_pluginname
 
119
# UNIQUE: NO (Several plugins using this function can be loaded)
 
120
# Function called to add additionnal information for URLs in URLs' report.
 
121
# This function is called after writing the URL value in the URL cell of the
 
122
# Top Pages-URL report.
 
123
# Parameters: URL
 
124
#-----------------------------------------------------------------------------
 
125
sub ShowInfoURL_example {
 
126
        # <-----
 
127
        # PERL CODE HERE
 
128
        # ----->
 
129
}
 
130
 
 
131
#-----------------------------------------------------------------------------
 
132
# PLUGIN FUNCTION: ShowInfoUser_pluginname
 
133
# UNIQUE: NO (Several plugins using this function can be loaded)
 
134
# Function called to add additionnal columns to Authenticated users report.
 
135
# This function is called when building rows of the report (One call for each
 
136
# row). So it allows you to add a column in report, for example with code :
 
137
#   print "<TD>This is a new cell</TD>";
 
138
# Parameters: User
 
139
#-----------------------------------------------------------------------------
 
140
sub ShowInfoUser_example {
 
141
        # <-----
 
142
        # PERL CODE HERE
 
143
        # ----->
 
144
}
 
145
 
 
146
 
 
147
1;      # Do not remove this line