--- awstats.pl.orig 2005-02-24 22:02:23.000000000 +0100
+++ awstats.pl 2005-11-05 16:17:33.000000000 +0100
@@ -291,6 +291,7 @@
%TrapInfosForHTTPErrorCodes %NotPageList %DayBytes %DayHits %DayPages %DayVisits
%MaxNbOf %MinHit
%ListOfYears %HistoryAlreadyFlushed %PosInFile %ValueInFile
+%FirstMonth
%val %nextval %egal
%TmpDNSLookup %TmpOS %TmpRefererServer %TmpRobot %TmpBrowser %MyDNSTable
/;
@@ -303,6 +304,7 @@
%DayBytes = %DayHits = %DayPages = %DayVisits = ();
%MaxNbOf = %MinHit = ();
%ListOfYears = %HistoryAlreadyFlushed = %PosInFile = %ValueInFile = ();
+%FirstMonth = ();
%val = %nextval = %egal = ();
%TmpDNSLookup = %TmpOS = %TmpRefererServer = %TmpRobot = %TmpBrowser = %MyDNSTable = ();
use vars qw/
@@ -3357,6 +3359,7 @@
else {
$HistoryAlreadyFlushed{"$year$month"}=1;
}
+ if (! $FirstMonth{"$year"} || $FirstMonth{"$year"} gt "$month") { $FirstMonth{"$year"}="$month"; }
if (! $ListOfYears{"$year"} || $ListOfYears{"$year"} lt "$month") { $ListOfYears{"$year"}="$month"; }
}
@@ -5166,7 +5169,7 @@
foreach my $key (sort { $menu->{$a} <=> $menu->{$b} } keys %$menu) {
if ($menu->{$key}==0) { next; }
if ($menulink->{$key}==1) { print ($frame?"
| ":""); print "$menutext->{$key}"; print ($frame?" |
\n":" "); }
- if ($menulink->{$key}==2) { print ($frame?" ":""); print "$menutext->{$key}\n"; print ($frame?" |
\n":" "); }
+ if ($menulink->{$key}==2) { print ($frame?" ":""); print "$menutext->{$key}\n"; print ($frame?" |
\n":" "); }
}
print ($frame?"":"\n");
}
@@ -5191,8 +5194,8 @@
$title="$Message[131]";
}
else {
- $title="$Message[131] ($Message[77] $MaxNbOf{'EMailsShown'}) - $Message[80]";
- if ($ShowEMailSenders =~ /L/i) { $title.=" - $Message[9]"; }
+ $title="$Message[131] ($Message[77] $MaxNbOf{'EMailsShown'}) - $Message[80]";
+ if ($ShowEMailSenders =~ /L/i) { $title.=" - $Message[9]"; }
}
&tab_head("$title",19,0,'emailsenders');
print "| $Message[131] : ".(scalar keys %_emails_h)." | ";
@@ -5264,8 +5267,8 @@
$title="$Message[132]";
}
else {
- $title="$Message[132] ($Message[77] $MaxNbOf{'EMailsShown'}) - $Message[80]";
- if ($ShowEMailReceivers =~ /L/i) { $title.=" - $Message[9]"; }
+ $title="$Message[132] ($Message[77] $MaxNbOf{'EMailsShown'}) - $Message[80]";
+ if ($ShowEMailReceivers =~ /L/i) { $title.=" - $Message[9]"; }
}
&tab_head("$title",19,0,'emailreceivers');
print "
|---|
| $Message[132] : ".(scalar keys %_emailr_h)." | ";
@@ -5389,7 +5392,7 @@
# No update but report by default when run from a browser
$UpdateStats=($QueryString=~/update=1/i?1:0);
- if ($QueryString =~ /config=([^&]+)/i) { $SiteConfig=&DecodeEncodedString("$1"); }
+ if ($QueryString =~ /config=([^&]+)/i) { $SiteConfig=&Sanitize(&DecodeEncodedString("$1")); }
if ($QueryString =~ /diricons=([^&]+)/i) { $DirIcons=&DecodeEncodedString("$1"); }
if ($QueryString =~ /pluginmode=([^&]+)/i) { $PluginMode=&Sanitize(&DecodeEncodedString("$1"),1); }
if ($QueryString =~ /configdir=([^&]+)/i) { $DirConfig=&Sanitize(&DecodeEncodedString("$1")); }
@@ -5438,7 +5441,7 @@
# Update with no report by default when run from command line
$UpdateStats=1;
- if ($QueryString =~ /config=([^&]+)/i) { $SiteConfig="$1"; }
+ if ($QueryString =~ /config=([^&]+)/i) { $SiteConfig=&Sanitize("$1"); }
if ($QueryString =~ /diricons=([^&]+)/i) { $DirIcons="$1"; }
if ($QueryString =~ /pluginmode=([^&]+)/i) { $PluginMode=&Sanitize("$1",1); }
if ($QueryString =~ /configdir=([^&]+)/i) { $DirConfig=&Sanitize("$1"); }
@@ -5464,8 +5467,8 @@
if ($QueryString =~ /showunknownorigin/i) { $ShowUnknownOrigin=1; $QueryString=~s/showunknownorigin[^&]*//i; }
}
-if ($QueryString =~ /(^|&)staticlinks/i) { $StaticLinks=".$SiteConfig"; }
-if ($QueryString =~ /(^|&)staticlinks=([^&]+)/i) { $StaticLinks=".$2"; } # When ran from awstatsbuildstaticpages.pl
+if ($QueryString =~ /(^|&)staticlinks/i) { $StaticLinks="-"; }
+if ($QueryString =~ /(^|&)staticlinks=([^&]+)/i) { $StaticLinks="-"; } # When ran from awstatsbuildstaticpages.pl
if ($QueryString =~ /(^|&)staticlinksext=([^&]+)/i) { $StaticExt="$2"; }
if ($QueryString =~ /(^|&)framename=([^&]+)/i) { $FrameName="$2"; }
if ($QueryString =~ /(^|&)debug=(\d+)/i) { $Debug=$2; }
@@ -5843,6 +5846,9 @@
$ListOfYears{"$2"}="$1"; # ListOfYears contains max month found
if ("$2" gt $lastyearbeforeupdate) { $lastyearbeforeupdate="$2"; }
}
+ if (! $FirstMonth{"$2"} || "$1" lt $ListOfYears{"$2"}) {
+ $FirstMonth{"$2"}="$1";
+ }
}
close DIR;
@@ -7343,7 +7349,61 @@
$NewLinkParams =~ tr/&/&/s; $NewLinkParams =~ s/^&//; $NewLinkParams =~ s/&$//;
my $NewLinkTarget='';
if ($FrameName eq 'mainright') { $NewLinkTarget=" target=\"_parent\""; }
- print "
\n";
#------- Referrals by search engines
- print "$Message[40] - $Message[80] \n";
+ print " |
$Message[40] - $Message[80] \n";
if (scalar keys %_se_referrals_h) {
print "\n";
$total_p=0; $total_h=0;
@@ -9870,7 +9932,7 @@
if ($ShowOriginStats =~ /H/i) { print "| ".($_from_h[2]?$_from_h[2]:" ")." | ".($_from_h[2]?"$p_h[2] %":" ")." | "; }
print "\n";
#------- Referrals by external HTML link
- print "$Message[41] - $Message[80] \n";
+ print " | $Message[41] - $Message[80] \n";
if (scalar keys %_pagesrefs_h) {
print "\n";
$total_p=0; $total_h=0;
@@ -9929,7 +9991,7 @@
# By Keyphrases
if ($ShowKeyphrasesStats && $ShowKeywordsStats) { print "\n"; }
if ($Debug) { debug("ShowKeyphrasesStats",2); }
- &tab_head("$Message[120] ($Message[77] $MaxNbOf{'KeyphrasesShown'}) $Message[80]",19,($ShowKeyphrasesStats && $ShowKeywordsStats)?95:70,'keyphrases');
+ &tab_head("$Message[120] ($Message[77] $MaxNbOf{'KeyphrasesShown'}) $Message[80]",19,($ShowKeyphrasesStats && $ShowKeywordsStats)?95:70,'keyphrases');
print " | | $TotalDifferentKeyphrases $Message[103] | $Message[14] | $Message[15] | \n";
$total_s=0;
my $count=0;
@@ -9961,7 +10023,7 @@
# By Keywords
if ($ShowKeyphrasesStats && $ShowKeywordsStats) { print "\n"; }
if ($Debug) { debug("ShowKeywordsStats",2); }
- &tab_head("$Message[121] ($Message[77] $MaxNbOf{'KeywordsShown'}) $Message[80]",19,($ShowKeyphrasesStats && $ShowKeywordsStats)?95:70,'keywords');
+ &tab_head("$Message[121] ($Message[77] $MaxNbOf{'KeywordsShown'}) $Message[80]",19,($ShowKeyphrasesStats && $ShowKeywordsStats)?95:70,'keywords');
print " | | $TotalDifferentKeywords $Message[13] | $Message[14] | $Message[15] | \n";
$total_s=0;
my $count=0;
@@ -10048,7 +10110,7 @@
foreach my $key (@keylist) {
my $p=int($_errors_h{$key}/$TotalHitsErrors*1000)/10;
print "";
- if ($TrapInfosForHTTPErrorCodes{$key}) { print "| $key | "; }
+ if ($TrapInfosForHTTPErrorCodes{$key}) { print "$key | "; }
else { print "$key | "; }
print "".($httpcodelib{$key}?$httpcodelib{$key}:'Unknown error')." | $_errors_h{$key} | $p % | ".Format_Bytes($_errors_k{$key})." | ";
print " \n";
| |