From: eldy <> Date: Fri, 23 Nov 2001 23:52:34 +0000 (+0000) Subject: Added NotPageList parameter X-Git-Tag: AWSTATS_1_0~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a27c9ebfb69ccbb27691c7f073c5dc9786460a8d;p=thirdparty%2FAWStats.git Added NotPageList parameter --- diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf index 4e5139a1..9452a7ce 100644 --- a/wwwroot/cgi-bin/awstats.model.conf +++ b/wwwroot/cgi-bin/awstats.model.conf @@ -261,9 +261,20 @@ SkipFiles="\.css$ \.js$ \.class$ robots\.txt$" # OnlyFiles="" +# Add here a list of kind of url (file extension) that must be counted as +# "Hit only" and not as a "Hit" and "Page viewed". You can set here all images +# extensions as they are hit downloaded but they are not viewed pages. +# URL with such extensions are not included in the TOP Pages/URL report. +# Example: "" +# Example: "gif jpg jpeg png bmp zip arj gz z wav mp3 wma" +# Default: "gif jpg jpeg png bmp" +# +NotPageList="gif jpg jpeg png bmp" + # Keep or attach the query string to the URL in the statistics for individual # pages. This is primarily used to differentiate between the URLs of dynamic -# pages. +# pages. If set to 1, mypage.html?id=x and mypage.html?id=y are counted as +# two different pages. # Possible values: # 0 - URLs are cleaned from the query string (ie: "/mypage.html") # 1 - Full URL with query string is used (ie: "/mypage.html?x=y") diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index fb27dcd1..545a4742 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -82,7 +82,7 @@ $WarningMessages= 1; %MonthBytes = %MonthHits = %MonthHostsKnown = %MonthHostsUnknown = %MonthPages = %MonthUnique = %MonthVisits = %monthlib = %monthnum = (); -$VERSION="3.2 (build 62)"; +$VERSION="3.2 (build 63)"; $Lang="en"; # Default value @@ -115,14 +115,6 @@ $BarImageHorizontal_k = "barrehk.png"; $AddOn=0; #require "${DIR}addon.pl"; $AddOn=1; # Keep this line commented in standard version -# URL with such end signature are kind of URL we only need to count as hits -@NotPageList= ( - "gif","jpg","jpeg","png","bmp", -# "zip","arj","gz","z", -# "pdf","doc","ppt","rtf","txt", -# "mp3","wma" - ); - # 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", @@ -417,6 +409,7 @@ sub Read_Config_File { } if ($FileConfig eq "") { error("Error: Couldn't open config file \"$PROG.$SiteConfig.conf\" nor \"$PROG.conf\" : $!"); } &debug("Call to Read_Config_File [FileConfig=\"$FileConfig\"]"); + my $foundNotPageList=0; while () { chomp $_; s/\r//; $_ =~ s/#.*//; # Remove comments @@ -484,6 +477,12 @@ sub Read_Config_File { $i=0; foreach $elem (@felter) { $OnlyFiles[$i]=$elem; $i++; } next; } + if ($param =~ /^NotPageList/) { + my @felter=split(/\s+/,$value); + $i=0; foreach $elem (@felter) { $NotPageList[$i]=$elem; $i++; } + $foundNotPageList=1; + next; + } if ($param =~ /^URLWithQuery/) { $URLWithQuery=$value; next; } if ($param =~ /^WarningMessages/) { $WarningMessages=$value; next; } if ($param =~ /^NbOfLinesForCorruptedLog/) { $NbOfLinesForCorruptedLog=$value; next; } @@ -551,6 +550,14 @@ sub Read_Config_File { if ($param =~ /^color_s/) { $color_s=$value; next; } } close CONFIG; + # If parameter NotPageList not found. Init for backward compatibility + if (! $foundNotPageList) { + $NotPageList[0]="gif"; + $NotPageList[1]="jpg"; + $NotPageList[2]="jpeg"; + $NotPageList[3]="png"; + $NotPageList[4]="bmp"; + } } @@ -2643,6 +2650,7 @@ EOF if ($URLFilter) { print "$Message[79]: $URLFilter - ".(scalar keys %_url_p)." $Message[28]"; } else { print "".(scalar keys %_url_p)."  $Message[28]"; } print " $Message[29] "; + print " $Message[104] "; if ($AddOn) { AddOn_ShowFields(""); } print " \n"; $max_p=1; foreach my $key (values %_url_p) { if ($key > $max_p) { $max_p = $key; } } @@ -2656,10 +2664,18 @@ EOF if (length($nompage)>$MaxLengthOfURL) { $nompage=substr($nompage,0,$MaxLengthOfURL)."..."; } if ($ShowLinksOnUrl) { print "$nompage"; } else { print "$nompage"; } - my $bredde=int($BarWidth*$_url_p{$key}/$max_p)+1; - print "$_url_p{$key}"; + my $bredde_p=0; my $bredde_s=0; + if ($max_p > 0) { $bredde_p=int($BarWidth*$_url_p{$key}/$max_p)+1; } + if ($_url_p{$key} && ($bredde_p==1)) { $bredde_p=2; } + if ($max_p > 0) { $bredde_e=int($BarWidth*$_url_e{$key}/$max_p)+1; } + if ($_url_e{$key} && ($bredde_e==1)) { $bredde_e=2; } + print ""; + print "$_url_p{$key}".($_url_e{$key}?$_url_e{$key}:" ").""; if ($AddOn) { AddOn_ShowFields($key); } - print "\n"; + print ""; + print "
"; + print ""; + print ""; $count++; } &tab_end; @@ -3245,7 +3261,8 @@ EOF if ($_url_p{$key} && ($bredde_p==1)) { $bredde_p=2; } if ($max_p > 0) { $bredde_e=int($BarWidth*$_url_e{$key}/$max_p)+1; } if ($_url_e{$key} && ($bredde_e==1)) { $bredde_e=2; } - print "$_url_p{$key}".($_url_e{$key}?$_url_e{$key}:" ").""; + print "$_url_p{$key}".($_url_e{$key}?$_url_e{$key}:" ").""; + print ""; print "\"$Message[56]:
"; print "\"$Message[104]:"; print "\n";