1 rizwank 1.1 #!/usr/bin/perl
2 #-----------------------------------------------------------------------------
3 # Example AWStats 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.12 $ - $Author: eldy $ - $Date: 2004/03/28 17:02:23 $
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 rizwank 1.1
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 rizwank 1.1 #-----------------------------------------------------------------------------
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 rizwank 1.1
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 # Parameters: None
71 #-----------------------------------------------------------------------------
72 sub AddHTMLStyles_example {
73 # <-----
74 # PERL CODE HERE
75 # ----->
76 }
77
78 #-----------------------------------------------------------------------------
79 # PLUGIN FUNCTION: AddHTMLBodyHeader_pluginname
80 # UNIQUE: NO (Several plugins using this function can be loaded)
81 # Function called to Add HTML code at beginning of BODY section (top of page).
82 # Parameters: None
83 #-----------------------------------------------------------------------------
84 sub AddHTMLBodyHeader_example {
85 rizwank 1.1 # <-----
86 # PERL CODE HERE
87 # ----->
88 }
89
90 #-----------------------------------------------------------------------------
91 # PLUGIN FUNCTION: AddHTMLBodyFooter_pluginname
92 # UNIQUE: NO (Several plugins using this function can be loaded)
93 # Function called to Add HTML code at end of BODY section (bottom of page).
94 # Parameters: None
95 #-----------------------------------------------------------------------------
96 sub AddHTMLBodyFooter_example {
97 # <-----
98 # PERL CODE HERE
99 # ----->
100 }
101
102 #-----------------------------------------------------------------------------
103 # PLUGIN FUNCTION: AddHTMLMenuHeader_pluginname
104 # UNIQUE: NO (Several plugins using this function can be loaded)
105 # Function called to Add HTML code just before the menu section
106 rizwank 1.1 # Parameters: None
107 #-----------------------------------------------------------------------------
108 sub AddHTMLMenuHeader_example {
109 # <-----
110 # PERL CODE HERE
111 # ----->
112 }
113
114 #-----------------------------------------------------------------------------
115 # PLUGIN FUNCTION: AddHTMLMenuFooter_pluginname
116 # UNIQUE: NO (Several plugins using this function can be loaded)
117 # Function called to Add HTML code just after the menu section
118 # Parameters: None
119 #-----------------------------------------------------------------------------
120 sub AddHTMLMenuFooter_example {
121 # <-----
122 # PERL CODE HERE
123 # ----->
124 }
125
126 #-----------------------------------------------------------------------------
127 rizwank 1.1 # PLUGIN FUNCTION: AddHTMLContentHeader_pluginname
128 # UNIQUE: NO (Several plugins using this function can be loaded)
129 # Function called to Add HTML code just before the first report
130 # Parameters: None
131 #-----------------------------------------------------------------------------
132 sub AddHTMLContentHeader_example {
133 # <-----
134 # PERL CODE HERE
135 # ----->
136 }
137
138 #-----------------------------------------------------------------------------
139 # PLUGIN FUNCTION: ShowInfoHost_pluginname
140 # UNIQUE: NO (Several plugins using this function can be loaded)
141 # Function called to add additionnal columns to the Hosts report.
142 # This function is called when building rows of the report (One call for each
143 # row). So it allows you to add a column in report, for example with code :
144 # print "<TD>This is a new cell for $param</TD>";
145 # Parameters: Host name or ip
146 #-----------------------------------------------------------------------------
147 sub ShowInfoHost_example {
148 rizwank 1.1 my $param="$_[0]";
149 # <-----
150 # PERL CODE HERE
151 # ----->
152 }
153
154 #-----------------------------------------------------------------------------
155 # PLUGIN FUNCTION: ShowPagesAddField_pluginname
156 # UNIQUE: NO (Several plugins using this function can be loaded)
157 # Function used to add additionnal columns to the Top Pages-URL report.
158 # This function is called when building rows of the report (One call for each
159 # row). So it allows you to add a column in report, for example with code :
160 # print "<TD>This is a new cell for $param</TD>";
161 # Parameters: URL
162 #-----------------------------------------------------------------------------
163 sub ShowPagesAddField_example {
164 my $param="$_[0]";
165 # <-----
166 # PERL CODE HERE
167 # ----->
168 }
169 rizwank 1.1
170 #-----------------------------------------------------------------------------
171 # PLUGIN FUNCTION: ShowInfoURL_pluginname
172 # UNIQUE: NO (Several plugins using this function can be loaded)
173 # Function called to add additionnal information for URLs in URLs' report.
174 # This function is called after writing the URL value in the URL cell of the
175 # Top Pages-URL report.
176 # Parameters: URL
177 #-----------------------------------------------------------------------------
178 sub ShowInfoURL_example {
179 my $param="$_[0]";
180 # <-----
181 # PERL CODE HERE
182 # ----->
183 }
184
185 #-----------------------------------------------------------------------------
186 # PLUGIN FUNCTION: ShowInfoUser_pluginname
187 # UNIQUE: NO (Several plugins using this function can be loaded)
188 # Function called to add additionnal columns to Authenticated users report.
189 # This function is called when building rows of the report (One call for each
190 rizwank 1.1 # row). So it allows you to add a column in report, for example with code :
191 # print "<TD>This is a new cell for $param</TD>";
192 # Parameters: User
193 #-----------------------------------------------------------------------------
194 sub ShowInfoUser_example {
195 my $param="$_[0]";
196 # <-----
197 # PERL CODE HERE
198 # ----->
199 }
200
201
202 1; # Do not remove this line
|