<?php 
$__ONLYDB = true;
require_once(dirname(__FILE__)."/../include/config_base.php");

$id = intval($id);
$id = ereg_replace("[^0-9]","",$id);

$dsql = new DedeSql(false);
$dsql->ExecuteNoneQuery("Update #@__story_books set click=click+1 where id='$id'");
if(!empty($view)){
	$row = $dsql->GetOne("Select click From #@__story_books  where id='$id'");
	echo "document.write('".$row[0]."');\r\n";
}
$dsql->Close();
exit();

//如果想显示点击次数,请增加view参数,即把下面ＪＳ调用放到文档模板适当位置 
//<script src="{dede:field name='phpurl'/}/countbook.php?view=yes&aid={dede:field name='id'/}" language="javascript"></script>
//普通计数器为
//<script src="{dede:field name='phpurl'/}/countbook.php?aid={dede:field name='id'/}" language="javascript"></script>

?>