
PHPCMSV9后台调用用户总户、今日新注册用户、待审、总文章数(按照 hits)
先打开/phpcms/modules/admin/index.php
搜索:public function public_main() {
在里面加上:
$this->content_check_db = pc_base::load_model('content_check_model');
$this->hits_db = pc_base::load_model('hits_model');
$total_content_check = $this->content_check_db->count(array('status'=>'0'));
$total_hits = $this->hits_db->count();
$this->member_db = pc_base::load_model('member_model');
$total_member = $this->member_db->count(); //会员总数
$todaytime = strtotime(date('Y-m-d', SYS_TIME)); //今日会员数
$today_member = $this->member_db->count("`regdate` > '$todaytime'");
然后/phpcms/modules/admin/templates/main.tpl.php 里调用方法:
用户总数:<?php echo $total_member?>
今日注册用户:<?php echo $today_member?>
文章总数:<?php echo $total_hits?>
待审文章总数:<?php echo $total_content_check?>
周涛博客








评论前必须登录!
注册