//更新收藏次数 $title = ($arctitle); $stows = 0; $rs = $dsql->ExecuteNoneQuery2("UPDATE `dede_stows` SET stows = stows+1 WHERE title='$title' "); if($rs <= 0) { $query = " INSERT INTO `dede_stows`(`title`, `id`, `stows`) VALUES('$title', '$id', 1); "; $dsql->ExecNoneQuery($query); }
<?php /* * 收藏总次数统计 */ require_once(dirname(__FILE__)."/../include/common.inc.php"); $aid = (isset($aid) && is_numeric($aid)) ? $aid : 0; $row = $dsql->GetOne("SELECT SUM(stows) AS totals FROM `dede_stows` WHERE id='$aid' "); if(empty($row['totals'])) $row['totals'] = 0; echo "document.write('{$row['totals']}');"; exit();
<srcipt src="{dede:global name='cfg_phpurl'/}/stows.php?aid={dede:field name='id'/}" language="javasrcipt"></srcipt>
版权声明: 本站资源均来自互联网或会员发布,如果侵犯了您的权益请与我们联系,我们将在24小时内删除!谢谢!
转载请注明: dedecms织梦二次开发全站收藏总次数统计