From: eldy <> Date: Mon, 2 Jul 2001 23:44:05 +0000 (+0000) Subject: Reduce number of variables in code X-Git-Tag: AWSTATS_1_0~243 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc8c18ff08257884264014f900f6d43ff97e07c1;p=thirdparty%2FAWStats.git Reduce number of variables in code --- diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index d3609b30..361c626b 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -46,7 +46,7 @@ $DIR, $DNSLookup, $DefaultFile, $DirCgi, $DirData, $DirIcons, $Extension, $FileConfig, $FileSuffix, $FirstTime, $HTMLEndSection, $Host, $HostAlias, $LastTime, $LastUpdate, $SiteToAnalyze, $SiteToAnalyzeIsInHostAliases, $SiteToAnalyzeWithoutwww, $LogFile, -$LogFormat, $LogFormatString, $Logo, $MaxNbOfHostsShown, $MaxNbOfKeywordsShown, +$LogFormat, $LogFormatString, $Logo, $MaxNbOfDays, $MaxNbOfHostsShown, $MaxNbOfKeywordsShown, $MaxNbOfPageShown, $MaxNbOfRefererShown, $MaxNbOfRobotShown, $MinHitFile, $MinHitHost, $MinHitKeyword, $MinHitRefer, $MinHitRobot, $MonthRequired, $NewDNSLookup, $NowNewLinePhase, $OpenFileError, $PROG, $PageBool, $PageCode, @@ -70,7 +70,6 @@ $word, $yearcon, $yearfile, $yearmonthfile, $yeartoprocess) = (); @BrowserArray = @DomainsArray = @HostAliases = @OnlyFiles = @OSArray = @RobotArray = @SearchEnginesArray = @SkipFiles = @SkipHosts = -@_from_h = @_from_p = @_msiever_h = @_nsver_h = @_time_h = @_time_k = @_time_p = @dateparts = @felter = @field = @filearray = @message = @paramlist = @refurl = @sortbrowsers = @sortdomains_h = @sortdomains_k = @sortdomains_p = @sorterrors = @sorthosts_p = @sortos = @sortpagerefs = @sortrobot = @@ -82,7 +81,7 @@ $word, $yearcon, $yearfile, $yearmonthfile, $yeartoprocess) = (); %MonthBytes = %MonthHits = %MonthPages = %MonthUnique = %MonthVisits = %listofyears = %monthlib = %monthnum = (); -$VERSION="2.5 (build 31)"; +$VERSION="2.5 (build 33)"; $Lang=0; # Default value @@ -90,6 +89,7 @@ $SortDir = -1; # -1 = Sort order from most to less, 1 = reverse order (De $VisitTimeOut = 10000; # Laps of time to consider a page load as a new visit. 10000 = one hour (Default = 10000) $FullHostName = 1; # 1 = Use name.domain.zone to refer host clients, 0 = all hosts in same domain.zone are one host (Default = 1, 0 never tested) $MaxLengthOfURL= 70; # Maximum length of URL shown on stats page. This affects only URL visible text, link still work (Default = 70) +$MaxNbOfDays = 15; $CENTER = ""; $WIDTH = "600"; # Images for graphics @@ -112,7 +112,7 @@ $BarImageHorizontal_k = "barrehk.png"; # "\\.mp3","\\.wma" ); -# Those addresses are shown with those lib (First column is full relative URL, Second column is text to show instead of URL) +# Those addresses are shown with those lib (First column is full exact relative URL, second column is text to show instead of URL) %Aliases = ( "/", "HOME PAGE", "/cgi-bin/awstats.pl", "AWStats stats page", @@ -167,8 +167,6 @@ $BarImageHorizontal_k = "barrehk.png"; "search\..*com","Other search engines" ); - - # Search engines known URLs database (update the 10th january 2001) # To add a search engine, add a new line: # "match_string_in_url_that_identify_engine", "search_engine_name", @@ -1225,7 +1223,7 @@ sub Save_History_File { print HISTORYTMP "FirstTime $FirstTime{$_[0].$_[1]}\n"; print HISTORYTMP "LastTime $LastTime{$_[0].$_[1]}\n"; - if ($LastUpdate{$_[0].$_[1]} lt "$nowyear$nowmonth$nowday$nowhour$nowmin") { $LastUpdate{$_[0].$_[1]}="$nowyear$nowmonth$nowday$nowhour$nowmin"; } + if ($LastUpdate{$_[0].$_[1]} lt "$nowyear$nowmonth$nowday$nowhour$nowmin$nowsec") { $LastUpdate{$_[0].$_[1]}="$nowyear$nowmonth$nowday$nowhour$nowmin$nowsec"; } print HISTORYTMP "LastUpdate $LastUpdate{$_[0].$_[1]}\n"; print HISTORYTMP "TotalVisits $MonthVisits{$_[0].$_[1]}\n"; @@ -1326,13 +1324,15 @@ sub Save_History_File { sub Init_HashArray { # We purge data read for year $_[0] and month $_[1] so it's like we never read it $HistoryFileAlreadyRead{"$_[0]$_[1]"}=0; - # Delete all hash arrays with name beginning by _ + # Delete/Reinit all arrays with name beginning by _ + @_msiever_h = @_nsver_h = (); + for ($ix=0; $ix<5; $ix++) { $_from_p[$ix]=0; $_from_h[$ix]=0; } + for ($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 = %_sider404_h = %_sider_h = %_sider_k = %_sider_p = %_unknownip_l = %_unknownreferer_l = %_unknownrefererbrowser_l = (); - for ($ix=0; $ix<5; $ix++) { $_from_p[$ix]=0; $_from_h[$ix]=0; } - for ($ix=0; $ix<=23; $ix++) { $_time_h[$ix]=0; $_time_k[$ix]=0; $_time_p[$ix]=0; } # reset _; } @@ -1423,7 +1423,7 @@ if (($ENV{"GATEWAY_INTERFACE"} eq "") && ($SiteToAnalyze eq "")) { print " Statistics by day/month/year\n"; print "New versions and FAQ at http://awstats.sourceforge.net\n"; exit 0; - } +} # Get current time $nowtime=time; @@ -2235,7 +2235,8 @@ if ($QueryString =~ /action=browserdetail/i) { &tab_head; print "
| $oldday ".$monthlib{$oldmonth}." | "; + print "$oldday ".$monthlib{$oldmonth}." | ";
}
print "