初始化项目
This commit is contained in:
54
addons/sitestat/Sitestat.php
Normal file
54
addons/sitestat/Sitestat.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | OneThink [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yangweijie <yangweijiester@gmail.com> <code-tech.diandian.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace addons\sitestat;
|
||||
use app\common\controller\Addons;
|
||||
|
||||
/**
|
||||
* 系统环境信息插件
|
||||
* @author thinkphp
|
||||
*/
|
||||
|
||||
class Sitestat extends Addons{
|
||||
|
||||
public $info = array(
|
||||
'name'=>'Sitestat',
|
||||
'title'=>'站点统计信息',
|
||||
'description'=>'统计站点的基础信息',
|
||||
'status'=>1,
|
||||
'author'=>'thinkphp',
|
||||
'version'=>'0.2'
|
||||
);
|
||||
|
||||
public function install(){
|
||||
return true;
|
||||
}
|
||||
|
||||
public function uninstall(){
|
||||
return true;
|
||||
}
|
||||
|
||||
//实现的AdminIndex钩子方法
|
||||
public function AdminIndex($param){
|
||||
$config = $this->getConfig();
|
||||
$this->assign('addons_config', $config);
|
||||
$map['status'] = array('egt',0);
|
||||
$maps['is_read'] = array('eq',0);
|
||||
if($config['display']){
|
||||
$info['users'] = db('Member')->where($map)->count();
|
||||
$info['userall'] = db('Member')->count();
|
||||
$info['action'] = db('ActionLog')->where(array('create_time'=>array('gt',strtotime(date('Y-m-d')))))->count();
|
||||
$info['category'] = db('Category')->count();
|
||||
$info['model'] = db('Model')->count();
|
||||
$this->assign('info',$info);
|
||||
$this->template('index/info');
|
||||
}
|
||||
}
|
||||
}
|
||||
35
addons/sitestat/config.php
Normal file
35
addons/sitestat/config.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | OneThink [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: yangweijie <yangweijiester@gmail.com> <code-tech.diandian.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return array(
|
||||
'title'=>array(//配置在表单中的键名 ,这个会是config[title]
|
||||
'title'=>'显示标题:',//表单的文字
|
||||
'type'=>'text', //表单的类型:text、textarea、checkbox、radio、select等
|
||||
'value'=>'系统信息', //表单的默认值
|
||||
),
|
||||
'width'=>array(
|
||||
'title'=>'显示宽度:',
|
||||
'type'=>'select',
|
||||
'options'=>array(
|
||||
'4'=>'4格',
|
||||
'6'=>'6格',
|
||||
'12'=>'12格',
|
||||
),
|
||||
'value'=>'2'
|
||||
),
|
||||
'display'=>array(
|
||||
'title'=>'是否显示:',
|
||||
'type'=>'radio',
|
||||
'options'=>array(
|
||||
'1'=>'显示',
|
||||
'0'=>'不显示'
|
||||
),
|
||||
'value'=>'1'
|
||||
)
|
||||
);
|
||||
29
addons/sitestat/view/index/info.html
Normal file
29
addons/sitestat/view/index/info.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<div class="col-lg-12">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-sm-6 col-xs-12">
|
||||
<div class="main-box infographic-box colored emerald-bg"> <i class="fa fa-envelope"></i>
|
||||
<span class="headline">今日行为</span>
|
||||
<span class="value">{$info['action']}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-sm-6 col-xs-12">
|
||||
<div class="main-box infographic-box colored green-bg"> <i class="fa fa-money"></i>
|
||||
<span class="headline">栏目总数</span>
|
||||
<span class="value">{$info['category']}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-sm-6 col-xs-12">
|
||||
<div class="main-box infographic-box colored red-bg"> <i class="fa fa-user"></i>
|
||||
<span class="headline">用户总数</span>
|
||||
<span class="value">{$info['users']}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-sm-6 col-xs-12">
|
||||
<div class="main-box infographic-box colored purple-bg">
|
||||
<i class="fa fa-globe"></i>
|
||||
<span class="headline">模型总数</span>
|
||||
<span class="value">{$info['model']}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user