Exclude Bot Hits from Counterize v2.0

十二月 15th, 2005 by 思考/HK-X-Force Leave a reply »
  • Share

Oops, I’ve misunderstand the syntax of user agent tag. The following code can exclude most bot hits, with also Baidu search and Yahoo search.

if ( (stristr($useragent, "bot") === TRUE) || (stristr($useragent, "spider") === TRUE) || (stristr($useragent, "crawler") === TRUE) || (stristr($useragent, "baidu") === TRUE) || (stristr($useragent, "Yahoo! Slurp") === TRUE) )
$checkval = TRUE;

So replace it with the old one. If you are new, add this below these two lines (around line 377) in wp-content/plugins/counterize.php:
$excludelist=get_option(‘counterize_excluded’);
$checkval = strpos($excludelist, $remoteaddr);

Old version:
Exclude Bot Hits from Counterize

Share
Advertisement
CP_HK Image Banner 580 x 100

3 comments

  1. 王小虎 說道:

    代码中的引号应为,而非

  2. 王小虎 說道:

    不好意思,请忽略以上留言。

    我发现这个留言系统总是把代码中的“单引号(ASCII为39)”转换成UTF-8里面的“文书单引号”。

  3. 我還是 PHP 新手呢,在 PHP 中使用單引號及雙引號不是一樣的嗎? @@"

發表迴響