From: eldy <> Date: Mon, 10 Dec 2001 02:24:40 +0000 (+0000) Subject: no message X-Git-Tag: AWSTATS_4_0_BETA~184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa09b085a2dce2bc62b986fc6a81b4bd215900d8;p=thirdparty%2FAWStats.git no message --- diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index e416e56f..f9dcc090 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -93,7 +93,7 @@ $color_h, $color_k, $color_link, $color_p, $color_s, $color_u, $color_v, $color_ %monthlib = %monthnum = (); -$VERSION="3.2 (build 75)"; +$VERSION="3.2 (build 76)"; $Lang="en"; # Default value @@ -2942,7 +2942,7 @@ EOF &html_end; exit(0); } - + # FirstTime LastTime TotalVisits TotalUnique TotalHostsKnown TotalHostsUnknown my $beginmonth=$MonthRequired;my $endmonth=$MonthRequired; if ($MonthRequired eq "year") { $beginmonth=1;$endmonth=12; } @@ -2966,6 +2966,30 @@ EOF if ($TotalVisits > 0) { $RatioPages=int($TotalPages/$TotalVisits*100)/100; } if ($TotalVisits > 0) { $RatioHits=int($TotalHits/$TotalVisits*100)/100; } if ($TotalVisits > 0) { $RatioBytes=int(($TotalBytes/1024)*100/$TotalVisits)/100; } + # Define firstdaytocountaverage, lastdaytocountaverage, firstdaytoshowtime, lastdaytoshowtime + my $firstdaytocountaverage=$nowyear.$nowmonth."01"; # Set day cursor to 1st day of month + my $firstdaytoshowtime=$nowyear.$nowmonth."01"; # Set day cursor to 1st day of month + my $lastdaytocountaverage=$nowyear.$nowmonth.$nowday; # Set day cursor to today + my $lastdaytoshowtime=$nowyear.$nowmonth."31"; # Set day cursor to last day of month + if ($MonthRequired eq "year") { + $firstdaytocountaverage=$YearRequired."0101"; # Set day cursor to 1st day of the required year + } + if (($MonthRequired ne $nowmonth && $MonthRequired ne "year") || $YearRequired ne $nowyear) { + if ($MonthRequired eq "year") { + $firstdaytocountaverage=$YearRequired."0101"; # Set day cursor to 1st day of the required year + $firstdaytoshowtime=$YearRequired."1201"; # Set day cursor to 1st day of last month of required year + $lastdaytocountaverage=$YearRequired."1231"; # Set day cursor to last day of the required year + $lastdaytoshowtime=$YearRequired."1231"; # Set day cursor to last day of last month of required year + } + else { + $firstdaytocountaverage=$YearRequired.$MonthRequired."01"; # Set day cursor to 1st day of the required month + $firstdaytoshowtime=$YearRequired.$MonthRequired."01"; # Set day cursor to 1st day of the required month + $lastdaytocountaverage=$YearRequired.$MonthRequired."31"; # Set day cursor to last day of the required month + $lastdaytoshowtime=$YearRequired.$MonthRequired."31"; # Set day cursor to last day of the required month + } + } + debug("firstdaytocountaverage=$firstdaytocountaverage, lastdaytocountaverage=$lastdaytocountaverage",1); + debug("firstdaytoshowtime=$firstdaytoshowtime, lastdaytoshowtime=$lastdaytoshowtime",1); # SUMMARY #--------------------------------------------------------------------- @@ -3048,56 +3072,30 @@ EOF # Show daily stats print "
| ";
- print " | \n";
- }
- print ""; # Calculate average values my $avg_day_nb=0; my $avg_day_v=0; my $avg_day_p=0; my $avg_day_h=0; my $avg_day_k=0; - my $FirstTimeDay=$FirstTime; - my $LastTimeDay=$LastTime; - $FirstTimeDay =~ /^(\d\d\d\d\d\d\d\d).*/; $FirstTimeDay=$1; - $LastTimeDay =~ /^(\d\d\d\d\d\d\d\d).*/; $LastTimeDay=$1; - foreach my $daycursor ($FirstTimeDay..$LastTimeDay) { + #my $FirstTimeDay=$FirstTime; + #my $LastTimeDay=$LastTime; + #$FirstTimeDay =~ /^(\d\d\d\d\d\d\d\d).*/; $FirstTimeDay=$1; + #$LastTimeDay =~ /^(\d\d\d\d\d\d\d\d).*/; $LastTimeDay=$1; + #foreach my $daycursor ($FirstTimeDay..$LastTimeDay) { + foreach my $daycursor ($firstdaytocountaverage..$lastdaytocountaverage) { $daycursor =~ /^(\d\d\d\d)(\d\d)(\d\d)/; my $year=$1; my $month=$2; my $day=$3; if (! DateIsValid($day,$month,$year)) { next; } # If not an existing day, go to next @@ -3112,6 +3110,9 @@ EOF $avg_day_p=sprintf("%.2f",$avg_day_p/$avg_day_nb); $avg_day_h=sprintf("%.2f",$avg_day_h/$avg_day_nb); $avg_day_k=sprintf("%.2f",$avg_day_k/$avg_day_nb); + if ($avg_day_v > $max_v) { $max_v=$avg_day_v; } + if ($avg_day_h > $max_h) { $max_h=$avg_day_h; } + if ($avg_day_k > $max_k) { $max_k=$avg_day_k; } } else { $avg_day_v="?"; @@ -3119,6 +3120,26 @@ EOF $avg_day_h="?"; $avg_day_k="?"; } + #$nbofdaysshown=0; + #for (my $daycursor=$firstdaytoshowtime; $nbofdaysshown<$MaxNbOfDays; $daycursor++) { + foreach my $daycursor ($firstdaytoshowtime..$lastdaytoshowtime) { + $daycursor =~ /^(\d\d\d\d)(\d\d)(\d\d)/; + my $year=$1; my $month=$2; my $day=$3; + if (! DateIsValid($day,$month,$year)) { next; } # If not an existing day, go to next + #$nbofdaysshown++; + my $bredde_v=0; my $bredde_p=0; my $bredde_h=0; my $bredde_k=0; + if ($max_v > 0) { $bredde_v=int(($DayVisits{$year.$month.$day}||0)/$max_v*$BarHeight/2)+1; } + if ($max_h > 0) { $bredde_p=int(($DayPages{$year.$month.$day}||0)/$max_h*$BarHeight/2)+1; } + if ($max_h > 0) { $bredde_h=int(($DayHits{$year.$month.$day}||0)/$max_h*$BarHeight/2)+1; } + if ($max_k > 0) { $bredde_k=int(($DayBytes{$year.$month.$day}||0)/$max_k*$BarHeight/2)+1; } + print " | ";
+ print " | \n";
+ }
+ print ""; # Show average values print " | "; my $bredde_v=0; my $bredde_p=0; my $bredde_h=0; my $bredde_k=0; @@ -3133,12 +3154,13 @@ EOF print " | \n"; print "
| ";
print ($day==$nowday && $month==$nowmonth?"":"");
@@ -3164,25 +3186,27 @@ EOF
print " |