]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Support for CODE in extra section conditions.
authoreldy <>
Mon, 8 Mar 2004 21:15:22 +0000 (21:15 +0000)
committereldy <>
Mon, 8 Mar 2004 21:15:22 +0000 (21:15 +0000)
wwwroot/cgi-bin/awstats.model.conf
wwwroot/cgi-bin/awstats.pl

index f2dd44134f47742687be7d4a54ad738de08f999a..fd00401867f8b893f6176e7d573883340d6da8e7 100644 (file)
@@ -1263,14 +1263,14 @@ color_x="C1B2E2"                                # Background color for number of exit pages (Default = "C1B2
 #
 # ExtraSectionNameX is title of your personalized chart.
 # ExtraSectionConditionalX are conditions you can use to count or not the hit,
-#   Use one of the field condition (URL, QUERY_STRING, REFERER, UA, HOST),
-#   and a regex to match after a coma. Use "|" for "OR".
+#   Use one of the field condition (URL,QUERY_STRING,REFERER,UA,HOST,CODE),
+#   and a regex to match, after a coma. Use "|" for "OR".
 # ExtraSectionFirstColumnTitleX is the first column title of the chart.
 # ExtraSectionFirstColumnValuesX is a Regex string to tell AWStats in which 
-#   field to extract value from (URL, QUERY_STRING, REFERER, UA, HOST) and how
-#   to extract the value (using regex syntax). Each different value found will
-#   appear in first column of report on a different row. Be sure that list of
-#   different values is "limited" to avoid "not enough memory" problems !
+#   field to extract value from (URL, QUERY_STRING, REFERER, UA, HOST, CODE)
+#   and how to extract the value (using regex syntax). Each different value
+#   found will appear in first column of report on a different row. Be sure
+#   that list of different possible values will not grow indefinitely.
 # ExtraSectionFirstColumnFormatX is the string used to write value.
 # ExtraSectionStatTypesX are things you want to count. You can use standard
 #   code letters (P for pages,H for hits,B for bandwidth,L for last access).
index b928ed9bb077fe98b24c035d83ca55e4a16f7ad8..0cd72b2c321ef03c5936edd44afb7a0a1ee07ea2 100644 (file)
@@ -6749,6 +6749,10 @@ if ($UpdateStats && $FrameName ne 'index' && $FrameName ne 'mainleft') { # Updat
                                        if ($Debug) { debug("  Check condition '$conditiontype' must contain '$conditiontypeval' in $field[$pos_host]",5); }
                                        if ($HostResolved =~ /$conditiontypeval/) { $conditionok=1; last; }
                                }
+                               elsif ($conditiontype eq 'CODE') {
+                                       if ($Debug) { debug("  Check condition '$conditiontype' must be '$conditiontypeval' in $field[$pos_code]",5); }
+                                       if ($field[$pos_code] eq "$conditiontypeval") { $conditionok=1; last; }
+                               }
                                else { error("Wrong value of parameter ExtraSectionCondition$extranum"); }
                        }
                        if (! $conditionok && @{$ExtraConditionType[$extranum]}) { next; }      # End for this section