I have described a simple way to configure the AWStats web-interface last month,
so I will continue this topic further and tell you how to add a menu to quickly switch between configured sites.
You need to set to true
the UseFramesWhenCGI
AWStats configuration directive. Then, the whole process is based on left frame
modification, which can be achieved by editing HTMLTopBanner
function located in /usr/lib/cgi-bin/awstats.pl
file.
Simple menu
AWStats menu defference.
The following modification provides a small and straightforward static menu.
--- awstats.pl 2016-05-04 21:30:39.689655190 +0000 +++ awstats.simple.pl 2016-05-04 21:16:59.327708554 +0000 @@ -9835,6 +9835,14 @@ print "</td>"; } print "$lt;/tr>\n"; + print "$lt;tr>"; + print "$lt;td class=\"aws\">"; + print "Other: "; + print "[$lt;a target=\"_parent\" href=\"/awstats.pl?config=sleeplessbeastie.eu\">www</a>] "; + print "[$lt;a target=\"_parent\" href=\"/awstats.pl?config=blog.sleeplessbeastie.eu\">blog</a>] "; + print "[$lt;a target=\"_parent\" href=\"/awstats.pl?config=repository.sleeplessbeastie.eu\">repo</a>]"; + print "$lt;/td>"; + print "$lt;/tr>"; } if ( $FrameName ne 'mainleft' ) {
Advanced menu
AWStats menu defference.
The following modification provides a more advanced menu without duplicated entries.
--- awstats.pl 2016-05-04 21:30:39.689655190 +0000 +++ awstats.advanced.pl 2016-05-04 21:30:12.386589742 +0000 @@ -9835,6 +9835,13 @@ print "</td>"; } print "</tr>\n"; + print "<tr>"; + print "<td class=\"aws\">"; + foreach my $tempSite ('sleeplessbeastie.eu', 'blog.sleeplessbeastie.eu', 'repository.sleeplessbeastie.eu', 'survey.sleeplessbeastie.eu', 'debian.sleeplessbeastie.eu') { + if ( $SiteDomain ne $tempSite ) { print "<a target=\"_parent\" href=\"/awstats.pl?config=$tempSite\">$tempSite</a><br/>"; } + } + print "</td>"; + print "</tr>"; } if ( $FrameName ne 'mainleft' ) {
You can apply these patches using patch
utility against awstats 7.2 (build 1.992)
.
Downloads