From: eldy <> Date: Thu, 3 Oct 2002 16:02:30 +0000 (+0000) Subject: ShowxxxStats parmaters accept codes to decide which columns to show in chart. X-Git-Tag: AWSTATS_5_1_BETA~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8600618260d6fd5d9aca8aefa5891527d62859f9;p=thirdparty%2FAWStats.git ShowxxxStats parmaters accept codes to decide which columns to show in chart. --- diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf index 7a573dfc..e65636b8 100644 --- a/wwwroot/cgi-bin/awstats.model.conf +++ b/wwwroot/cgi-bin/awstats.model.conf @@ -1,4 +1,4 @@ -# AWStats configure file +# AWSTATS CONFIGURE FILE 5.1 #----------------------------------------------------------------------------- # Copy this file into awstats.www.mydomain.conf or awstats.conf and edit this # new file to setup AWStats (See documentation in docs/ directory). @@ -39,7 +39,7 @@ # You can also use a pipe if log file come from a pipe. # Example: "gzip -d Codes are P (Nb pages), H (Nb hits), B (bandwidth), L (last access date) ShowAuthenticatedUsers=0 +# Show robots chart ShowRobotsStats=1 +# Show session chart ShowSessionsStats=1 -ShowPagesStats=1 -ShowCompressionStats=0 # Show compression statistics when using mod_gzip -ShowFileTypesStats=1 -ShowFileSizesStats=0 # Not yet available +# Show pages-url chart. +# ->Codes are H (Nb hits), B (bandwidth), E (entry), X (exit) +ShowPagesStats=HBEX +# Show file types chart. +# ->Codes are H (Nb hits), B (bandwidth), C (mod_gzip compression statistics) +ShowFileTypesStats=HB +# Show file size chart (Not yet available) +ShowFileSizesStats=0 +# Show browsers chart ShowBrowsersStats=1 +# Show Operating systems chart ShowOSStats=1 +# Show Origin chart ShowOriginStats=1 +# Show keyphrases chart ShowKeyphrasesStats=1 +# Show keywords chart ShowKeywordsStats=1 +# Show HTTP errors chart ShowHTTPErrorsStats=1 -ShowEMailSenders=0 # For use when analyzing mail log files. Not yet available -ShowEMailReceivers=0 # For use when analyzing mail log files. Not yet available +# Show EMail senders chart (For use when analyzing mail log files. Not yet available) +ShowEMailSenders=0 +# Show EMail receiver chart (For use when analyzing mail log files. Not yet available) +ShowEMailReceivers=0 # This value can be used to choose maximum number of lines shown for each @@ -702,10 +726,10 @@ LogoLink="http://awstats.sourceforge.net" # Value of maximum bar width/height for horizontal/vertical graphics bar -# Default: 260/180 +# Default: 260/90 # BarWidth = 260 -BarHeight = 180 +BarHeight = 90 # You can ask AWStats to use a particular CSS (Cascading Style Sheet) to diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 476da2b9..865d4a4f 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -466,7 +466,7 @@ sub tab_head { #------------------------------------------------------------------------------ sub tab_end { print ""; - print "\n\n"; + print "
\n\n"; } #------------------------------------------------------------------------------ @@ -792,9 +792,19 @@ sub Read_Config { if (! $FileConfig) { error("Error: Couldn't open config file \"$PROG.$SiteConfig.conf\" nor \"$PROG.conf\" : $!"); } if ($Debug) { debug("Call to Read_Config [FileConfig=\"$FileConfig\"]"); } my $foundNotPageList = my $foundValidHTTPCodes = 0; + my $versionnum=0; while () { chomp $_; s/\r//; + + # Extract version from first line + if (! $versionnum && $_ =~ /^# AWSTATS CONFIGURE FILE (\d+).(\d+)/i) { + $versionnum=($1*1000)+$2; + if ($Debug) { debug(" Configure file version is $versionnum",1); } + next; + } + if ($_ =~ /^$/) { next; } + # Remove comments if ($_ =~ /^#/) { next; } $_ =~ s/^([^\"]*)#.*/$1/; @@ -979,14 +989,16 @@ sub Read_Config { if ($param =~ /^LoadPlugin/) { push @PluginsToLoad, $value; next; } } close CONFIG; - # If parameter NotPageList not found, init for backward compatibility + + # Changes for backward compatibility if (! $foundNotPageList) { $NotPageList{"gif"}=$NotPageList{"jpg"}=$NotPageList{"jpeg"}=$NotPageList{"png"}=$NotPageList{"bmp"}=1; } - # If parameter ValidHTTPCodes not found, init for backward compatibility if (! $foundValidHTTPCodes) { $ValidHTTPCodes{"200"}=$ValidHTTPCodes{"304"}=1; } + if ($versionnum < 5001) { $BarHeight=$BarHeight>>1; } + if ($Debug) { debug(" NotPageList ".(scalar keys %NotPageList)); } if ($Debug) { debug(" ValidHTTPCodes ".(scalar keys %ValidHTTPCodes)); } if ($Debug) { debug(" UseFramesWhenCGI=$UseFramesWhenCGI"); } @@ -1263,11 +1275,11 @@ sub Check_Config { if ($ShowHoursStats !~ /[0-1]/) { $ShowHoursStats=1; } if ($ShowDomainsStats !~ /[0-1]/) { $ShowDomainsStats=1; } if ($ShowHostsStats !~ /[0-1]/) { $ShowHostsStats=1; } - if ($ShowAuthenticatedUsers !~ /[0-1]/) { $ShowAuthenticatedUsers=1; } + if ($ShowAuthenticatedUsers !~ /[01PHBL]/) { $ShowAuthenticatedUsers=0; } if ($ShowRobotsStats !~ /[0-1]/) { $ShowRobotsStats=1; } if ($ShowSessionsStats !~ /[0-1]/) { $ShowSessionsStats=1; } - if ($ShowPagesStats !~ /[0-1]/) { $ShowPagesStats=1; } - if ($ShowFileTypesStats !~ /[0-1]/) { $ShowFileTypesStats=1; } + if ($ShowPagesStats !~ /[01HBEX]/i) { $ShowPagesStats="HBEX"; } + if ($ShowFileTypesStats !~ /[01HBC]/) { $ShowFileTypesStats="HB"; } if ($ShowFileSizesStats !~ /[0-1]/) { $ShowFileSizesStats=1; } if ($ShowBrowsersStats !~ /[0-1]/) { $ShowBrowsersStats=1; } if ($ShowOSStats !~ /[0-1]/) { $ShowOSStats=1; } @@ -1302,7 +1314,7 @@ sub Check_Config { if (! $Logo) { $Logo="awstats_logo1.png"; } if (! $LogoLink) { $LogoLink="http://awstats.sourceforge.net"; } if ($BarWidth !~ /^\d+/ || $BarWidth<1) { $BarWidth=260; } - if ($BarHeight !~ /^\d+/ || $BarHeight<1) { $BarHeight=180; } + if ($BarHeight !~ /^\d+/ || $BarHeight<1) { $BarHeight=90; } $color_Background =~ s/#//g; if ($color_Background !~ /^[0-9|A-Z]+$/i) { $color_Background="FFFFFF"; } $color_TableBGTitle =~ s/#//g; if ($color_TableBGTitle !~ /^[0-9|A-Z]+$/i) { $color_TableBGTitle="CCCCDD"; } $color_TableTitle =~ s/#//g; if ($color_TableTitle !~ /^[0-9|A-Z]+$/i) { $color_TableTitle="000000"; } @@ -1458,9 +1470,12 @@ sub Check_Config { if (! $Message[129]) { $Message[129]="Exact value not available in 'Year' view"; } if (! $Message[130]) { $Message[130]="Data value arrays"; } - # Correct ShowFlagLinks - if ($ShowFlagLinks eq "0") { $ShowFlagLinks = ""; } # For backward compatibility - if ($ShowFlagLinks eq "1") { $ShowFlagLinks = "en fr de nl es"; } # For backward compatibility + # Correct param for backward compatibility + if ($ShowFlagLinks eq "0") { $ShowFlagLinks = ""; } + if ($ShowFlagLinks eq "1") { $ShowFlagLinks = "en fr de nl es"; } + if ($ShowAuthenticatedUsers eq "1") { $ShowAuthenticatedUsers = "PHBL"; } + if ($ShowPagesStats eq "1") { $ShowPagesStats = "HBEX"; } + if ($ShowFileTypesStats eq "1") { $ShowFileTypesStats = "HB"; } # Refuse LogFile if contains a pipe and PurgeLogFile || ArchiveLogRecords set on if (($PurgeLogFile || $ArchiveLogRecords) && $LogFile =~ /\|\s*$/) { @@ -1635,9 +1650,10 @@ sub Read_History_With_TmpUpdate { my $versionnum=0; my @field=(); while () { - chomp $_; s/\r//; $countlines++; + chomp $_; s/\r//; + $countlines++; - # Extract version for first line + # Extract version from first line if (! $versionnum && $_ =~ /^AWSTATS DATA FILE (\d+).(\d+)/i) { $versionnum=($1*1000)+$2; if ($Debug) { debug(" Data file version is $versionnum",1); } @@ -4262,10 +4278,9 @@ if ($UpdateStats && $FrameName ne "index" && $FrameName ne "mainleft") { # Updat # Reset counter for benchmark (first call to GetDelaySinceStart) &GetDelaySinceStart(1); if ($ShowSteps) { print "Phase 1 : First bypass old records\n"; } - while () - { - $NbOfLinesRead++; + while () { chomp $_; s/\r$//; + $NbOfLinesRead++; if ($ShowSteps) { if (++$NbOfLinesShowsteps % $NBOFLINESFORBENCHMARK == 0) { @@ -5212,7 +5227,7 @@ EOF if ($ShowHostsStats) { print ($frame?"   \"...\" ":""); print "$Message[45]\n"; print ($frame?"\n":"   "); } if ($ShowAuthenticatedUsers) { print ($frame?"":""); print "$Message[94]"; print ($frame?"\n":"   "); } if ($ShowAuthenticatedUsers) { print ($frame?"   \"...\" ":""); print "$Message[80]\n"; print ($frame?"\n":"   "); } - if ($ShowAuthenticatedUsers) { print ($frame?"   \"...\" ":""); print "$Message[9]\n"; print ($frame?"\n":"   "); } + if ($ShowAuthenticatedUsers =~ /L/i) { print ($frame?"   \"...\" ":""); print "$Message[9]\n"; print ($frame?"\n":"   "); } if ($ShowRobotsStats) { print ($frame?"":""); print "$Message[53]"; print ($frame?"\n":"   "); } if ($ShowRobotsStats) { print ($frame?"   \"...\" ":""); print "$Message[80]\n"; print ($frame?"\n":"   "); } if ($ShowRobotsStats) { print ($frame?"   \"...\" ":""); print "$Message[9]\n"; print ($frame?"\n":"   "); } @@ -5224,8 +5239,8 @@ EOF if ($ShowSessionsStats) { print ($frame?"":""); print "$Message[117]"; print ($frame?"\n":"   "); } if ($ShowPagesStats) { print ($frame?"":""); print "$Message[29]\n"; print ($frame?"\n":"   "); } if ($ShowPagesStats) { print ($frame?"   \"...\" ":""); print "$Message[80]\n"; print ($frame?"\n":"   "); } - if ($ShowPagesStats) { print ($frame?"   \"...\" ":""); print "$Message[104]\n"; print ($frame?"\n":"   "); } - if ($ShowPagesStats) { print ($frame?"   \"...\" ":""); print "$Message[116]\n"; print ($frame?"\n":"   "); } + if ($ShowPagesStats =~ /E/i) { print ($frame?"   \"...\" ":""); print "$Message[104]\n"; print ($frame?"\n":"   "); } + if ($ShowPagesStats =~ /X/i) { print ($frame?"   \"...\" ":""); print "$Message[116]\n"; print ($frame?"\n":"   "); } if ($ShowFileTypesStats) { print ($frame?"":""); print "$Message[73]"; print ($frame?"\n":"   "); } if ($ShowFileSizesStats) { } if ($ShowOSStats) { print ($frame?"":""); print "$Message[59]"; print ($frame?"\n":"   "); } @@ -5249,7 +5264,7 @@ EOF $linetitle=$ShowCompressionStats+$ShowHTTPErrorsStats; if ($linetitle) { print "$Message[2] : \n"; } if ($linetitle) { print ($frame?"\n":""); } - if ($ShowCompressionStats) { print ($frame?"":""); print "$Message[98]"; print ($frame?"\n":"   "); } + if ($ShowFileTypesStats =~ /C/i) { print ($frame?"":""); print "$Message[98]"; print ($frame?"\n":"   "); } if ($ShowHTTPErrorsStats) { print ($frame?"":""); print "$Message[22]"; print ($frame?"\n":"   "); } if ($ShowHTTPErrorsStats) { print ($frame?"   \"...\" ":""); print "$Message[31]\n"; print ($frame?"\n":"   "); } if ($linetitle) { print ($frame?"":"\n"); } @@ -5385,11 +5400,11 @@ EOF for (my $ix=1; $ix<=12; $ix++) { my $monthix=sprintf("%02s",$ix); my $bredde_u=0; my $bredde_v=0;my $bredde_p=0;my $bredde_h=0;my $bredde_k=0; - if ($max_v > 0) { $bredde_u=int($MonthUnique{$YearRequired.$monthix}/$max_v*$BarHeight/2)+1; } - if ($max_v > 0) { $bredde_v=int($MonthVisits{$YearRequired.$monthix}/$max_v*$BarHeight/2)+1; } - if ($max_h > 0) { $bredde_p=int($MonthPages{$YearRequired.$monthix}/$max_h*$BarHeight/2)+1; } - if ($max_h > 0) { $bredde_h=int($MonthHits{$YearRequired.$monthix}/$max_h*$BarHeight/2)+1; } - if ($max_k > 0) { $bredde_k=int($MonthBytes{$YearRequired.$monthix}/$max_k*$BarHeight/2)+1; } + if ($max_v > 0) { $bredde_u=int($MonthUnique{$YearRequired.$monthix}/$max_v*$BarHeight)+1; } + if ($max_v > 0) { $bredde_v=int($MonthVisits{$YearRequired.$monthix}/$max_v*$BarHeight)+1; } + if ($max_h > 0) { $bredde_p=int($MonthPages{$YearRequired.$monthix}/$max_h*$BarHeight)+1; } + if ($max_h > 0) { $bredde_h=int($MonthHits{$YearRequired.$monthix}/$max_h*$BarHeight)+1; } + if ($max_k > 0) { $bredde_k=int($MonthBytes{$YearRequired.$monthix}/$max_k*$BarHeight)+1; } print ""; print "\"$Message[11]:"; print "\"$Message[10]:"; @@ -5490,10 +5505,10 @@ EOF my $year=$1; my $month=$2; my $day=$3; if (! DateIsValid($day,$month,$year)) { next; } # If not an existing day, go to next 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; } + if ($max_v > 0) { $bredde_v=int(($DayVisits{$year.$month.$day}||0)/$max_v*$BarHeight)+1; } + if ($max_h > 0) { $bredde_p=int(($DayPages{$year.$month.$day}||0)/$max_h*$BarHeight)+1; } + if ($max_h > 0) { $bredde_h=int(($DayHits{$year.$month.$day}||0)/$max_h*$BarHeight)+1; } + if ($max_k > 0) { $bredde_k=int(($DayBytes{$year.$month.$day}||0)/$max_k*$BarHeight)+1; } print ""; print "\"$Message[10]:"; print "\"$Message[56]:"; @@ -5504,10 +5519,10 @@ EOF print " "; print ""; # Show average value cell my $bredde_v=0; my $bredde_p=0; my $bredde_h=0; my $bredde_k=0; - if ($max_v > 0) { $bredde_v=int($avg_day_v/$max_v*$BarHeight/2)+1; } - if ($max_h > 0) { $bredde_p=int($avg_day_p/$max_h*$BarHeight/2)+1; } - if ($max_h > 0) { $bredde_h=int($avg_day_h/$max_h*$BarHeight/2)+1; } - if ($max_k > 0) { $bredde_k=int($avg_day_k/$max_k*$BarHeight/2)+1; } + if ($max_v > 0) { $bredde_v=int($avg_day_v/$max_v*$BarHeight)+1; } + if ($max_h > 0) { $bredde_p=int($avg_day_p/$max_h*$BarHeight)+1; } + if ($max_h > 0) { $bredde_h=int($avg_day_h/$max_h*$BarHeight)+1; } + if ($max_k > 0) { $bredde_k=int($avg_day_k/$max_k*$BarHeight)+1; } $avg_day_v=sprintf("%.2f",$avg_day_v); $avg_day_p=sprintf("%.2f",$avg_day_p); $avg_day_h=sprintf("%.2f",$avg_day_h); @@ -5672,19 +5687,28 @@ EOF &html_end; exit(0); } - if ($HTMLOutput eq "alllogins") { + if ($HTMLOutput eq "alllogins" || $HTMLOutput eq "lastlogins") { print "$Center 
\n"; - &tab_head($Message[94],19); + my $title=""; + if ($HTMLOutput eq "alllogins") { $title.="$Message[94]"; } + if ($HTMLOutput eq "lastlogins") { $title.="$Message[9]"; } + &tab_head("$title",19); print "$Message[94] : ".(scalar keys %_login_h).""; - print "$Message[56]$Message[57]$Message[75]$Message[9]\n"; + if ($ShowAuthenticatedUsers =~ /P/i) { print "$Message[56]"; } + if ($ShowAuthenticatedUsers =~ /H/i) { print "$Message[57]"; } + if ($ShowAuthenticatedUsers =~ /B/i) { print "$Message[75]"; } + if ($ShowAuthenticatedUsers =~ /L/i) { print "$Message[9]"; } + print "\n"; $total_p=$total_h=$total_k=0; my $count=0; - &BuildKeyList($MaxRowsInHTMLOutput,$MinHitHost,\%_login_h,\%_login_p); + if ($HTMLOutput eq "alllogins") { &BuildKeyList($MaxRowsInHTMLOutput,$MinHitHost,\%_login_h,\%_login_p); } + if ($HTMLOutput eq "lastlogins") { &BuildKeyList($MaxRowsInHTMLOutput,$MinHitHost,\%_login_h,\%_login_l); } foreach my $key (@keylist) { print "$key"; - print "$_login_p{$key}$_login_h{$key}".Format_Bytes($_login_k{$key}).""; - if ($_login_l{$key}) { print "".Format_Date($_login_l{$key},1).""; } - else { print "-"; } + if ($ShowAuthenticatedUsers =~ /P/i) { print "$_login_p{$key}"; } + if ($ShowAuthenticatedUsers =~ /H/i) { print "$_login_h{$key}"; } + if ($ShowAuthenticatedUsers =~ /B/i) { print "".Format_Bytes($_login_k{$key}).""; } + if ($ShowAuthenticatedUsers =~ /L/i) { print "".($_login_l{$key}?Format_Date($_login_l{$key},1):"-").""; } print "\n"; $total_p += $_login_p{$key}||0; $total_h += $_login_h{$key}; @@ -5697,38 +5721,11 @@ EOF $rest_k=$TotalBytes-$total_k; if ($rest_p > 0 || $rest_h > 0 || $rest_k > 0) { # All other logins and/or anonymous print "$Message[125]"; - print "$rest_p$rest_h".Format_Bytes($rest_k)." \n"; - } - &tab_end; - &html_end; - exit(0); - } - if ($HTMLOutput eq "lastlogins") { - print "$Center 
\n"; - &tab_head($Message[9],19); - print "$Message[94] : ".(scalar keys %_login_h).""; - print "$Message[56]$Message[57]$Message[75]$Message[9]\n"; - $total_p=$total_h=$total_k=0; - my $count=0; - &BuildKeyList($MaxRowsInHTMLOutput,$MinHitHost,\%_login_h,\%_login_l); - foreach my $key (@keylist) { - print "$key"; - print "$_login_p{$key}$_login_h{$key}".Format_Bytes($_login_k{$key}).""; - if ($_login_l{$key}) { print "".Format_Date($_login_l{$key},1).""; } - else { print "-"; } + if ($ShowAuthenticatedUsers =~ /P/i) { print "$rest_p"; } + if ($ShowAuthenticatedUsers =~ /H/i) { print "$rest_h"; } + if ($ShowAuthenticatedUsers =~ /B/i) { print "".Format_Bytes($rest_k).""; } + if ($ShowAuthenticatedUsers =~ /L/i) { print " "; } print "\n"; - $total_p += $_login_p{$key}||0; - $total_h += $_login_h{$key}; - $total_k += $_login_k{$key}||0; - $count++; - } - if ($Debug) { debug("Total real / shown : $TotalPages / $total_p - $TotalHits / $total_h - $TotalBytes / $total_h",2); } - $rest_p=$TotalPages-$total_p; - $rest_h=$TotalHits-$total_h; - $rest_k=$TotalBytes-$total_k; - if ($rest_p > 0 || $rest_h > 0 || $rest_k > 0) { # All other logins and/or anonymous - print "$Message[125]"; - print "$rest_p$rest_h".Format_Bytes($rest_k)." \n"; } &tab_end; &html_end; @@ -5846,10 +5843,10 @@ EOF } else { print "$Message[102]: $cpt $Message[28]"; } print ""; - print "$Message[29]"; - print "$Message[106]"; - print "$Message[104]"; - print "$Message[116]"; + if ($ShowPagesStats =~ /H/i) { print "$Message[29]"; } + if ($ShowPagesStats =~ /B/i) { print "$Message[106]"; } + if ($ShowPagesStats =~ /E/i) { print "$Message[104]"; } + if ($ShowPagesStats =~ /X/i) { print "$Message[116]"; } if ($PluginsLoaded{"etf1"}) { AddOn_ShowFields(""); } print " \n"; $total_p=$total_k=$total_e=$total_x=0; @@ -5885,6 +5882,7 @@ EOF else { print "$nompage"; } + print ""; my $bredde_p=0; my $bredde_e=0; my $bredde_x=0; my $bredde_k=0; if ($max_p > 0) { $bredde_p=int($BarWidth*($_url_p{$key}||0)/$max_p)+1; } if (($bredde_p==1) && $_url_p{$key}) { $bredde_p=2; } @@ -5894,13 +5892,16 @@ EOF if (($bredde_x==1) && $_url_x{$key}) { $bredde_x=2; } if ($max_k > 0) { $bredde_k=int($BarWidth*(($_url_k{$key}||0)/($_url_p{$key}||1))/$max_k)+1; } if (($bredde_k==1) && $_url_k{$key}) { $bredde_k=2; } - print "$_url_p{$key}".($_url_k{$key}?Format_Bytes($_url_k{$key}/($_url_p{$key}||1)):" ")."".($_url_e{$key}?$_url_e{$key}:" ")."".($_url_x{$key}?$_url_x{$key}:" ").""; + if ($ShowPagesStats =~ /H/i) { print "$_url_p{$key}"; } + if ($ShowPagesStats =~ /B/i) { print "".($_url_k{$key}?Format_Bytes($_url_k{$key}/($_url_p{$key}||1)):" ").""; } + if ($ShowPagesStats =~ /E/i) { print "".($_url_e{$key}?$_url_e{$key}:" ").""; } + if ($ShowPagesStats =~ /X/i) { print "".($_url_x{$key}?$_url_x{$key}:" ").""; } if ($PluginsLoaded{"etf1"}) { AddOn_ShowFields($key); } print ""; - print "
"; - print "
"; - print "
"; - print ""; + if ($ShowPagesStats =~ /H/i) { print "
"; } + if ($ShowPagesStats =~ /B/i) { print "
"; } + if ($ShowPagesStats =~ /E/i) { print "
"; } + if ($ShowPagesStats =~ /X/i) { print ""; } print "\n"; $total_p += $_url_p{$key}; $total_e += $_url_e{$key}; @@ -5913,8 +5914,13 @@ EOF $rest_e=$TotalEntries-$total_e; $rest_x=$TotalExits-$total_x; $rest_k=$TotalBytesPages-$total_k; - if ($rest_p > 0 || $rest_e > 0 || $rest_k) { - print "$Message[2]".($rest_p?$rest_p:" ")."".($rest_k?Format_Bytes($rest_k/$rest_p||1):" ")."".($rest_e?$rest_e:" ")."".($rest_x?$rest_x:" ")." \n"; + if ($rest_p > 0 || $rest_e > 0 || $rest_k > 0) { + print "$Message[2]"; + if ($ShowPagesStats =~ /H/i) { print "".($rest_p?$rest_p:" ").""; } + if ($ShowPagesStats =~ /B/i) { print "".($rest_k?Format_Bytes($rest_k/$rest_p||1):" ").""; } + if ($ShowPagesStats =~ /E/i) { print "".($rest_e?$rest_e:" ").""; } + if ($ShowPagesStats =~ /X/i) { print "".($rest_x?$rest_x:" ").""; } + print " \n"; } &tab_end; &html_end; @@ -6198,11 +6204,11 @@ EOF for (my $ix=1; $ix<=12; $ix++) { my $monthix=sprintf("%02s",$ix); my $bredde_u=0; my $bredde_v=0;my $bredde_p=0;my $bredde_h=0;my $bredde_k=0; - if ($max_v > 0) { $bredde_u=int($MonthUnique{$YearRequired.$monthix}/$max_v*$BarHeight/2)+1; } - if ($max_v > 0) { $bredde_v=int($MonthVisits{$YearRequired.$monthix}/$max_v*$BarHeight/2)+1; } - if ($max_h > 0) { $bredde_p=int($MonthPages{$YearRequired.$monthix}/$max_h*$BarHeight/2)+1; } - if ($max_h > 0) { $bredde_h=int($MonthHits{$YearRequired.$monthix}/$max_h*$BarHeight/2)+1; } - if ($max_k > 0) { $bredde_k=int($MonthBytes{$YearRequired.$monthix}/$max_k*$BarHeight/2)+1; } + if ($max_v > 0) { $bredde_u=int($MonthUnique{$YearRequired.$monthix}/$max_v*$BarHeight)+1; } + if ($max_v > 0) { $bredde_v=int($MonthVisits{$YearRequired.$monthix}/$max_v*$BarHeight)+1; } + if ($max_h > 0) { $bredde_p=int($MonthPages{$YearRequired.$monthix}/$max_h*$BarHeight)+1; } + if ($max_h > 0) { $bredde_h=int($MonthHits{$YearRequired.$monthix}/$max_h*$BarHeight)+1; } + if ($max_k > 0) { $bredde_k=int($MonthBytes{$YearRequired.$monthix}/$max_k*$BarHeight)+1; } print ""; print "\"$Message[11]:"; print "\"$Message[10]:"; @@ -6273,10 +6279,10 @@ EOF my $year=$1; my $month=$2; my $day=$3; if (! DateIsValid($day,$month,$year)) { next; } # If not an existing day, go to next 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; } + if ($max_v > 0) { $bredde_v=int(($DayVisits{$year.$month.$day}||0)/$max_v*$BarHeight)+1; } + if ($max_h > 0) { $bredde_p=int(($DayPages{$year.$month.$day}||0)/$max_h*$BarHeight)+1; } + if ($max_h > 0) { $bredde_h=int(($DayHits{$year.$month.$day}||0)/$max_h*$BarHeight)+1; } + if ($max_k > 0) { $bredde_k=int(($DayBytes{$year.$month.$day}||0)/$max_k*$BarHeight)+1; } print ""; print "\"$Message[10]:"; print "\"$Message[56]:"; @@ -6288,10 +6294,10 @@ EOF # Show average value cell print ""; my $bredde_v=0; my $bredde_p=0; my $bredde_h=0; my $bredde_k=0; - if ($max_v > 0) { $bredde_v=int($avg_day_v/$max_v*$BarHeight/2)+1; } - if ($max_h > 0) { $bredde_p=int($avg_day_p/$max_h*$BarHeight/2)+1; } - if ($max_h > 0) { $bredde_h=int($avg_day_h/$max_h*$BarHeight/2)+1; } - if ($max_k > 0) { $bredde_k=int($avg_day_k/$max_k*$BarHeight/2)+1; } + if ($max_v > 0) { $bredde_v=int($avg_day_v/$max_v*$BarHeight)+1; } + if ($max_h > 0) { $bredde_p=int($avg_day_p/$max_h*$BarHeight)+1; } + if ($max_h > 0) { $bredde_h=int($avg_day_h/$max_h*$BarHeight)+1; } + if ($max_k > 0) { $bredde_k=int($avg_day_k/$max_k*$BarHeight)+1; } $avg_day_v=sprintf("%.2f",$avg_day_v); $avg_day_p=sprintf("%.2f",$avg_day_p); $avg_day_h=sprintf("%.2f",$avg_day_h); @@ -6376,9 +6382,9 @@ EOF } for (@DOWIndex) { my $bredde_p=0; my $bredde_h=0; my $bredde_k=0; - if ($max_h > 0) { $bredde_p=int($avg_dayofweek_p[$_]/$max_h*$BarHeight/2)+1; } - if ($max_h > 0) { $bredde_h=int($avg_dayofweek_h[$_]/$max_h*$BarHeight/2)+1; } - if ($max_k > 0) { $bredde_k=int($avg_dayofweek_k[$_]/$max_k*$BarHeight/2)+1; } + if ($max_h > 0) { $bredde_p=int($avg_dayofweek_p[$_]/$max_h*$BarHeight)+1; } + if ($max_h > 0) { $bredde_h=int($avg_dayofweek_h[$_]/$max_h*$BarHeight)+1; } + if ($max_k > 0) { $bredde_k=int($avg_dayofweek_k[$_]/$max_k*$BarHeight)+1; } $avg_dayofweek_p[$_]=sprintf("%.2f",$avg_dayofweek_p[$_]); $avg_dayofweek_h[$_]=sprintf("%.2f",$avg_dayofweek_h[$_]); $avg_dayofweek_k[$_]=sprintf("%.2f",$avg_dayofweek_k[$_]); @@ -6394,11 +6400,28 @@ EOF print "\n"; print "\n"; for (@DOWIndex) { - print "".$Message[$_+84].""; + print "".$Message[$_+84].""; } - print ""; + print "\n"; + print "
\n"; + + # Show data array for days of week + print "\n"; + print ""; + print ""; + print ""; + print ""; + for (@DOWIndex) { + print ""; + print "".$Message[$_+84].""; + print "",$avg_dayofweek_p[$_],""; + print "",$avg_dayofweek_h[$_],""; + print "",Format_Bytes($avg_dayofweek_k[$_]),""; + print "\n"; + } + print "
$Message[4]$Message[56]$Message[57]$Message[75]
\n
\n"; + + print ""; print "\n"; &tab_end; } @@ -6408,24 +6431,16 @@ EOF if ($ShowHoursStats) { if ($Debug) { debug("ShowHoursStats",2); } print "$Center 
\n"; - my $title=$Message[20]; + my $title="$Message[20]"; if ($PluginsLoaded{"timezone"}) { $title.=($PluginsLoaded{"timezone"}?" (GMT ".($PluginsLoaded{"timezone"}>=0?"+":"").int($PluginsLoaded{"timezone"}/3600).")":"i"); } - &tab_head($title,19); - print "
\n"; + &tab_head("$title",19); + print "\n"; + print ""; + # Show clock icon + print ""; + for (my $ix=0; $ix<=23; $ix++) { + print "\n"; # width=19 instead of 18 to avoid a MacOS browser bug. + } + print "\n"; + # Show hour lib + print "\n"; + for (my $ix=0; $ix<=23; $ix++) { + my $hr=($ix+1); if ($hr>12) { $hr=$hr-12; } + print "\n"; + } + print "\n"; + + print "
\n"; $max_h=$max_k=1; for (my $ix=0; $ix<=23; $ix++) { - print "\n"; # width=19 instead of 18 to avoid a MacOS browser bug. #if ($_time_p[$ix]>$max_p) { $max_p=$_time_p[$ix]; } if ($_time_h[$ix]>$max_h) { $max_h=$_time_h[$ix]; } if ($_time_k[$ix]>$max_k) { $max_k=$_time_k[$ix]; } } - print "\n"; - print "\n"; - for (my $ix=0; $ix<=23; $ix++) { - my $hr=($ix+1); if ($hr>12) { $hr=$hr-12; } - print "\n"; - } - print "\n"; print "\n"; for (my $ix=0; $ix<=23; $ix++) { my $bredde_p=0;my $bredde_h=0;my $bredde_k=0; @@ -6438,7 +6453,42 @@ EOF print "\"$Message[75]:"; print "\n"; } - print "
$ix
$ix
\n"; + print "
\n"; + + # Show data array for hours + print "\n"; + print ""; + print ""; + print ""; + print ""; + for (my $ix=1; $ix<=23; $ix++) { + my $monthix=($ix<10?"0$ix":"$ix"); + print ""; + print ""; + print ""; + print ""; + print ""; + print "\n"; + } + print "
$Message[20]$Message[56]$Message[57]$Message[75]
$monthix",$_time_p[$monthix]?$_time_p[$monthix]:"0","",$_time_h[$monthix]?$_time_h[$monthix]:"0","",Format_Bytes(int($_time_k[$monthix])),"
\n
\n"; + + print "
\n"; &tab_end; } @@ -6534,8 +6584,15 @@ EOF if ($ShowAuthenticatedUsers) { if ($Debug) { debug("ShowAuthenticatedUsers",2); } print "$Center 
\n"; - &tab_head("$Message[94] ($Message[77] $MaxNbOfLoginShown)   -   $Message[80]   -   $Message[9]",19); - print "$Message[94] : ".(scalar keys %_login_h)."$Message[56]$Message[57]$Message[75]$Message[9]\n"; + my $title="$Message[94] ($Message[77] $MaxNbOfLoginShown)   -   $Message[80]"; + if ($ShowAuthenticatedUsers =~ /L/i) { $title.="   -   $Message[9]"; } + &tab_head("$title",19); + print "$Message[94] : ".(scalar keys %_login_h).""; + if ($ShowAuthenticatedUsers =~ /P/i) { print "$Message[56]"; } + if ($ShowAuthenticatedUsers =~ /H/i) { print "$Message[57]"; } + if ($ShowAuthenticatedUsers =~ /B/i) { print "$Message[75]"; } + if ($ShowAuthenticatedUsers =~ /L/i) { print "$Message[9]"; } + print "\n"; $total_p=$total_h=$total_k=0; $max_h=1; foreach my $key (values %_login_h) { if ($key > $max_h) { $max_h = $key; } } $max_k=1; foreach my $key (values %_login_k) { if ($key > $max_k) { $max_k = $key; } } @@ -6547,9 +6604,10 @@ EOF if ($max_h > 0) { $bredde_h=int($BarWidth*$_login_h{$key}/$max_h)+1; } if ($max_k > 0) { $bredde_k=int($BarWidth*$_login_k{$key}/$max_k)+1; } print "$key"; - print "$_login_p{$key}$_login_h{$key}".Format_Bytes($_login_k{$key}).""; - if ($_login_l{$key}) { print "".Format_Date($_login_l{$key},1).""; } - else { print "-"; } + if ($ShowAuthenticatedUsers =~ /P/i) { print "$_login_p{$key}"; } + if ($ShowAuthenticatedUsers =~ /H/i) { print "$_login_h{$key}"; } + if ($ShowAuthenticatedUsers =~ /B/i) { print "".Format_Bytes($_login_k{$key}).""; } + if ($ShowAuthenticatedUsers =~ /L/i) { print "".($_login_l{$key}?Format_Date($_login_l{$key},1):"-").""; } #print ""; #print "\"$Message[56]:
\n"; #print "\"$Message[57]:
\n"; @@ -6565,7 +6623,12 @@ EOF $rest_h=$TotalHits-$total_h; $rest_k=$TotalBytes-$total_k; if ($rest_p > 0 || $rest_h > 0 || $rest_k > 0) { # All other login - print "$Message[125]$rest_p$rest_h".Format_Bytes($rest_k)." \n"; + print "$Message[125]"; + if ($ShowAuthenticatedUsers =~ /P/i) { print "$rest_p"; } + if ($ShowAuthenticatedUsers =~ /H/i) { print "$rest_h"; } + if ($ShowAuthenticatedUsers =~ /B/i) { print "".Format_Bytes($rest_k).""; } + if ($ShowAuthenticatedUsers =~ /L/i) { print " "; } + print "\n"; } &tab_end; } @@ -6632,12 +6695,15 @@ EOF if ($ShowPagesStats) { if ($Debug) { debug("ShowPagesStats (MaxNbOfPageShown=$MaxNbOfPageShown TotalDifferentPages=$TotalDifferentPages)",2); } print "$Center   
\n"; - &tab_head("$Message[19] ($Message[77] $MaxNbOfPageShown)   -   $Message[80]   -   $Message[104]   -   $Message[116]",19); + my $title="$Message[19] ($Message[77] $MaxNbOfPageShown)   -   $Message[80]"; + if ($ShowPagesStats =~ /E/i) { $title.="   -   $Message[104]"; } + if ($ShowPagesStats =~ /X/i) { $title.="   -   $Message[116]"; } + &tab_head("$title",19); print "$TotalDifferentPages $Message[28]"; - print "$Message[29]"; - print "$Message[106]"; - print "$Message[104]"; - print "$Message[116]"; + if ($ShowPagesStats =~ /H/i) { print "$Message[29]"; } + if ($ShowPagesStats =~ /B/i) { print "$Message[106]"; } + if ($ShowPagesStats =~ /E/i) { print "$Message[104]"; } + if ($ShowPagesStats =~ /X/i) { print "$Message[116]"; } print " \n"; $total_p=$total_e=$total_x=$total_k=0; $max_p=1; $max_k=1; @@ -6670,6 +6736,7 @@ EOF else { print "$nompage"; } + print ""; my $bredde_p=0; my $bredde_e=0; my $bredde_x=0; my $bredde_k=0; if ($max_p > 0) { $bredde_p=int($BarWidth*($_url_p{$key}||0)/$max_p)+1; } if (($bredde_p==1) && $_url_p{$key}) { $bredde_p=2; } @@ -6679,12 +6746,15 @@ EOF if (($bredde_x==1) && $_url_x{$key}) { $bredde_x=2; } if ($max_k > 0) { $bredde_k=int($BarWidth*(($_url_k{$key}||0)/($_url_p{$key}||1))/$max_k)+1; } if (($bredde_k==1) && $_url_k{$key}) { $bredde_k=2; } - print "$_url_p{$key}".($_url_k{$key}?Format_Bytes($_url_k{$key}/($_url_p{$key}||1)):" ")."".($_url_e{$key}?$_url_e{$key}:" ")."".($_url_x{$key}?$_url_x{$key}:" ").""; + if ($ShowPagesStats =~ /H/i) { print "$_url_p{$key}"; } + if ($ShowPagesStats =~ /B/i) { print "".($_url_k{$key}?Format_Bytes($_url_k{$key}/($_url_p{$key}||1)):" ").""; } + if ($ShowPagesStats =~ /E/i) { print "".($_url_e{$key}?$_url_e{$key}:" ").""; } + if ($ShowPagesStats =~ /X/i) { print "".($_url_x{$key}?$_url_x{$key}:" ").""; } print ""; - print "\"$Message[56]:
"; - print "\"$Message[106]:
"; - print "\"$Message[104]:
"; - print "\"$Message[116]:"; + if ($ShowPagesStats =~ /H/i) { print "\"$Message[56]:
"; } + if ($ShowPagesStats =~ /B/i) { print "\"$Message[106]:
"; } + if ($ShowPagesStats =~ /E/i) { print "\"$Message[104]:
"; } + if ($ShowPagesStats =~ /X/i) { print "\"$Message[116]:"; } print "\n"; $total_p += $_url_p{$key}; $total_e += $_url_e{$key}; @@ -6697,7 +6767,12 @@ EOF $rest_x=$TotalExits-$total_x; $rest_k=$TotalBytesPages-$total_k; if ($rest_p > 0 || $rest_k > 0 || $rest_e > 0 || $rest_x > 0) { # All other urls - print "$Message[2]$rest_p".($rest_k?Format_Bytes($rest_k/($rest_p||1)):" ")."".($rest_e?$rest_e:" ")."".($rest_x?$rest_x:" ")." \n"; + print "$Message[2]"; + if ($ShowPagesStats =~ /H/i) { print "$rest_p"; } + if ($ShowPagesStats =~ /B/i) { print "".($rest_k?Format_Bytes($rest_k/($rest_p||1)):" ").""; } + if ($ShowPagesStats =~ /E/i) { print "".($rest_e?$rest_e:" ").""; } + if ($ShowPagesStats =~ /X/i) { print "".($rest_x?$rest_x:" ").""; } + print " \n"; } &tab_end; } @@ -6712,13 +6787,9 @@ EOF if ($ShowCompressionStats) { &tab_head("$Message[73] - $Message[98]",19); } else { &tab_head("$Message[73]",19); } print "$Message[73]"; - print " $Message[57] $Message[15]"; - if ($ShowCompressionStats) { - print "$Message[75]$Message[100]$Message[101]$Message[99]"; - } - else { - print "$Message[75]"; - } + if ($ShowFileTypesStats =~ /H/i) { print " $Message[57] $Message[15]"; } + if ($ShowFileTypesStats =~ /B/i) { print "$Message[75]"; } + if ($ShowFileTypesStats =~ /C/i) { print "$Message[100]$Message[101]$Message[99]"; } print "\n"; my $count=0; foreach my $key (sort { $_filetypes_h{$b} <=> $_filetypes_h{$a} } keys (%_filetypes_h)) { @@ -6729,19 +6800,17 @@ EOF else { print "$key"; } - print "$_filetypes_h{$key}$p %"; - if ($ShowCompressionStats) { + if ($ShowFileTypesStats =~ /H/i) { print "$_filetypes_h{$key}$p %"; } + if ($ShowFileTypesStats =~ /B/i) { print "".Format_Bytes($_filetypes_k{$key}).""; } + if ($ShowFileTypesStats =~ /C/i) { if ($_filetypes_gz_in{$key}) { my $percent=int(100*(1-$_filetypes_gz_out{$key}/$_filetypes_gz_in{$key})); - printf("%s%s%s%s (%s%)",Format_Bytes($_filetypes_k{$key}),Format_Bytes($_filetypes_gz_in{$key}),Format_Bytes($_filetypes_gz_out{$key}),Format_Bytes($_filetypes_gz_in{$key}-$_filetypes_gz_out{$key}),$percent); + printf("%s%s%s (%s%)",Format_Bytes($_filetypes_gz_in{$key}),Format_Bytes($_filetypes_gz_out{$key}),Format_Bytes($_filetypes_gz_in{$key}-$_filetypes_gz_out{$key}),$percent); } else { - printf("%s   ",Format_Bytes($_filetypes_k{$key})); + print "   "; } } - else { - printf("%s",Format_Bytes($_filetypes_k{$key})); - } print "\n"; $count++; }