//更新收藏次數(shù) $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 /* * 收藏總次數(shù)統(tǒng)計(jì) */ 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>
版權(quán)聲明: 本站資源均來(lái)自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請(qǐng)注明: dedecms織夢(mèng)二次開(kāi)發(fā)全站收藏總次數(shù)統(tǒng)計(jì)