帝国CMS使用用户自定义函数取发表的新闻数
添加用户自定义函数
1.函数内容如下:
<?php
function user_newstotal($userid){
global $empire,$class_r,$dbtbpre;
$query="select count(*) as total from {$dbtbpre}ecms_news WHERE userid=".$userid." ";
$num=$empire->gettotal($query);
echo $num;
}
?>
2.将函数内容复制到e/class/userfun.php文件里
3.登陆后台->“模板管理”->“管理标签”->“增加标签”
4.调用[newstotal]用户ID[/newstotal]
1.函数内容如下:
代码如下:
<?php
function user_newstotal($userid){
global $empire,$class_r,$dbtbpre;
$query="select count(*) as total from {$dbtbpre}ecms_news WHERE userid=".$userid." ";
$num=$empire->gettotal($query);
echo $num;
}
?>
2.将函数内容复制到e/class/userfun.php文件里
3.登陆后台->“模板管理”->“管理标签”->“增加标签”
4.调用[newstotal]用户ID[/newstotal]
文章版权声明:除非注明,否则均为奥多云原创文章,转载或复制请以超链接形式并注明出处。
还没有评论,来说两句吧...