From 1346905e82f3048807b822600f5e0193b5b04196 Mon Sep 17 00:00:00 2001 From: tensent Date: Wed, 25 Mar 2020 21:22:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8F=92=E4=BB=B6=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/devteam/Plugin.php | 45 ++++++++++++++++ addons/devteam/config.php | 36 +++++++++++++ addons/devteam/view/widget.html | 35 ++++++++++++ addons/sitestat/Plugin.php | 53 +++++++++++++++++++ addons/sitestat/config.php | 35 ++++++++++++ addons/sitestat/view/index/info.html | 29 ++++++++++ addons/syslogin/Syslogin.php | 40 ++++++++++++++ addons/syslogin/controller/Admin.php | 19 +++++++ addons/syslogin/controller/Index.php | 18 +++++++ addons/syslogin/view/admin/login.html | 3 ++ addons/syslogin/view/index/login.html | 1 + addons/systeminfo/Plugin.php | 76 +++++++++++++++++++++++++++ addons/systeminfo/config.php | 35 ++++++++++++ addons/systeminfo/view/widget.html | 38 ++++++++++++++ 14 files changed, 463 insertions(+) create mode 100644 addons/devteam/Plugin.php create mode 100644 addons/devteam/config.php create mode 100644 addons/devteam/view/widget.html create mode 100644 addons/sitestat/Plugin.php create mode 100644 addons/sitestat/config.php create mode 100644 addons/sitestat/view/index/info.html create mode 100644 addons/syslogin/Syslogin.php create mode 100644 addons/syslogin/controller/Admin.php create mode 100644 addons/syslogin/controller/Index.php create mode 100644 addons/syslogin/view/admin/login.html create mode 100644 addons/syslogin/view/index/login.html create mode 100644 addons/systeminfo/Plugin.php create mode 100644 addons/systeminfo/config.php create mode 100644 addons/systeminfo/view/widget.html diff --git a/addons/devteam/Plugin.php b/addons/devteam/Plugin.php new file mode 100644 index 00000000..9252a5b8 --- /dev/null +++ b/addons/devteam/Plugin.php @@ -0,0 +1,45 @@ + +// +---------------------------------------------------------------------- + + +namespace addons\devteam; + +/** + * 开发团队信息插件 + * @author thinkphp + */ + +class Plugin extends \sent\Addons{ + + public $info = array( + 'name'=>'Devteam', + 'title'=>'开发团队信息', + 'description'=>'开发团队成员信息', + 'status'=>1, + 'author'=>'molong', + 'version'=>'0.1' + ); + + public function install(){ + return true; + } + + public function uninstall(){ + return true; + } + + //实现的AdminIndex钩子方法 + public function AdminIndex($param){ + $config = $this->getConfig(); + $this->assign('addons_config', $config); + if($config['display']){ + return $this->fetch('widget'); + } + } +} \ No newline at end of file diff --git a/addons/devteam/config.php b/addons/devteam/config.php new file mode 100644 index 00000000..bed2aa73 --- /dev/null +++ b/addons/devteam/config.php @@ -0,0 +1,36 @@ + +// +---------------------------------------------------------------------- + +return array( + 'title'=>array(//配置在表单中的键名 ,这个会是config[title] + 'title'=>'显示标题:',//表单的文字 + 'type'=>'text', //表单的类型:text、textarea、checkbox、radio、select等 + 'value'=>'SentCMS开发团队', //表单的默认值 + ), + 'width'=>array( + 'title'=>'显示宽度:', + 'type'=>'select', + 'options'=>array( + '1'=>'1格', + '2'=>'2格', + '4'=>'4格', + '6'=>'6格' + ), + 'value'=>'6' + ), + 'display'=>array( + 'title'=>'是否显示:', + 'type'=>'radio', + 'options'=>array( + '1'=>'显示', + '0'=>'不显示' + ), + 'value'=>'1' + ) +); diff --git a/addons/devteam/view/widget.html b/addons/devteam/view/widget.html new file mode 100644 index 00000000..2fdcf797 --- /dev/null +++ b/addons/devteam/view/widget.html @@ -0,0 +1,35 @@ +
+
+
+

{$addons_config.title}

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
总策划郭平平
产品设计及研发团队郭平平
界面及用户体验团队BootStrap 团队
官方网址www.tensent.cn
官方QQ群SentCMS技术交流
BUG反馈SentCMS讨论区
+
+
+
\ No newline at end of file diff --git a/addons/sitestat/Plugin.php b/addons/sitestat/Plugin.php new file mode 100644 index 00000000..09877a87 --- /dev/null +++ b/addons/sitestat/Plugin.php @@ -0,0 +1,53 @@ + +// +---------------------------------------------------------------------- +namespace addons\sitestat; + +use \think\facade\Db; + +/** + * 系统环境信息插件 + * @author thinkphp + */ + +class Plugin extends \sent\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::name('Member')->where($map)->count(); + $info['userall'] = Db::name('Member')->count(); + $info['action'] = Db::name('ActionLog')->where(array('create_time'=>array('gt',strtotime(date('Y-m-d')))))->count(); + $info['category'] = Db::name('Category')->count(); + $info['model'] = Db::name('Model')->count(); + $this->assign('info',$info); + return $this->fetch('index/info'); + } + } +} \ No newline at end of file diff --git a/addons/sitestat/config.php b/addons/sitestat/config.php new file mode 100644 index 00000000..4c41ea42 --- /dev/null +++ b/addons/sitestat/config.php @@ -0,0 +1,35 @@ + +// +---------------------------------------------------------------------- + +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' + ) +); diff --git a/addons/sitestat/view/index/info.html b/addons/sitestat/view/index/info.html new file mode 100644 index 00000000..795e14c8 --- /dev/null +++ b/addons/sitestat/view/index/info.html @@ -0,0 +1,29 @@ +
+
+
+
+ 今日行为 + {$info['action']} +
+
+
+
+ 栏目总数 + {$info['category']} +
+
+
+
+ 用户总数 + {$info['users']} +
+
+
+
+ + 模型总数 + {$info['model']} +
+
+
+
\ No newline at end of file diff --git a/addons/syslogin/Syslogin.php b/addons/syslogin/Syslogin.php new file mode 100644 index 00000000..02ff8140 --- /dev/null +++ b/addons/syslogin/Syslogin.php @@ -0,0 +1,40 @@ + +// +---------------------------------------------------------------------- + + +namespace addons\Syslogin; + +/** + * 系统环境信息插件 + * @author thinkphp + */ + +class Syslogin extends Addons{ + + public $info = array( + 'name'=>'Syslogin', + 'title'=>'第三方登录', + 'description'=>'第三方登录', + 'status'=>0, + 'author'=>'molong', + 'version'=>'0.1' + ); + + public function loginBottomAddon(){ + + } + + public function install(){ + return true; + } + + public function uninstall(){ + return true; + } +} \ No newline at end of file diff --git a/addons/syslogin/controller/Admin.php b/addons/syslogin/controller/Admin.php new file mode 100644 index 00000000..9848f7b2 --- /dev/null +++ b/addons/syslogin/controller/Admin.php @@ -0,0 +1,19 @@ + +// +---------------------------------------------------------------------- + +namespace addons\syslogin\controller; +use app\common\controller\Addons; + +class Admin extends Addons{ + + public function setting(){ + $this->setMeta('第三方登录设置'); + $this->template('admin/login'); + } +} diff --git a/addons/syslogin/controller/Index.php b/addons/syslogin/controller/Index.php new file mode 100644 index 00000000..34c72d53 --- /dev/null +++ b/addons/syslogin/controller/Index.php @@ -0,0 +1,18 @@ + +// +---------------------------------------------------------------------- + +namespace addons\syslogin\controller; +use app\common\controller\Addons; + +class Index extends Addons{ + + public function login(){ + $this->template('index/login'); + } +} diff --git a/addons/syslogin/view/admin/login.html b/addons/syslogin/view/admin/login.html new file mode 100644 index 00000000..d6efb672 --- /dev/null +++ b/addons/syslogin/view/admin/login.html @@ -0,0 +1,3 @@ +{extend name="admin@public:base"/} +{block name="body"} +{/block} \ No newline at end of file diff --git a/addons/syslogin/view/index/login.html b/addons/syslogin/view/index/login.html new file mode 100644 index 00000000..62ec5348 --- /dev/null +++ b/addons/syslogin/view/index/login.html @@ -0,0 +1 @@ +登录 \ No newline at end of file diff --git a/addons/systeminfo/Plugin.php b/addons/systeminfo/Plugin.php new file mode 100644 index 00000000..a85b2ce3 --- /dev/null +++ b/addons/systeminfo/Plugin.php @@ -0,0 +1,76 @@ + +// +---------------------------------------------------------------------- + +namespace addons\systeminfo; + +/** + * 系统环境信息插件 + * @author thinkphp + */ + +class Plugin extends \sent\Addons{ + + public $info = array( + 'name' => 'Systeminfo', + 'title' => '系统环境信息', + 'description' => '用于显示一些服务器的信息', + 'status' => 1, + 'author' => 'molong', + 'version' => '0.1', + ); + + public function install() { + return true; + } + + public function uninstall() { + return true; + } + + //实现的AdminIndex钩子方法 + public function AdminIndex($param) { + $config = $this->getConfig(); + + if (false) { +//extension_loaded('curl') + $url = 'http://www.tensent.cn/index.php?m=home&c=version&a=check_version'; + $params = array( + 'version' => ONETHINK_VERSION, + 'domain' => $_SERVER['HTTP_HOST'], + 'auth' => sha1(config('DATA_AUTH_KEY')), + ); + + $vars = http_build_query($params); + $opts = array( + CURLOPT_TIMEOUT => 5, + CURLOPT_RETURNTRANSFER => 1, + CURLOPT_URL => $url, + CURLOPT_POST => 1, + CURLOPT_POSTFIELDS => $vars, + CURLOPT_USERAGENT => $_SERVER['HTTP_USER_AGENT'], + ); + + /* 初始化并执行curl请求 */ + $ch = curl_init(); + curl_setopt_array($ch, $opts); + $data = curl_exec($ch); + $error = curl_error($ch); + curl_close($ch); + } + + if (!empty($data) && strlen($data) < 400) { + $config['new_version'] = $data; + } + + $this->assign('addons_config', $config); + if ($config['display']) { + echo $this->fetch('widget'); + } + } +} \ No newline at end of file diff --git a/addons/systeminfo/config.php b/addons/systeminfo/config.php new file mode 100644 index 00000000..fa5c7f57 --- /dev/null +++ b/addons/systeminfo/config.php @@ -0,0 +1,35 @@ + +// +---------------------------------------------------------------------- + +return array( + 'title'=>array(//配置在表单中的键名 ,这个会是config[title] + 'title'=>'显示标题:',//表单的文字 + 'type'=>'text', //表单的类型:text、textarea、checkbox、radio、select等 + 'value'=>'系统信息', //表单的默认值 + ), + 'width'=>array( + 'title'=>'显示宽度:', + 'type'=>'select', + 'options'=>array( + '3'=>'3格', + '4'=>'4格', + '6'=>'6格' + ), + 'value'=>'6' + ), + 'display'=>array( + 'title'=>'是否显示:', + 'type'=>'radio', + 'options'=>array( + '1'=>'显示', + '0'=>'不显示' + ), + 'value'=>'1' + ) +); diff --git a/addons/systeminfo/view/widget.html b/addons/systeminfo/view/widget.html new file mode 100644 index 00000000..87a1a68b --- /dev/null +++ b/addons/systeminfo/view/widget.html @@ -0,0 +1,38 @@ +
+
+
+

{$addons_config.title}

+
+
+ + + + + + + + + + + + + + + + {php}$system_info_mysql = \think\facade\Db::query("select version() as v;");{/php} + + + + + + + + + + +
核心版本SentCMS v{$Think.SENTCMS_VERSION}
服务器操作系统{$Think.const.PHP_OS}
运行环境{$_SERVER['SERVER_SOFTWARE']}
MYSQL版本{$system_info_mysql.0.v}
上传限制{:ini_get('upload_max_filesize')}
系统版权所有 + 南昌腾速科技有限公司 +
+
+
+
\ No newline at end of file