From: eldy <> Date: Mon, 8 Mar 2004 21:15:22 +0000 (+0000) Subject: Support for CODE in extra section conditions. X-Git-Tag: AWSTATS_6_1_BETA~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de8e722e9854566dbfdfc0fd9dc4cff0b142a8a4;p=thirdparty%2FAWStats.git Support for CODE in extra section conditions. --- diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf index f2dd4413..fd004018 100644 --- a/wwwroot/cgi-bin/awstats.model.conf +++ b/wwwroot/cgi-bin/awstats.model.conf @@ -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). diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl index b928ed9b..0cd72b2c 100644 --- a/wwwroot/cgi-bin/awstats.pl +++ b/wwwroot/cgi-bin/awstats.pl @@ -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