From: eldy <> Date: Sat, 15 Sep 2001 14:06:58 +0000 (+0000) Subject: Add Days of week report X-Git-Tag: AWSTATS_1_0~125 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c217c98844b06f499386592fb4cab596f511bc6c;p=thirdparty%2FAWStats.git Add Days of week report --- diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf index ec9f66dc..d37ded84 100644 --- a/wwwroot/cgi-bin/awstats.model.conf +++ b/wwwroot/cgi-bin/awstats.model.conf @@ -251,6 +251,41 @@ OnlyFiles="" # URLWithQuery=0 +# AWStats can detect setup problems or show you important informations to have +# a better use. Keep this to 1, except if AWStats says you can change it. +# Possible values: 1 or 0 +# Default: 1 +WarningMessages=1 + +# Choose if you want week to start on sunday or monday +# Possible values: +# 0 - Week start on sunday +# 1 - Week start on monday +# Default: 1 +# +FirstDayOfWeek=1 + +# This value can be used to choose maximum number of lines shown for each +# particular reporting. +# +# Stats by domains +MaxNbOfDomain = 25 +# Stats by hosts +MaxNbOfHostsShown = 25 +MinHitHost = 1 +# Stats by robots +MaxNbOfRobotShown = 25 +MinHitRobot = 1 +# Stats by pages +MaxNbOfPageShown = 25 +MinHitFile = 1 +# Stats by referers +MaxNbOfRefererShown = 25 +MinHitRefer = 1 +# Stats for keywords +MaxNbOfKeywordsShown = 25 +MinHitKeyword = 1 + # Search engines keywords reported are full search string or separate keywords # Possible values: # 0 - Search keywords reported are full search string (ie: "town maps") @@ -259,12 +294,6 @@ URLWithQuery=0 # SplitSearchString=0 -# AWStats can detect setup problems or show you important informations to have -# a better use. Keep this to 1, except if AWStats says you can change it. -# Possible values: 1 or 0 -# Default: 1 -WarningMessages=1 - # You can add in the HTML report page a delay to force browsers to reload page # if page is loaded a second time after this delay (in seconds). # Example: 3600 @@ -285,13 +314,14 @@ ShowDomainsStats=1 ShowHostsStats=1 ShowRobotsStats=1 ShowHoursStats=1 -ShowDaysOfWeekStats=0 # Not yet available +ShowDaysOfWeekStats=1 ShowPagesStats=1 ShowFileTypesStats=0 # Not yet available ShowFileSizesStats=0 # Not yet available ShowBrowsersStats=1 ShowOSStats=1 ShowOriginStats=1 +ShowKeyphrasesStats=1 ShowKeywordsStats=1 ShowAuthenticatedUsers=0 # Not yet available ShowHTTPErrorsStats=1 @@ -314,7 +344,12 @@ ShowLinksOnUrl=1 # Possible values: 1 or 0 # Default: 1 # -OpenDetailedReportOnNewWindows=1 +DetailedReportsOnNewWindows=1 + +# You can put here HTML code that will be added at the top of AWStats reports. +# Default: "" +# +HTMLHeadSection="" # You can put here HTML code that will be added at the end of AWStats reports. # Great to add advert ban. @@ -328,27 +363,6 @@ HTMLEndSection="" BarWidth = 260 BarHeight = 180 -# This value can be used to choose maximum number of lines shown for each -# particular reporting. -# -# Stats by domains -MaxNbOfDomain = 25 -# Stats by hosts -MaxNbOfHostsShown = 25 -MinHitHost = 1 -# Stats by robots -MaxNbOfRobotShown = 25 -MinHitRobot = 1 -# Stats by pages -MaxNbOfPageShown = 25 -MinHitFile = 1 -# Stats by referers -MaxNbOfRefererShown = 25 -MinHitRefer = 1 -# Stats for keywords -MaxNbOfKeywordsShown = 25 -MinHitKeyword = 1 - # You can set Logo and LogoLink to use your own logo. # Logo must be the name of image file (must be in $DirIcons/other directory). # LogoLink is the expected URL when clicking on Logo. diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index df4e46d8..7a73a8bf 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -46,14 +46,19 @@ ($AddOn, $ArchiveFileName, $ArchiveLogRecords, $BarHeight, $BarWidth, $DIR, $DNSLookup, $Debug, $DefaultFile, $DirCgi, $DirData, $DirIcons, $DirLang, -$Expires, $Extension, $FileConfig, $FileSuffix, -$FirstTime, $HTMLEndSection, $Host, $HostAlias, $LastTime, $LastUpdate, +$DetailedReportsOnNewWindows, $Expires, $Extension, $FileConfig, $FileSuffix, $FirstDayOfWeek, +$FirstTime, $HTMLHeadSection, $HTMLEndSection, $Host, $HostAlias, $LastTime, $LastUpdate, $LogFile, $LogFormat, $LogFormatString, $Logo, $LogoLink, $MaxNbOfDays, $MaxNbOfHostsShown, $MaxNbOfKeywordsShown, $MaxNbOfPageShown, $MaxNbOfRefererShown, $MaxNbOfRobotShown, $MinHitFile, $MinHitHost, $MinHitKeyword, $MinHitRefer, $MinHitRobot, $MonthRequired, $HTMLOutput, $PROG, $PageCode, $PurgeLogFile, $QueryString, $RatioBytes, $RatioHits, $RatioHosts, $RatioPages, +$ShowHeader, $ShowMenu, $ShowMonthDayStats, $ShowDomainsStats, +$ShowHostsStats, $ShowRobotsStats, $ShowHoursStats, $ShowDaysOfWeekStats, +$ShowPagesStats, $ShowFileTypesStats, $ShowFileSizesStats, +$ShowBrowsersStats, $ShowOSStats, $ShowOriginStats, $ShowKeyphrasesStats, $ShowKeywordsStats, +$ShowAuthenticatedUsers, $ShowHTTPErrorsStats, $ShowFlagLinks, $ShowLinksOnURL, $ShowLinksOnUrl, $ShowSteps, $SiteConfig, $SiteDomain, $SiteToAnalyze, $SiteToAnalyzeWithoutwww, $TotalBytes, $TotalDifferentPages, $TotalErrors, $TotalHits, @@ -65,13 +70,15 @@ $color_h, $color_k, $color_link, $color_p, $color_s, $color_v, $color_w, $color_ $found, $internal_link, $new) = (); # ---------- Init arrays -------- @HostAliases = @Message = @OnlyFiles = @SkipDNSLookupFor = @SkipFiles = @SkipHosts = (); +@LastDOW = @DOWIndex = (); +@DOW_Pages = @DOW_Hits = @DOW_Kilo = (0, 0, 0, 0, 0, 0, 0); # ---------- Init hash arrays -------- %DayBytes = %DayHits = %DayPages = %DayUnique = %DayVisits = %FirstTime = %HistoryFileAlreadyRead = %LastTime = %LastUpdate = %MonthBytes = %MonthHits = %MonthHostsKnown = %MonthHostsUnknown = %MonthPages = %MonthUnique = %MonthVisits = %monthlib = %monthnum = (); -$VERSION="3.2 (build 2)"; +$VERSION="3.2 (build 3)"; $Lang="en"; # Default value @@ -962,6 +969,18 @@ sub SkipDNSLookup { 0; # Not in @SkipDNSLookupFor } +sub DayOfWeek { + my ($day, $month, $year) = @_; + if ($month < 3) { $month += 10; $year--; } + else { $month -= 2; } + my $cent = sprintf("%1i",($year/100)); + my $y = ($year % 100); + my $dw = (sprintf("%1i",(2.6*$month)-0.2) + $day + $y + sprintf("%1i",($y/4)) + sprintf("%1i",($cent/4)) - (2*$cent)) % 7; + $dw += 7 if ($dw<0); + &debug("day of week for $day $month $year= $dw",3); + return $dw; +} + #------------------------------------------------------------------------------ # Function: read config file @@ -1001,18 +1020,33 @@ sub Read_Config_File { next; } if ($param =~ /^LogFormat/) { $LogFormat=$value; next; } - if ($param =~ /^URLWithQuery/) { $URLWithQuery=$value; next; } if ($param =~ /^AllowToUpdateStatsFromBrowser/) { $AllowToUpdateStatsFromBrowser=$value; next; } if ($param =~ /^HostAliases/) { my @felter=split(/\s+/,$value); $i=0; foreach $elem (@felter) { $HostAliases[$i]=$elem; $i++; } next; } + if ($param =~ /^DirData/) { $DirData=$value; next; } + if ($param =~ /^DirCgi/) { $DirCgi=$value; next; } + if ($param =~ /^DirIcons/) { $DirIcons=$value; next; } + if ($param =~ /^DNSLookup/) { $DNSLookup=$value; next; } + if ($param =~ /^PurgeLogFile/) { $PurgeLogFile=$value; next; } + if ($param =~ /^ArchiveLogRecords/) { $ArchiveLogRecords=$value; next; } + # Read optional section + if ($param =~ /^SiteDomain/) { $SiteDomain=$value; next; } + if ($param =~ /^Lang/) { $Lang=$value; next; } + if ($param =~ /^DirLang/) { $DirLang=$value; next; } + if ($param =~ /^DefaultFile/) { $DefaultFile=$value; next; } if ($param =~ /^SkipHosts/) { my @felter=split(/\s+/,$value); $i=0; foreach $elem (@felter) { $SkipHosts[$i]=$elem; $i++; } next; } + if ($param =~ /^SkipDNSLookupFor/) { + my @felter=split(/\s+/,$value); + $i=0; foreach $elem (@felter) { $SkipDNSLookupFor[$i]=$elem; $i++; } + next; + } if ($param =~ /^SkipFiles/) { my @felter=split(/\s+/,$value); $i=0; foreach $elem (@felter) { $SkipFiles[$i]=$elem; $i++; } @@ -1023,24 +1057,22 @@ sub Read_Config_File { $i=0; foreach $elem (@felter) { $OnlyFiles[$i]=$elem; $i++; } next; } - if ($param =~ /^SkipDNSLookupFor/) { - my @felter=split(/\s+/,$value); - $i=0; foreach $elem (@felter) { $SkipDNSLookupFor[$i]=$elem; $i++; } - next; - } - if ($param =~ /^DirData/) { $DirData=$value; next; } - if ($param =~ /^DirCgi/) { $DirCgi=$value; next; } - if ($param =~ /^DirIcons/) { $DirIcons=$value; next; } - if ($param =~ /^DNSLookup/) { $DNSLookup=$value; next; } - if ($param =~ /^PurgeLogFile/) { $PurgeLogFile=$value; next; } - if ($param =~ /^ArchiveLogRecords/) { $ArchiveLogRecords=$value; next; } - # Read optional section - if ($param =~ /^SiteDomain/) { $SiteDomain=$value; next; } - if ($param =~ /^Lang/) { $Lang=$value; next; } - if ($param =~ /^DirLang/) { $DirLang=$value; next; } - if ($param =~ /^DefaultFile/) { $DefaultFile=$value; next; } + if ($param =~ /^URLWithQuery/) { $URLWithQuery=$value; next; } if ($param =~ /^WarningMessages/) { $WarningMessages=$value; next; } if ($param =~ /^Expires/) { $Expires=$value; next; } + if ($param =~ /^FirstDayOfWeek/) { $FirstDayOfWeek=$value; next; } + if ($param =~ /^MaxNbOfDomain/) { $MaxNbOfDomain=$value; next; } + if ($param =~ /^MaxNbOfHostsShown/) { $MaxNbOfHostsShown=$value; next; } + if ($param =~ /^MinHitHost/) { $MinHitHost=$value; next; } + if ($param =~ /^MaxNbOfRobotShown/) { $MaxNbOfRobotShown=$value; next; } + if ($param =~ /^MinHitRobot/) { $MinHitRobot=$value; next; } + if ($param =~ /^MaxNbOfPageShown/) { $MaxNbOfPageShown=$value; next; } + if ($param =~ /^MinHitFile/) { $MinHitFile=$value; next; } + if ($param =~ /^MaxNbOfRefererShown/) { $MaxNbOfRefererShown=$value; next; } + if ($param =~ /^MinHitRefer/) { $MinHitRefer=$value; next; } + if ($param =~ /^MaxNbOfKeywordsShown/) { $MaxNbOfKeywordsShown=$value; next; } + if ($param =~ /^MinHitKeyword/) { $MinHitKeyword=$value; next; } + if ($param =~ /^SplitSearchString/) { $SplitSearchString=$value; next; } if ($param =~ /^ShowHeader/) { $ShowHeader=$value; next; } if ($param =~ /^ShowMenu/) { $ShowMenu=$value; next; } if ($param =~ /^ShowMonthDayStats/) { $ShowMonthDayStats=$value; next; } @@ -1055,26 +1087,17 @@ sub Read_Config_File { if ($param =~ /^ShowBrowsersStats/) { $ShowBrowsersStats=$value; next; } if ($param =~ /^ShowOSStats/) { $ShowOSStats=$value; next; } if ($param =~ /^ShowOriginStats/) { $ShowOriginStats=$value; next; } + if ($param =~ /^ShowKeyphrasesStats/) { $ShowKeyphrasesStats=$value; next; } if ($param =~ /^ShowKeywordsStats/) { $ShowKeywordsStats=$value; next; } if ($param =~ /^ShowAuthenticatedUsers/) { $ShowAuthenticatedUsers=$value; next; } if ($param =~ /^ShowHTTPErrorsStats/) { $ShowHTTPErrorsStats=$value; next; } if ($param =~ /^ShowFlagLinks/) { $ShowFlagLinks=$value; next; } if ($param =~ /^ShowLinksOnUrl/) { $ShowLinksOnUrl=$value; next; } + if ($param =~ /^DetailedReportsOnNewWindows/) { $DetailedReportsOnNewWindows=$value; next; } + if ($param =~ /^HTMLHeadSection/) { $HTMLHeadSection=$value; next; } if ($param =~ /^HTMLEndSection/) { $HTMLEndSection=$value; next; } if ($param =~ /^BarWidth/) { $BarWidth=$value; next; } if ($param =~ /^BarHeight/) { $BarHeight=$value; next; } - if ($param =~ /^MaxNbOfDomain/) { $MaxNbOfDomain=$value; next; } - if ($param =~ /^MaxNbOfHostsShown/) { $MaxNbOfHostsShown=$value; next; } - if ($param =~ /^MinHitHost/) { $MinHitHost=$value; next; } - if ($param =~ /^MaxNbOfRobotShown/) { $MaxNbOfRobotShown=$value; next; } - if ($param =~ /^MinHitRobot/) { $MinHitRobot=$value; next; } - if ($param =~ /^MaxNbOfPageShown/) { $MaxNbOfPageShown=$value; next; } - if ($param =~ /^MinHitFile/) { $MinHitFile=$value; next; } - if ($param =~ /^MaxNbOfRefererShown/) { $MaxNbOfRefererShown=$value; next; } - if ($param =~ /^MinHitRefer/) { $MinHitRefer=$value; next; } - if ($param =~ /^MaxNbOfKeywordsShown/) { $MaxNbOfKeywordsShown=$value; next; } - if ($param =~ /^MinHitKeyword/) { $MinHitKeyword=$value; next; } - if ($param =~ /^SplitSearchString/) { $SplitSearchString=$value; next; } if ($param =~ /^Logo$/) { $Logo=$value; next; } if ($param =~ /^LogoLink/) { $LogoLink=$value; next; } if ($param =~ /^color_Background/) { $color_Background=$value; next; } @@ -1194,13 +1217,27 @@ sub Check_Config { # Main section if ($LogFormat =~ /^[\d]$/ && $LogFormat !~ /[1-4]/) { error("Error: LogFormat parameter is wrong. Value is '$LogFormat' (should be 1 or 2 or a 'personalised AWtats log format string')"); } if ($DNSLookup !~ /[0-1]/) { error("Error: DNSLookup parameter is wrong. Value is '$DNSLookup' (should be 0 or 1)"); } - # Optional section - if ($URLWithQuery !~ /[0-1]/) { $URLWithQuery=0; } if ($AllowToUpdateStatsFromBrowser !~ /[0-1]/) { $AllowToUpdateStatsFromBrowser=1; } # For compatibility, is 1 if not defined if ($PurgeLogFile !~ /[0-1]/) { $PurgeLogFile=0; } if ($ArchiveLogRecords !~ /[0-1]/) { $ArchiveLogRecords=1; } + # Optional section if ($DefaultFile eq "") { $DefaultFile="index.html"; } + if ($URLWithQuery !~ /[0-1]/) { $URLWithQuery=0; } if ($WarningMessages !~ /[0-1]/) { $WarningMessages=1; } + if ($FirstDayOfWeek !~ /[0-1]/) { $FirstDayOfWeek=1; } + if ($MaxNbOfDomain !~ /^[\d][\d]*/) { $MaxNbOfDomain=25; } + if ($MaxNbOfHostsShown !~ /^[\d][\d]*/) { $MaxNbOfHostsShown=25; } + if ($MinHitHost !~ /^[\d][\d]*/) { $MinHitHost=1; } + if ($MaxNbOfRobotShown !~ /^[\d][\d]*/) { $MaxNbOfRobotShown=25; } + if ($MinHitRobot !~ /^[\d][\d]*/) { $MinHitRobot=1; } + if ($MaxNbOfPageShown !~ /^[\d][\d]*/) { $MaxNbOfPageShown=25; } + if ($MinHitFile !~ /^[\d][\d]*/) { $MinHitFile=1; } + if ($MaxNbOfRefererShown !~ /^[\d][\d]*/) { $MaxNbOfRefererShown=25; } + if ($MinHitRefer !~ /^[\d][\d]*/) { $MinHitRefer=1; } + if ($MaxNbOfKeywordsShown !~ /^[\d][\d]*/) { $MaxNbOfKeywordsShown=25; } + if ($MinHitKeyword !~ /^[\d][\d]*/) { $MinHitKeyword=1; } + if ($MaxNbOfLastHosts !~ /^[\d][\d]*/) { $MaxNbOfLastHosts=1000; } + if ($SplitSearchString !~ /[0-1]/) { $SplitSearchString=0; } if ($Expires !~ /^[\d][\d]*/) { $Expires=0; } if ($ShowHeader !~ /[0-1]/) { $ShowHeader=1; } if ($ShowMenu !~ /[0-1]/) { $ShowMenu=1; } @@ -1216,26 +1253,15 @@ sub Check_Config { if ($ShowBrowsersStats !~ /[0-1]/) { $ShowBrowsersStats=1; } if ($ShowOSStats !~ /[0-1]/) { $ShowOSStats=1; } if ($ShowOriginStats !~ /[0-1]/) { $ShowOriginStats=1; } + if ($ShowKeyphrasesStats !~ /[0-1]/) { $ShowKeyphrasesStats=1; } if ($ShowKeywordsStats !~ /[0-1]/) { $ShowKeywordsStats=1; } if ($ShowHTTPErrorsStats !~ /[0-1]/) { $ShowHTTPErrorsStats=1; } if ($ShowAuthenticatedUsers !~ /[0-1]/) { $ShowAuthenticatedUsers=1; } if ($ShowFlagLinks !~ /[0-1]/) { $ShowFlagLinks=1; } if ($ShowLinksOnURL !~ /[0-1]/) { $ShowLinksOnURL=1; } + if ($DetailedReportsOnNewWindows !~ /[0-1]/) { $DetailedReportsOnNewWindows=1; } if ($BarWidth !~ /^[\d][\d]*/) { $BarWidth=260; } if ($BarHeight !~ /^[\d][\d]*/) { $BarHeight=180; } - if ($MaxNbOfDomain !~ /^[\d][\d]*/) { $MaxNbOfDomain=25; } - if ($MaxNbOfHostsShown !~ /^[\d][\d]*/) { $MaxNbOfHostsShown=25; } - if ($MinHitHost !~ /^[\d][\d]*/) { $MinHitHost=1; } - if ($MaxNbOfRobotShown !~ /^[\d][\d]*/) { $MaxNbOfRobotShown=25; } - if ($MinHitRobot !~ /^[\d][\d]*/) { $MinHitRobot=1; } - if ($MaxNbOfPageShown !~ /^[\d][\d]*/) { $MaxNbOfPageShown=25; } - if ($MinHitFile !~ /^[\d][\d]*/) { $MinHitFile=1; } - if ($MaxNbOfRefererShown !~ /^[\d][\d]*/) { $MaxNbOfRefererShown=25; } - if ($MinHitRefer !~ /^[\d][\d]*/) { $MinHitRefer=1; } - if ($MaxNbOfKeywordsShown !~ /^[\d][\d]*/) { $MaxNbOfKeywordsShown=25; } - if ($MinHitKeyword !~ /^[\d][\d]*/) { $MinHitKeyword=1; } - if ($MaxNbOfLastHosts !~ /^[\d][\d]*/) { $MaxNbOfLastHosts=1000; } - if ($SplitSearchString !~ /[0-1]/) { $SplitSearchString=0; } if ($Logo eq "") { $Logo="awstats_logo1.png"; } if ($LogoLink eq "") { $LogoLink="http://awstats.sourceforge.net"; } $color_Background =~ s/#//g; if ($color_Background !~ /^[0-9|A-Z][0-9|A-Z]*$/i) { $color_Background="FFFFFF"; } @@ -1341,6 +1367,14 @@ sub Check_Config { if ($Message[81] eq "") { $Message[81]="Hosts"; } if ($Message[82] eq "") { $Message[82]="Known"; } if ($Message[83] eq "") { $Message[83]="Robots"; } + if ($Message[84] eq "") { $Message[84]="Sun"; } + if ($Message[85] eq "") { $Message[85]="Mon"; } + if ($Message[86] eq "") { $Message[86]="Tue"; } + if ($Message[87] eq "") { $Message[87]="Wed"; } + if ($Message[88] eq "") { $Message[88]="Thu"; } + if ($Message[89] eq "") { $Message[89]="Fri"; } + if ($Message[90] eq "") { $Message[90]="Sat"; } + if ($Message[91] eq "") { $Message[91]="Days of week"; } } #-------------------------------------------------------------------- @@ -1447,6 +1481,29 @@ sub Read_History_File { &debug(" End of TIME section"); next; } + if ($field[0] eq "BEGIN_DAYOFWEEK") { + &debug(" Begin of DAYOFWEEK section"); + $_=; + chomp $_; s/\r//; + if ($_ eq "") { error("Error: History file \"$DirData/$PROG$_[1]$_[0]$FileSuffix.txt\" is corrupted. Restore a backup of this file, or remove it (data for this month will be lost)."); } + my @field=split(/\s+/,$_); + my $count=0; + while ($field[0] ne "END_DAYOFWEEK") { +# ($DOW_Pages[$count], $DOW_Hits[$count], $DOW_Kilo[$count]) = @field; + if ($part) { + $DOW_Pages[$count] += $field[0]; + $DOW_Hits[$count] += $field[1]; + $DOW_Kilo[$count] += $field[2]; + } + $_=; + chomp $_; s/\r//; + if ($_ eq "") { error("Error: History file \"$DirData/$PROG$_[1]$_[0]$FileSuffix.txt\" is corrupted. Restore a backup of this file, or remove it (data for this month will be lost)."); } + $count++; + @field=split(/\s+/,$_); + } + &debug(" End of DAYOFWEEK section ($count entries)"); + next; + } if ($field[0] eq "BEGIN_DAY") { &debug(" Begin of DAY section"); $_=; @@ -1599,7 +1656,7 @@ sub Read_History_File { if ($field[0] eq "HitFrom3") { $_from_p[3]+=0; $_from_h[3]+=$field[1]; next; } if ($field[0] eq "HitFrom4") { $_from_p[4]+=0; $_from_h[4]+=$field[1]; next; } if ($readse) { $_se_referrals_h{$field[0]}+=$field[1]; next; } - if ($readsearchwords) { $_keywords{$field[0]}+=$field[1]; next; } + if ($readsearchwords) { $_keyphrases{$field[0]}+=$field[1]; next; } if ($readerrors) { $_errors_h{$field[0]}+=$field[1]; next; } } } @@ -1657,6 +1714,10 @@ sub Save_History_File { for (my $ix=0; $ix<=23; $ix++) { print HISTORYTMP "$ix $_time_p[$ix] $_time_h[$ix] $_time_k[$ix]\n"; next; } print HISTORYTMP "END_TIME\n"; + print HISTORYTMP "BEGIN_DAYOFWEEK\n"; + for (0..6) { print HISTORYTMP "$DOW_Pages[$_] $DOW_Hits[$_] $DOW_Kilo[$_]\n"; } + print HISTORYTMP "END_DAYOFWEEK\n"; + print HISTORYTMP "BEGIN_DAY\n"; foreach my $key (keys %DayHits) { if ($key =~ /^$year$month/) { # Found a day entry of the good month @@ -1704,7 +1765,7 @@ sub Save_History_File { print HISTORYTMP "END_PAGEREFS\n"; print HISTORYTMP "BEGIN_SEARCHWORDS\n"; - foreach my $key (keys %_keywords) { if ($_keywords{$key}) { print HISTORYTMP "$key $_keywords{$key}\n"; } next; } + foreach my $key (keys %_keyphrases) { if ($_keyphrases{$key}) { print HISTORYTMP "$key $_keyphrases{$key}\n"; } next; } print HISTORYTMP "END_SEARCHWORDS\n"; print HISTORYTMP "BEGIN_ERRORS\n"; @@ -1728,13 +1789,14 @@ sub Init_HashArray { # We purge data read for $year and $month so it's like we never read it $HistoryFileAlreadyRead{"$year$month"}=0; # Delete/Reinit all arrays with name beginning by _ + @DOW_Pages = @DOW_Hits = @DOW_Kilo = (0, 0, 0, 0, 0, 0, 0); @_msiever_h = @_nsver_h = (); for (my $ix=0; $ix<5; $ix++) { $_from_p[$ix]=0; $_from_h[$ix]=0; } for (my $ix=0; $ix<=23; $ix++) { $_time_h[$ix]=0; $_time_k[$ix]=0; $_time_p[$ix]=0; } # Delete/Reinit all hash arrays with name beginning by _ %_browser_h = %_domener_h = %_domener_k = %_domener_p = %_errors_h = %_hostmachine_h = %_hostmachine_k = %_hostmachine_l = %_hostmachine_p = - %_keywords = %_os_h = %_pagesrefs_h = %_robot_h = %_robot_l = %_se_referrals_h = + %_keyphrases = %_os_h = %_pagesrefs_h = %_robot_h = %_robot_l = %_se_referrals_h = %_sider404_h = %_sider_h = %_sider_k = %_sider_p = %_unknownip_l = %_unknownreferer_l = %_unknownrefererbrowser_l = (); } @@ -1938,6 +2000,8 @@ $SiteToAnalyze=$SiteDomain; if ($SiteToAnalyze eq "") { $SiteToAnalyze=$SiteConfig; } $SiteToAnalyze =~ tr/A-Z/a-z/; $SiteToAnalyzeWithoutwww = $SiteToAnalyze; $SiteToAnalyzeWithoutwww =~ s/www\.//; +if ($FirstDayOfWeek == 1) { @DOWIndex = (1,2,3,4,5,6,0); } +else { @DOWIndex = (0,1,2,3,4,5,6); } # Print html header &html_head; @@ -2278,18 +2342,30 @@ if ($UpdateStats) { # Analyze: Date - Hour - Pages - Hits - Kilo #------------------------------------------- - if (! $FirstTime{$yearmonth}) { $FirstTime{$yearmonth}=$timeconnexion; } - $LastTime{$yearmonth} = $timeconnexion; + if ($LastDOW[0] ne $dayconnexion) { # LastDOW is a memory array to increase speed + $LastDOW[0] = $dayconnexion; + $LastDOW[1] = &DayOfWeek($dateparts[0],$dateparts[1],$dateparts[2]); + } if ($PageBool) { - $_time_p[int($dateparts[3])]++; #Count accesses per hour (page) + # FirstTime and LastTime were moved into PageBool if (a visitor is a human visitor if access to page) + if (! $FirstTime{$yearmonth}) { $FirstTime{$yearmonth}=$timeconnexion; } + $LastTime{$yearmonth} = $timeconnexion; + $DayPages{$dayconnexion}++; $MonthPages{$yearmonth}++; - $_sider_p{$field[$pos_url]}++; #Count accesses per page (page) + $_time_p[int($dateparts[3])]++; #Count accesses for hour (page) + $_sider_p{$field[$pos_url]}++; #Count accesses for page (page) + $DOW_Pages[$LastDOW[1]]++; } - $_time_h[int($dateparts[3])]++; $MonthHits{$yearmonth}++; $DayHits{$dayconnexion}++; #Count accesses per hour (hit) - $_time_k[int($dateparts[3])]+=$field[$pos_size]; $MonthBytes{$yearmonth}+=$field[$pos_size]; $DayBytes{$dayconnexion}+=$field[$pos_size]; #Count accesses per hour (kb) - $_sider_h{$field[$pos_url]}++; #Count accesses per page (hit) - $_sider_k{$field[$pos_url]}+=$field[$pos_size]; #Count accesses per page (kb) + $_time_h[int($dateparts[3])]++; $MonthHits{$yearmonth}++; $DayHits{$dayconnexion}++; #Count accesses for hour (hit) + $_time_k[int($dateparts[3])]+=$field[$pos_size]; $MonthBytes{$yearmonth}+=$field[$pos_size]; $DayBytes{$dayconnexion}+=$field[$pos_size]; #Count accesses for hour (kb) + $_sider_h{$field[$pos_url]}++; #Count accesses for page (hit) + $_sider_k{$field[$pos_url]}+=$field[$pos_size]; #Count accesses for page (kb) + $DOW_Hits[$LastDOW[1]]++; + $DOW_Kilo[$LastDOW[1]]+=$field[$pos_size]; + + # Analize Pages, Hits, Kilo at days of week + #------------------------------------------- # Analyze: IP-address #-------------------- @@ -2494,12 +2570,12 @@ if ($UpdateStats) { if ($SplitSearchString) { my @wordlist=split(/ /,$param); # Split aaa bbb ccc ddd eee fff into a wordlist array foreach $word (@wordlist) { - if ((length $word) > 0) { $_keywords{$word}++; } + if ((length $word) > 0) { $_keyphrases{$word}++; } } } else { $param =~ s/^ *//; $param =~ s/ *$//; $param =~ tr/ / /s; - if ((length $param) > 0) { $param =~ tr/ /+/; $_keywords{$param}++; } + if ((length $param) > 0) { $param =~ tr/ /+/; $_keyphrases{$param}++; } } last; } @@ -2520,12 +2596,12 @@ if ($UpdateStats) { if ($SplitSearchString) { my @wordlist=split(/ /,$param); # Split aaa bbb ccc ddd eee fff into a wordlist array foreach $word (@wordlist) { - if ((length $word) > 2) { $_keywords{$word}++; } # Keep word only if word length is 3 or more + if ((length $word) > 2) { $_keyphrases{$word}++; } # Keep word only if word length is 3 or more } } else { $param =~ s/^ *//; $param =~ s/ *$//; $param =~ tr/ / /s; - if ((length $param) > 2) { $param =~ tr/ /+/; $_keywords{$param}++; } + if ((length $param) > 2) { $param =~ tr/ /+/; $_keyphrases{$param}++; } } } } @@ -2889,12 +2965,6 @@ EOF exit(0); } - - # SUMMARY - #--------------------------------------------------------------------- - print "$CENTER 
"; - &tab_head("$Message[7] $SiteToAnalyze"); - # FirstTime LastTime TotalVisits TotalUnique TotalHostsKnown TotalHostsUnknown my $beginmonth=$MonthRequired;my $endmonth=$MonthRequired; if ($MonthRequired eq "year") { $beginmonth=1;$endmonth=12; } @@ -2919,422 +2989,491 @@ EOF if ($TotalVisits > 0) { $RatioHits=int($TotalHits/$TotalVisits*100)/100; } if ($TotalVisits > 0) { $RatioBytes=int(($TotalBytes/1024)*100/$TotalVisits)/100; } - print "$Message[8]"; - if ($MonthRequired eq "year") { print "$Message[6] $YearRequired
"; } - else { print "$Message[5] $monthlib{$MonthRequired} $YearRequired
"; } - # Show links for possible years - foreach my $key (keys %listofyears) { - print "$Message[6] $key   "; - } - print ""; - print "$Message[9]"; - - if ($FirstTime) { print "".Format_Date($FirstTime).""; } - else { print "NA"; } - if ($LastTime) { print "".Format_Date($LastTime).""; } - else { print "NA\n"; } - print ""; - print "$Message[10]"; - print "$Message[11]"; - print "$Message[56]"; - print "$Message[57]"; - print "$Message[75]"; - print "$TotalVisits
 $TotalUnique
($RatioHosts $Message[52])$TotalPages
($RatioPages ".lc($Message[56]."/".$Message[12]).")"; - print "$TotalHits
($RatioHits ".lc($Message[57]."/".$Message[12]).")".Format_Bytes($TotalBytes)."
($RatioBytes $Message[44]/".lc($Message[12]).")\n"; - print "
"; - # Show monthly stats - print ""; - print ""; - $max_p=$max_h=$max_k=$max_v=1; - for (my $ix=1; $ix<=12; $ix++) { - my $monthix=$ix; if ($monthix < 10) { $monthix="0$monthix"; } - if ($MonthVisits{$YearRequired.$monthix} > $max_v) { $max_v=$MonthVisits{$YearRequired.$monthix}; } - if ($MonthUnique{$YearRequired.$monthix} > $max_v) { $max_v=$MonthUnique{$YearRequired.$monthix}; } - if ($MonthPages{$YearRequired.$monthix} > $max_p) { $max_p=$MonthPages{$YearRequired.$monthix}; } - if ($MonthHits{$YearRequired.$monthix} > $max_h) { $max_h=$MonthHits{$YearRequired.$monthix}; } - if ($MonthBytes{$YearRequired.$monthix} > $max_k) { $max_k=$MonthBytes{$YearRequired.$monthix}; } - } - for (my $ix=1; $ix<=12; $ix++) { - my $monthix=$ix; if ($monthix < 10) { $monthix="0$monthix"; } - 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_v=int($MonthVisits{$YearRequired.$monthix}/$max_v*$BarHeight/2)+1; } - if ($max_v > 0) { $bredde_u=int($MonthUnique{$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; } - print "\n"; - } - print ""; - for (my $ix=1; $ix<=12; $ix++) { - my $monthix=$ix; if ($monthix < 10) { $monthix="0$monthix"; } - print ""; - } - print "
"; - print "\"$Message[10]:"; - print "\"$Message[11]:"; - print " "; - print "\"$Message[56]:"; - print "\"$Message[57]:"; - print "\"$Message[75]:"; - print "
$monthlib{$monthix}

"; - # Show daily stats - print ""; - print ""; - $max_p=$max_h=$max_k=$max_v=1; - my $lastdaytoshowtime=$nowtime; # Set day cursor to today - if (! (($MonthRequired eq $nowmonth || $MonthRequired eq "year") && $YearRequired eq $nowyear)) { - if ($MonthRequired eq "year") { - # About 365.24 days a year = 31556736 seconds a year - $lastdaytoshowtime=($YearRequired-1970+1)*31556736-43200; # Set day cursor to last day of the year + # SUMMARY + #--------------------------------------------------------------------- + if ($ShowMonthDayStats) { + print "$CENTER 
"; + &tab_head("$Message[7] $SiteToAnalyze"); + + print ""; + if ($MonthRequired eq "year") { print ""; + print ""; + + if ($FirstTime) { print ""; } + else { print ""; } + if ($LastTime) { print ""; } + else { print "\n"; } + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "\n"; + print ""; - &tab_end; - - print "

\n"; - + for (my $ix=1; $ix<=12; $ix++) { + my $monthix=$ix; if ($monthix < 10) { $monthix="0$monthix"; } + 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_v=int($MonthVisits{$YearRequired.$monthix}/$max_v*$BarHeight/2)+1; } + if ($max_v > 0) { $bredde_u=int($MonthUnique{$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; } + print "\n"; + } + print ""; + for (my $ix=1; $ix<=12; $ix++) { + my $monthix=$ix; if ($monthix < 10) { $monthix="0$monthix"; } + print ""; + } + print "
$Message[8]$Message[6] $YearRequired
"; } + else { print "
$Message[5] $monthlib{$MonthRequired} $YearRequired
"; } + # Show links for possible years + foreach my $key (keys %listofyears) { + print "$Message[6] $key   "; } - else { - # About 30.43 days a month = 2626728 seconds a month - $lastdaytoshowtime=($YearRequired-1970)*31556736+$MonthRequired*2629728; + print "
$Message[9]
".Format_Date($FirstTime)."
NA".Format_Date($LastTime)."
NA
$Message[10]$Message[11]$Message[56]$Message[57]$Message[75]
$TotalVisits
 
$TotalUnique
($RatioHosts $Message[52])
$TotalPages
($RatioPages ".lc($Message[56]."/".$Message[12]).")
$TotalHits
($RatioHits ".lc($Message[57]."/".$Message[12]).")
".Format_Bytes($TotalBytes)."
($RatioBytes $Message[44]/".lc($Message[12]).")
"; + # Show monthly stats + print ""; + print ""; + $max_p=$max_h=$max_k=$max_v=1; + for (my $ix=1; $ix<=12; $ix++) { + my $monthix=$ix; if ($monthix < 10) { $monthix="0$monthix"; } + if ($MonthVisits{$YearRequired.$monthix} > $max_v) { $max_v=$MonthVisits{$YearRequired.$monthix}; } + if ($MonthUnique{$YearRequired.$monthix} > $max_v) { $max_v=$MonthUnique{$YearRequired.$monthix}; } + if ($MonthPages{$YearRequired.$monthix} > $max_p) { $max_p=$MonthPages{$YearRequired.$monthix}; } + if ($MonthHits{$YearRequired.$monthix} > $max_h) { $max_h=$MonthHits{$YearRequired.$monthix}; } + if ($MonthBytes{$YearRequired.$monthix} > $max_k) { $max_k=$MonthBytes{$YearRequired.$monthix}; } } - } - for (my $ix=$MaxNbOfDays-1; $ix>=0; $ix--) { - my ($oldsec,$oldmin,$oldhour,$oldday,$oldmonth,$oldyear) = localtime($lastdaytoshowtime-($ix*86400)); - if ($oldyear < 100) { $oldyear+=2000; } else { $oldyear+=1900; } - if (++$oldmonth < 10) { $oldmonth="0$oldmonth"; } - if ($oldday < 10) { $oldday="0$oldday"; } - if ($DayPages{$oldyear.$oldmonth.$oldday} > $max_p) { $max_p=$DayPages{$oldyear.$oldmonth.$oldday}; } - if ($DayHits{$oldyear.$oldmonth.$oldday} > $max_h) { $max_h=$DayHits{$oldyear.$oldmonth.$oldday}; } - if ($DayBytes{$oldyear.$oldmonth.$oldday} > $max_k) { $max_k=$DayBytes{$oldyear.$oldmonth.$oldday}; } - } - for (my $ix=$MaxNbOfDays-1; $ix>=0; $ix--) { - my ($oldsec,$oldmin,$oldhour,$oldday,$oldmonth,$oldyear) = localtime($lastdaytoshowtime-($ix*86400)); - if ($oldyear < 100) { $oldyear+=2000; } else { $oldyear+=1900; } - if (++$oldmonth < 10) { $oldmonth="0$oldmonth"; } - if ($oldday < 10) { $oldday="0$oldday"; } - my $bredde_p=0;my $bredde_h=0;my $bredde_k=0; - if ($max_h > 0) { $bredde_p=int($DayPages{$oldyear.$oldmonth.$oldday}/$max_h*$BarHeight/2)+1; } - if ($max_h > 0) { $bredde_h=int($DayHits{$oldyear.$oldmonth.$oldday}/$max_h*$BarHeight/2)+1; } - if ($max_k > 0) { $bredde_k=int($DayBytes{$oldyear.$oldmonth.$oldday}/$max_k*$BarHeight/2)+1; } - print "\n"; - } - print ""; - for (my $ix=$MaxNbOfDays-1; $ix>=0; $ix--) { - my ($oldsec,$oldmin,$oldhour,$oldday,$oldmonth,$oldyear,$oldwday) = localtime($lastdaytoshowtime-($ix*86400)); - if ($oldyear < 100) { $oldyear+=2000; } else { $oldyear+=1900; } - if (++$oldmonth < 10) { $oldmonth="0$oldmonth"; } - if ($oldday < 10) { $oldday="0$oldday"; } - print "":""); - } - print "
"; - print "\"$Message[56]:"; - print "\"$Message[57]:"; - print "\"$Message[75]:"; - print "
"; - print ($oldday==$nowday && $oldmonth==$nowmonth?"":""); - print "$oldday
".$monthlib{$oldmonth}.""; - print ($oldday==$nowday && $oldmonth==$nowmonth?"

"; - - print "
"; + print "\"$Message[10]:"; + print "\"$Message[11]:"; + print " "; + print "\"$Message[56]:"; + print "\"$Message[57]:"; + print "\"$Message[75]:"; + print "
$monthlib{$monthix}

"; + # Show daily stats + print ""; + print ""; + $max_p=$max_h=$max_k=$max_v=1; + my $lastdaytoshowtime=$nowtime; # Set day cursor to today + if (! (($MonthRequired eq $nowmonth || $MonthRequired eq "year") && $YearRequired eq $nowyear)) { + if ($MonthRequired eq "year") { + # About 365.24 days a year = 31556736 seconds a year + $lastdaytoshowtime=($YearRequired-1970+1)*31556736-43200; # Set day cursor to last day of the year + } + else { + # About 30.43 days a month = 2626728 seconds a month + $lastdaytoshowtime=($YearRequired-1970)*31556736+$MonthRequired*2629728; + } + } + for (my $ix=$MaxNbOfDays-1; $ix>=0; $ix--) { + my ($oldsec,$oldmin,$oldhour,$oldday,$oldmonth,$oldyear) = localtime($lastdaytoshowtime-($ix*86400)); + if ($oldyear < 100) { $oldyear+=2000; } else { $oldyear+=1900; } + if (++$oldmonth < 10) { $oldmonth="0$oldmonth"; } + if ($oldday < 10) { $oldday="0$oldday"; } + if ($DayPages{$oldyear.$oldmonth.$oldday} > $max_p) { $max_p=$DayPages{$oldyear.$oldmonth.$oldday}; } + if ($DayHits{$oldyear.$oldmonth.$oldday} > $max_h) { $max_h=$DayHits{$oldyear.$oldmonth.$oldday}; } + if ($DayBytes{$oldyear.$oldmonth.$oldday} > $max_k) { $max_k=$DayBytes{$oldyear.$oldmonth.$oldday}; } + } + for (my $ix=$MaxNbOfDays-1; $ix>=0; $ix--) { + my ($oldsec,$oldmin,$oldhour,$oldday,$oldmonth,$oldyear) = localtime($lastdaytoshowtime-($ix*86400)); + if ($oldyear < 100) { $oldyear+=2000; } else { $oldyear+=1900; } + if (++$oldmonth < 10) { $oldmonth="0$oldmonth"; } + if ($oldday < 10) { $oldday="0$oldday"; } + my $bredde_p=0;my $bredde_h=0;my $bredde_k=0; + if ($max_h > 0) { $bredde_p=int($DayPages{$oldyear.$oldmonth.$oldday}/$max_h*$BarHeight/2)+1; } + if ($max_h > 0) { $bredde_h=int($DayHits{$oldyear.$oldmonth.$oldday}/$max_h*$BarHeight/2)+1; } + if ($max_k > 0) { $bredde_k=int($DayBytes{$oldyear.$oldmonth.$oldday}/$max_k*$BarHeight/2)+1; } + print "\n"; + } + print ""; + for (my $ix=$MaxNbOfDays-1; $ix>=0; $ix--) { + my ($oldsec,$oldmin,$oldhour,$oldday,$oldmonth,$oldyear,$oldwday) = localtime($lastdaytoshowtime-($ix*86400)); + if ($oldyear < 100) { $oldyear+=2000; } else { $oldyear+=1900; } + if (++$oldmonth < 10) { $oldmonth="0$oldmonth"; } + if ($oldday < 10) { $oldday="0$oldday"; } + print "":""); + } + print "
"; + print "\"$Message[56]:"; + print "\"$Message[57]:"; + print "\"$Message[75]:"; + print "
"; + print ($oldday==$nowday && $oldmonth==$nowmonth?"":""); + print "$oldday
".$monthlib{$oldmonth}.""; + print ($oldday==$nowday && $oldmonth==$nowmonth?"

"; + + print "
"; + &tab_end; + + print "

\n"; + } # BY COUNTRY/DOMAIN #--------------------------- - my @sortdomains_p=sort { $SortDir*$_domener_p{$a} <=> $SortDir*$_domener_p{$b} } keys (%_domener_p); - print "$CENTER 
"; - &tab_head($Message[25]); - print "$Message[17]Code$Message[56]$Message[57]$Message[75] \n"; - $total_p=$total_h=$total_k=0; - $max_h=1; foreach my $key (values %_domener_h) { if ($key > $max_h) { $max_h = $key; } } - $max_k=1; foreach my $key (values %_domener_k) { if ($key > $max_k) { $max_k = $key; } } - $count=0; $rest_p=0; - foreach my $key (@sortdomains_p) { - if ($count >= $MaxNbOfDomain) { last; } - my $bredde_p=0;my $bredde_h=0;my $bredde_k=0; - if ($max_h > 0) { $bredde_p=int($BarWidth*$_domener_p{$key}/$max_h)+1; } # use max_h to enable to compare pages with hits - if ($max_h > 0) { $bredde_h=int($BarWidth*$_domener_h{$key}/$max_h)+1; } - if ($max_k > 0) { $bredde_k=int($BarWidth*$_domener_k{$key}/$max_k)+1; } - if ($key eq "ip") { - print "$Message[0]$key"; + if ($ShowDomainsStats) { + my @sortdomains_p=sort { $SortDir*$_domener_p{$a} <=> $SortDir*$_domener_p{$b} } keys (%_domener_p); + print "$CENTER 
"; + &tab_head($Message[25]); + print "$Message[17]Code$Message[56]$Message[57]$Message[75] \n"; + $total_p=$total_h=$total_k=0; + $max_h=1; foreach my $key (values %_domener_h) { if ($key > $max_h) { $max_h = $key; } } + $max_k=1; foreach my $key (values %_domener_k) { if ($key > $max_k) { $max_k = $key; } } + $count=0; $rest_p=0; + foreach my $key (@sortdomains_p) { + if ($count >= $MaxNbOfDomain) { last; } + my $bredde_p=0;my $bredde_h=0;my $bredde_k=0; + if ($max_h > 0) { $bredde_p=int($BarWidth*$_domener_p{$key}/$max_h)+1; } # use max_h to enable to compare pages with hits + if ($max_h > 0) { $bredde_h=int($BarWidth*$_domener_h{$key}/$max_h)+1; } + if ($max_k > 0) { $bredde_k=int($BarWidth*$_domener_k{$key}/$max_k)+1; } + if ($key eq "ip") { + print "$Message[0]$key"; + } + else { + print "$DomainsHash{$key}$key"; + } + print "$_domener_p{$key}$_domener_h{$key}".Format_Bytes($_domener_k{$key}).""; + print ""; + print "\"$Message[56]:
\n"; + print "\"$Message[57]:
\n"; + print "\"$Message[75]:"; + print "\n"; + $total_p += $_domener_p{$key}; + $total_h += $_domener_h{$key}; + $total_k += $_domener_k{$key}; + $count++; } - else { - print "$DomainsHash{$key}$key"; - } - print "$_domener_p{$key}$_domener_h{$key}".Format_Bytes($_domener_k{$key}).""; - print ""; - print "\"$Message[56]:
\n"; - print "\"$Message[57]:
\n"; - print "\"$Message[75]:"; - print "\n"; - $total_p += $_domener_p{$key}; - $total_h += $_domener_h{$key}; - $total_k += $_domener_k{$key}; - $count++; - } - $rest_p=$TotalPages-$total_p; - $rest_h=$TotalHits-$total_h; - $rest_k=$TotalBytes-$total_k; - if ($rest_p > 0) { # All other domains (known or not) - my $bredde_p=0;my $bredde_h=0;my $bredde_k=0; - if ($max_h > 0) { $bredde_p=int($BarWidth*$rest_p/$max_h)+1; } # use max_h to enable to compare pages with hits - if ($max_h > 0) { $bredde_h=int($BarWidth*$rest_h/$max_h)+1; } - if ($max_k > 0) { $bredde_k=int($BarWidth*$rest_k/$max_k)+1; } - print "$Message[2]$rest_p$rest_h".Format_Bytes($rest_k)."\n"; - print ""; - print "\"$Message[56]:
\n"; - print "\"$Message[57]:
\n"; - print "\"$Message[75]:"; - print "\n"; + $rest_p=$TotalPages-$total_p; + $rest_h=$TotalHits-$total_h; + $rest_k=$TotalBytes-$total_k; + if ($rest_p > 0) { # All other domains (known or not) + my $bredde_p=0;my $bredde_h=0;my $bredde_k=0; + if ($max_h > 0) { $bredde_p=int($BarWidth*$rest_p/$max_h)+1; } # use max_h to enable to compare pages with hits + if ($max_h > 0) { $bredde_h=int($BarWidth*$rest_h/$max_h)+1; } + if ($max_k > 0) { $bredde_k=int($BarWidth*$rest_k/$max_k)+1; } + print "$Message[2]$rest_p$rest_h".Format_Bytes($rest_k)."\n"; + print ""; + print "\"$Message[56]:
\n"; + print "\"$Message[57]:
\n"; + print "\"$Message[75]:"; + print "\n"; + } + &tab_end; } - &tab_end; - # BY HOST/VISITOR #-------------------------- - print "$CENTER 
"; - $MaxNbOfHostsShown = $TotalHostsKnown+($_hostmachine_h{"Unknown"}?1:0) if $MaxNbOfHostsShown > $TotalHostsKnown; - &tab_head("$Message[77] $MaxNbOfHostsShown $Message[55] ".($TotalHostsKnown+$TotalHostsUnknown)." $Message[26] ($TotalUnique $Message[11])   -   $Message[9]"); - print "$Message[81] : $TotalHostsKnown $Message[82], $TotalHostsUnknown $Message[1]$Message[56]$Message[57]$Message[75]$Message[9]\n"; - $total_p=$total_h=$total_k=0; - $count=0; - foreach my $key (sort { $SortDir*$_hostmachine_p{$a} <=> $SortDir*$_hostmachine_p{$b} } keys (%_hostmachine_p)) { - if ($count>=$MaxNbOfPageShown) { last; } - if ($_hostmachine_h{$key}<$MinHitHost) { last; } - if ($key eq "Unknown") { - print "$Message[1]$_hostmachine_p{$key}$_hostmachine_h{$key}".Format_Bytes($_hostmachine_k{$key})."$Message[3]\n"; + if ($ShowHostsStats) { + print "$CENTER 
"; + $MaxNbOfHostsShown = $TotalHostsKnown+($_hostmachine_h{"Unknown"}?1:0) if $MaxNbOfHostsShown > $TotalHostsKnown; + &tab_head("$Message[77] $MaxNbOfHostsShown $Message[55] ".($TotalHostsKnown+$TotalHostsUnknown)." $Message[26] ($TotalUnique $Message[11])   -   $Message[9]"); + print "$Message[81] : $TotalHostsKnown $Message[82], $TotalHostsUnknown $Message[1]$Message[56]$Message[57]$Message[75]$Message[9]\n"; + $total_p=$total_h=$total_k=0; + $count=0; + foreach my $key (sort { $SortDir*$_hostmachine_p{$a} <=> $SortDir*$_hostmachine_p{$b} } keys (%_hostmachine_p)) { + if ($count>=$MaxNbOfPageShown) { last; } + if ($_hostmachine_h{$key}<$MinHitHost) { last; } + if ($key eq "Unknown") { + print "$Message[1]$_hostmachine_p{$key}$_hostmachine_h{$key}".Format_Bytes($_hostmachine_k{$key})."$Message[3]\n"; + } + else { + print "$key$_hostmachine_p{$key}$_hostmachine_h{$key}".Format_Bytes($_hostmachine_k{$key}).""; + if ($_hostmachine_l{$key}) { print "".Format_Date($_hostmachine_l{$key}).""; } + else { print "-"; } + print ""; } - else { - print "$key$_hostmachine_p{$key}$_hostmachine_h{$key}".Format_Bytes($_hostmachine_k{$key}).""; - if ($_hostmachine_l{$key}) { print "".Format_Date($_hostmachine_l{$key}).""; } - else { print "-"; } - print ""; - } - $total_p += $_hostmachine_p{$key}; - $total_h += $_hostmachine_h{$key}; - $total_k += $_hostmachine_k{$key}; - $count++; - } - $rest_p=$TotalPages-$total_p; - $rest_h=$TotalHits-$total_h; - $rest_k=$TotalBytes-$total_k; - if ($rest_p > 0) { # All other visitors (known or not) - print "$Message[2]$rest_p$rest_h".Format_Bytes($rest_k)." \n"; - } - &tab_end; - + $total_p += $_hostmachine_p{$key}; + $total_h += $_hostmachine_h{$key}; + $total_k += $_hostmachine_k{$key}; + $count++; + } + $rest_p=$TotalPages-$total_p; + $rest_h=$TotalHits-$total_h; + $rest_k=$TotalBytes-$total_k; + if ($rest_p > 0) { # All other visitors (known or not) + print "$Message[2]$rest_p$rest_h".Format_Bytes($rest_k)." \n"; + } + &tab_end; + } # BY ROBOTS #---------------------------- - print "$CENTER 
"; - &tab_head($Message[53]); - print "$Message[83]$Message[57]$Message[9]\n"; - my $count=0; - foreach my $key (sort { $SortDir*$_robot_h{$a} <=> $SortDir*$_robot_h{$b} } keys (%_robot_h)) { - print "$RobotHashIDLib{$key}$_robot_h{$key}".Format_Date($_robot_l{$key}).""; - $count++; - } - &tab_end; - + if ($ShowRobotsStats) { + print "$CENTER 
"; + &tab_head($Message[53]); + print "$Message[83]$Message[57]$Message[9]\n"; + my $count=0; + foreach my $key (sort { $SortDir*$_robot_h{$a} <=> $SortDir*$_robot_h{$b} } keys (%_robot_h)) { + print "$RobotHashIDLib{$key}$_robot_h{$key}".Format_Date($_robot_l{$key}).""; + $count++; + } + &tab_end; + } # BY HOUR #---------------------------- - print "$CENTER 
"; - &tab_head($Message[20]); - print "
\n"; - $max_p=$max_h=$max_k=1; - for (my $ix=0; $ix<=23; $ix++) { - print ""; - 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=1; $ix<=24; $ix++) { - my $hr=$ix; if ($hr>12) { $hr=$hr-12; } - print ""; + if ($ShowHoursStats) { + print "$CENTER 
"; + &tab_head($Message[20]); + print "\n"; + &tab_end; } - print "\n"; - print "\n\n"; - for (my $ix=0; $ix<=23; $ix++) { - my $bredde_p=0;my $bredde_h=0;my $bredde_k=0; - if ($max_h > 0) { $bredde_p=int($BarHeight*$_time_p[$ix]/$max_h)+1; } - if ($max_h > 0) { $bredde_h=int($BarHeight*$_time_h[$ix]/$max_h)+1; } - if ($max_k > 0) { $bredde_k=int($BarHeight*$_time_k[$ix]/$max_k)+1; } - print "\n"; + + # BY DAY OF WEEK + #------------------------- + if ($ShowDaysOfWeekStats) { + print "$CENTER 
"; + &tab_head($Message[91]); + print "\n"; + &tab_end; } - print "
$ix
\n"; + $max_p=$max_h=$max_k=1; + for (my $ix=0; $ix<=23; $ix++) { + print ""; + 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=1; $ix<=24; $ix++) { + my $hr=$ix; if ($hr>12) { $hr=$hr-12; } + print ""; + } + print "\n"; + print "\n\n"; + for (my $ix=0; $ix<=23; $ix++) { + my $bredde_p=0;my $bredde_h=0;my $bredde_k=0; + if ($max_h > 0) { $bredde_p=int($BarHeight*$_time_p[$ix]/$max_h)+1; } + if ($max_h > 0) { $bredde_h=int($BarHeight*$_time_h[$ix]/$max_h)+1; } + if ($max_k > 0) { $bredde_k=int($BarHeight*$_time_k[$ix]/$max_k)+1; } + print "\n"; + } + print "
$ix
"; + print "\"$Message[56]:"; + print "\"$Message[57]:"; + print "\"$Message[75]:"; + print "
"; - print "\"$Message[56]:"; - print "\"$Message[57]:"; - print "\"$Message[75]:"; - print "
\n"; + $max_p=$max_h=$max_k=$max_v=1; + for (0..6) { + $max_p = $DOW_Pages[$_] if ($DOW_Pages[$_] > $max_p); + $max_h = $DOW_Hits[$_] if ($DOW_Hits[$_] > $max_h); + $max_k = $DOW_Kilo[$_] if ($DOW_Kilo[$_] > $max_k); + } + for (@DOWIndex) { + if ($max_h > 0) { $bredde_p=int($DOW_Pages[$_]/$max_h*$BarHeight/2)+1; } + if ($max_h > 0) { $bredde_h=int($DOW_Hits[$_]/$max_h*$BarHeight/2)+1; } + if ($max_k > 0) { $bredde_k=int($DOW_Kilo[$_]/$max_k*$BarHeight/2)+1; } + print "\n"; + } + print "\n\n"; + for (@DOWIndex) { + print "".$Message[$_+84].""; + } + print "
\n"; + print "\"$Message[56]:"; + print "\"$Message[57]:"; + print "\"$Message[75]:"; + print "
\n"; - &tab_end; - - + # BY PAGE #------------------------- - print "$CENTER 
"; - $MaxNbOfPageShown = $TotalDifferentPages if $MaxNbOfPageShown > $TotalDifferentPages; - &tab_head("$Message[77] $MaxNbOfPageShown $Message[55] $TotalDifferentPages $Message[27]   -   $Message[80]"); - print "$Message[19] $Message[29]  \n"; - $max_p=1; foreach my $key (values %_sider_p) { if ($key > $max_p) { $max_p = $key; } } - $count=0; $rest_p=0; - foreach my $key (sort { $SortDir*$_sider_p{$a} <=> $SortDir*$_sider_p{$b} } keys (%_sider_p)) { - if ($count>=$MaxNbOfPageShown) { $rest_p+=$_sider_p{$key}; next; } - if ($_sider_p{$key}<$MinHitFile) { $rest_p+=$_sider_p{$key}; next; } - print ""; - my $nompage=$Aliases{$key}; - if ($nompage eq "") { $nompage=$key; } - if (length($nompage)>$MaxLengthOfURL) { $nompage=substr($nompage,0,$MaxLengthOfURL)."..."; } - if ($ShowLinksOnUrl) { print "$nompage"; } - else { print "$nompage"; } - my $bredde=int($BarWidth*$_sider_p{$key}/$max_p)+1; - print "$_sider_p{$key}\"$Message[56]:\n"; - $count++; + if ($ShowPagesStats) { + print "$CENTER 
"; + $MaxNbOfPageShown = $TotalDifferentPages if $MaxNbOfPageShown > $TotalDifferentPages; + &tab_head("$Message[77] $MaxNbOfPageShown $Message[55] $TotalDifferentPages $Message[27]   -   $Message[80]"); + print "$Message[19] $Message[29]  \n"; + $max_p=1; foreach my $key (values %_sider_p) { if ($key > $max_p) { $max_p = $key; } } + $count=0; $rest_p=0; + foreach my $key (sort { $SortDir*$_sider_p{$a} <=> $SortDir*$_sider_p{$b} } keys (%_sider_p)) { + if ($count>=$MaxNbOfPageShown) { $rest_p+=$_sider_p{$key}; next; } + if ($_sider_p{$key}<$MinHitFile) { $rest_p+=$_sider_p{$key}; next; } + print ""; + my $nompage=$Aliases{$key}; + if ($nompage eq "") { $nompage=$key; } + if (length($nompage)>$MaxLengthOfURL) { $nompage=substr($nompage,0,$MaxLengthOfURL)."..."; } + if ($ShowLinksOnUrl) { print "$nompage"; } + else { print "$nompage"; } + my $bredde=int($BarWidth*$_sider_p{$key}/$max_p)+1; + print "$_sider_p{$key}\"$Message[56]:\n"; + $count++; + } + &tab_end; } - &tab_end; - + + # BY FILE TYPE + #------------------------- + if ($ShowFileTypesStats) { + + } + + + # BY FILE SIZE + #------------------------- + if ($ShowFileSizesStats) { + + } + # BY BROWSER #---------------------------- - print "$CENTER 
"; - &tab_head($Message[21]); - print "Browser$Message[57]$Message[15]\n"; - $count=0; - foreach my $key (sort { $SortDir*$_browser_h{$a} <=> $SortDir*$_browser_h{$b} } keys (%_browser_h)) { - my $p=int($_browser_h{$key}/$TotalHits*1000)/10; - if ($key eq "Unknown") { - print "$Message[0]$_browser_h{$key}$p %\n"; - } - else { - print "$BrowsersHashIDLib{$key}$_browser_h{$key}$p %\n"; + if ($ShowBrowsersStats) { + print "$CENTER 
"; + &tab_head($Message[21]); + print "Browser$Message[57]$Message[15]\n"; + $count=0; + foreach my $key (sort { $SortDir*$_browser_h{$a} <=> $SortDir*$_browser_h{$b} } keys (%_browser_h)) { + my $p=int($_browser_h{$key}/$TotalHits*1000)/10; + if ($key eq "Unknown") { + print "$Message[0]$_browser_h{$key}$p %\n"; + } + else { + print "$BrowsersHashIDLib{$key}$_browser_h{$key}$p %\n"; + } + $count++; } - $count++; - } - &tab_end; - + &tab_end; + } # BY OS #---------------------------- - print "$CENTER 
"; - &tab_head($Message[59]); - print "OS$Message[57]$Message[15]\n"; - $count=0; - foreach my $key (sort { $SortDir*$_os_h{$a} <=> $SortDir*$_os_h{$b} } keys (%_os_h)) { - my $p=int($_os_h{$key}/$TotalHits*1000)/10; - if ($key eq "Unknown") { - print "$Message[0]$_os_h{$key} "; - print "$p %\n"; + if ($ShowOSStats) { + print "$CENTER 
"; + &tab_head($Message[59]); + print "OS$Message[57]$Message[15]\n"; + $count=0; + foreach my $key (sort { $SortDir*$_os_h{$a} <=> $SortDir*$_os_h{$b} } keys (%_os_h)) { + my $p=int($_os_h{$key}/$TotalHits*1000)/10; + if ($key eq "Unknown") { + print "$Message[0]$_os_h{$key} "; + print "$p %\n"; + } + else { + my $nameicon = $OSHashLib{$key}; $nameicon =~ s/\s.*//; $nameicon =~ tr/A-Z/a-z/; + print "$OSHashLib{$key}$_os_h{$key}"; + print "$p %\n"; } - else { - my $nameicon = $OSHashLib{$key}; $nameicon =~ s/\s.*//; $nameicon =~ tr/A-Z/a-z/; - print "$OSHashLib{$key}$_os_h{$key}"; - print "$p %\n"; + $count++; } - $count++; - } - &tab_end; - + &tab_end; + } # BY REFERENCE #--------------------------- - print "$CENTER 
"; - &tab_head($Message[36]); - my @p_p=(); - if ($TotalPages > 0) { - $p_p[0]=int($_from_p[0]/$TotalPages*1000)/10; - $p_p[1]=int($_from_p[1]/$TotalPages*1000)/10; - $p_p[2]=int($_from_p[2]/$TotalPages*1000)/10; - $p_p[3]=int($_from_p[3]/$TotalPages*1000)/10; - $p_p[4]=int($_from_p[4]/$TotalPages*1000)/10; - } - my @p_h=(); - if ($TotalHits > 0) { - $p_h[0]=int($_from_h[0]/$TotalHits*1000)/10; - $p_h[1]=int($_from_h[1]/$TotalHits*1000)/10; - $p_h[2]=int($_from_h[2]/$TotalHits*1000)/10; - $p_h[3]=int($_from_h[3]/$TotalHits*1000)/10; - $p_h[4]=int($_from_h[4]/$TotalHits*1000)/10; - } - print "$Message[37]$Message[56]$Message[15]$Message[57]$Message[15]\n"; - print "$Message[38]:$_from_p[0] $p_p[0] %$_from_h[0] $p_h[0] %\n"; - #------- Referrals by search engine - print "$Message[40] :
\n"; - print "\n"; - $count=0; - foreach my $key (sort { $SortDir*$_se_referrals_h{$a} <=> $SortDir*$_se_referrals_h{$b} } keys (%_se_referrals_h)) { - print "\n"; - $count++; - } - print "
- $SearchEnginesHash{$key} $_se_referrals_h{\"$key\"}
\n"; - print "$_from_p[2] $p_p[2] %$_from_h[2] $p_h[2] %\n"; - #------- Referrals by external HTML link - print "$Message[41]:
\n"; - print "\n"; - $count=0; $rest_h=0; - foreach my $key (sort { $SortDir*$_pagesrefs_h{$a} <=> $SortDir*$_pagesrefs_h{$b} } keys (%_pagesrefs_h)) { - if ($count>=$MaxNbOfRefererShown) { $rest_h+=$_pagesrefs_h{$key}; next; } - if ($_pagesrefs_h{$key}<$MinHitRefer) { $rest_h+=$_pagesrefs_h{$key}; next; } - my $nompage=$key; - if (length($nompage)>$MaxLengthOfURL) { $nompage=substr($nompage,0,$MaxLengthOfURL)."..."; } - if ($ShowLinksOnUrl && ($key =~ /^http(s|):\/\//i)) { - print "\n"; - } else { - print "\n"; - } - $count++; - } - if ($rest_h > 0) { - print ""; - } - print "
- $nompage$_pagesrefs_h{$key}
- $nompage$_pagesrefs_h{$key}
- $Message[2]$rest_h
\n"; - print "$_from_p[3] $p_p[3] %$_from_h[3] $p_h[3] %\n"; - #------- Referrals by internal HTML link - print "$Message[42]:$_from_p[4] $p_p[4] %$_from_h[4] $p_h[4] %\n"; - print "$Message[39]:$_from_p[1] $p_p[1] %$_from_h[1] $p_h[1] %\n"; - &tab_end; - + if ($ShowOriginStats) { + print "$CENTER 
"; + &tab_head($Message[36]); + my @p_p=(); + if ($TotalPages > 0) { + $p_p[0]=int($_from_p[0]/$TotalPages*1000)/10; + $p_p[1]=int($_from_p[1]/$TotalPages*1000)/10; + $p_p[2]=int($_from_p[2]/$TotalPages*1000)/10; + $p_p[3]=int($_from_p[3]/$TotalPages*1000)/10; + $p_p[4]=int($_from_p[4]/$TotalPages*1000)/10; + } + my @p_h=(); + if ($TotalHits > 0) { + $p_h[0]=int($_from_h[0]/$TotalHits*1000)/10; + $p_h[1]=int($_from_h[1]/$TotalHits*1000)/10; + $p_h[2]=int($_from_h[2]/$TotalHits*1000)/10; + $p_h[3]=int($_from_h[3]/$TotalHits*1000)/10; + $p_h[4]=int($_from_h[4]/$TotalHits*1000)/10; + } + print "$Message[37]$Message[56]$Message[15]$Message[57]$Message[15]\n"; + print "$Message[38]:$_from_p[0] $p_p[0] %$_from_h[0] $p_h[0] %\n"; + #------- Referrals by search engine + print "$Message[40] :
\n"; + print "\n"; + $count=0; + foreach my $key (sort { $SortDir*$_se_referrals_h{$a} <=> $SortDir*$_se_referrals_h{$b} } keys (%_se_referrals_h)) { + print "\n"; + $count++; + } + print "
- $SearchEnginesHash{$key} $_se_referrals_h{\"$key\"}
\n"; + print "$_from_p[2] $p_p[2] %$_from_h[2] $p_h[2] %\n"; + #------- Referrals by external HTML link + print "$Message[41]:
\n"; + print "\n"; + $count=0; $rest_h=0; + foreach my $key (sort { $SortDir*$_pagesrefs_h{$a} <=> $SortDir*$_pagesrefs_h{$b} } keys (%_pagesrefs_h)) { + if ($count>=$MaxNbOfRefererShown) { $rest_h+=$_pagesrefs_h{$key}; next; } + if ($_pagesrefs_h{$key}<$MinHitRefer) { $rest_h+=$_pagesrefs_h{$key}; next; } + my $nompage=$key; + if (length($nompage)>$MaxLengthOfURL) { $nompage=substr($nompage,0,$MaxLengthOfURL)."..."; } + if ($ShowLinksOnUrl && ($key =~ /^http(s|):\/\//i)) { + print "\n"; + } else { + print "\n"; + } + $count++; + } + if ($rest_h > 0) { + print ""; + } + print "
- $nompage$_pagesrefs_h{$key}
- $nompage$_pagesrefs_h{$key}
- $Message[2]$rest_h
\n"; + print "$_from_p[3] $p_p[3] %$_from_h[3] $p_h[3] %\n"; + #------- Referrals by internal HTML link + print "$Message[42]:$_from_p[4] $p_p[4] %$_from_h[4] $p_h[4] %\n"; + print "$Message[39]:$_from_p[1] $p_p[1] %$_from_h[1] $p_h[1] %\n"; + &tab_end; + } - # BY SEARCHWORDS + # BY SEARCH PHRASES #---------------------------- - my $TotalDifferentKeywords=scalar keys %_keywords; - my $TotalKeywords=0; foreach my $key (keys %_keywords) { $TotalKeywords+=$_keywords{$key}; } - print "$CENTER 
"; - $MaxNbOfKeywordsShown = $TotalDifferentKeywords if $MaxNbOfKeywordsShown > $TotalDifferentKeywords; - &tab_head("$Message[77] $MaxNbOfKeywordsShown $Message[55] $TotalDifferentKeywords $Message[43]"); - print "$Message[13]$Message[14]$Message[15]\n"; - $count=0; $rest=0; - foreach my $key (sort { $SortDir*$_keywords{$a} <=> $SortDir*$_keywords{$b} } keys (%_keywords)) { - if ($count>=$MaxNbOfKeywordsShown) { $rest+=$_keywords{$key}; next; } - if ($_keywords{$key}<$MinHitKeyword) { $rest+=$_keywords{$key}; next; } - my $p=int($_keywords{$key}/$TotalKeywords*1000)/10; - my $mot = $key; $mot =~ s/\+/ /g; # Showing $key without + - print "$mot$_keywords{$key}$p %\n"; - $count++; - } - if ($rest > 0) { - if ($TotalKeywords > 0) { $p=int($rest/$TotalKeywords*1000)/10; } - print "$Message[30]$rest"; - print "$p %\n"; - } - &tab_end; - + if ($ShowKeyphrasesStats) { + my $TotalDifferentKeyphrases=scalar keys %_keyphrases; + my $TotalKeyphrases=0; foreach my $key (keys %_keyphrases) { $TotalKeyphrases+=$_keyphrases{$key}; } + print "$CENTER 
"; + $MaxNbOfKeywordsShown = $TotalDifferentKeyphrases if $MaxNbOfKeywordsShown > $TotalDifferentKeyphrases; + &tab_head("$Message[77] $MaxNbOfKeywordsShown $Message[55] $TotalDifferentKeyphrases $Message[43]"); + print "$Message[13]$Message[14]$Message[15]\n"; + $count=0; $rest=0; + foreach my $key (sort { $SortDir*$_keyphrases{$a} <=> $SortDir*$_keyphrases{$b} } keys (%_keyphrases)) { + if ($count>=$MaxNbOfKeywordsShown) { $rest+=$_keyphrases{$key}; next; } + if ($_keyphrases{$key}<$MinHitKeyword) { $rest+=$_keyphrases{$key}; next; } + my $p=int($_keyphrases{$key}/$TotalKeyphrases*1000)/10; + my $mot = $key; $mot =~ s/\+/ /g; # Showing $key without + + print "$mot$_keyphrases{$key}$p %\n"; + $count++; + } + if ($rest > 0) { + if ($TotalKeyphrases > 0) { $p=int($rest/$TotalKeyphrases*1000)/10; } + print "$Message[30]$rest"; + print "$p %\n"; + } + &tab_end; + } + # BY AUTHENTICATED USERS + #------------------------- + if ($ShowAuthenticatedUsers) { + + } + # BY ERRORS #---------------------------- - print "$CENTER 
"; - &tab_head($Message[32]); - print "$Message[32]$Message[57]$Message[15]\n"; - $count=0; - foreach my $key (sort { $SortDir*$_errors_h{$a} <=> $SortDir*$_errors_h{$b} } keys (%_errors_h)) { - my $p=int($_errors_h{$key}/$TotalErrors*1000)/10; - if ($httpcode{$key}) { print ""; } - else { print ""; } - if ($key == 404) { print "$key"; } - else { print "$key"; } - if ($httpcode{$key}) { print "$httpcode{$key}$_errors_h{$key}$p %\n"; } - else { print "Unknown error$_errors_h{$key}$p %\n"; } - $count++; + if ($ShowHTTPErrorsStats) { + print "$CENTER 
"; + &tab_head($Message[32]); + print "$Message[32]$Message[57]$Message[15]\n"; + $count=0; + foreach my $key (sort { $SortDir*$_errors_h{$a} <=> $SortDir*$_errors_h{$b} } keys (%_errors_h)) { + my $p=int($_errors_h{$key}/$TotalErrors*1000)/10; + if ($httpcode{$key}) { print ""; } + else { print ""; } + if ($key == 404) { print "$key"; } + else { print "$key"; } + if ($httpcode{$key}) { print "$httpcode{$key}$_errors_h{$key}$p %\n"; } + else { print "Unknown error$_errors_h{$key}$p %\n"; } + $count++; + } + &tab_end; } - &tab_end; - + &html_end; } diff --git a/wwwroot/cgi-bin/lang/awstats-en.txt b/wwwroot/cgi-bin/lang/awstats-en.txt index fb791e18..deee1b01 100644 --- a/wwwroot/cgi-bin/lang/awstats-en.txt +++ b/wwwroot/cgi-bin/lang/awstats-en.txt @@ -90,4 +90,4 @@ message87=Wed message88=Thu message89=Fri message90=Sat - +message91=Days of week diff --git a/wwwroot/cgi-bin/lang/awstats-fr.txt b/wwwroot/cgi-bin/lang/awstats-fr.txt index 2f072d68..eac5d8cb 100644 --- a/wwwroot/cgi-bin/lang/awstats-fr.txt +++ b/wwwroot/cgi-bin/lang/awstats-fr.txt @@ -83,3 +83,11 @@ message80=Liste compl message81=Hôtes message82=Connus message83=Robots +message84=Dim +message85=Lun +message86=Mar +message87=Mer +message88=Jeu +message89=Ven +message90=Sam +message91=Jours de la semaine diff --git a/wwwroot/cgi-bin/lang/awstats-ru.txt b/wwwroot/cgi-bin/lang/awstats-ru.txt index 5826cc49..faedc338 100644 --- a/wwwroot/cgi-bin/lang/awstats-ru.txt +++ b/wwwroot/cgi-bin/lang/awstats-ru.txt @@ -75,4 +75,18 @@ message72= message73=Ñòàòèñòèêà çà äåíü message74=Îáíîâèòü message75=Bytes -message76=Ïîñëåäíåå îáíîâëåíèå \ No newline at end of file +message76=Âîçâðàò ê ãëàâíîé ñòðàíèöå +message77=Òîï +message78=dd mmm yyyy - HH:MM +message79=Ôèëüòåð +message80=Âåñü ñïèñîê +message81=Õîñòû +message82=Èçâåñòíûå +message83=Ðîáîòû +message84=Âñ +message85=Ïí +message86=Âò +message87=Ñð +message88=×ò +message89=Ïò +message90=Ñá \ No newline at end of file