]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Added count for "Add to favourites"
authoreldy <>
Fri, 13 Jun 2003 19:10:10 +0000 (19:10 +0000)
committereldy <>
Fri, 13 Jun 2003 19:10:10 +0000 (19:10 +0000)
wwwroot/cgi-bin/awstats.model.conf
wwwroot/cgi-bin/awstats.pl

index abb87dccb1717957f4411f378302bc89d6e9fbe9..78eb81f766b7767a90fc6bc81a07603dd28df25e 100644 (file)
@@ -413,16 +413,16 @@ SkipUserAgents=""
 # You can, with this option, add a list of not important frame pages (like 
 # menus, etc...) to exclude them from statistics.
 # For example, to ignore a whole directory tree, just add "directorytoignore",
-# to ignore "users" web site pages in your stats, you can add "/~".
+# to ignore "users" web site pages in your stats, you can add "REGEX[^/~]".
 # The opposite parameter of "SkipFiles" is "OnlyFiles".
 # Note: This parameter is not case sensitive.
 # Note: Use space between each value and do not remove default values.
 # Note: You can use regular expression values writing value with REGEX[value].
 # Change : Effective for new updates only
-# Example: "REGEX[robots\.txt$] REGEX[favicon\.ico$] /badpage.html /~"
-# Default: "REGEX[robots\.txt$] REGEX[favicon\.ico$]"
+# Example: "/badpage.html REGEX[^/~]"
+# Default: ""
 #
-SkipFiles="REGEX[robots\.txt$] REGEX[favicon\.ico$]"
+SkipFiles=""
 
 
 # Include in stats, only accesses from hosts that match one of following
index cd160bc2e231f399053eafd66a92a4420b49ea27..fd2feaaf83120a20b1ada6905dd84dc35183d1c6 100644 (file)
@@ -3031,7 +3031,7 @@ sub Save_History {
                print HISTORYTMP "# for direct I/O access. If you made changes somewhere in this file, you\n";
                print HISTORYTMP "# should also remove completely the MAP section (AWStats will rewrite it\n";
                print HISTORYTMP "# at next update).\n";
-               print HISTORYTMP "BEGIN_MAP ".(24+(scalar keys %TrapInfosForHTTPErrorCodes)+(scalar @ExtraName?scalar @ExtraName-1:0))."\n";
+               print HISTORYTMP "BEGIN_MAP ".(25+(scalar keys %TrapInfosForHTTPErrorCodes)+(scalar @ExtraName?scalar @ExtraName-1:0))."\n";
                print HISTORYTMP "POS_GENERAL ";$PosInFile{"general"}=tell HISTORYTMP;print HISTORYTMP "$spacebar\n";
                # When
                print HISTORYTMP "POS_TIME ";$PosInFile{"time"}=tell HISTORYTMP;print HISTORYTMP "$spacebar\n";
@@ -3058,6 +3058,7 @@ sub Save_History {
                print HISTORYTMP "POS_SEREFERRALS ";$PosInFile{"sereferrals"}=tell HISTORYTMP;print HISTORYTMP "$spacebar\n";
                print HISTORYTMP "POS_PAGEREFS ";$PosInFile{"pagerefs"}=tell HISTORYTMP;print HISTORYTMP "$spacebar\n";
                print HISTORYTMP "POS_SEARCHWORDS ";$PosInFile{"searchwords"}=tell HISTORYTMP;print HISTORYTMP "$spacebar\n";
+               print HISTORYTMP "POS_MISC ";$PosInFile{"misc"}=tell HISTORYTMP;print HISTORYTMP "$spacebar\n";
                print HISTORYTMP "POS_KEYWORDS ";$PosInFile{"keywords"}=tell HISTORYTMP;print HISTORYTMP "$spacebar\n";
                # Others
                print HISTORYTMP "POS_ERRORS ";$PosInFile{"errors"}=tell HISTORYTMP;print HISTORYTMP "$spacebar\n";
@@ -3495,6 +3496,14 @@ sub Save_History {
        }
 
        # Other - Errors
+       if ($sectiontosave eq 'misc') {
+               print HISTORYTMP "\n";
+               print HISTORYTMP "# Misc ID - Pages - Hits - Bandwidth\n";
+               $ValueInFile{$sectiontosave}=tell HISTORYTMP;
+               print HISTORYTMP "BEGIN_MISC ".(scalar keys %_misc_h)."\n";
+               foreach my $key (keys %_misc_h) { print HISTORYTMP "$key ".int($_misc_p{$key}||0)." $_misc_h{$key} ".int($_misc_k{$key}||0)."\n"; }
+               print HISTORYTMP "END_MISC\n";
+       }
        if ($sectiontosave eq 'errors') {
                print HISTORYTMP "\n";
                print HISTORYTMP "# Errors - Hits - Bandwidth\n";
@@ -5218,12 +5227,13 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') {        # Updat
                #----------------------------------------
                if ($timerecord > $LastLine) { $LastLine = $timerecord; }       # Test should always be true except with not sorted log files
 
-               # TODO. Add robot in a list if URL is robots.txt (Note: robot referer value can be same than a normal browser)
-
-
-
+               # Skip for robot init
+               if ($field[$pos_url] =~ /^\/robots.txt$/i) {
+                       # TODO. Add robot in a list if URL is robots.txt (Note: robot referer value can be same than a normal browser)
+                       $qualifdrop="Dropped record (URL $field[$pos_url] is a robot init check)";
+               }
                # Skip for some client host IP addresses, some URLs, other URLs
-               if    (@SkipHosts && (&SkipHost($field[$pos_host]) || ($pos_hostr && &SkipHost($field[$pos_host]))))   { $qualifdrop="Dropped record (host $field[$pos_host] not qualified by SkipHosts)"; }
+               elsif (@SkipHosts && (&SkipHost($field[$pos_host]) || ($pos_hostr && &SkipHost($field[$pos_host]))))   { $qualifdrop="Dropped record (host $field[$pos_host] not qualified by SkipHosts)"; }
                elsif (@SkipFiles && &SkipFile($field[$pos_url]))    { $qualifdrop="Dropped record (URL $field[$pos_url] not qualified by SkipFiles)"; }
                elsif (@OnlyHosts && ! &OnlyHost($field[$pos_host]) && (! $pos_hostr || ! &OnlyHost($field[$pos_hostr]))) { $qualifdrop="Dropped record (host $field[$pos_host]".($pos_hostr?" and $field[$pos_hostr]":"")." not qualified by OnlyHosts)"; } \r
                elsif (@OnlyFiles && ! &OnlyFile($field[$pos_url]))  { $qualifdrop="Dropped record (URL $field[$pos_url] not qualified by OnlyFiles)"; }
@@ -5264,6 +5274,9 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') {  # Updat
                        }
                        elsif ($field[$pos_url] =~ /w=(\d+)&h=(\d+)/) { $_screensize_h{"$1x$2"}++; next; }
                }
+               # Check favicon
+               #-----------------------------------------------
+               elsif ($field[$pos_url] =~ /\/favicon\.ico$/i) { $_misc_h{'AddToFavourites'}++; next; }
                
                # Check return status code
                #-------------------------
@@ -8808,11 +8821,11 @@ if (scalar keys %HTMLOutput) {
                        print "$Center<a name=\"MISC\">&nbsp;</a><BR>\n";
                        my $title="$Message[139]";
                        &tab_head("$title",19);
-                       print "<TR bgcolor=\"#$color_TableBGRowTitle\"><TH>$Message[139]</TH><TH>&nbsp</TH></TR>\n";
+                       print "<TR bgcolor=\"#$color_TableBGRowTitle\"><TH>$Message[139]</TH><TH width=80>&nbsp</TH></TR>\n";
                        foreach my $key (keys %_misc_h) {
                                print "<TR>";
-                               print "<TD>$key</TD>";
-                               print "<TD CLASS=AWS>$_misc_h{$key}</TD>";
+                               print "<TD CLASS=AWS>$key</TD>";
+                               print "<TD>$_misc_h{$key} / $TotalVisits</TD>";
                                print "</TR>\n";
                        }
                        &tab_end;