优选主流主机商
任何主机均需规范使用

如何在帝国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中利用用户自定义函数高效统计已发表新闻数量