用戶自己定義函數(shù)添加方法:
1.函數(shù)內(nèi)容代碼:
<?php
function user_ztotal($classid){
global $empire,$class_r,$dbtbpre;
$beginYesterday = mktime(0, 0, 0, date("m"), date("d") -1, date("Y"));
$endYesterday = mktime(0,0,0,date("m") ,date("d"),date("Y"));
$query="select count(*) as total from {$dbtbpre}ecms_".$class_r[$classid][tbname]." WHERE classid=".$classid." and newstime BETWEEN ".$beginYesterday." AND ".$endYesterday;
$num=$empire->gettotal($query);
echo $num;
}
?>
2.將函數(shù)內(nèi)容復制到e/class/userfun.php文件里
3.登陸后臺->“模板管理”->“管理標簽”->“增加標簽”:
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: 帝國CMS用戶自定義函數(shù)取昨天發(fā)表的文章數(shù)