Home > CMS Tutorial > Empire CMS > Sharing Empire CMS uses user-defined functions to get the number of published news

Sharing Empire CMS uses user-defined functions to get the number of published news

silencement
Release: 2019-11-30 13:11:34
forward
2490 people have browsed it

Sharing Empire CMS uses user-defined functions to get the number of published news

Add user-defined function
1. The function content is as follows:

The code is as follows:

<?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;
}
?>
Copy after login


2. Copy the function content to the e/class/userfun.php file

3. Log in to the backend->"Template Management"->"Manage Tags"->"Add Tags"

4. Call [newstotal]User ID[/newstotal]

Recommended to study "Empirecms Tutorial"

The above is the detailed content of Sharing Empire CMS uses user-defined functions to get the number of published news. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:www.word666.com/cms
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template