Here’s a quick modification to awstats that allows you to add a totals field for the “Viewed – Full List” option. There isn’t a total hits field for matching files in awstats, so I added one to make it more useful. This makes it a lot quicker to total up hits for a specific folder, file type, or specific file in awstats.
The information provided below is for informational purposes only.
1) Locate your awstats.pl file.
If you are using the awstats Debian/Ubuntu package, awstats is located in /usr/lib/cgi-bin/awstats.pl.
2) Backup the awstats.pl file.
cp awstats.pl awstats.pl.bak
3) Open up the awstats.pl file in your favorite text editor. Find line 8468 (approximately, depending on your version of awstats).
There should be the following code:
&tab_end();
&html_end(1);
}
if ($HTMLOutput{'unknownos'}) {
4) Above the &tab_end(); add the following lines:
# Total up the matching pages
print "<tr><td style=\"text-align: left\"><strong>Total</strong></td><td><strong>$total_p</strong></td></tr>\n";
The end result should look like:
# Total up the matching pages
print "<tr><td style=\"text-align: left\"><strong>Total</strong></td><td><strong>$total_p</strong></td></tr>\n";
&tab_end();
&html_end(1);
}
if ($HTMLOutput{'unknownos'}) {
5) Save the awstats.pl file. Any future updates to Awstats package will overwrite these changes, but the fix should only take a minute to add it back in. If it doesn’t work, copy the awstats.pl.bak file as awstats.pl.
The modification will add the totals row for the following awstats reports:
Pingback: Al