From: eldy <> Date: Mon, 9 Jun 2003 00:10:54 +0000 (+0000) Subject: Added count for "Add to favourites" X-Git-Tag: AWSTATS_5_6_BETA~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cf10a02f36d97461971a90195604da4ec838f13;p=thirdparty%2FAWStats.git Added count for "Add to favourites" --- diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 49099f41..628d89d4 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -23,8 +23,7 @@ use vars qw/ $REVISION $VERSION /; $REVISION='$Revision$'; $REVISION =~ /\s(.*)\s/; $REVISION=$1; $VERSION="5.6 (build $REVISION)"; -# ---------- Init variables ------- -# Constants +# ----- Constants ----- use vars qw/ $DEBUGFORCED $NBOFLINESFORBENCHMARK $FRAMEWIDTH $NBOFLASTUPDATELOOKUPTOSAVE $LIMITFLUSH $NEWDAYVISITTIMEOUT $VISITTIMEOUT $NOTSORTEDRECORDTOLERANCE $MAXDIFFEXTRA @@ -43,20 +42,50 @@ $WIDTHCOLICON=32; $WIDTHINFO=640; $HEIGHTINFO=480; $TOOLTIPON=0; # Tooltips plugin loaded -# Plugins variable -use vars qw/ %PluginsLoaded $PluginDir /; -%PluginsLoaded=(); -$PluginDir=''; -# Running variables +# ----- Running variables ----- use vars qw/ $DIR $PROG $Extension $Debug $ShowSteps $DebugResetDone $DNSLookupAlreadyDone +$RunAsCli $lowerval +$LastLine $LastLineNumber $LastLineOffset $LastLineChecksum +$LastUpdate +$TotalUnique $TotalVisits $TotalHostsKnown $TotalHostsUnknown +$TotalPages $TotalHits $TotalBytes $TotalEntries $TotalExits $TotalBytesPages $TotalDifferentPages +$TotalKeyphrases $TotalKeywords $TotalDifferentKeyphrases $TotalDifferentKeywords +$TotalSearchEnginesPages $TotalSearchEnginesHits $TotalRefererPages $TotalRefererHits $TotalDifferentSearchEngines $TotalDifferentReferer +$FrameName $Center $FileConfig $FileSuffix $Host $DayRequired $MonthRequired $YearRequired +$QueryString $SiteConfig $StaticLinks $PageCode $PerlParsingFormat +$HostFilter $URLFilter $RefererPagesFilter +$SiteToAnalyze $SiteToAnalyzeWithoutwww $UserAgent +$pos_vh $pos_host $pos_logname $pos_date $pos_method $pos_url $pos_code $pos_size +$pos_referer $pos_agent $pos_query $pos_gzipin $pos_gzipout $pos_compratio +$pos_emails $pos_emailr $pos_hostr /; $DIR=$PROG=$Extension=''; $Debug=$ShowSteps=0; $DebugResetDone=$DNSLookupAlreadyDone=0; -# Time vars +$RunAsCli = 0; +$lowerval = 0; +$LastLine = $LastLineNumber = $LastLineOffset = $LastLineChecksum = 0; +$LastUpdate = 0; +$TotalUnique = $TotalVisits = $TotalHostsKnown = $TotalHostsUnknown = 0; +$TotalPages = $TotalHits = $TotalBytes = $TotalEntries = $TotalExits = $TotalBytesPages = $TotalDifferentPages = 0; +$TotalKeyphrases = $TotalKeywords = $TotalDifferentKeyphrases = $TotalDifferentKeywords = 0; +$TotalSearchEnginesPages = $TotalSearchEnginesHits = $TotalRefererPages = $TotalRefererHits = $TotalDifferentSearchEngines = $TotalDifferentReferer = 0; +($FrameName, $Center, $FileConfig, $FileSuffix, $Host, $DayRequired, $MonthRequired, $YearRequired, +$QueryString, $SiteConfig, $StaticLinks, $PageCode, $PerlParsingFormat, +$HostFilter, $URLFilter, $RefererPagesFilter, +$SiteToAnalyze, $SiteToAnalyzeWithoutwww, $UserAgent)= +('','','','','','','','','','','','','','','','','','',''); +$pos_vh = $pos_host = $pos_logname = $pos_date = $pos_method = $pos_url = $pos_code = $pos_size = -1; +$pos_referer = $pos_agent = $pos_query = $pos_gzipin = $pos_gzipout = $pos_compratio = -1; +$pos_emails = $pos_emailr = $pos_hostr = -1; +# ----- Plugins variable ----- +use vars qw/ %PluginsLoaded $PluginDir /; +%PluginsLoaded=(); +$PluginDir=''; +# ----- Time vars ----- use vars qw/ $starttime $nowtime $tomorrowtime @@ -65,12 +94,12 @@ $nowsec $nowmin $nowhour $nowday $nowmonth $nowyear $nowwday $nowyday $nowns $StartSeconds $StartMicroseconds /; $StartSeconds=$StartMicroseconds=0; -# Vars for config file reading +# ----- Variables for config file reading ----- use vars qw/ $FoundNotPageList $FoundValidHTTPCodes $FoundValidSMTPCodes /; $FoundNotPageList=$FoundValidHTTPCodes=$FoundValidSMTPCodes=0; -# Config vars +# ----- Config file variables ----- use vars qw/ $StaticExt $DNSStaticCacheFile @@ -81,38 +110,18 @@ $MaxRowsInHTMLOutput $MaxLengthOfURL $MaxLengthOfStoredURL $MaxLengthOfStoredUA -$BarImageVertical_v -$BarImageVertical_u -$BarImageVertical_p -$BarImageHorizontal_p -$BarImageHorizontal_e -$BarImageHorizontal_x -$BarImageVertical_h -$BarImageHorizontal_h -$BarImageVertical_k -$BarImageHorizontal_k +%BarPng /; $StaticExt='html'; $DNSStaticCacheFile='dnscache.txt'; $DNSLastUpdateCacheFile='dnscachelastupdate.txt'; $LogScreenSizeUrl='logscreensizeurl'; $Lang='auto'; -$MaxRowsInHTMLOutput = 1000; +$MaxRowsInHTMLOutput=1000; $MaxLengthOfStoredURL=256; # Note: Apache LimitRequestLine is default to 8190 $MaxLengthOfStoredUA=256; -$BarImageVertical_v = 'vv.png'; -#$BarImageHorizontal_v = 'hv.png'; -$BarImageVertical_u = 'vu.png'; -#$BarImageHorizontal_u = 'hu.png'; -$BarImageVertical_p = 'vp.png'; -$BarImageHorizontal_p = 'hp.png'; -#$BarImageVertical_e = 've.png'; -$BarImageHorizontal_e = 'he.png'; -$BarImageHorizontal_x = 'hx.png'; -$BarImageVertical_h = 'vh.png'; -$BarImageHorizontal_h = 'hh.png'; -$BarImageVertical_k = 'vk.png'; -$BarImageHorizontal_k = 'hk.png'; +%BarPng=('vv'=>'vv.png','vu'=>'vu.png','hu'=>'hu.png','vp'=>'vp.png','hp'=>'hp.png', +'he'=>'he.png','hx'=>'hx.png','vh'=>'vh.png','hh'=>'hh.png','vk'=>'vk.png','hk'=>'hk.png'); use vars qw/ $EnableLockForUpdate $DNSLookup $AllowAccessFromWebToAuthenticatedUsersOnly $BarHeight $BarWidth $CreateDirDataIfNotExists $KeepBackupOfHistoricFiles @@ -144,7 +153,7 @@ $ShowMenu $ShowMonthStats $ShowDaysOfMonthStats $ShowDaysOfWeekStats $ShowHoursStats $ShowDomainsStats $ShowHostsStats $ShowRobotsStats $ShowWormsStats $ShowSessionsStats $ShowPagesStats $ShowFileTypesStats $ShowOSStats $ShowBrowsersStats $ShowOriginStats -$ShowKeyphrasesStats $ShowKeywordsStats $ShowHTTPErrorsStats +$ShowKeyphrasesStats $ShowKeywordsStats $ShowMiscStats $ShowHTTPErrorsStats $ShowFlagLinks $ShowLinksOnUrl $AddDataArrayMonthStats $AddDataArrayShowDaysOfMonthStats $AddDataArrayShowDaysOfWeekStats $AddDataArrayShowHoursStats /; @@ -155,11 +164,11 @@ $ShowMenu, $ShowMonthStats, $ShowDaysOfMonthStats, $ShowDaysOfWeekStats, $ShowHoursStats, $ShowDomainsStats, $ShowHostsStats, $ShowRobotsStats, $ShowWormsStats, $ShowSessionsStats, $ShowPagesStats, $ShowFileTypesStats, $ShowOSStats, $ShowBrowsersStats, $ShowOriginStats, -$ShowKeyphrasesStats, $ShowKeywordsStats, $ShowHTTPErrorsStats, +$ShowKeyphrasesStats, $ShowKeywordsStats, $ShowMiscStats, $ShowHTTPErrorsStats, $ShowFlagLinks, $ShowLinksOnUrl, $AddDataArrayMonthStats, $AddDataArrayShowDaysOfMonthStats, $AddDataArrayShowDaysOfWeekStats, $AddDataArrayShowHoursStats )= -(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); +(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); use vars qw/ $LevelForRobotsDetection $LevelForBrowsersDetection $LevelForOSDetection $LevelForRefererAnalyze $LevelForSearchEnginesDetection $LevelForKeywordsDetection @@ -189,55 +198,17 @@ $color_TableBGTitle, $color_TableBorder, $color_TableRowTitle, $color_TableTitle $color_text, $color_textpercent, $color_titletext, $color_weekend, $color_link, $color_hover, $color_other, $color_h, $color_k, $color_p, $color_e, $color_x, $color_s, $color_u, $color_v)= ('','','','','','','','','','','','','','','','','','','','','',''); -use vars qw/ -$FrameName $Center $FileConfig $FileSuffix $Host $DayRequired $MonthRequired $YearRequired -$QueryString $SiteConfig $StaticLinks $PageCode $PerlParsingFormat -$HostFilter $URLFilter $RefererPagesFilter -$SiteToAnalyze $SiteToAnalyzeWithoutwww $UserAgent -/; -($FrameName, $Center, $FileConfig, $FileSuffix, $Host, $DayRequired, $MonthRequired, $YearRequired, -$QueryString, $SiteConfig, $StaticLinks, $PageCode, $PerlParsingFormat, -$HostFilter, $URLFilter, $RefererPagesFilter, -$SiteToAnalyze, $SiteToAnalyzeWithoutwww, $UserAgent)= -('','','','','','','','','','','','','','','','','','',''); -use vars qw/ -$pos_vh $pos_host $pos_logname $pos_date $pos_method $pos_url $pos_code $pos_size -$pos_referer $pos_agent $pos_query $pos_gzipin $pos_gzipout $pos_compratio -$pos_emails $pos_emailr $pos_hostr -/; -$pos_vh = $pos_host = $pos_logname = $pos_date = $pos_method = $pos_url = $pos_code = $pos_size = -1; -$pos_referer = $pos_agent = $pos_query = $pos_gzipin = $pos_gzipout = $pos_compratio = -1; -$pos_emails = $pos_emailr = $pos_hostr = -1; -use vars qw/ -$RunAsCli $lowerval -$LastLine $LastLineNumber $LastLineOffset $LastLineChecksum -$LastUpdate -$TotalUnique $TotalVisits $TotalHostsKnown $TotalHostsUnknown -$TotalPages $TotalHits $TotalBytes $TotalEntries $TotalExits $TotalBytesPages $TotalDifferentPages -$TotalKeyphrases $TotalKeywords $TotalDifferentKeyphrases $TotalDifferentKeywords -$TotalSearchEnginesPages $TotalSearchEnginesHits $TotalRefererPages $TotalRefererHits $TotalDifferentSearchEngines $TotalDifferentReferer -/; -$RunAsCli = 0; -$lowerval = 0; -$LastLine = $LastLineNumber = $LastLineOffset = $LastLineChecksum = 0; -$LastUpdate = 0; -$TotalUnique = $TotalVisits = $TotalHostsKnown = $TotalHostsUnknown = 0; -$TotalPages = $TotalHits = $TotalBytes = $TotalEntries = $TotalExits = $TotalBytesPages = $TotalDifferentPages = 0; -$TotalKeyphrases = $TotalKeywords = $TotalDifferentKeyphrases = $TotalDifferentKeywords = 0; -$TotalSearchEnginesPages = $TotalSearchEnginesHits = $TotalRefererPages = $TotalRefererHits = $TotalDifferentSearchEngines = $TotalDifferentReferer = 0; # ---------- Init arrays -------- use vars qw/ @RobotsSearchIDOrder_list1 @RobotsSearchIDOrder_list2 @RobotsSearchIDOrder_list3 @BrowsersSearchIDOrder @OSSearchIDOrder @SearchEnginesSearchIDOrder @WordsToExtractSearchUrl @WordsToCleanSearchUrl @WormsSearchIDOrder @DOWIndex @RobotsSearchIDOrder -@_from_p @_from_h -@_time_p @_time_h @_time_k +@_from_p @_from_h @_time_p @_time_h @_time_k @fieldlib @keylist /; @DOWIndex = @RobotsSearchIDOrder = (); -@_from_p = @_from_h = (); -@_time_p = @_time_h = @_time_k = (); +@_from_p = @_from_h = @_time_p = @_time_h = @_time_k = (); @fieldlib = @keylist = (); use vars qw/ @OSFamily @BrowsersFamily @SessionsRange %SessionsAverage %LangBrowserToAwstats @@ -257,19 +228,20 @@ use vars qw/ @SessionsRange=('0s-30s','30s-2mn','2mn-5mn','5mn-15mn','15mn-30mn','30mn-1h','1h+'); %SessionsAverage=('0s-30s',15,'30s-2mn',75,'2mn-5mn',210,'5mn-15mn',600,'15mn-30mn',1350,'30mn-1h',2700,'1h+',3600); # Values reported by HTTP-Accept with AWStats code to use -%LangBrowserToAwstats=('sq','al','ba','ba','bg','bg','zh-tw','tw','zh','cn','cz','cz', -'da','dk','nl','nl','en','en','et','et','fi','fi','fr','fr', -'de','de','el','gr','hu','hu','is','is','in','id','it','it', -'ja','jp','ko','kr','lv','lv','no','nb','nb','nb','nn','nn','pl','pl','pt','pt','pt-br','br', -'ro','ro','ru','ru','sr','sr','sk','sk','es','es','ca','es_cat','sv','se','tr','tr','uk','ua','wlk','wlk'); -@HostAliases=(); -@AllowAccessFromWebToFollowingAuthenticatedUsers=(); +%LangBrowserToAwstats=('sq'=>'al','ba'=>'ba','bg'=>'bg','zh-tw'=>'tw','zh'=>'cn','cz'=>'cz', +'da'=>'dk','nl'=>'nl','en'=>'en','et'=>'et','fi'=>'fi','fr'=>'fr', +'de'=>'de','el'=>'gr','hu'=>'hu','is'=>'is','in'=>'id','it'=>'it', +'ja'=>'jp','ko'=>'kr','lv'=>'lv','no'=>'nb','nb'=>'nb','nn'=>'nn','pl'=>'pl','pt'=>'pt','pt-br'=>'br', +'ro'=>'ro','ru'=>'ru','sr'=>'sr','sk'=>'sk','es'=>'es','eu'=>'es_eu','ca'=>'es_cat','sv'=>'se','tr'=>'tr','uk'=>'ua','wlk'=>'wlk'); +@HostAliases = @AllowAccessFromWebToFollowingAuthenticatedUsers=(); @DefaultFile = @SkipDNSLookupFor = (); @SkipHosts = @SkipUserAgents = @SkipFiles = (); @OnlyHosts = @OnlyFiles = (); @URLWithQueryWithoutFollowingParameters = (); @ExtraName = @ExtraCondition = @ExtraStatTypes = @MaxNbOfExtra = @MinHitExtra = (); @ExtraFirstColumnTitle = @ExtraFirstColumnValues = (); +@ExtraConditionType = @ExtraConditionTypeVal = (); +@ExtraFirstColumnValuesType = @ExtraFirstColumnValuesTypeVal = (); @PluginsToLoad = (); # ---------- Init hash arrays -------- use vars qw/ @@ -297,12 +269,12 @@ use vars qw/ %_waithost_e %_waithost_l %_waithost_s %_waithost_u %_keyphrases %_keywords %_os_h %_pagesrefs_p %_pagesrefs_h %_robot_h %_robot_k %_robot_l %_worm_h %_worm_l %_login_h %_login_p %_login_k %_login_l %_screensize_h +%_misc_p %_misc_h %_misc_k %_se_referrals_p %_se_referrals_h %_sider404_h %_referer404_h %_url_p %_url_k %_url_e %_url_x %_unknownreferer_l %_unknownrefererbrowser_l %_emails_h %_emails_k %_emails_l %_emailr_h %_emailr_k %_emailr_l %val %nextval %egal -%TmpDNSLookup %TmpOS %TmpRefererServer %TmpRobot %TmpBrowser -%MyDNSTable +%TmpDNSLookup %TmpOS %TmpRefererServer %TmpRobot %TmpBrowser %MyDNSTable /; %HTMLOutput = (); %BadFormatWarning = (); @@ -321,11 +293,12 @@ use vars qw/ %_waithost_e = %_waithost_l = %_waithost_s = %_waithost_u = (); %_keyphrases = %_keywords = %_os_h = %_pagesrefs_p = %_pagesrefs_h = %_robot_h = %_robot_k = %_robot_l = (); %_worm_h = %_worm_l = %_login_h = %_login_p = %_login_k = %_login_l = %_screensize_h = (); +%_misc_p = %_misc_h = %_misc_k = (); %_se_referrals_p = %_se_referrals_h = %_sider404_h = %_referer404_h = %_url_p = %_url_k = %_url_e = %_url_x = (); %_unknownreferer_l = %_unknownrefererbrowser_l = (); %_emails_h = %_emails_k = %_emails_l = %_emailr_h = %_emailr_k = %_emailr_l = (); %val = %nextval = %egal = (); -%TmpDNSLookup = %TmpOS = %TmpRefererServer = %TmpRobot = %TmpBrowser = (); +%TmpDNSLookup = %TmpOS = %TmpRefererServer = %TmpRobot = %TmpBrowser = %MyDNSTable = (); # ---------- Init Tie::hash arrays -------- # Didn't find a tie that increase speed #use Tie::StdHash; @@ -339,55 +312,55 @@ use vars qw/ use vars qw/ %httpcodelib /; %httpcodelib = ( #[Miscellaneous successes] -'2xx', '[Miscellaneous successes]', -'200', 'OK', # HTTP request OK -'201', 'Created', -'202', 'Request recorded, will be executed later', -'203', 'Non-authoritative information', -'204', 'Request executed', -'205', 'Reset document', -'206', 'Partial Content', +'2xx'=>'[Miscellaneous successes]', +'200'=>'OK', # HTTP request OK +'201'=>'Created', +'202'=>'Request recorded, will be executed later', +'203'=>'Non-authoritative information', +'204'=>'Request executed', +'205'=>'Reset document', +'206'=>'Partial Content', #[Miscellaneous redirections] -'3xx', '[Miscellaneous redirections]', -'300', 'Multiple documents available', -'301', 'Moved Permanently', -'302', 'Found', -'303', 'See other document', -'304', 'Not Modified since last retrieval', # HTTP request OK -'305', 'Use proxy', -'306', 'Switch proxy', -'307', 'Document moved temporarily', +'3xx'=>'[Miscellaneous redirections]', +'300'=>'Multiple documents available', +'301'=>'Moved Permanently', +'302'=>'Found', +'303'=>'See other document', +'304'=>'Not Modified since last retrieval', # HTTP request OK +'305'=>'Use proxy', +'306'=>'Switch proxy', +'307'=>'Document moved temporarily', #[Miscellaneous client/user errors] -'4xx', '[Miscellaneous client/user errors]', -'400', 'Bad Request', -'401', 'Unauthorized', -'402', 'Payment required', -'403', 'Forbidden', -'404', 'Document Not Found', -'405', 'Method not allowed', -'406', 'Document not acceptable to client', -'407', 'Proxy authentication required', -'408', 'Request Timeout', -'409', 'Request conflicts with state of resource', -'410', 'Document gone permanently', -'411', 'Length required', -'412', 'Precondition failed', -'413', 'Request too long', -'414', 'Requested filename too long', -'415', 'Unsupported media type', -'416', 'Requested range not valid', -'417', 'Failed', +'4xx'=>'[Miscellaneous client/user errors]', +'400'=>'Bad Request', +'401'=>'Unauthorized', +'402'=>'Payment required', +'403'=>'Forbidden', +'404'=>'Document Not Found', +'405'=>'Method not allowed', +'406'=>'Document not acceptable to client', +'407'=>'Proxy authentication required', +'408'=>'Request Timeout', +'409'=>'Request conflicts with state of resource', +'410'=>'Document gone permanently', +'411'=>'Length required', +'412'=>'Precondition failed', +'413'=>'Request too long', +'414'=>'Requested filename too long', +'415'=>'Unsupported media type', +'416'=>'Requested range not valid', +'417'=>'Failed', #[Miscellaneous server errors] -'5xx', '[Miscellaneous server errors]', -'500', 'Internal server Error', -'501', 'Not implemented', -'502', 'Received bad response from real server', -'503', 'Server busy', -'504', 'Gateway timeout', -'505', 'HTTP version not supported', -'506', 'Redirection failed', +'5xx'=>'[Miscellaneous server errors]', +'500'=>'Internal server Error', +'501'=>'Not implemented', +'502'=>'Received bad response from real server', +'503'=>'Server busy', +'504'=>'Gateway timeout', +'505'=>'HTTP version not supported', +'506'=>'Redirection failed', #[Unknown] -'xxx' ,'[Unknown]' +'xxx'=>'[Unknown]' ); # FTP codes @@ -1472,6 +1445,7 @@ sub Check_Config { if ($ShowOriginStats !~ /[01PH]/) { $ShowOriginStats='PH'; } if ($ShowKeyphrasesStats !~ /[0-1]/) { $ShowKeyphrasesStats=1; } if ($ShowKeywordsStats !~ /[0-1]/) { $ShowKeywordsStats=1; } + if ($ShowMiscStats !~ /[0-1]/) { $ShowMiscStats=1; } if ($ShowHTTPErrorsStats !~ /[0-1]/) { $ShowHTTPErrorsStats=1; } if ($AddDataArrayMonthStats !~ /[0-1]/) { $AddDataArrayMonthStats=1; } if ($AddDataArrayShowDaysOfMonthStats !~ /[0-1]/) { $AddDataArrayShowDaysOfMonthStats=1; } @@ -1564,12 +1538,8 @@ sub Check_Config { debug(" DirCgi='$DirCgi'",2); debug(" DirIcons='$DirIcons'",2); debug(" SiteDomain=$SiteDomain",2); - foreach my $key (keys %MaxNbOf) { - debug(" MaxNbOf{$key}=$MaxNbOf{$key}",2); - } - foreach my $key (keys %MinHit) { - debug(" MinHit{$key}=$MinHit{$key}",2); - } + foreach my $key (keys %MaxNbOf) { debug(" MaxNbOf{$key}=$MaxNbOf{$key}",2); } + foreach my $key (keys %MinHit) { debug(" MinHit{$key}=$MinHit{$key}",2); } } foreach my $extranum (1..@ExtraName-1) { debug(" ExtraConditionType[$extranum] is array ".join(',',@{$ExtraConditionType[$extranum]}),2); @@ -1735,14 +1705,14 @@ sub Read_History_With_TmpUpdate { my $lastlineoffset=shift||0; my $lastlinechecksum=shift||0; - my %allsections=('general'=>1,'time'=>2,'visitor'=>3,'day'=>4, - 'domain'=>5,'login'=>6,'robot'=>7,'worms'=>8,'emailsender'=>9,'emailreceiver'=>10, - 'session'=>11,'sider'=>12,'filetypes'=>13, - 'os'=>14,'browser'=>15,'screensize'=>16,'unknownreferer'=>17,'unknownrefererbrowser'=>18, - 'origin'=>19,'sereferrals'=>20,'pagerefs'=>21, - 'searchwords'=>22,'keywords'=>23, - 'errors'=>24); - my $order=25; + my %allsections=('general'=>1,'misc'=>2,'time'=>3,'visitor'=>4,'day'=>5, + 'domain'=>6,'login'=>7,'robot'=>8,'worms'=>9,'emailsender'=>10,'emailreceiver'=>11, + 'session'=>12,'sider'=>13,'filetypes'=>14, + 'os'=>15,'browser'=>16,'screensize'=>17,'unknownreferer'=>18,'unknownrefererbrowser'=>19, + 'origin'=>20,'sereferrals'=>21,'pagerefs'=>22, + 'searchwords'=>23,'keywords'=>24, + 'errors'=>25); + my $order=26; foreach my $code (keys %TrapInfosForHTTPErrorCodes) { $allsections{"sider_$code"}=$order++; } foreach my $extranum (1..@ExtraName-1) { $allsections{"extra_$extranum"}=$order++; } @@ -1787,6 +1757,7 @@ sub Read_History_With_TmpUpdate { if ($UpdateStats || $MigrateStats || ($HTMLOutput{'main'} && $ShowKeyphrasesStats) || $HTMLOutput{'keyphrases'} || $HTMLOutput{'keywords'}) { $SectionsToLoad{'searchwords'}=$order++; } if (! $withupdate && $HTMLOutput{'main'} && $ShowKeywordsStats) { $SectionsToLoad{'keywords'}=$order++; } # If we update, dont need to load # Others + if ($UpdateStats || $MigrateStats || ($HTMLOutput{'main'} && $ShowMiscStats)) { $SectionsToLoad{'misc'}=$order++; } if ($UpdateStats || $MigrateStats || ($HTMLOutput{'main'} && $ShowHTTPErrorsStats) || $HTMLOutput{'errors'}) { $SectionsToLoad{'errors'}=$order++; } foreach my $code (keys %TrapInfosForHTTPErrorCodes) { if ($UpdateStats || $MigrateStats || $HTMLOutput{"errors$code"}) { $SectionsToLoad{"sider_$code"}=$order++; } @@ -1933,6 +1904,40 @@ sub Read_History_With_TmpUpdate { } if ($versionnum >= 5000) { next; } # We can forget 'END_GENERAL' line and read next one } + + # BEGIN_MISC + if ($field[0] eq 'BEGIN_MISC') { + if ($Debug) { debug(" Begin of MISC section"); } + $_=; + chomp $_; s/\r//; + if (! $_) { error("History file \"$filetoread\" is corrupted (in section MISC). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost).","","",1); } + my @field=split(/\s+/,$_); $countlines++; + my $count=0;my $countloaded=0; + while ($field[0] ne 'END_MISC') { + if ($field[0]) { + $count++; + if ($SectionsToLoad{'misc'}) { + $countloaded++; + if ($field[1]) { $_misc_p{$field[0]}+=int($field[1]); } + if ($field[2]) { $_misc_h{$field[0]}+=int($field[2]); } + if ($field[3]) { $_misc_k{$field[0]}+=int($field[3]); } + } + } + $_=; + chomp $_; s/\r//; + if (! $_) { error("History file \"$filetoread\" is corrupted (in section MISC). Last line read is number $countlines.\nCorrect the line, restore a recent backup of this file, or remove it (data for this month will be lost).","","",1); } + @field=split(/\s+/,$_); $countlines++; + } + if ($Debug) { debug(" End of MISC section ($count entries, $countloaded loaded)"); } + delete $SectionsToLoad{'time'}; + if ($SectionsToSave{'time'}) { + Save_History('time',$year,$month); delete $SectionsToSave{'time'}; + if ($withpurge) { %_misc_p=(); %_misc_h=(); %_misc_k=(); } + } + if (! scalar %SectionsToLoad) { debug(" Stop reading history file. Got all we need."); last; } + next; + } + # BEGIN_TIME if ($field[0] eq 'BEGIN_TIME') { if ($Debug) { debug(" Begin of TIME section"); } @@ -6313,10 +6318,11 @@ if (scalar keys %HTMLOutput) { if ($ShowKeywordsStats) { print ($frame?"   \"...\" ":""); print "$Message[121]\n"; print ($frame?"\n":"   "); } if ($linetitle) { print ($frame?"":"\n"); } # Others - $linetitle=&AtLeastOneNotNull($ShowFileTypesStats=~/C/i,$ShowHTTPErrorsStats); + $linetitle=&AtLeastOneNotNull($ShowFileTypesStats=~/C/i,$ShowMiscStats,$ShowHTTPErrorsStats); if ($linetitle) { print "$Message[2]: \n"; } if ($linetitle) { print ($frame?"\n":""); } if ($ShowFileTypesStats =~ /C/i) { print ($frame?"":""); print "$Message[98]"; print ($frame?"\n":"   "); } + if ($ShowMiscStats) { print ($frame?"":""); print "$Message[139]"; print ($frame?"\n":"   "); } if ($ShowHTTPErrorsStats) { print ($frame?"":""); print "$Message[22]"; print ($frame?"\n":"   "); } foreach my $code (keys %TrapInfosForHTTPErrorCodes) { if ($ShowHTTPErrorsStats) { print ($frame?"   \"...\" ":""); print "$Message[31]\n"; print ($frame?"\n":"   "); } @@ -6477,12 +6483,12 @@ if (scalar keys %HTMLOutput) { # 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 ""; -# if ($ShowMonthDayStats =~ /U/i) { print "\"$Message[11]:"; } -# if ($ShowMonthDayStats =~ /V/i) { print "\"$Message[10]:"; } +# if ($ShowMonthDayStats =~ /U/i) { print "\"$Message[11]:"; } +# if ($ShowMonthDayStats =~ /V/i) { print "\"$Message[10]:"; } # print " "; -# if ($ShowMonthDayStats =~ /P/i) { print "\"$Message[56]:"; } -# if ($ShowMonthDayStats =~ /H/i) { print "\"$Message[57]:"; } -# if ($ShowMonthDayStats =~ /B/i) { print "\"$Message[75]:"; } +# if ($ShowMonthDayStats =~ /P/i) { print "\"$Message[56]:"; } +# if ($ShowMonthDayStats =~ /H/i) { print "\"$Message[57]:"; } +# if ($ShowMonthDayStats =~ /B/i) { print "\"$Message[75]:"; } # print "\n"; # } # print "\n"; @@ -6582,10 +6588,10 @@ if (scalar keys %HTMLOutput) { # 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 ""; -# if ($ShowMonthDayStats =~ /V/i) { print "\"$Message[10]:"; } -# if ($ShowMonthDayStats =~ /P/i) { print "\"$Message[56]:"; } -# if ($ShowMonthDayStats =~ /H/i) { print "\"$Message[57]:"; } -# if ($ShowMonthDayStats =~ /B/i) { print "\"$Message[75]:"; } +# if ($ShowMonthDayStats =~ /V/i) { print "\"$Message[10]:"; } +# if ($ShowMonthDayStats =~ /P/i) { print "\"$Message[56]:"; } +# if ($ShowMonthDayStats =~ /H/i) { print "\"$Message[57]:"; } +# if ($ShowMonthDayStats =~ /B/i) { print "\"$Message[75]:"; } # print "\n"; # } # print " "; @@ -6599,10 +6605,10 @@ if (scalar keys %HTMLOutput) { # $average_p=sprintf("%.2f",$average_p); # $average_h=sprintf("%.2f",$average_h); # $average_k=sprintf("%.2f",$average_k); -# if ($ShowMonthDayStats =~ /V/i) { print "\"$Message[10]:"; } -# if ($ShowMonthDayStats =~ /P/i) { print "\"$Message[56]:"; } -# if ($ShowMonthDayStats =~ /H/i) { print "\"$Message[57]:"; } -# if ($ShowMonthDayStats =~ /B/i) { print "\"$Message[75]:"; } +# if ($ShowMonthDayStats =~ /V/i) { print "\"$Message[10]:"; } +# if ($ShowMonthDayStats =~ /P/i) { print "\"$Message[56]:"; } +# if ($ShowMonthDayStats =~ /H/i) { print "\"$Message[57]:"; } +# if ($ShowMonthDayStats =~ /B/i) { print "\"$Message[75]:"; } # print ""; # print "\n"; # print "\n"; @@ -6690,9 +6696,9 @@ if (scalar keys %HTMLOutput) { if ($ShowDomainsStats =~ /H/i) { print "$_domener_h{$key}"; } if ($ShowDomainsStats =~ /B/i) { print "".Format_Bytes($_domener_k{$key}).""; } print ""; - if ($ShowDomainsStats =~ /P/i) { print "\"$Message[56]:
\n"; } - if ($ShowDomainsStats =~ /H/i) { print "\"$Message[57]:
\n"; } - if ($ShowDomainsStats =~ /B/i) { print "\"$Message[75]:"; } + if ($ShowDomainsStats =~ /P/i) { print "\"$Message[56]:
\n"; } + if ($ShowDomainsStats =~ /H/i) { print "\"$Message[57]:
\n"; } + if ($ShowDomainsStats =~ /B/i) { print "\"$Message[75]:"; } print ""; print "\n"; $total_p += $_domener_p{$key}; @@ -7071,14 +7077,14 @@ if (scalar keys %HTMLOutput) { } print ""; # alt and title are not provided to reduce page size - if ($ShowPagesStats =~ /P/i) { print "
"; } - if ($ShowPagesStats =~ /B/i) { print "
"; } - if ($ShowPagesStats =~ /E/i) { print "
"; } - if ($ShowPagesStats =~ /X/i) { print ""; } - #if ($ShowPagesStats =~ /P/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 ($ShowPagesStats =~ /P/i) { print "
"; } + if ($ShowPagesStats =~ /B/i) { print "
"; } + if ($ShowPagesStats =~ /E/i) { print "
"; } + if ($ShowPagesStats =~ /X/i) { print ""; } + #if ($ShowPagesStats =~ /P/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 += $_url_p{$key}; $total_e += $_url_e{$key}; @@ -7198,7 +7204,7 @@ if (scalar keys %HTMLOutput) { print "$_os_h{$key}$p"; print ""; # alt and title are not provided to reduce page size - if ($ShowOSStats) { print "
"; } + if ($ShowOSStats) { print "
"; } print ""; print "\n"; $count++; @@ -7229,7 +7235,7 @@ if (scalar keys %HTMLOutput) { print "$_os_h{$key}$p"; print ""; # alt and title are not provided to reduce page size - if ($ShowOSStats) { print "
"; } + if ($ShowOSStats) { print "
"; } print ""; print "\n"; } @@ -7280,7 +7286,7 @@ if (scalar keys %HTMLOutput) { print "$_browser_h{$key}$p"; print ""; # alt and title are not provided to reduce page size - if ($ShowBrowsersStats) { print "
"; } + if ($ShowBrowsersStats) { print "
"; } print ""; print "\n"; $count++; @@ -7311,7 +7317,7 @@ if (scalar keys %HTMLOutput) { print "$_browser_h{$key}$p"; print ""; # alt and title are not provided to reduce page size - if ($ShowBrowsersStats) { print "
"; } + if ($ShowBrowsersStats) { print "
"; } print ""; print "\n"; } @@ -7597,12 +7603,12 @@ if (scalar keys %HTMLOutput) { 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 ""; - if ($ShowMonthStats =~ /U/i) { print "\"$Message[11]:"; } - if ($ShowMonthStats =~ /V/i) { print "\"$Message[10]:"; } + if ($ShowMonthStats =~ /U/i) { print "\"$Message[11]:"; } + if ($ShowMonthStats =~ /V/i) { print "\"$Message[10]:"; } print " "; - if ($ShowMonthStats =~ /P/i) { print "\"$Message[56]:"; } - if ($ShowMonthStats =~ /H/i) { print "\"$Message[57]:"; } - if ($ShowMonthStats =~ /B/i) { print "\"$Message[75]:"; } + if ($ShowMonthStats =~ /P/i) { print "\"$Message[56]:"; } + if ($ShowMonthStats =~ /H/i) { print "\"$Message[57]:"; } + if ($ShowMonthStats =~ /B/i) { print "\"$Message[75]:"; } print "\n"; } print " "; @@ -7751,10 +7757,10 @@ if (scalar keys %HTMLOutput) { 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 ""; - if ($ShowDaysOfMonthStats =~ /V/i) { print "\"$Message[10]:"; } - if ($ShowDaysOfMonthStats =~ /P/i) { print "\"$Message[56]:"; } - if ($ShowDaysOfMonthStats =~ /H/i) { print "\"$Message[57]:"; } - if ($ShowDaysOfMonthStats =~ /B/i) { print "\"$Message[75]:"; } + if ($ShowDaysOfMonthStats =~ /V/i) { print "\"$Message[10]:"; } + if ($ShowDaysOfMonthStats =~ /P/i) { print "\"$Message[56]:"; } + if ($ShowDaysOfMonthStats =~ /H/i) { print "\"$Message[57]:"; } + if ($ShowDaysOfMonthStats =~ /B/i) { print "\"$Message[75]:"; } print "\n"; } print " "; @@ -7769,10 +7775,10 @@ if (scalar keys %HTMLOutput) { $average_p=sprintf("%.2f",$average_p); $average_h=sprintf("%.2f",$average_h); $average_k=(int($average_k)?Format_Bytes(sprintf("%.2f",$average_k)):"0.00"); - if ($ShowDaysOfMonthStats =~ /V/i) { print "\"$Message[10]:"; } - if ($ShowDaysOfMonthStats =~ /P/i) { print "\"$Message[56]:"; } - if ($ShowDaysOfMonthStats =~ /H/i) { print "\"$Message[57]:"; } - if ($ShowDaysOfMonthStats =~ /B/i) { print "\"$Message[75]:"; } + if ($ShowDaysOfMonthStats =~ /V/i) { print "\"$Message[10]:"; } + if ($ShowDaysOfMonthStats =~ /P/i) { print "\"$Message[56]:"; } + if ($ShowDaysOfMonthStats =~ /H/i) { print "\"$Message[57]:"; } + if ($ShowDaysOfMonthStats =~ /B/i) { print "\"$Message[75]:"; } print "\n"; print "\n"; # Show lib for day @@ -7886,9 +7892,9 @@ if (scalar keys %HTMLOutput) { if ($avg_dayofweek_p[$_] == int($avg_dayofweek_p[$_])) { $avg_dayofweek_p[$_]=int($avg_dayofweek_p[$_]); } if ($avg_dayofweek_h[$_] == int($avg_dayofweek_h[$_])) { $avg_dayofweek_h[$_]=int($avg_dayofweek_h[$_]); } print ""; - if ($ShowDaysOfWeekStats =~ /P/i) { print "\"$Message[56]:"; } - if ($ShowDaysOfWeekStats =~ /H/i) { print "\"$Message[57]:"; } - if ($ShowDaysOfWeekStats =~ /B/i) { print "\"$Message[75]:"; } + if ($ShowDaysOfWeekStats =~ /P/i) { print "\"$Message[56]:"; } + if ($ShowDaysOfWeekStats =~ /H/i) { print "\"$Message[57]:"; } + if ($ShowDaysOfWeekStats =~ /B/i) { print "\"$Message[75]:"; } print "\n"; } print "\n"; @@ -7944,9 +7950,9 @@ if (scalar keys %HTMLOutput) { 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 ""; - if ($ShowHoursStats =~ /P/i) { print "\"$Message[56]:"; } - if ($ShowHoursStats =~ /H/i) { print "\"$Message[57]:"; } - if ($ShowHoursStats =~ /B/i) { print "\"$Message[75]:"; } + if ($ShowHoursStats =~ /P/i) { print "\"$Message[56]:"; } + if ($ShowHoursStats =~ /H/i) { print "\"$Message[57]:"; } + if ($ShowHoursStats =~ /B/i) { print "\"$Message[75]:"; } print "\n"; } print "\n"; @@ -8050,9 +8056,9 @@ if (scalar keys %HTMLOutput) { if ($ShowDomainsStats =~ /H/i) { print "$_domener_h{$key}"; } if ($ShowDomainsStats =~ /B/i) { print "".Format_Bytes($_domener_k{$key}).""; } print ""; - if ($ShowDomainsStats =~ /P/i) { print "\"\"
\n"; } - if ($ShowDomainsStats =~ /H/i) { print "\"\"
\n"; } - if ($ShowDomainsStats =~ /B/i) { print "\"\""; } + if ($ShowDomainsStats =~ /P/i) { print "\"\"
\n"; } + if ($ShowDomainsStats =~ /H/i) { print "\"\"
\n"; } + if ($ShowDomainsStats =~ /B/i) { print "\"\""; } print ""; print "\n"; $total_p += $_domener_p{$key}; @@ -8253,9 +8259,9 @@ if (scalar keys %HTMLOutput) { 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"; - #print "\"$Message[75]:"; + #print "\"$Message[56]:
\n"; + #print "\"$Message[57]:
\n"; + #print "\"$Message[75]:"; #print ""; print "\n"; $total_p += $_login_p{$key}; @@ -8461,10 +8467,10 @@ if (scalar keys %HTMLOutput) { eval("$function"); } print ""; - if ($ShowPagesStats =~ /P/i) { print "\"\"
"; } - if ($ShowPagesStats =~ /B/i) { print "\"\"
"; } - if ($ShowPagesStats =~ /E/i) { print "\"\"
"; } - if ($ShowPagesStats =~ /X/i) { print "\"\""; } + if ($ShowPagesStats =~ /P/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};