上一篇:
mysql中取随机n条记录
mysql中取随机n条记录
dede的文章点击计数不防刷的,自己改了下,自己试着好像没问题。
将plus/count.php 改为下面代码就OK了。
以下为引用的内容:
以下为引用的内容:
将plus/count.php 改为下面代码就OK了。
以下为引用的内容:
<?
$__ONLYDB = true;
require_once(dirname(__FILE__)."/../include/config_base.php");
session_start(); //新加入
if(empty($aid)) $aid="0";
$aid = ereg_replace("[^0-9]","",$aid);
if(empty($mid)) $mid="0";
$mid = ereg_replace("[^0-9]","",$mid);
$__ONLYDB = true;
require_once(dirname(__FILE__)."/../include/config_base.php");
session_start(); //新加入
if(empty($aid)) $aid="0";
$aid = ereg_replace("[^0-9]","",$aid);
if(empty($mid)) $mid="0";
$mid = ereg_replace("[^0-9]","",$mid);
以下为引用的内容:
if (!isset($_SESSION['c_time'.$aid])) // 如果第一次访问,设定时间戳,并允许增加
{
$_SESSION['c_time'.$aid] = time();
$dsql = new DedeSql(false);
$dsql->ExecuteNoneQuery("Update #@__archives set click=click+1 where ID='$aid'");
if(!empty($mid)){
$dsql->ExecuteNoneQuery("Update #@__member set pageshow=pageshow+1 where ID='$mid'");
}
if(!empty($view)){
$row = $dsql->GetOne("Select click From #@__archives where ID='$aid'");
echo "document.write('".$row[0]."');\r\n";
}
$dsql->Close();
exit();
}
elseif (time() - $_SESSION['ctime'.$aid] < 3600) // 如果在一小时内刷新页面,则不增加。按此可以设置永远不增加
{
exit();
} else { // 如果超过一小时,则重新计时,并允许增加
$allow_insert = true;
unset($_SESSION['ctime'.$aid]);
}
?>
{
$_SESSION['c_time'.$aid] = time();
$dsql = new DedeSql(false);
$dsql->ExecuteNoneQuery("Update #@__archives set click=click+1 where ID='$aid'");
if(!empty($mid)){
$dsql->ExecuteNoneQuery("Update #@__member set pageshow=pageshow+1 where ID='$mid'");
}
if(!empty($view)){
$row = $dsql->GetOne("Select click From #@__archives where ID='$aid'");
echo "document.write('".$row[0]."');\r\n";
}
$dsql->Close();
exit();
}
elseif (time() - $_SESSION['ctime'.$aid] < 3600) // 如果在一小时内刷新页面,则不增加。按此可以设置永远不增加
{
exit();
} else { // 如果超过一小时,则重新计时,并允许增加
$allow_insert = true;
unset($_SESSION['ctime'.$aid]);
}
?>
无法载入mcrypt扩展
2008/11/18 15:12 | by



