这篇文章主要为大家分享下帝国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]
查看更多关于帝国CMS使用用户自定义函数取发表的新闻数_帝国的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did26846