if($MOD['show_hits'])
{
$ip=file_get_contents("http://fw.qq.com/ipaddress");
$ip=str_replace('"',' ',$ip);
$ip2=explode("(",$ip);
$a=substr($ip2[1],0,-2);
$b=explode(",",$a);
$dz=trim($b[2]);

$r = $db->get_one("select articleid,catid,hits,comments from ".channel_table('article', $channelid)." where articleid=$articleid ", "CACHE");
if($r['articleid'])
{
$db->query("update ".channel_table('article', $channelid)." set hits=hits+1 where articleid=$articleid ");
echo "try {setidval('hits','".$r['hits']."');}catch(e){}\n";
echo "try {setidval('commentnumber','".$r['comments']."');}catch(e){}\n";
}
echo "try {setidval('dz','".$dz."');}catch(e){}\n";
}$dz是拿来查询游览者IP的。这个字段在数据库里没有的。
请教下正确写法 3Q