//更新收藏次数 $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>
新闻热点
疑难解答