diff -u -F '^function' old.statistics_filter/statistics_filter.module statistics_filter/statistics_filter.module --- old.statistics_filter/statistics_filter.module 2005-09-27 10:08:14.000000000 +0200 +++ statistics_filter/statistics_filter.module 2005-11-24 00:06:07.000000000 +0200 @@ -65,6 +65,17 @@ function statistics_filter_exit() { } } } + + // Ignore page if requested + $pages = variable_get('statistics_filter_pages', ''); + if ($pages) { + $path = drupal_get_path_alias($_GET['q']); + $regexp = '/^('. preg_replace(array('/(\r\n?|\n)/', '/\\\\\*/', '/(^|\|)\\\\($|\|)/'), array('|', '.*', '\1'. preg_quote(variable_get('site_frontpage', 'node'), '/') .'\2'), preg_quote($pages, '/')) .')$/'; + $page_match = !(preg_match($regexp, $path)); + if (preg_match($regexp, $path)) { + $do_filtering = TRUE; + } + } // We don't want these stats to count, precisely undo what // statistics.module and browscap.module did @@ -134,6 +145,8 @@ function statistics_filter_settings() { TRUE, variable_get('statistics_filter_crawlers', FALSE), t("Ignore search engine crawlers' accesses to this site.")); } + + $output .= form_textarea(t('Pages'), 'statistics_filter_pages', variable_get('statistics_filter_pages', ''), 40, 5, t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are 'blog' for the blog page and 'blog/*' for every personal blog. '<front>' is the front page.")); return $output; }