From: eldy <> Date: Sat, 4 May 2002 15:45:48 +0000 (+0000) Subject: Fixed: Parameter DetailedReportsOnNewWindows was not working. X-Git-Tag: AWSTATS_4_1_BETA~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=211efa2eba55219bd791c00abe8981c2a3c1ae94;p=thirdparty%2FAWStats.git Fixed: Parameter DetailedReportsOnNewWindows was not working. --- diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf index 56a66afb..0d5fa2cd 100644 --- a/wwwroot/cgi-bin/awstats.model.conf +++ b/wwwroot/cgi-bin/awstats.model.conf @@ -452,15 +452,15 @@ ShowHTTPErrorsStats=1 # particular reporting. # # Stats by domains -MaxNbOfDomain = 25 +MaxNbOfDomain = 20 # Stats by hosts -MaxNbOfHostsShown = 25 +MaxNbOfHostsShown = 20 MinHitHost = 1 # Stats by authenticated users MaxNbOfLoginShown = 10 MinHitLogin = 1 # Stats by robots -MaxNbOfRobotShown = 25 +MaxNbOfRobotShown = 20 MinHitRobot = 1 # Stats by pages MaxNbOfPageShown = 25 @@ -488,9 +488,10 @@ FirstDayOfWeek=1 DetailedReportsOnNewWindows=1 # List of visible flags with link to other language translations. +# See Lang parameter for list of allowed flag/language codes. # If you don't want any flag link, set ShowFlagLinks to "". -# This parameter is used only if ShowHeader is set to 1. -# Possible values: "" or "language_codes_separated_by_space" +# This parameter is used only if ShowHeader parameter is set to 1. +# Possible values: "" or "language_codes_separated_by_space". # Default: "en es fr it nl es" # ShowFlagLinks="en fr de it nl es" @@ -578,7 +579,7 @@ color_u="FFB055" # Background color for number of unique visitors (Default = color_v="F8E880" # Background color for number of visites (Default = "F8E880") color_p="4477DD" # Background color for number of pages (Default = "4477DD") color_h="66F0FF" # Background color for number of hits (Default = "66F0FF") -color_k="339944" # Background color for number of bytes (Default = "2EA495") +color_k="2EA495" # Background color for number of bytes (Default = "2EA495") color_s="8888DD" # Background color for number of search (Default = "8888DD") color_e="CEC2E8" # Background color for number of entry pages (Default = "CEC2E8") color_x="C1B2E2" # Background color for number of exit pages (Default = "C1B2E2") diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index 9f1459bd..e4627379 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -11,7 +11,7 @@ #------------------------------------------------------- # $Revision$ - $Author$ - $Date$ -# Next 'use' are commented to make AWStats working with old perl. +# use strict and use vars are commented to make AWStats working with old perl. use strict;no strict "refs"; use vars qw(%DomainsHashIDLib @RobotsSearchIDOrder_list1 @RobotsSearchIDOrder_list2 @RobotsSearchIDOrder_list3 @BrowsersSearchIDOrder @OSSearchIDOrder @WordsToCleanSearchUrl %BrowsersHereAreGrabbers %BrowsersHashIcon %BrowsersHashIDLib %OSHashID %OSHashLib %RobotsHashIDLib %SearchEnginesHashIDLib %SearchEnginesKnownUrl %DomainsHashIDLib); #use warnings; # Must be used in test mode only. This reduce a little process speed @@ -81,8 +81,8 @@ $NowNewLinePhase, $NbOfLinesForCorruptedLog, $PurgeLogFile, $ShowAuthenticatedUsers, $ShowCompressionStats, $ShowFileSizesStats, $ShowDropped, $ShowCorrupted, $ShowUnknownOrigin, $ShowLinksToWhoIs, $SplitSearchString, $StartSeconds, $StartMicroseconds, -$StaticLinks, $UpdateStats, $URLWithQuery)= -(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); +$UpdateStats, $URLWithQuery)= +(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); my ($AllowToUpdateStatsFromBrowser, $ArchiveLogRecords, $DetailedReportsOnNewWindows, $FirstDayOfWeek, $SaveDatabaseFilesWithPermissionsForEveryone, $LevelForRobotsDetection, $LevelForBrowsersDetection, $LevelForOSDetection, @@ -104,9 +104,9 @@ $color_text, $color_textpercent, $color_titletext, $color_weekend, $color_link, $color_h, $color_k, $color_p, $color_e, $color_x, $color_s, $color_u, $color_v)= ("","","","","","","","","","","","","","","","","","","","",""); my ($FileConfig, $FileSuffix, $Host, $HTMLOutput, $LastUpdate, $DayRequired, $MonthRequired, $YearRequired, -$QueryString, $SiteConfig, $URLFilter, $PageCode, $LogFormatString, $PerlParsingFormat, +$QueryString, $SiteConfig, $StaticLinks, $URLFilter, $PageCode, $LogFormatString, $PerlParsingFormat, $SiteToAnalyze, $SiteToAnalyzeWithoutwww, $UserAgent)= -("","","","","","","","","","","","","","","","",""); +("","","","","","","","","","","","","","","","","",""); my $pos_rc = my $pos_logname = my $pos_date = my $pos_method = my $pos_url = my $pos_code = my $pos_size = 0; my $pos_referer = my $pos_agent = my $pos_query = my $pos_gzipin = my $pos_gzipout = my $pos_gzipratio = 0; my $lastrequiredfield = my $lowerval = 0; @@ -276,10 +276,10 @@ EOF Show_Flag_Links($Lang); print "\n"; if ($LogoLink =~ "http://awstats.sourceforge.net") { - print "\"$PROG\n"; + print "\"$PROG\n"; } else { - print "\n"; + print "\n"; } #print "HomePage •\; Back
\n"; print "$Message[54]\n"; @@ -293,7 +293,7 @@ EOF sub html_end { if ($HTMLOutput) { print "$CENTER


\n"; - print "Advanced Web Statistics $VERSION - Created by $PROG
\n"; + print "Advanced Web Statistics $VERSION - Created by $PROG
\n"; print "
\n"; print "$HTMLEndSection\n"; print "\n"; @@ -1074,6 +1074,7 @@ sub Check_Config { if (! $Message[115]) { $Message[115]="OK"; } if (! $Message[116]) { $Message[116]="Exit Pages"; } if (! $Message[117]) { $Message[117]="Visits duration"; } + if (! $Message[118]) { $Message[118]="Close window"; } # Check if DirData is OK if (! -d $DirData) { if ($CreateDirDataIfNotExists) { @@ -2150,7 +2151,7 @@ sub ShowWhoIsCell { } else { $keyurl =~ /(\w+\.\w+)$/; $keyforwhois=$1; } print ""; - if ($keyforwhois) { print "?"; } + if ($keyforwhois) { print "?"; } print ""; } @@ -2374,7 +2375,8 @@ else { # Run from command line $QueryString=~s/showunknownorigin[^&]*//; } if ($QueryString =~ /logfile=([^\s&]+)$/i) { $LogFile=$1; } -if ($QueryString =~ /staticlinks/i) { $StaticLinks=1; } +if ($QueryString =~ /staticlinks/i) { $StaticLinks=".$SiteConfig"; } +if ($QueryString =~ /staticlinks=([^\s&]+)/i) { $StaticLinks=".$1"; } if ($QueryString =~ /debug=(\d+)/i) { $Debug=$1; } if ($QueryString =~ /output=urldetail:/i) { # A filter on URL list can be defined with output=urldetail:filter to reduce number of lines read and showed @@ -3690,7 +3692,7 @@ EOF if ($LastUpdate) { print Format_Date($LastUpdate,0); } else { print "Never updated"; } print "       "; - if ($AllowToUpdateStatsFromBrowser) { + if ($AllowToUpdateStatsFromBrowser && ! $StaticLinks) { my $NewLinkParams=${QueryString}; $NewLinkParams =~ s/update[=]*[^ &]*//i; $NewLinkParams =~ s/staticlinks[=]*[^ &]*//i; @@ -3712,9 +3714,9 @@ EOF print ""; if ($ShowDomainsStats) { print "$Message[17]   "; } if ($ShowHostsStats) { print "".ucfirst($Message[81])."   "; } - if ($ShowHostsStats) { print "$Message[80]  \n"; } - if ($ShowHostsStats) { print "$Message[9]  \n"; } - if ($ShowHostsStats) { print "$Message[45]  \n"; } + if ($ShowHostsStats) { print "$Message[80]  \n"; } + if ($ShowHostsStats) { print "$Message[9]  \n"; } + if ($ShowHostsStats) { print "$Message[45]  \n"; } if ($ShowAuthenticatedUsers) { print "$Message[94]   "; } if ($ShowRobotsStats) { print "$Message[53]   "; } print "
"; @@ -3722,15 +3724,15 @@ EOF print "$Message[72] : "; print ""; if ($ShowSessionsStats) { print "$Message[117]   "; } - if ($ShowPagesStats) { print "$Message[29]   "; } + if ($ShowPagesStats) { print "$Message[29]   "; } if ($ShowPagesStats) { print "$Message[104]   "; } if ($ShowPagesStats) { print "$Message[116]   "; } if ($ShowFileTypesStats) { print "$Message[73]   "; } if ($ShowFileSizesStats) { } if ($ShowOSStats) { print "$Message[59]   "; } if ($ShowBrowsersStats) { print "$Message[21]   "; } - if ($ShowBrowsersStats) { print "$Message[33]   "; } - if ($ShowBrowsersStats) { print "$Message[34]
\n"; } + if ($ShowBrowsersStats) { print "$Message[33]   "; } + if ($ShowBrowsersStats) { print "$Message[34]
\n"; } # Referers print "$Message[23] : "; print ""; @@ -3741,12 +3743,17 @@ EOF print ""; if ($ShowCompressionStats) { print "$Message[98]   "; } if ($ShowHTTPErrorsStats) { print "$Message[22]   "; } - if ($ShowHTTPErrorsStats) { print "$Message[31]
\n"; } + if ($ShowHTTPErrorsStats) { print "$Message[31]
\n"; } } - else { + else { # If not main page $NewLinkParams =~ s/urlfilter[=]*[^ &]*//i; $NewLinkParams =~ s/&+$//; - if ($ShowBackLink) { print "$Message[76]\n"; } + if (! $DetailedReportsOnNewWindows) { + if ($ShowBackLink) { print "$Message[76]\n"; } + } + else { + print "$Message[118]\n"; + } } print "\n"; print "
\n"; @@ -4409,7 +4416,7 @@ EOF if ($Debug) { debug("ShowHostsStats",2); } print "$CENTER 
"; $MaxNbOfHostsShown = (scalar keys %_hostmachine_h) if $MaxNbOfHostsShown > (scalar keys %_hostmachine_h); - &tab_head("$Message[81] ($Message[77] $MaxNbOfHostsShown)   -   $Message[80]   -   $Message[9]   -   $Message[45]",19); + &tab_head("$Message[81] ($Message[77] $MaxNbOfHostsShown)   -   $Message[80]   -   $Message[9]   -   $Message[45]",19); if ($MonthRequired ne "year") { print "$Message[81] : $TotalHostsKnown $Message[82], $TotalHostsUnknown $Message[1] - $TotalUnique $Message[11]"; } else { print "$Message[81] : ".(scalar keys %_hostmachine_h).""; } if ($ShowLinksToWhoIs && $LinksToWhoIs) { print "$Message[114]"; } @@ -4510,7 +4517,7 @@ EOF $count++; } if ($TotalVisits > $total_s) { - print "$Message[0]".($TotalVisits-$total_s)."\n"; + print "$Message[0]".($TotalVisits-$total_s)."\n"; } &tab_end; } @@ -4521,7 +4528,7 @@ EOF if ($Debug) { debug("ShowPagesStats (MaxNbOfPageShown=$MaxNbOfPageShown TotalDifferentPages=$TotalDifferentPages)",2); } print "$CENTER   
"; $MaxNbOfPageShown = $TotalDifferentPages if $MaxNbOfPageShown > $TotalDifferentPages; - &tab_head("$Message[19] ($Message[77] $MaxNbOfPageShown)   -   $Message[80]",19); + &tab_head("$Message[19] ($Message[77] $MaxNbOfPageShown)   -   $Message[80]",19); print "$TotalDifferentPages $Message[28]"; print "$Message[29]"; print "$Message[106]"; @@ -4544,11 +4551,11 @@ EOF my $newkey=CleanFromCSSA($key); if ($newkey =~ /^http(s|):/i) { # URL is url extracted from a proxy log file - print "$nompage"; + print "$nompage"; } else { # URL is url extracted from a web/wap server log file - print "$nompage"; + print "$nompage"; } } else { @@ -4650,13 +4657,13 @@ EOF foreach my $key (sort { $_browser_h{$b} <=> $_browser_h{$a} } keys (%_browser_h)) { my $p=int($_browser_h{$key}/$Total*1000)/10; if ($key eq "Unknown") { - print "$Message[0]?$_browser_h{$key}$p %\n"; + print "$Message[0]?$_browser_h{$key}$p %\n"; } else { my $nameicon=$BrowsersHashIcon{$key}||"notavailable"; $nameicon =~ s/\s.*//; $nameicon =~ tr/A-Z/a-z/; my $newbrowser=$BrowsersHashIDLib{$key}||$key; - if ($newbrowser eq "netscape") { $newbrowser="Netscape ($Message[58])"; } - if ($newbrowser eq "msie") { $newbrowser="MS Internet Explorer ($Message[58])"; } + if ($newbrowser eq "netscape") { $newbrowser="Netscape ($Message[58])"; } + if ($newbrowser eq "msie") { $newbrowser="MS Internet Explorer ($Message[58])"; } print "$newbrowser".($BrowsersHereAreGrabbers{$key}?"$Message[112]":"$Message[113]")."$_browser_h{$key}$p %\n"; } $count++; @@ -4676,7 +4683,7 @@ EOF foreach my $key (sort { $_os_h{$b} <=> $_os_h{$a} } keys (%_os_h)) { my $p=int($_os_h{$key}/$Total*1000)/10; if ($key eq "Unknown") { - print "$Message[0]$_os_h{$key}"; + print "$Message[0]$_os_h{$key}"; print "$p %\n"; } else { @@ -4744,7 +4751,7 @@ EOF if (length($nompage)>$MaxLengthOfURL) { $nompage=substr($nompage,0,$MaxLengthOfURL)."..."; } if ($ShowLinksOnUrl && ($key =~ /^http(s|):/i)) { my $newkey=CleanFromCSSA($key); - print "- $nompage$_pagesrefs_h{$key}\n"; + print "- $nompage$_pagesrefs_h{$key}\n"; } else { print "- $nompage$_pagesrefs_h{$key}\n"; } @@ -4767,7 +4774,7 @@ EOF if ($Debug) { debug("ShowKeyphrasesStats",2); } print "$CENTER 
"; $MaxNbOfKeywordsShown = $TotalDifferentKeyphrases if $MaxNbOfKeywordsShown > $TotalDifferentKeyphrases; - &tab_head("$Message[43] ($Message[77] $MaxNbOfKeywordsShown)   -   $Message[80]",19); + &tab_head("$Message[43] ($Message[77] $MaxNbOfKeywordsShown)   -   $Message[80]",19); print "$TotalDifferentKeyphrases $Message[103]$Message[14]$Message[15]\n"; $total_s=0; my $count=0; @@ -4802,7 +4809,7 @@ EOF my $p=int($_errors_h{$key}/$TotalErrors*1000)/10; if ($httpcode{$key}) { print ""; } else { print ""; } - if ($key == 404) { print "$key"; } + 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"; }