]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Fix: Exclude robots.txt from download view.
authoreldy <>
Wed, 17 Oct 2012 09:05:49 +0000 (09:05 +0000)
committereldy <>
Wed, 17 Oct 2012 09:05:49 +0000 (09:05 +0000)
Fix: Add download view into awstats_buildstaticpages.pl script

test/test.pl
tools/awstats_buildstaticpages.pl
wwwroot/cgi-bin/awstats.pl

index 118414206dc9460d05f327ca7888aceb9ef361bd..a2ba51c1e2fe7e1403cfd7b1840c11daa075ec3b 100644 (file)
@@ -4,9 +4,9 @@
 #-----------------------------------------------------------------------------
 
 
-$DIRAWSTATS="/media/DATA/Mes Developpements/awstats/wwwroot/cgi-bin";
-$DIRCONF="/media/DATA/Mes Developpements/awstats/test/awstats/conf";
-$DIRRESULT="/media/DATA/Mes Developpements/awstats/test/awstats/result";
+$DIRAWSTATS="/media/HDDATA1_LD/Mes Developpements/awstats/wwwroot/cgi-bin";
+$DIRCONF="/media/HDDATA1_LD/Mes Developpements/awstats/test/awstats/conf";
+$DIRRESULT="/media/HDDATA1_LD/Mes Developpements/awstats/test/awstats/result";
 $TEMP="/temp";
 #$PERL="\"c:\\Program files\\cygwin\\bin\\perl.exe\"";
 $PERL="perl";
index 95a77ac245430eebe3c1713aac654c66ad31087c..0f65fda95a1f7cf946f465311f451bd5f436b3b9 100644 (file)
@@ -51,7 +51,7 @@ $ShowEMailSenders $ShowEMailReceivers $ShowWormsStats $ShowClusterStats
 $ShowMenu $ShowMonthStats $ShowDaysOfMonthStats $ShowDaysOfWeekStats
 $ShowHoursStats $ShowDomainsStats $ShowHostsStats
 $ShowRobotsStats $ShowSessionsStats $ShowPagesStats $ShowFileTypesStats
-$ShowOSStats $ShowBrowsersStats $ShowOriginStats
+$ShowOSStats $ShowBrowsersStats $ShowDownloadsStats $ShowOriginStats
 $ShowKeyphrasesStats $ShowKeywordsStats $ShowMiscStats $ShowHTTPErrorsStats
 $BuildReportFormat
 @ExtraName
@@ -354,6 +354,7 @@ if ($ShowPagesStats) { push @OutputList,'urldetail'; push @OutputList,'urlentry'
 #if ($ShowFileTypesStats) { push @OutputList,'filetypes'; }    # There is dedicated page for filetypes
 if ($ShowOSStats) { push @OutputList,'osdetail'; push @OutputList,'unknownos'; }
 if ($ShowBrowsersStats) { push @OutputList,'browserdetail'; push @OutputList,'unknownbrowser'; }
+if ($ShowDownloadsStats) { push @OutputList,'downloads'; }
 if ($ShowScreenSizeStats) { push @OutputList,'screensize'; }
 if ($ShowOriginStats) { push @OutputList,'refererse'; push @OutputList,'refererpages'; }
 if ($ShowKeyphrasesStats) { push @OutputList,'keyphrases'; }
index 2ea66c2e1054094dfd502406bb409d1a755239c6..3c9af148ee2f0dd3ce3aa69ccba7d5bd8abaa05c 100644 (file)
@@ -13,7 +13,6 @@
 #
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
@@ -18548,7 +18547,8 @@ if ( $UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft' )
                                if ( $ValidHTTPCodes{ $field[$pos_code] } ) {    # Code is valid
                                        if ( int($field[$pos_code]) == 304 && $pos_size>0) { $field[$pos_size] = 0; }
                                        # track downloads
-                                       if (int($field[$pos_code]) == 200 && $MimeHashLib{$extension}[1] eq 'd'){
+                                       if (int($field[$pos_code]) == 200 && $MimeHashLib{$extension}[1] eq 'd' && $urlwithnoquery !~ /robots.txt$/ )  # We track download if $MimeHashLib{$extension}[1] = 'd'
+                                       {
                                                $_downloads{$urlwithnoquery}->{'AWSTATS_HITS'}++;
                                                $_downloads{$urlwithnoquery}->{'AWSTATS_SIZE'} += ($pos_size>0 ? int($field[$pos_size]) : 0);
                                                if ($Debug) { debug( " New download detected: '$urlwithnoquery'", 2 ); }