Abilify For Sale
一直用Stattraq插件来统计Blog的访问信息,使用起来还不错。后来发现,我的Blog上很多关键词都是来自Baidu,而Stattraq根本没有对Baidu的特殊处理,于是Hack一下,让Stattraq也能统计百度的信息。
1)BaiduRobot
在"stattraq.php"的函数"statTraqGetBrowser"中,添加对Baidu Robot的识别(顺便也识别一下Sogou的Robot吧):
Abilify For Sale, [code lang="php"]
}else if(strpos($ua, "Baiduspider") !== false){
$browser_type = ST_BOT;
$s_id = "Baiduspider";
return "Baiduspider";
}else if(strpos($ua, "sohu-search") !== false){
$browser_type = ST_BOT;
$s_id = "SogouBot";
return "SogouBot";
}
?>
[/code]
原理很简单,就是分析HTTP头中的"HTTP_USER_AGENT"信息,负责任的搜索引擎都会给出自己的标志,比如Google的"Googlebot",MSN的"msnbot"等等,对于那些把自己伪装成浏览器的搜索引擎,不统计也罢。
一个需要注意的问题是大小写不能搞错。
然后再修改一下"stattraq-install.php",主要是为了今后的升级:
[code lang="php"]
$sqlQuery = "UPDATE {$tablestattraq} SET user_agent_type=1
WHERE browser = 'Googlebot' OR
browser = 'msnbot' OR
browser = 'Baiduspider' OR
browser = 'SogouRobot' OR
... "
?>
[/code]
2) SE Saturation
在StatTraq的SE Saturation中,可以看到对各个搜索引擎收录你文章的统计,同样,加上百度和Sogou。
在"search_engine_stat.php"中,找到相应的代码段,并添加如下信息:
[code lang="php"]
$baidu = getPageDBResults("Baiduspider", Abilify used for, Abilify description, $date_format, $time_frame, order Abilify no prescription, Where can i order Abilify without prescription, $betweenClause, $orderBy);
$sogou = getPageDBResults("SogouBot", order Abilify from mexican pharmacy, Abilify over the counter, $date_format, $time_frame, no prescription Abilify online, Order Abilify online c.o.d, $betweenClause, $orderBy);
.., Abilify australia, uk, us, usa. Abilify used for, if($baidu)
{
$baidu_count = $baidu->cnt;
}
if($sogou)
{
$sogou_count = $sogou->cnt;
}
...
echo '
echo '
echo '
.., order Abilify online overnight delivery no prescription.
?>
[/code]
显然,这里的"BaiduSpider"和"SogouRobot"就是我们刚才修改的那个函数的返回值。
3)统计用Baidu访问的关键词(Search Team)
在"stattraq.php"的函数"statTraqGetSearchPhrase"中,添加针对Baidu和Sogou的解析:
[code lang="php"]
}else if(strpos($referrer, "baidu.")!== false){
$key = "wd";
}else if(strpos($referrer, "sogou.")!== false){
$key = "query";
?>
[/code]
原理很简单,就是分析referrer中的Query串(Baidu默认是采用GB2312来传递,这个比较烦人)。
比如:
http://www.google.com/search?hl=zh-CN&q=xerdoc&...
"q"就是Key。
Update (2005.11.04)
修改一下StatTraq中文乱码的错误:
1) Summary页面中的乱码:
1.打开/wp-stattraq/reporter/summary.php,找到第140行
<?php echo htmlentities(stripslashes($row->post_title));?> ,修改为
<?php echo htmlentities(stripslashes($row->post_title),ENT_NOQUOTES,’utf-8′);?>
2.打开/wp-stattraq/reporter/query_strings.php,找到第88行
htmlentities($row->search_phrase) ,修改为
htmlentities($row->search_phrase,ENT_NOQUOTES,’utf-8′)
2) Baidu, Sogou等query串的转码:
用iconv来进行转码
[code lang="php"]
if($gb2312 == true && extension_loaded("iconv"))
$phrase = iconv("gb2312","UTF-8",$phrase);
[/code].
Similar posts: Buy Inderal Without Prescription. Buy Cialis Without Prescription. Buy Accutane Without Prescription. Temovate Cream For Sale. Buy Abilify Without Prescription. Ultram long term. Buying Glucophage online over the counter. Phenergan duration. Online buying Prednisolone hcl. Pristiq for sale.
Trackbacks from: Abilify For Sale. Abilify For Sale. Abilify For Sale. Abilify For Sale. Abilify For Sale. Comprar en línea Abilify, comprar Abilify baratos. What is Abilify. Abilify use. Buy Abilify without prescription. Discount Abilify.
Related entries:
September 28th, 2005 at 12:08 am
[...] 一个很好用的访问统计插件:wp-Stattraq,目前的版本是1.0b。目前官方版本只支持google、msn、yahoo!。如果要添加百度、搜狗的支持,可以参考:“Some hacking to support Baidu and Sogou in StatTraq”。 安装好后的访问地址是:StatTraq @ DL-China Tags: none [...]
September 30th, 2005 at 2:15 pm
我那stattraq也是自己hack加上的百度 国内搜索引擎应该都是gb2312吧
所以显示出的文字编码出问题 考虑iconv转换一下..
October 2nd, 2005 at 3:12 pm
Thanks BunnyQ, yes, it should be “iconv”ed,
October 28th, 2005 at 6:25 pm
[...] 2. 添加新的搜索引擎 这个统计系统默认只是支持Google, Yahoo和MSN这三个搜索引擎, 而国内的一些搜索引擎就只有我们自己想办法了. 这个链接就给出了解决方法, 不过里面的代码有一点点问题
http://www.mengyan.org/blog/archives/2005/08/30/59.html [link] [...]