添加用户自定义函数
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教程》
以上就是分享帝国CMS使用用户自定义函数取发表的新闻数的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号