This commit is contained in:
Gitea
2022-01-24 10:43:35 +08:00
commit 15dfc6576b
786 changed files with 219240 additions and 0 deletions

View File

@@ -0,0 +1,349 @@
<?php
/**
* @copyright (C)2016-2099 Hnaoyun Inc.
* @author XingMeng
* @email hnxsh@foxmail.com
* @date 2017年3月13日
* 默认主页
*/
namespace app\admin\controller;
use core\basic\Controller;
use app\admin\model\IndexModel;
class IndexController extends Controller
{
private $model;
public function __construct()
{
$this->model = new IndexModel();
}
// 登录页面
public function index()
{
if (session('sid')) {
location(url('admin/Index/home'));
}
$this->assign('admin_check_code', $this->config('admin_check_code'));
$this->display('index.html');
}
// 主页面
public function home()
{
// 手动修改数据名称
if (get('action') == 'moddb') {
if ($this->modDB()) {
alert_back('修改成功!');
} else {
alert_back('修改失败!');
}
}
// 删除修改后老数据库(上一步无法直接修改删除)
if (issetSession('deldb')) {
@unlink(ROOT_PATH . session('deldb'));
unset($_SESSION['deldb']);
}
$dbsecurity = true;
// 如果是sqlite数据库并且路径为默认的则标记为不安全
if (get_db_type() == 'sqlite') {
if (strpos($this->config('database.dbname'), 'pbootcms') !== false) {
if (get_user_ip() != '127.0.0.1' && $this->modDB()) { // 非本地测试时尝试自动修改数据库名称
$dbsecurity = true;
} else {
$dbsecurity = false;
}
}
} elseif (file_exists(ROOT_PATH . '/data/pbootcms.db')) {
rename(ROOT_PATH . '/data/pbootcms.db', ROOT_PATH . '/data/' . get_uniqid() . '.db');
}
$this->assign('dbsecurity', $dbsecurity);
if (! session('pwsecurity')) {
location(url('/admin/Index/ucenter'));
}
$this->assign('server', get_server_info());
$this->assign('branch', $this->config('upgrade_branch') == '3.X.dev' ? '3.X.dev' : '3.X');
$this->assign('revise', $this->config('revise_version') ?: '0');
$this->assign('snuser', $this->config('sn_user') ?: '0');
$this->assign('site', get_http_url());
$this->assign('user_info', $this->model->getUserInfo(session('ucode')));
$this->assign('sum_msg', model('admin.content.Message')->getCount());
// 内容模型菜单
$model = model('admin.content.Model');
$models = $model->getModelMenu();
foreach ($models as $key => $value) {
$models[$key]->count = $model->getModelCount($value->mcode)->count;
}
$this->assign('model_msg', $models);
$this->display('system/home.html');
}
// 异步登录验证
public function login()
{
if (! $_POST) {
return;
}
// 在安装了gd库时才执行验证码验证
if (extension_loaded("gd") && $this->config('admin_check_code') && strtolower(post('checkcode', 'var')) != session('checkcode')) {
json(0, '验证码错误!');
}
// 就收数据
$username = post('username');
$password = post('password');
if (! preg_match('/^[\x{4e00}-\x{9fa5}\w\-\.@]+$/u', $username)) {
json(0, '用户名含有不允许的特殊字符!');
}
if (! $username) {
json(0, '用户名不能为空!');
}
if (! $password) {
json(0, '密码不能为空!');
}
if (! ! $time = $this->checkLoginBlack()) {
$this->log('登录锁定!');
json(0, '您登录失败次数太多已被锁定,请' . $time . '秒后再试!');
}
// 执行用户登录
$where = array(
'username' => $username,
'password' => encrypt_string($password)
);
// 判断数据库写入权限
if ((get_db_type() == 'sqlite') && ! is_writable(ROOT_PATH . $this->config('database.dbname'))) {
json(0, '数据库目录写入权限不足!');
}
if (! ! $login = $this->model->login($where)) {
session_regenerate_id(true);
session('sid', encrypt_string(session_id() . $login->id)); // 会话标识
session('M', M);
session('id', $login->id); // 用户id
session('ucode', $login->ucode); // 用户编码
session('username', $login->username); // 用户名
session('realname', $login->realname); // 真实名字
if ($where['password'] != '14e1b600b1fd579f47433b88e8d85291') {
session('pwsecurity', true);
}
session('acodes', $login->acodes); // 用户管理区域
if ($login->acodes) { // 当前显示区域
session('acode', $login->acodes[0]);
} else {
session('acode', '');
}
session('rcodes', $login->rcodes); // 用户角色代码表
session('levels', $login->levels); // 用户权限URL列表
session('menu_tree', $login->menus); // 菜单树
session('area_map', $login->area_map); // 区域代码名称映射表
session('area_tree', $login->area_tree); // 用户区域树
$this->log('登录成功!');
json(1, url('admin/Index/home'));
} else {
$this->setLoginBlack();
$this->log('登录失败!');
session('checkcode', mt_rand(10000, 99999)); // 登录失败,随机打乱原有验证码
json(0, '用户名或密码错误!');
}
}
// 退出登录
public function loginOut()
{
session_unset();
location(url('/admin/Index/index'));
}
// 用户中心,修改密码
public function ucenter()
{
if ($_POST) {
$username = post('username'); // 用户名
$realname = post('realname'); // 真实姓名
$cpassword = post('cpassword'); // 现在密码
$password = post('password'); // 新密码
$rpassword = post('rpassword'); // 确认密码
if (! $username) {
alert_back('用户名不能为空!');
}
if (! $cpassword) {
alert_back('当前密码不能为空!');
}
if (! preg_match('/^[\x{4e00}-\x{9fa5}\w\-\.@]+$/u', $username)) {
alert_back('用户名含有不允许的特殊字符!');
}
$data = array(
'username' => $username,
'realname' => $realname,
'update_user' => $username
);
// 如果有修改密码,则添加数据
if ($password) {
if ($password != $rpassword) {
alert_back('确认密码不正确!');
}
$data['password'] = encrypt_string($password);
if ($data['password'] != '14e1b600b1fd579f47433b88e8d85291') {
session('pwsecurity', true);
} else {
session('pwsecurity', false);
}
}
// 检查现有密码
if ($this->model->checkUserPwd(encrypt_string($cpassword))) {
if ($this->model->modUserInfo($data)) {
session('username', post('username'));
session('realname', post('realname'));
$this->log('用户资料成功!');
success('用户资料修改成功!', - 1);
}
} else {
$this->log('用户资料修改时当前密码错误!');
alert_location('当前密码错误!', - 1);
}
}
$this->display('system/ucenter.html');
}
// 切换显示的数据区域
public function area()
{
if ($_POST) {
$acode = post('acode');
if (in_array($acode, session('acodes'))) {
session('acode', $acode);
cookie('lg', $acode); // 同步切换前台语言
}
location(url('admin/Index/home'));
}
}
// 清理缓存
public function clearCache()
{
if (get('delall')) {
$rs = path_delete(RUN_PATH);
} else {
$rs = (path_delete(RUN_PATH . '/cache') && path_delete(RUN_PATH . '/complile') && path_delete(RUN_PATH . '/config') && path_delete(RUN_PATH . '/upgrade') && path_delete(RUN_PATH . '/image'));
}
if ($rs) {
if (extension_loaded('Zend OPcache')) {
opcache_reset(); // 在启用了OPcache加速器时同时清理
}
$this->log('清理缓存成功!');
alert_back('清理缓存成功!');
} else {
$this->log('清理缓存失败!');
alert_back('清理缓存失败!');
}
}
// 文件上传方法
public function upload()
{
$upload = upload('upload');
if (is_array($upload)) {
json(1, $upload);
} else {
json(0, $upload);
}
}
// 检查是否在黑名单
private function checkLoginBlack()
{
// 读取黑名单
$ip_black = RUN_PATH . '/data/' . md5('login_black') . '.php';
if (file_exists($ip_black)) {
$data = require $ip_black;
$user_ip = get_user_ip();
$lock_time = $this->config('lock_time') ?: 900;
$lock_count = $this->config('lock_count') ?: 5;
if (isset($data[$user_ip]) && $data[$user_ip]['count'] >= $lock_count && time() - $data[$user_ip]['time'] < $lock_time) {
return $lock_time - (time() - $data[$user_ip]['time']); // 返回剩余秒数
}
}
return false;
}
// 添加登录黑名单
private function setLoginBlack()
{
// 读取黑名单
$ip_black = RUN_PATH . '/data/' . md5('login_black') . '.php';
if (file_exists($ip_black)) {
$data = require $ip_black;
} else {
$data = array();
}
// 添加IP
$user_ip = get_user_ip();
$lock_time = $this->config('lock_time') ?: 900;
$lock_count = $this->config('lock_count') ?: 5;
if (isset($data[$user_ip]) && $data[$user_ip]['count'] < $lock_count && time() - $data[$user_ip]['time'] < $lock_time) {
$data[$user_ip] = array(
'time' => time(),
'count' => $data[get_user_ip()]['count'] + 1
);
} else {
$data[$user_ip] = array(
'time' => time(),
'count' => 1
);
}
// 写入黑名单
check_file($ip_black, true);
return file_put_contents($ip_black, "<?php\nreturn " . var_export($data, true) . ";");
}
// 修改数据库名称
private function modDB()
{
$file = CONF_PATH . '/database.php';
$sname = $this->config('database.dbname');
$dname = '/data/' . get_uniqid() . '.db';
$sconfig = file_get_contents($file);
$dconfig = str_replace($sname, $dname, $sconfig);
if (file_put_contents($file, $dconfig)) {
if (! copy(ROOT_PATH . $sname, ROOT_PATH . $dname)) {
file_put_contents($file, $sconfig); // 回滚配置
} else {
session('deldb', $sname);
return true;
}
}
return false;
}
}

View File

@@ -0,0 +1,557 @@
<?php
/**
* @copyright (C)2016-2099 Hnaoyun Inc.
* @author XingMeng
* @email hnxsh@foxmail.com
* @date 2017年12月26日
* 内容栏目控制器
*/
namespace app\admin\controller\content;
use core\basic\Controller;
use app\admin\model\content\ContentSortModel;
class ContentSortController extends Controller
{
private $count;
private $blank;
private $outData = array();
private $model;
public function __construct()
{
$this->model = new ContentSortModel();
}
// 内容栏目列表
public function index()
{
$this->assign('list', true);
$tree = $this->model->getList();
$sorts = $this->makeSortList($tree);
$this->assign('sorts', $sorts);
// 内容模型
$models = model('admin.content.Model');
$this->assign('allmodels', $models->getSelectAll());
$this->assign('models', $models->getSelect());
// 内容栏目下拉表
$sort_tree = $this->model->getSelect();
$sort_select = $this->makeSortSelect($sort_tree);
$this->assign('sort_select', $sort_select);
// 模板文件
$htmldir = $this->config('tpl_html_dir') ? '/' . $this->config('tpl_html_dir') : '';
$this->assign('tpls', file_list(ROOT_PATH . current($this->config('tpl_dir')) . '/' . $this->model->getTheme() . $htmldir));
// 前端地址连接符判断
$url_break_char = $this->config('url_break_char') ?: '_';
$this->assign('url_break_char', $url_break_char);
// 获取会员分组
$this->assign('groups', model('admin.member.MemberGroup')->getSelect());
$this->display('content/contentsort.html');
}
// 生成无限级内容栏目列表
private function makeSortList($tree)
{
// 循环生成
foreach ($tree as $value) {
$this->count ++;
$this->outData[$this->count] = new \stdClass();
$this->outData[$this->count]->id = $value->id;
$this->outData[$this->count]->blank = $this->blank;
$this->outData[$this->count]->name = $value->name;
$this->outData[$this->count]->subname = $value->subname;
$this->outData[$this->count]->scode = $value->scode;
$this->outData[$this->count]->pcode = $value->pcode;
$this->outData[$this->count]->mcode = $value->mcode;
$this->outData[$this->count]->listtpl = $value->listtpl;
$this->outData[$this->count]->contenttpl = $value->contenttpl;
$this->outData[$this->count]->ico = $value->ico;
$this->outData[$this->count]->pic = $value->pic;
$this->outData[$this->count]->keywords = $value->keywords;
$this->outData[$this->count]->description = $value->description;
$this->outData[$this->count]->outlink = $value->outlink;
$this->outData[$this->count]->sorting = $value->sorting;
$this->outData[$this->count]->status = $value->status;
$this->outData[$this->count]->filename = $value->filename;
$this->outData[$this->count]->type = $value->type;
$this->outData[$this->count]->urlname = $value->urlname;
$this->outData[$this->count]->create_user = $value->create_user;
$this->outData[$this->count]->update_user = $value->update_user;
$this->outData[$this->count]->create_time = $value->create_time;
$this->outData[$this->count]->update_time = $value->update_time;
if ($value->son) {
$this->outData[$this->count]->son = true;
} else {
$this->outData[$this->count]->son = false;
}
// 子菜单处理
if ($value->son) {
$this->blank .= '  ';
$this->makeSortList($value->son);
}
}
// 循环完后回归缩进位置
$this->blank = substr($this->blank, 6);
return $this->outData;
}
// 内容栏目增加
public function add()
{
if ($_POST) {
if (! ! $multiplename = post('multiplename')) {
$multiplename = str_replace('', ',', $multiplename);
$pcode = post('pcode', 'var');
$type = post('type');
$mcode = post('mcode');
$listtpl = basename(post('listtpl'));
$contenttpl = basename(post('contenttpl'));
$status = post('status');
if (! $pcode) { // 父编码默认为0
$pcode = 0;
}
if (! $mcode) {
alert_back('栏目模型必须选择!');
}
if (! $type) {
alert_back('栏目类型不能为空!');
}
$names = explode(',', $multiplename);
$lastcode = $this->model->getLastCode();
$scode = get_auto_code($lastcode);
foreach ($names as $key => $value) {
$data[] = array(
'acode' => session('acode'),
'pcode' => $pcode,
'scode' => $scode,
'name' => $value,
'mcode' => $mcode,
'listtpl' => $listtpl,
'contenttpl' => $contenttpl,
'status' => $status,
'gid' => 0,
'gtype' => 4,
'subname' => '',
'filename' => '',
'outlink' => '',
'ico' => '',
'pic' => '',
'title' => '',
'keywords' => '',
'description' => '',
'sorting' => 255,
'create_user' => session('username'),
'update_user' => session('username')
);
$scode = get_auto_code($scode);
}
} else {
// 获取数据
$scode = get_auto_code($this->model->getLastCode()); // 自动编码;
$pcode = post('pcode', 'var');
$name = post('name');
$type = post('type');
$mcode = post('mcode');
$listtpl = basename(post('listtpl'));
$contenttpl = basename(post('contenttpl'));
$status = post('status');
$subname = post('subname');
$filename = post('filename');
$outlink = post('outlink');
$ico = post('ico');
$pic = post('pic');
$title = post('title');
$keywords = post('keywords');
$description = post('description');
$gid = post('gid', 'int') ?: 0;
$gtype = post('gtype', 'int') ?: 4;
$gnote = post('gnote');
$def1 = post('def1');
$def2 = post('def2');
$def3 = post('def3');
if (! $scode) {
alert_back('编码不能为空!');
}
if (! $pcode) { // 父编码默认为0
$pcode = 0;
}
if (! $name) {
alert_back('栏目名不能为空!');
}
if (! $mcode) {
alert_back('栏目模型必须选择!');
}
if (! $type) {
alert_back('栏目类型不能为空!');
}
if ($filename && ! preg_match('/^[a-zA-Z0-9\-]+$/', $filename)) {
alert_back('URL名称只允许字母、数字、横线组成!');
}
if ($filename && $this->model->checkUrlname($filename)) {
alert_back('URL名称与模型URL名称冲突请换一个名称');
}
// 缩放缩略图
if ($ico) {
resize_img(ROOT_PATH . $ico, '', $this->config('ico.max_width'), $this->config('ico.max_height'));
}
// 检查编码
if ($this->model->checkSort("scode='$scode'")) {
alert_back('该内容栏目编号已经存在,不能再使用!');
}
// 检查自定义URL名称
if ($filename) {
while ($this->model->checkFilename($filename)) {
$filename = $filename . '_' . mt_rand(1, 20);
}
}
// 构建数据
$data = array(
'acode' => session('acode'),
'pcode' => $pcode,
'scode' => $scode,
'name' => $name,
'mcode' => $mcode,
'listtpl' => $listtpl,
'contenttpl' => $contenttpl,
'status' => $status,
'gid' => $gid,
'gtype' => $gtype,
'gnote' => $gnote,
'subname' => $subname,
'def1' => $def1,
'def2' => $def2,
'def3' => $def3,
'filename' => $filename,
'outlink' => $outlink,
'ico' => $ico,
'pic' => $pic,
'title' => $title,
'keywords' => $keywords,
'description' => $description,
'sorting' => 255,
'create_user' => session('username'),
'update_user' => session('username')
);
}
// 执行添加
if ($this->model->addSort($data)) {
if ($type == 1 && ! $outlink) { // 在填写了外链时不生成单页
if ($multiplename) {
foreach ($data as $key => $value) {
$this->addSingle($value['scode'], $value['name']);
}
} else {
$this->addSingle($scode, $name);
}
}
$this->log('新增数据内容栏目' . $scode . '成功!');
success('新增成功!', url('/admin/ContentSort/index'));
} else {
$this->log('新增数据内容栏目' . $scode . '失败!');
error('新增失败!', - 1);
}
}
}
// 生成内容栏目下拉选择
private function makeSortSelect($tree, $selectid = null)
{
$list_html = '';
foreach ($tree as $value) {
// 默认选择项
if ($selectid == $value->scode) {
$select = "selected='selected'";
} else {
$select = '';
}
if (get('scode') != $value->scode) { // 不显示本身,避免出现自身为自己的父节点
$list_html .= "<option value='{$value->scode}' $select>{$this->blank}{$value->name}</option>";
}
// 子菜单处理
if ($value->son) {
$this->blank .= '  ';
$list_html .= $this->makeSortSelect($value->son, $selectid);
}
}
// 循环完后回归位置
$this->blank = substr($this->blank, 0, - 6);
return $list_html;
}
// 内容栏目删除
public function del()
{
// 执行批量删除
if ($_POST) {
if (! ! $list = post('list')) {
if ($this->model->delSortList($list)) {
$this->log('批量删除栏目成功!');
success('批量删除成功!', - 1);
} else {
$this->log('批量删除栏目失败!');
error('批量删除失败!', - 1);
}
} else {
alert_back('请选择要删除的栏目!');
}
}
if (! $scode = get('scode', 'var')) {
error('传递的参数值错误!', - 1);
}
if ($this->model->delSort($scode)) {
$this->log('删除数据内容栏目' . $scode . '成功!');
success('删除成功!', - 1);
} else {
$this->log('删除数据内容栏目' . $scode . '失败!');
error('删除失败!', - 1);
}
}
// 内容栏目修改
public function mod()
{
if (! ! $submit = post('submit')) {
switch ($submit) {
case 'sorting': // 修改列表排序
$listall = post('listall');
if ($listall) {
$sorting = post('sorting');
foreach ($listall as $key => $value) {
if ($sorting[$key] === '' || ! is_numeric($sorting[$key]))
$sorting[$key] = 255;
$this->model->modSortSorting($value, "sorting=" . $sorting[$key]);
}
$this->log('批量修改栏目排序成功!');
success('修改成功!', - 1);
} else {
alert_back('排序失败,无任何内容!');
}
break;
}
}
if (! $scode = get('scode', 'var')) {
error('传递的参数值错误!', - 1);
}
// 单独修改状态
if (($field = get('field', 'var')) && ! is_null($value = get('value', 'var'))) {
if ($this->model->modSort($scode, "$field='$value',update_user='" . session('username') . "'")) {
$this->log('修改数据内容栏目' . $scode . '状态' . $value . '成功!');
location(- 1);
} else {
$this->log('修改数据内容栏目' . $scode . '状态' . $value . '失败!');
alert_back('修改失败!');
}
}
// 修改操作
if ($_POST) {
// 获取数据
$pcode = post('pcode', 'var');
$name = post('name');
$mcode = post('mcode');
$type = post('type');
$listtpl = basename(post('listtpl'));
$contenttpl = basename(post('contenttpl'));
$status = post('status');
$subname = post('subname');
$filename = post('filename');
$outlink = post('outlink');
$ico = post('ico');
$pic = post('pic');
$title = post('title');
$keywords = post('keywords');
$description = post('description');
$modsub = post('modsub', 'int');
$gid = post('gid', 'int') ?: 0;
$gtype = post('gtype', 'int') ?: 4;
$gnote = post('gnote');
$def1 = post('def1');
$def2 = post('def2');
$def3 = post('def3');
if (! $pcode) { // 父编码默认为0
$pcode = 0;
}
if (! $name) {
alert_back('栏目名不能为空!');
}
if (! $mcode) {
alert_back('栏目模型必须选择!');
}
if (! $type) {
alert_back('栏目类型不能为空!');
}
if ($filename && ! preg_match('/^[a-zA-Z0-9\-]+$/', $filename)) {
alert_back('URL名称只允许字母、数字、横线组成!');
}
if ($filename && $this->model->checkUrlname($filename)) {
alert_back('URL名称与模型URL名称冲突请换一个名称');
}
// 缩放缩略图
if ($ico) {
resize_img(ROOT_PATH . $ico, '', $this->config('ico.max_width'), $this->config('ico.max_height'));
}
if ($filename) {
while ($this->model->checkFilename($filename, "scode<>'$scode'")) {
$filename = $filename . '-' . mt_rand(1, 20);
}
}
// 构建数据
$data = array(
'pcode' => $pcode,
'name' => $name,
'mcode' => $mcode,
'listtpl' => $listtpl,
'contenttpl' => $contenttpl,
'status' => $status,
'gid' => $gid,
'gtype' => $gtype,
'gnote' => $gnote,
'subname' => $subname,
'def1' => $def1,
'def2' => $def2,
'def3' => $def3,
'filename' => $filename,
'outlink' => $outlink,
'ico' => $ico,
'pic' => $pic,
'title' => $title,
'keywords' => $keywords,
'description' => $description,
'update_user' => session('username')
);
// 执行添加
if ($this->model->modSort($scode, $data, $modsub)) {
// 如果修改为单页并且跳转,则删除单页内容,否则判断是否存在内容,不存在则添加
if ($type == 1 && $outlink) {
$this->model->delContent($scode);
} elseif ($type == 1 && ! $this->model->findContent($scode)) {
$this->addSingle($scode, $name);
}
$this->log('修改数据内容栏目' . $scode . '成功!');
success('修改成功!', url('/admin/ContentSort/index'));
} else {
location(- 1);
}
} else { // 调取修改内容
$this->assign('mod', true);
$sort = $this->model->getSort($scode);
if (! $sort) {
error('编辑的内容已经不存在!', - 1);
}
$this->assign('sort', $sort);
// 父编码下拉选择
$sort_tree = $this->model->getSelect();
$sort_select = $this->makeSortSelect($sort_tree, $sort->pcode);
$this->assign('sort_select', $sort_select);
// 模板文件
$htmldir = $this->config('tpl_html_dir') ? '/' . $this->config('tpl_html_dir') : '';
$this->assign('tpls', file_list(ROOT_PATH . current($this->config('tpl_dir')) . '/' . $this->model->getTheme() . $htmldir));
// 内容模型
$models = model('admin.content.Model');
$this->assign('models', $models->getSelect());
// 获取会员分组
$this->assign('groups', model('admin.member.MemberGroup')->getSelect());
$this->display('content/contentsort.html');
}
}
// 添加栏目时执行单页内容增加
public function addSingle($scode, $title)
{
// 构建数据
$data = array(
'acode' => session('acode'),
'scode' => $scode,
'subscode' => '',
'title' => $title,
'titlecolor' => '#333333',
'subtitle' => '',
'filename' => '',
'author' => session('realname'),
'source' => '本站',
'outlink' => '',
'date' => date('Y-m-d H:i:s'),
'ico' => '',
'pics' => '',
'content' => '',
'tags' => '',
'enclosure' => '',
'keywords' => '',
'description' => '',
'sorting' => 255,
'status' => 1,
'istop' => 0,
'isrecommend' => 0,
'isheadline' => 0,
'gid' => 0,
'gtype' => 4,
'gnote' => '',
'visits' => 0,
'likes' => 0,
'oppose' => 0,
'create_user' => session('username'),
'update_user' => session('username')
);
// 执行添加
if ($this->model->addSingle($data)) {
return true;
} else {
return false;
}
}
}

View File

@@ -0,0 +1,259 @@
<?php
/**
* @copyright (C)2016-2099 Hnaoyun Inc.
* @author XingMeng
* @email hnxsh@foxmail.com
* @date 2017年12月15日
* 单页内容控制器
*/
namespace app\admin\controller\content;
use core\basic\Controller;
use app\admin\model\content\SingleModel;
class SingleController extends Controller
{
private $model;
private $blank;
public function __construct()
{
$this->model = new SingleModel();
}
// 单页内容列表
public function index()
{
if ((! ! $id = get('id', 'int')) && $result = $this->model->getSingle($id)) {
$this->assign('more', true);
$this->assign('content', $result);
} else {
$this->assign('list', true);
if (! $mcode = get('mcode', 'var')) {
error('传递的模型编码参数有误,请核对后重试!');
}
if (! ! ($field = get('field', 'var')) && ! ! ($keyword = get('keyword', 'vars'))) {
$result = $this->model->findSingle($mcode, $field, $keyword);
} else {
$result = $this->model->getList($mcode);
}
$this->assign('baidu_zz_token', $this->config('baidu_zz_token'));
$this->assign('baidu_ks_token', $this->config('baidu_ks_token'));
// 模型名称
$this->assign('model_name', model('admin.content.Model')->getName($mcode));
// 前端地址连接符判断
$url_break_char = $this->config('url_break_char') ?: '_';
$this->assign('url_break_char', $url_break_char);
$this->assign('contents', $result);
}
$this->display('content/single.html');
}
// 单页内容删除
public function del()
{
if (! $id = get('id', 'int')) {
error('传递的参数值错误!', - 1);
}
if ($this->model->delSingle($id)) {
$this->log('删除单页内容' . $id . '成功!');
success('删除成功!', - 1);
} else {
$this->log('删除单页内容' . $id . '失败!');
error('删除失败!', - 1);
}
}
// 单页内容修改
public function mod()
{
// 前端地址连接符判断
if (get('baiduzz') || get('baiduxzh')) {
$url_break_char = $this->config('url_break_char') ?: '_';
$url_rule_sort_suffix = $this->config('url_rule_sort_suffix') ? true : false;
}
// 站长普通推送
if (! ! $id = get('baiduzz')) {
$domain = get_http_url();
if (! $token = $this->config('baidu_zz_token')) {
alert_back('请先到系统配置中填写百度普通收录推送token值');
}
$api = "http://data.zz.baidu.com/urls?site=$domain&token=$token";
$data = $this->model->getSingle($id);
$data->urlname = $data->urlname ?: 'about';
if ($data->outlink) {
alert_back('链接类型不允许推送!');
}
if ($data->filename) {
$urls[] = $domain . homeurl('/home/Index/' . $data->filename, $url_rule_sort_suffix);
} else {
$urls[] = $domain . homeurl('/home/Index/' . $data->urlname . $url_break_char . $data->scode, $url_rule_sort_suffix);
}
$result = post_baidu($api, $urls);
if (isset($result->error)) {
$this->log('百度普通收录推送失败:' . $urls[0]);
alert_back('推送发生错误:' . $result->message);
} elseif (isset($result->success)) {
$this->log('百度普通收录推送成功:' . $urls[0]);
alert_back('成功推送' . $result->success . '条,今天剩余可推送' . $result->remain . '条数!');
} else {
alert_back('发生未知错误!');
}
}
// 站长快速推送
if (! ! $id = get('baiduks')) {
$domain = get_http_url();
if (! $token = $this->config('baidu_ks_token')) {
alert_back('请先到系统配置中填写百度快速收录推送token值');
}
$api = "http://data.zz.baidu.com/urls?site=$domain&token=$token&type=daily";
$data = $this->model->getSingle($id);
$data->urlname = $data->urlname ?: 'about';
if ($data->outlink) {
alert_back('链接类型不允许推送!');
}
if ($data->filename) {
$urls[] = $domain . homeurl('/home/Index/' . $data->filename, $url_rule_sort_suffix);
} else {
$urls[] = $domain . homeurl('/home/Index/' . $data->urlname . $url_break_char . $data->scode, $url_rule_sort_suffix);
}
$result = post_baidu($api, $urls);
if (isset($result->error)) {
$this->log('百度快速收录推送失败:' . $urls[0]);
alert_back('推送发生错误:' . $result->message);
} elseif (isset($result->success_daily)) {
$this->log('百度快速收录推送成功:' . $urls[0]);
alert_back('成功推送' . $result->success_daily . '条,今天剩余可推送' . $result->remain_daily . '条数!');
} else {
alert_back('发生未知错误!');
}
}
if (! $id = get('id', 'int')) {
error('传递的参数值错误!', - 1);
}
// 单独修改状态
if (($field = get('field', 'var')) && ! is_null($value = get('value', 'var'))) {
if ($this->model->modSingle($id, "$field='$value',update_user='" . session('username') . "'")) {
location(- 1);
} else {
alert_back('修改失败!');
}
}
// 修改操作
if ($_POST) {
// 获取数据
$title = post('title');
$author = post('author');
$source = post('source');
$ico = post('ico');
$pics = post('pics');
$content = post('content');
$tags = str_replace('', ',', post('tags'));
$titlecolor = post('titlecolor');
$subtitle = post('subtitle');
$outlink = post('outlink');
$date = post('date');
$enclosure = post('enclosure');
$keywords = post('keywords');
$description = post('description');
$status = post('status', 'int');
if (! $title) {
alert_back('单页内容标题不能为空!');
}
// 自动提起前一百个字符为描述
if (! $description && isset($_POST['content'])) {
$description = escape_string(clear_html_blank(substr_both(strip_tags($_POST['content']), 0, 150)));
}
// 缩放缩略图
if ($ico) {
resize_img(ROOT_PATH . $ico, '', $this->config('ico.max_width'), $this->config('ico.max_height'));
}
// 构建数据
$data = array(
'title' => $title,
'content' => $content,
'tags' => $tags,
'author' => $author,
'source' => $source,
'ico' => $ico,
'pics' => $pics,
'titlecolor' => $titlecolor,
'subtitle' => $subtitle,
'outlink' => $outlink,
'date' => $date,
'enclosure' => $enclosure,
'keywords' => $keywords,
'description' => clear_html_blank($description),
'status' => $status,
'update_user' => session('username')
);
// 执行添加
if ($this->model->modSingle($id, $data)) {
// 扩展内容修改
foreach ($_POST as $key => $value) {
if (preg_match('/^ext_[\w\-]+$/', $key)) {
$temp = post($key);
if (is_array($temp)) {
$data2[$key] = implode(',', $temp);
} else {
$data2[$key] = str_replace("\r\n", '<br>', $temp);
}
}
}
if (isset($data2)) {
if ($this->model->findContentExt($id)) {
$this->model->modContentExt($id, $data2);
} else {
$data2['contentid'] = $id;
$this->model->addContentExt($data2);
}
}
$this->log('修改单页内容' . $id . '成功!');
if (! ! $backurl = get('backurl')) {
success('修改成功!', base64_decode($backurl));
} else {
success('修改成功!', url('/admin/Single/index/mcode/1'));
}
} else {
location(- 1);
}
} else {
// 调取修改内容
$this->assign('mod', true);
if (! $result = $this->model->getSingle($id)) {
error('编辑的内容已经不存在!', - 1);
}
$this->assign('content', $result);
// 扩展字段
if (! $mcode = get('mcode', 'var')) {
error('传递的模型编码参数有误,请核对后重试!');
}
$this->assign('extfield', model('admin.content.ExtField')->getModelField($mcode));
$this->display('content/single.html');
}
}
}

View File

@@ -0,0 +1,132 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="renderer" content="webkit">
<title>网站管理中心-V{APP_VERSION}-{RELEASE_TIME}</title>
<link rel="shortcut icon" href="{SITE_DIR}/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="{APP_THEME_DIR}/layui/css/layui.css?v=v2.5.4">
<link rel="stylesheet" href="{APP_THEME_DIR}/font-awesome/css/font-awesome.min.css?v=v4.7.0" type="text/css">
<link rel="stylesheet" href="{APP_THEME_DIR}/css/comm.css?v=v3.0.6">
<link href="{APP_THEME_DIR}/css/jquery.treetable.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{APP_THEME_DIR}/js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="{APP_THEME_DIR}/js/jquery.treetable.js"></script>
</head>
<body class="layui-layout-body">
<!--定义部分地址方便JS调用-->
<div style="display: none">
<span id="controller" data-controller="{C}"></span>
<span id="url" data-url="{URL}"></span>
<span id="preurl" data-preurl="{fun=url('/admin',false)}"></span>
<span id="sitedir" data-sitedir="{SITE_DIR}"></span>
<span id="mcode" data-mcode="{$get.mcode}"></span>
</div>
<div class="layui-layout layui-layout-admin">
<div class="layui-header">
<div class="layui-logo">
<a href="{url./admin/Index/home}">
后台管理中心
{if(LICENSE==3)}
<span class="layui-badge">SVIP</span>
{else}
<span class="layui-badge layui-bg-gray">V{APP_VERSION}</span>
{/if}
</a>
</div>
<ul class="menu">
<li class="menu-ico" title="显示或隐藏侧边栏"><i class="fa fa-bars" aria-hidden="true"></i></li>
</ul>
{if(![$one_area])}
<form method="post" action="{url./admin/Index/area}" class="area-select">
<input type="hidden" name="formcheck" value="{$formcheck}" >
<div class="layui-col-xs8">
<select name="acode">
{$area_html}
</select>
</div>
<div class="layui-col-xs4">
<button type="submit" class="layui-btn layui-btn-sm">切换</button>
</div>
</form>
{/if}
<ul class="layui-nav layui-layout-right">
<li class="layui-nav-item layui-hide-xs">
<a href="{SITE_DIR}/" target="_blank"><i class="fa fa-home" aria-hidden="true"></i> 网站主页</a>
</li>
<li class="layui-nav-item layui-hide-xs">
<a href="{url./admin/Index/clearCache}"><i class="fa fa-trash-o" aria-hidden="true"></i> 清理缓存</a>
</li>
<li class="layui-nav-item layui-hide-xs">
<a href="javascript:;">
<i class="fa fa-user-circle-o" aria-hidden="true"></i> {$session.realname}
</a>
<dl class="layui-nav-child">
<dd><a href="{url./admin/Index/ucenter}"><i class="fa fa-address-card-o" aria-hidden="true"></i> 资料修改</a></dd>
<dd><a href="{url./admin/Index/loginOut}"><i class="fa fa-sign-out" aria-hidden="true"></i> 退出登录</a></dd>
</dl>
</li>
</ul>
</div>
<div class="layui-side layui-bg-black">
<div class="layui-side-scroll">
<!-- 左侧导航区域可配合layui已有的垂直导航 -->
<ul class="layui-nav layui-nav-tree" id="nav" lay-shrink="all">
{foreach $menu_tree(key,value)}
<li class="layui-nav-item nav-item {if([$primary_menu_url]==$value->url)}layui-nav-itemed{/if}">
<a class="" href="javascript:;"><i class="fa [value->ico]" aria-hidden="true"></i>[value->name]</a>
<dl class="layui-nav-child">
{if($value->mcode=='M130')}
{foreach $menu_models(key3,value3,num3)}
{if($value3->type==1)}
<dd><a href="{url./admin/Single/index/mcode/'.$value3->mcode.'}"><i class="fa fa-file-text-o" aria-hidden="true"></i>[value3->name]内容</a></dd>
{/if}
{if($value3->type==2)}
<dd><a href="{url./admin/Content/index/mcode/'.$value3->mcode.'}"><i class="fa fa-file-text-o" aria-hidden="true"></i>[value3->name]内容</a></dd>
{/if}
{/foreach}
{else}
{foreach $value->son(key2,value2,num2)}
{if(!isset($value2->status)|| $value2->status==1)}
<dd><a href="{url.'.$value2->url.'}"><i class="fa [value2->ico]" aria-hidden="true"></i>[value2->name]</a></dd>
{/if}
{/foreach}
{if($value->mcode=='M101' && session('ucode')==10001)}
<dd><a href="{url./admin/Upgrade/index}"><i class="fa fa-cloud-upload" aria-hidden="true"></i>在线更新</a></dd>
{/if}
{/if}
</dl>
</li>
{/foreach}
<li style="height:1px;background:#666" class="layui-hide-sm"></li>
<li class="layui-nav-item layui-hide-sm">
<a href="{SITE_DIR}/" target="_blank"><i class="fa fa-home" aria-hidden="true"></i> 网站主页</a>
</li>
<li class="layui-nav-item layui-hide-sm">
<a href="{url./admin/Index/ucenter}"><i class="fa fa-address-card-o" aria-hidden="true"></i> 资料修改</a>
</li>
<li class="layui-nav-item layui-hide-sm">
<a href="{url./admin/Index/clearCache}"><i class="fa fa-trash-o" aria-hidden="true"></i> 清理缓存</a>
</li>
<li class="layui-nav-item layui-hide-sm">
<a href="{url./admin/Index/loginOut}"><i class="fa fa-sign-out" aria-hidden="true"></i> 退出登录</a>
</li>
</ul>
</div>
</div>

View File

@@ -0,0 +1,102 @@
{include file='common/head.html'}
<div class="layui-body">
<div class="layui-tab layui-tab-brief" lay-filter="tab">
<ul class="layui-tab-title">
<li class="layui-this">公司信息</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<form action="{url./admin/Company/mod}" method="post">
<input type="hidden" name="formcheck" value="{$formcheck}" >
<div class="layui-form-item">
<label class="layui-form-label">公司名称</label>
<div class="layui-input-block">
<input type="text" name="name" value="{$companys->name}" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">公司地址</label>
<div class="layui-input-block">
<input type="text" name="address" value="{$companys->address}" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">联系人</label>
<div class="layui-input-block">
<input type="text" name="contact" value="{$companys->contact}" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">手机号码</label>
<div class="layui-input-block">
<input type="text" name="mobile" value="{$companys->mobile}" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">电话号码</label>
<div class="layui-input-block">
<input type="text" name="phone" value="{$companys->phone}" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">传真号码</label>
<div class="layui-input-block">
<input type="text" name="fax" value="{$companys->fax}" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">电子邮箱</label>
<div class="layui-input-block">
<input type="text" name="email" value="{$companys->email}" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">QQ号码</label>
<div class="layui-input-block">
<input type="text" name="qq" value="{$companys->qq}" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">微信图标</label>
<div class="layui-input-inline">
<input type="text" name="weixin" id="weixin" value="{$companys->weixin}" placeholder="" class="layui-input">
</div>
<button type="button" class="layui-btn upload" data-des="weixin">
<i class="layui-icon">&#xe67c;</i>上传图片
</button>
<div id="weixin_box" class="pic"><dl><dt>{if(@[$companys->weixin])}<img src="{SITE_DIR}{$companys->weixin}" data-url="{$companys->weixin}"></dt><dd>删除</dd></dl>{/if}</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">其它信息</label>
<div class="layui-input-block">
<input type="text" name="other" value="{$companys->other}" placeholder="" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit>立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{include file='common/foot.html'}

View File

@@ -0,0 +1,425 @@
{include file='common/head.html'}
<div class="layui-body">
{if([$list])}
<div class="layui-tab layui-tab-brief" lay-filter="tab">
<ul class="layui-tab-title">
<li class="layui-this" lay-id="t1">{$model_name}内容</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<form action="{url./admin/Single/index/mcode/'.get('mcode').'}" method="get" class="layui-form">
<div class="layui-form-item nospace">
<div class="layui-input-inline">
{$pathinfo}
<select name="field" class="form-control input-sm" style="width:auto;">
<option value="b.name" {if(get('field')=='b.name')}selected="selected" {/if}>栏目名称</option>
<option value="a.title" {if(get('field')=='a.title')}selected="selected" {/if} >文章标题</option>
<option value="a.content" {if(get('field')=='a.content')}selected="selected" {/if}>文章内容</option>
</select>
</div>
<div class="layui-input-inline">
<input type="text" name="keyword" value="{$get.keyword}" placeholder="请输入搜索关键字" class="layui-input">
</div>
<div class="layui-input-inline">
<button class="layui-btn" lay-submit>搜索</button>
<a class="layui-btn layui-btn-primary" href="{url./admin/Single/index/mcode/'.get('mcode').'}">清除搜索</a>
</div>
</div>
</form>
<table class="layui-table">
<thead>
<tr>
<th>ID</th>
<th>栏目</th>
<th>标题</th>
<th>时间</th>
<th>状态</th>
<th>访问量</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{foreach $contents(key,value)}
<tr>
<td>[value->id]</td>
<td title="[value->scode]">[value->sortname]</td>
<td title="[value->title]">
{fun=substr_both($value->title,0,15)}
{if($value->ico)}
<span class="layui-badge layui-bg-orange"></span>
{/if}
{if($value->pics)}
<span class="layui-badge"></span>
{/if}
{if($value->outlink)}
<span class="layui-badge layui-bg-black"></span>
{/if}
</td>
<td>[value->date]</td>
<td>
{if($value->status)}
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/0}"><i class='fa fa-toggle-on' title="点击关闭"></i></a>
{else}
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/1}"><i class='fa fa-toggle-off' title="点击开启"></i></a>
{/if}
</td>
<td>[value->visits]</td>
<td>
{if(!$value->outlink)}
{php}
$value->urlname=$value->urlname?:'about';
$url_rule_sort_suffix = \core\basic\Config::get('url_rule_sort_suffix') ? true : false;
{/php}
{if($value->filename)}
<a href="{fun=homeurl('/home/Index/'.$value->filename,$url_rule_sort_suffix)}" class="layui-btn layui-btn-xs layui-btn-primary" target="_blank">查看</a>
{else}
<a href="{fun=homeurl('/home/Index/'.$value->urlname.[$url_break_char].$value->scode,$url_rule_sort_suffix)}" class="layui-btn layui-btn-xs layui-btn-primary" target="_blank">查看</a>
{/if}
{/if}
{if(check_level('mod'))}
<a href="{url./admin/Single/mod/mcode/'.$value->mcode.'/id/'.$value->id.'}{$btnqs}" class="layui-btn layui-btn-xs" >修改</a>
{if([$baidu_zz_token] && !$value->outlink)}
<a href="{url./admin/'.C.'/mod/baiduzz/'.$value->id.'}" class="layui-btn layui-btn-xs layui-btn-primary" >百度普通推送</a>
{/if}
{if([$baidu_ks_token] && !$value->outlink)}
<a href="{url./admin/'.C.'/mod/baiduks/'.$value->id.'}" class="layui-btn layui-btn-xs layui-btn-primary" >百度快速推送</a>
{/if}
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
</div>
{/if}
{if([$mod])}
<div class="layui-tab layui-tab-brief" lay-filter="tab">
<ul class="layui-tab-title">
<li class="layui-this">单页修改</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<form action="{url./admin/Single/mod/id/'.[$get.id].'}{$backurl}" method="post" class="layui-form" id="edit">
<input type="hidden" name="formcheck" value="{$formcheck}" >
<div class="layui-tab">
<ul class="layui-tab-title">
<li class="layui-this">基本内容</li>
<li>高级内容</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<div class="layui-form-item">
<label class="layui-form-label">内容标题 <span class="layui-text-red">*</span></label>
<div class="layui-input-block">
<input type="text" name="title" required lay-verify="required" value="{$content->title}" placeholder="请输入内容标题" class="layui-input">
</div>
</div>
{foreach $extfield(key,value)}
{if($value->type==1)} <!-- 单行文本 -->
<div class="layui-form-item">
<label class="layui-form-label">[value->description]</label>
<div class="layui-input-block">
<input type="text" name="[value->name]" value="{$content->{$value->name}}" placeholder="请输入[value->description]" class="layui-input">
</div>
</div>
{/if}
{if($value->type==2)}<!-- 多行文本 -->
<div class="layui-form-item">
<label class="layui-form-label">[value->description]</label>
<div class="layui-input-block">
<textarea name="[value->name]" class="layui-textarea" placeholder="请输入[value->description]">{php}$name=$value->name;echo str_replace('<br>', "\r\n",$this->vars['content']->$name);{/php}</textarea>
</div>
</div>
{/if}
{if($value->type==3)}<!-- 单选 -->
<div class="layui-form-item">
<label class="layui-form-label">[value->description]</label>
<div class="layui-input-block">
<div>
{php}
$radios=explode(',',$value->value);
$name=$value->name;
foreach ($radios as $value2) {
if($this->vars['content']->$name==$value2){
echo '<input type="radio" name="'.$value->name.'" value="'.$value2.'" title="'.$value2.'" checked>';
}else{
echo '<input type="radio" name="'.$value->name.'" value="'.$value2.'" title="'.$value2.'">';
}
}
{/php}
</div>
</div>
</div>
{/if}
{if($value->type==4)}<!-- 多选 -->
<div class="layui-form-item">
<label class="layui-form-label">[value->description]</label>
<div class="layui-input-block">
<div>
{php}
$checkboxs=explode(',',$value->value);
$name=$value->name;
echo '<input name="'.$value->name.'" type="hidden">';//占位清空
$values=explode(',',$this->vars['content']->$name);
foreach ($checkboxs as $value2) {
if(in_array($value2,$values)){
echo '<input type="checkbox" name="'.$value->name.'[]" value="'.$value2.'" title="'.$value2.'" checked>';
}else{
echo '<input type="checkbox" name="'.$value->name.'[]" value="'.$value2.'" title="'.$value2.'">';
}
}
{/php}
</div>
</div>
</div>
{/if}
{if($value->type==5)}<!-- 图片 -->
<div class="layui-form-item">
<label class="layui-form-label">[value->description]</label>
<div class="layui-input-inline">
<input type="text" name="[value->name]" id="[value->name]" value="{$content->{$value->name}}" placeholder="请上传[value->description]" class="layui-input">
</div>
<button type="button" class="layui-btn upload watermark" data-des="[value->name]">
<i class="layui-icon">&#xe67c;</i>上传图片
</button>
{php}$name=$value->name; {/php}
<div id="[value->name]_box" class="pic"><dl><dt>{if([$content]->$name)}<img src='{SITE_DIR}{$content->{$value->name}}' data-url="{$content->{$value->name}}"></dt><dd>删除</dd></dl>{/if}</div>
</div>
{/if}
{if($value->type==6)}<!-- 文件 -->
<div class="layui-form-item">
<label class="layui-form-label">[value->description]</label>
<div class="layui-input-inline">
<input type="text" name="[value->name]" id="[value->name]" value="{$content->{$value->name}}" placeholder="请上传[value->description]" class="layui-input">
</div>
<button type="button" class="layui-btn file" data-des="[value->name]">
<i class="layui-icon">&#xe67c;</i>上传文件
</button>
</div>
{/if}
{if($value->type==7)}<!-- 日期 -->
<div class="layui-form-item">
<label class="layui-form-label">[value->description]</label>
<div class="layui-input-block">
<input type="text" name="[value->name]" value="{$content->{$value->name}}" readonly placeholder="请选择[value->description]" class="layui-input datetime">
</div>
</div>
{/if}
{if($value->type==8)}<!-- 编辑器 -->
<div class="layui-form-item">
<label class="layui-form-label">[value->description]</label>
<div class="layui-input-block">
{php}
$name=@$value->name;
{/php}
<script type="text/plain" id="editor_[value->name]" name="[value->name]" style="width:100%;height:240px;">{fun=decode_string([$content->$name])}</script>
<script>
//初始化编辑器
$(document).ready(function (e) {
var ue = UE.getEditor('editor_[value->name]',{
maximumWords:10000
});
})
</script>
</div>
</div>
{/if}
{if($value->type==9)}<!-- 下拉 -->
<div class="layui-form-item">
<label class="layui-form-label">[value->description]</label>
<div class="layui-input-block">
<select name="[value->name]">
{php}
$selects=explode(',',$value->value);
$name=$value->name;
foreach ($selects as $value2) {
if($this->vars['content']->$name==$value2){
echo '<option value="'.$value2.'" selected>'.$value2.'</option>';
}else{
echo '<option value="'.$value2.'">'.$value2.'</option>';
}
}
{/php}
</select>
</div>
</div>
{/if}
{/foreach}
<div class="layui-form-item">
<label class="layui-form-label">内容</label>
<div class="layui-input-block">
<script type="text/plain" id="editor" name="content" style="width:100%;height:240px;">{fun=decode_string([$content->content])}</script>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">tags</label>
<div class="layui-input-block">
<input type="text" name="tags" placeholder="请输入文章tag英文逗号隔开" value="{$content->tags}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">作者</label>
<div class="layui-input-block">
<input type="text" name="author" placeholder="请输入作者" value="{$content->author}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">来源</label>
<div class="layui-input-block">
<input type="text" name="source" placeholder="请输入来源" value="{$content->source}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">缩略图</label>
<div class="layui-input-inline">
<input type="text" name="ico" id="ico" value="{$content->ico}" placeholder="请上传缩略图" class="layui-input">
</div>
<button type="button" class="layui-btn upload watermark" data-des="ico">
<i class="layui-icon">&#xe67c;</i>上传图片
</button>
<div id="ico_box" class="pic addedit">{if([$content->ico])}<dl><dt><img src="{SITE_DIR}{$content->ico}" data-url="{$content->ico}"></dt><dd>删除</dd></dl>{/if}</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">轮播多图</label>
<div class="layui-input-inline">
<input type="text" name="pics" id="pics" value="{$content->pics}" placeholder="请上传轮播多图" class="layui-input">
</div>
<button type="button" class="layui-btn uploads watermark" data-des="pics">
<i class="layui-icon">&#xe67c;</i>上传多图
</button>
<div id="pics_box" class="pic addedit">
<dl></dl> <!-- 规避空内容拖动bug -->
{php}
if([$content->pics]){
$pics=explode(',',[$content->pics]);
}else{
$pics = array();
}
foreach ($pics as $value) {
echo "<dl><dt><img src='".SITE_DIR.$value."' data-url='".$value."'></dt><dd>删除</dd></dl></dl>";
}
{/php}
</div>
</div>
</div>
<div class="layui-tab-item ">
<div class="layui-form-item">
<label class="layui-form-label">标题颜色</label>
<div class="layui-input-inline">
<input type="text" name="titlecolor" value="{$content->titlecolor}" placeholder="请选择标题颜色" class="layui-input jscolor {hash:true}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">副标题</label>
<div class="layui-input-block">
<input type="text" name="subtitle" value="{$content->subtitle}" placeholder="请输入副标题" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">时间</label>
<div class="layui-input-inline">
<input type="text" name="date" value="{$content->date}" readonly placeholder="请选择发布时间" class="layui-input datetime">
</div>
<div class="layui-form-mid layui-word-aux">温馨提示:单页不支持定时发布!</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">附件</label>
<div class="layui-input-inline">
<input type="text" name="enclosure" id="enclosure" value="{$content->enclosure}" placeholder="请上传附件" class="layui-input">
</div>
<button type="button" class="layui-btn file" data-des="enclosure">
<i class="layui-icon">&#xe67c;</i>上传附件
</button>
</div>
<div class="layui-form-item">
<label class="layui-form-label">SEO关键字</label>
<div class="layui-input-block">
<input type="text" name="keywords" value="{$content->keywords}" placeholder="请输入详情页SEO关键字" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">SEO描述</label>
<div class="layui-input-block">
<textarea name="description" placeholder="请输入详情页SEO描述" class="layui-textarea">{$content->description}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-input-block">
<input type="radio" name="status" value="1" title="显示" {if([$content->status]==1)} checked="checked"{/if}>
<input type="radio" name="status" value="0" title="隐藏" {if([$content->status]==0)} checked="checked"{/if}>
</div>
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit>立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
{fun=get_btn_back()}
</div>
</div>
</form>
</div>
</div>
</div>
{/if}
</div>
<style>.placeHolder {border:dashed 2px gray; }</style>
<script type="text/javascript" src="{APP_THEME_DIR}/js/jquery.dragsort-0.5.2.min.js"></script>
<script type="text/javascript">
$("#pics_box").dragsort({
dragSelector: "dl",
dragSelectorExclude: "input,textarea,dd",
dragBetween: false,
dragEnd: saveOrder,
placeHolderTemplate: "<dl class='placeHolder'><dt></dt></dl>"
});
function saveOrder() {
var data = $("#pics_box dl dt img").map(function() {
return $(this).data("url");
}).get();
$("input[name=pics]").val(data.join(","))
};
</script>
<script type="text/javascript" src="{APP_THEME_DIR}/js/jscolor.js"></script>
{include file='common/ueditor.html'}
{include file='common/foot.html'}

View File

@@ -0,0 +1,101 @@
{include file='common/head.html'}
<div class="layui-body">
<div class="layui-tab layui-tab-brief" lay-filter="tab">
<ul class="layui-tab-title">
<li class="layui-this">站点信息</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<form action="{url./admin/Site/mod}" method="post" class="layui-form">
<input type="hidden" name="formcheck" value="{$formcheck}" >
<div class="layui-form-item">
<label class="layui-form-label">站点标题</label>
<div class="layui-input-block">
<input type="text" name="title" value="{$sites->title}" placeholder="请输入站点标题" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">站点域名</label>
<div class="layui-input-block">
<input type="text" name="domain" value="{$sites->domain}" placeholder="请输入站点域名" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">站点LOGO</label>
<div class="layui-input-inline">
<input type="text" name="logo" id="logo" value="{$sites->logo}" placeholder="请上传站点LOGO图" class="layui-input">
</div>
<button type="button" class="layui-btn upload" data-des="logo">
<i class="layui-icon">&#xe67c;</i>上传图片
</button>
<div id="logo_box" class="pic"><dl><dt>{if(@[$sites->logo])}<img src="{SITE_DIR}{$sites->logo}" data-url="{$sites->logo}"></dt><dd>删除</dd></dl>{/if}</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">站点关键字</label>
<div class="layui-input-block">
<input type="text" name="keywords" value="{$sites->keywords}" placeholder="请输入站点关键字" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">站点描述</label>
<div class="layui-input-block">
<textarea name="description" placeholder="请输入站点描述" class="layui-textarea">{$sites->description}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">站点备案</label>
<div class="layui-input-block">
<input type="text" name="icp" value="{$sites->icp}" placeholder="请输入站点备案" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">站点模板</label>
<div class="layui-input-block">
<select name="theme">
{foreach $themes(key,value)}
{if($value == [$sites->theme])}
<option value="[value]" selected='selected'>[value]</option>
{else}
<option value="[value]">[value]</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">统计代码</label>
<div class="layui-input-block">
<textarea name="statistical" placeholder="请输入统计代码" class="layui-textarea">{$sites->statistical}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">尾部信息</label>
<div class="layui-input-block">
<textarea name="copyright" placeholder="请输入尾部信息" class="layui-textarea">{$sites->copyright}</textarea>
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit>立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{include file='common/foot.html'}

View File

@@ -0,0 +1,78 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="renderer" content="webkit">
<title>网站管理中心-V{APP_VERSION}-{RELEASE_TIME}</title>
<link rel="shortcut icon" href="{SITE_DIR}/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="{APP_THEME_DIR}/layui/css/layui.css?v=v2.5.4">
<link rel="stylesheet" href="{APP_THEME_DIR}/font-awesome/css/font-awesome.min.css?v=v4.7.0" type="text/css">
<link rel="stylesheet" href="{APP_THEME_DIR}/css/login.css?v=v1.1.6">
<script type="text/javascript" src="{APP_THEME_DIR}/js/jquery-1.12.4.min.js"></script>
</head>
<body>
<div class="user-login" >
<div class="user-login-main">
<div class="user-login-header">
<h2>
网站管理中心
</h2>
<p>高效、简洁、强悍的PHP企业网站管理系统</p>
</div>
<form action="{url./admin/Index/login}" onsubmit="return false" class="layui-form" id="dologin">
<input type="hidden" name="formcheck" id="formcheck" value="{$formcheck}" >
<div class="user-login-box">
<div class="layui-form-item">
<label class="user-login-icon layui-icon layui-icon-username"></label>
<input name="username" id="username" type="text" lay-verify="required" placeholder="用户名" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-item">
<label class="user-login-icon layui-icon layui-icon-password"></label>
<input name="password" id="password" type="password" lay-verify="required" placeholder="密码" autocomplete="off" class="layui-input">
</div>
{if([$config.admin_check_code])}
<div class="layui-form-item">
<div class="layui-row">
<div class="layui-col-xs7 layui-col-sm8">
<label class="user-login-icon layui-icon layui-icon-vercode" ></label>
<input name="checkcode" id="checkcode" type="text" lay-verify="required" placeholder="验证码" autocomplete="off" class="layui-input">
</div>
<div class="layui-col-xs5 layui-col-sm4">
<div style="margin-left: 10px;">
<img title="点击刷新" src="{CORE_DIR}/code.php" class="user-login-codeimg" id="codeimg" onclick="this.src='{CORE_DIR}/code.php?'+Math.round(Math.random()*10);" />
</div>
</div>
</div>
</div>
{/if}
<div class="layui-form-item">
<button class="layui-btn layui-btn-fluid" lay-submit lay-filter="login-submit" >登 录</button>
</div>
<div style="color:red;" id="note"></div>
</div>
</form>
</div>
<div class="layui-trans user-login-footer">
<p>© 2018-{fun=date('Y')}</p>
</div>
</div>
<script type="text/javascript" src="{APP_THEME_DIR}/layui/layui.all.js?v=v2.5.4"></script>
<script type="text/javascript" src="{APP_THEME_DIR}/js/mylayui.js?v=v1.1.6"></script>
<!-- 让IE8/9支持媒体查询从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</body>
</html>

View File

@@ -0,0 +1,806 @@
{include file='common/head.html'}
<div class="layui-body">
<div class="layui-tab layui-tab-brief" lay-filter="tab">
<ul class="layui-tab-title">
<li class="layui-this" lay-id="t1">基本配置</li>
<li lay-id="t2">邮件通知</li>
<li lay-id="t3">百度接口</li>
<li lay-id="t4">WebAPI</li>
<li lay-id="t5">图片水印</li>
<li lay-id="t6">安全配置</li>
<li lay-id="t7">URL规则</li>
<li lay-id="t8">标题样式</li>
<li lay-id="t9">会员配置</li>
</ul>
<div class="layui-tab-content">
<div class="layui-tab-item layui-show">
<form action="{url./admin/Config/index}" method="post" class="layui-form">
<input type="hidden" name="formcheck" value="{$formcheck}" >
<div class="layui-form-item">
<label class="layui-form-label">网站状态</label>
<div class="layui-input-block">
<input type="radio" name="close_site" value="1" {if([$configs.close_site.value]==1)} checked="checked" {/if} title="关闭">
<input type="radio" name="close_site" value="0" {if([$configs.close_site.value]==0)} checked="checked" {/if} title="开启">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">关站提示</label>
<div class="layui-input-inline">
<textarea name="close_site_note" placeholder="" class="layui-textarea">{$configs.close_site_note.value}</textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">独立手机版</label>
<div class="layui-input-block">
<input type="radio" name="open_wap" value="1" {if([$configs.open_wap.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="open_wap" value="0" {if([$configs.open_wap.value]==0)} checked="checked" {/if} title="禁用">
<span class="layui-icon layui-icon-about tips" data-content="使用响应式模板的用户请不要开启!"></span>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">手机版域名绑定</label>
<div class="layui-input-inline">
<input type="text" name="wap_domain" value="{$configs.wap_domain.value}" placeholder="如m.baidu.com" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">动态缓存</label>
<div class="layui-input-block">
<input type="radio" name="tpl_html_cache" value="1" {if([$configs.tpl_html_cache.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="tpl_html_cache" value="0" {if([$configs.tpl_html_cache.value]==0)} checked="checked" {/if} title="禁用">
<span class="layui-icon layui-icon-about tips" data-content="本功能效果接近生成静态,开启后将提高前端访问速度及并发能力!"></span>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">缓存有效期(秒)</label>
<div class="layui-input-inline">
<input type="text" name="tpl_html_cache_time" value="{$configs.tpl_html_cache_time.value}" placeholder="请输入缓存有效期(秒)" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux"></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">Gzip页面压缩</label>
<div class="layui-input-block">
<input type="radio" name="gzip" value="1" {if([$configs.gzip.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="gzip" value="0" {if([$configs.gzip.value]==0)} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">会话文件路径</label>
<div class="layui-input-block">
<input type="radio" name="session_in_sitepath" value="1" {if([$configs.session_in_sitepath.value]==1)} checked="checked" {/if} title="站内">
<input type="radio" name="session_in_sitepath" value="0" {if([$configs.session_in_sitepath.value]==0)} checked="checked" {/if} title="系统">
<span class="layui-icon layui-icon-about tips" data-content="站内则使用站点下runtime路径系统则使用操作系统的缓存路径"></span>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">跨语言自动切换</label>
<div class="layui-input-block">
<input type="radio" name="lgautosw" value="1" {if([$configs.lgautosw.value]=='1'||[$configs.lgautosw.value]=='')} checked="checked" {/if} title="启用">
<input type="radio" name="lgautosw" value="0" {if([$configs.lgautosw.value]=='0')} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">自动转HTTPS</label>
<div class="layui-input-block">
<input type="radio" name="to_https" value="1" {if([$configs.to_https.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="to_https" value="0" {if([$configs.to_https.value]==0)} checked="checked" {/if} title="禁用">
<span class="layui-icon layui-icon-about tips" data-content="访问非HTPPS地址时自动跳转"></span>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">自动转主域名</label>
<div class="layui-input-block">
<input type="radio" name="to_main_domain" value="1" {if([$configs.to_main_domain.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="to_main_domain" value="0" {if([$configs.to_main_domain.value]==0)} checked="checked" {/if} title="禁用">
<span class="layui-icon layui-icon-about tips" data-content="访问非主域名地址时自动跳转!"></span>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">网站主域名</label>
<div class="layui-input-inline">
<input type="text" name="main_domain" value="{$configs.main_domain.value}" placeholder="如www.baidu.com" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">分页数字条数量</label>
<div class="layui-input-inline">
<input type="text" name="pagenum" value="{$configs.pagenum.value}" placeholder="请输入前端分页数字条显示数量" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux"></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">内链替换次数</label>
<div class="layui-input-inline">
<input type="text" name="content_tags_replace_num" value="{$configs.content_tags_replace_num.value}" placeholder="请输入文章内链替换次数默认3次" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux"></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">敏感词过滤</label>
<div class="layui-input-inline">
<textarea name="content_keyword_replace" placeholder="请输入需要过滤的关键词,多个之间逗号隔开" class="layui-textarea">{$configs.content_keyword_replace.value}</textarea>
<div class="layui-form-mid layui-word-aux">注:多个敏感词之间用逗号隔开!</div>
</div>
</div>
{if(LICENSE<2)}
<div class="layui-form-item">
<label class="layui-form-label">系统授权码</label>
<div class="layui-input-inline">
<input type="text" name="sn" value="{$configs.sn.value}" placeholder="请输入授权码,多个授权码用逗号隔开" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">授权码手机</label>
<div class="layui-input-inline">
<input type="text" name="sn_user" value="{$configs.sn_user.value}" placeholder="请购买了万能授权码的用户填写" class="layui-input">
</div>
</div>
{/if}
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit name="submit" value="basic">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
<div class="layui-tab-item">
<form action="{url./admin/Config/index}" method="post" class="layui-form">
<input type="hidden" name="formcheck" value="{$formcheck}" >
<div class="layui-form-item">
<label class="layui-form-label">服务器状态 </label>
<div class="layui-input-block" style="line-height:36px;">
stream_socket_client函数<i class="layui-icon layui-icon-ok-circle" style="color: {php}echo function_exists('stream_socket_client')?'#5FB878':'#f2f2f2';{/php}"></i>&nbsp;&nbsp;&nbsp;
fsockopen函数 <i class="layui-icon layui-icon-ok-circle" style="color: {php}echo function_exists('fsockopen')?'#5FB878':'#f2f2f2';{/php}"></i>
<span class="layui-icon layui-icon-about tips" data-content="至少需要支持其中一个函数才能正常使用!"></span>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">SMTP服务器</label>
<div class="layui-input-inline">
<input type="text" name="smtp_server" value="{$configs.smtp_server.value}" placeholder="请输入SMTP服务器" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">SMTP端口</label>
<div class="layui-input-inline">
<input type="text" name="smtp_port" value="{$configs.smtp_port.value}" placeholder="请输入SMTP端口,一般SSL为465普通为25" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">是否为SSL</label>
<div class="layui-input-block">
<input type="radio" name="smtp_ssl" value="1" {if([$configs.smtp_ssl.value]==1)} checked="checked" {/if} title="是">
<input type="radio" name="smtp_ssl" value="0" {if([$configs.smtp_ssl.value]==0)} checked="checked" {/if} title="否">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">邮箱账号</label>
<div class="layui-input-inline">
<input type="text" name="smtp_username" value="{$configs.smtp_username.value}" placeholder="请输入邮箱账号" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">邮箱密码</label>
<div class="layui-input-inline">
<input type="password" name="smtp_password" value="{$configs.smtp_password.value}" placeholder="请输入邮箱密码或邮箱授权码" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">测试账号</label>
<div class="layui-input-inline">
<input type="text" name="smtp_username_test" id="smtp_username_test" value="{$configs.smtp_username_test.value}" placeholder="请输入用于接受测试邮件的账号" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">留言发送邮件</label>
<div class="layui-input-block">
<input type="radio" name="message_send_mail" value="1" {if([$configs.message_send_mail.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="message_send_mail" value="0" {if([$configs.message_send_mail.value]==0)} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">表单发送邮件</label>
<div class="layui-input-block">
<input type="radio" name="form_send_mail" value="1" {if([$configs.form_send_mail.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="form_send_mail" value="0" {if([$configs.form_send_mail.value]==0)} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">评论发送邮件</label>
<div class="layui-input-block">
<input type="radio" name="comment_send_mail" value="1" {if([$configs.comment_send_mail.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="comment_send_mail" value="0" {if([$configs.comment_send_mail.value]==0)} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">信息接收邮箱</label>
<div class="layui-input-inline">
<input type="text" name="message_send_to" value="{$configs.message_send_to.value}" placeholder="请输入信息接收邮箱" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit name="submit" value="email">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
<a href="{url./admin/Config/index/action/sendemail}" onclick="return sendtest(this,'#smtp_username_test')" class="layui-btn layui-btn-primary">发送测试邮件</a>
</div>
</div>
<script>
function sendtest(obj,to){
$(obj).attr('href',$(obj).attr('href')+'&to='+$(to).val());
return true;
}
</script>
</form>
</div>
<div class="layui-tab-item">
<form action="{url./admin/Config/index}" method="post" class="layui-form">
<input type="hidden" name="formcheck" value="{$formcheck}" >
<div class="layui-form-item">
<label class="layui-form-label">普通收录token</label>
<div class="layui-input-inline">
<input type="text" name="baidu_zz_token" value="{$configs.baidu_zz_token.value}" placeholder="请输入普通收录token" class="layui-input">
</div>
<span class="layui-icon layui-icon-about tips" data-content="请到百度站长中心获取!"></span>
</div>
<div class="layui-form-item">
<label class="layui-form-label">快速收录token</label>
<div class="layui-input-inline">
<input type="text" name="baidu_ks_token" value="{$configs.baidu_ks_token.value}" placeholder="请输入快速收录token" class="layui-input">
</div>
<span class="layui-icon layui-icon-about tips" data-content="请到百度站长中心获取!"></span>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit name="submit" value="baidu">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
<div class="layui-tab-item">
<form action="{url./admin/Config/index}" method="post" class="layui-form">
<input type="hidden" name="formcheck" value="{$formcheck}" >
<div class="layui-form-item">
<label class="layui-form-label">API状态</label>
<div class="layui-input-block">
<input type="radio" name="api_open" value="1" {if(@[$configs.api_open.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="api_open" value="0" {if(@[$configs.api_open.value]==0)} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">API强制认证</label>
<div class="layui-input-block">
<input type="radio" name="api_auth" value="1" {if(@[$configs.api_auth.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="api_auth" value="0" {if(@[$configs.api_auth.value]==0)} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">API认证用户</label>
<div class="layui-input-inline">
<input type="text" name="api_appid" value="{$configs.api_appid.value}" placeholder="请输入API认证用户名" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">API认证密钥</label>
<div class="layui-input-inline">
<input type="password" name="api_secret" value="{$configs.api_secret.value}" placeholder="请输入API认证密钥" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit name="submit" value="api">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
<div class="layui-tab-item">
<form action="{url./admin/Config/index}" method="post" class="layui-form">
<input type="hidden" name="formcheck" value="{$formcheck}" >
<div class="layui-form-item">
<label class="layui-form-label">状态</label>
<div class="layui-input-block">
<input type="radio" name="watermark_open" value="1" {if(@[$configs.watermark_open.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="watermark_open" value="0" {if(@[$configs.watermark_open.value]==0)} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">水印文字</label>
<div class="layui-input-inline">
<input type="text" name="watermark_text" value="{$configs.watermark_text.value}" placeholder="请输入水印文字Baidu" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">文字字体</label>
<div class="layui-input-inline">
<input type="text" name="watermark_text_font" id="watermark_text_font" value="{$configs.watermark_text_font.value}" placeholder="请上传水印文字字体" class="layui-input">
</div>
<button type="button" class="layui-btn file" data-des="watermark_text_font">
<i class="layui-icon">&#xe67c;</i>上传字体
</button>
</div>
<div class="layui-form-item">
<label class="layui-form-label">文字大小</label>
<div class="layui-input-inline">
<input type="text" name="watermark_text_size" value="{$configs.watermark_text_size.value}" placeholder="请输入水印文字大小20" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">文字颜色</label>
<div class="layui-input-inline">
<input type="text" name="watermark_text_color" value="{$configs.watermark_text_color.value}" placeholder="请输入水印文字颜色100,100,100" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">水印图片</label>
<div class="layui-input-inline">
<input type="text" name="watermark_pic" id="watermark_pic" value="{$configs.watermark_pic.value}" placeholder="请上传水印图片,优先文字水印" class="layui-input">
</div>
<button type="button" class="layui-btn upload" data-des="watermark_pic">
<i class="layui-icon">&#xe67c;</i>上传图片
</button>
<div id="watermark_pic_box" class="pic"><dl><dt>{if(@[$configs.watermark_pic.value])}<img src="{SITE_DIR}{$configs.watermark_pic.value}" data-url="{$configs.watermark_pic.value}"></dt><dd>删除</dd></dl>{/if}</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">水印位置</label>
<div class="layui-input-block">
<input type="radio" name="watermark_position" value="1" {if(@[$configs.watermark_position.value]==1)} checked="checked" {/if} title="左上">
<input type="radio" name="watermark_position" value="2" {if(@[$configs.watermark_position.value]==2)} checked="checked" {/if} title="右上">
<input type="radio" name="watermark_position" value="3" {if(@[$configs.watermark_position.value]==3)} checked="checked" {/if} title="左下">
<input type="radio" name="watermark_position" value="4" {if(@[$configs.watermark_position.value]==4)} checked="checked" {/if} title="右下">
<input type="radio" name="watermark_position" value="5" {if(@[$configs.watermark_position.value]==5)} checked="checked" {/if} title="中间">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit name="submit" value="watermark">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
<div class="layui-tab-item">
<form action="{url./admin/Config/index}" method="post" class="layui-form">
<input type="hidden" name="formcheck" value="{$formcheck}" >
<div class="layui-form-item">
<label class="layui-form-label">留言功能</label>
<div class="layui-input-block">
<input type="radio" name="message_status" value="1" {if([$configs.message_status.value]=='1'||[$configs.message_status.value]=='')} checked="checked" {/if} title="启用">
<input type="radio" name="message_status" value="0" {if([$configs.message_status.value]=='0')} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">留言验证码</label>
<div class="layui-input-block">
<input type="radio" name="message_check_code" value="1" {if([$configs.message_check_code.value]=='1'||[$configs.message_check_code.value]=='')} checked="checked" {/if} title="启用">
<input type="radio" name="message_check_code" value="0" {if([$configs.message_check_code.value]=='0')} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">留言审核</label>
<div class="layui-input-block">
<input type="radio" name="message_verify" value="1" {if([$configs.message_verify.value]=='1'||[$configs.message_verify.value]=='')} checked="checked" {/if} title="启用">
<input type="radio" name="message_verify" value="0" {if([$configs.message_verify.value]=='0')} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">留言需登录</label>
<div class="layui-input-block">
<input type="radio" name="message_rqlogin" value="1" {if([$configs.message_rqlogin.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="message_rqlogin" value="0" {if([$configs.message_rqlogin.value]==0)} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">表单功能</label>
<div class="layui-input-block">
<input type="radio" name="form_status" value="1" {if([$configs.form_status.value]=='1'||[$configs.form_status.value]=='')} checked="checked" {/if} title="启用">
<input type="radio" name="form_status" value="0" {if([$configs.form_status.value]=='0')} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">表单验证码</label>
<div class="layui-input-block">
<input type="radio" name="form_check_code" value="1" {if([$configs.form_check_code.value]=='1'||[$configs.form_check_code.value]=='')} checked="checked" {/if} title="启用">
<input type="radio" name="form_check_code" value="0" {if([$configs.form_check_code.value]=='0')} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">模板子目录</label>
<div class="layui-input-inline">
<input type="text" name="tpl_html_dir" value="{$configs.tpl_html_dir.value}" placeholder="首次请手动移动模板文件到填写的目录!" class="layui-input">
</div>
<span class="layui-icon layui-icon-about tips" data-content="一定程度上防盗,如填 html则默认模板情况下路径为 default/html 目录!"></span>
</div>
<div class="layui-form-item">
<label class="layui-form-label">IP黑名单</label>
<div class="layui-input-inline">
<textarea name="ip_deny" placeholder="请输入需要禁止访问的IP多个之间逗号隔开IP地址支持使用/掩码位数模式192.168.1.0/24, 192.168.2.100" class="layui-textarea">{$configs.ip_deny.value}</textarea>
</div>
<span class="layui-icon layui-icon-about tips" data-content="请输入需要禁止访问的IP多个之间逗号隔开IP地址支持使用/掩码位数模式192.168.1.0/24, 192.168.2.100"></span>
</div>
<div class="layui-form-item">
<label class="layui-form-label">IP白名单</label>
<div class="layui-input-inline">
<textarea name="ip_allow" placeholder="请输入需要允许访问的IP多个之间逗号隔开IP地址支持使用/掩码位数模式192.168.1.0/24, 192.168.2.100" class="layui-textarea">{$configs.ip_allow.value}</textarea>
</div>
<span class="layui-icon layui-icon-about tips" data-content="请输入需要允许访问的IP多个之间逗号隔开IP地址支持使用/掩码位数模式192.168.1.0/24,192.168.2.100"></span>
</div>
<hr>
<div class="layui-form-item">
<label class="layui-form-label">后台验证码</label>
<div class="layui-input-block">
<input type="radio" name="admin_check_code" value="1" {if([$configs.admin_check_code.value]=='1'||[$configs.admin_check_code.value]=='')} checked="checked" {/if} title="启用">
<input type="radio" name="admin_check_code" value="0" {if([$configs.admin_check_code.value]=='0')} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">后台登录阀值</label>
<div class="layui-input-inline">
<input type="text" name="lock_count" value="{$configs.lock_count.value}" placeholder="请输入后台登录失败几次后锁定IP默认5次" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux"></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">失败锁定时间</label>
<div class="layui-input-inline">
<input type="text" name="lock_time" value="{$configs.lock_time.value}" placeholder="请输入后台登录异常锁定时间默认为900秒" class="layui-input">
</div>
<div class="layui-form-mid layui-word-aux"></div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit name="submit" value="security">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
<div class="layui-tab-item">
<form action="{url./admin/Config/index}" method="post" class="layui-form">
<input type="hidden" name="formcheck" value="{$formcheck}" >
<div class="layui-form-item">
<label class="layui-form-label">地址模式</label>
<div class="layui-input-block">
<P>
<input type="radio" name="url_rule_type" value="1" {if([$configs.url_rule_type.value]==1)} checked="checked" {/if} title="普通模式,类似:/index.php/product/1.html">
<span class="layui-icon layui-icon-about tips" data-content="基本模式需要服务器支持pathinfo,特别是nginx下pathinfo要手动配置"></span>
</P>
<P>
<input type="radio" name="url_rule_type" value="2" {if([$configs.url_rule_type.value]==2)} checked="checked" {/if} title="伪静态模式,类似:/product/1.html">
<span class="layui-icon layui-icon-about tips" data-content="伪静态时需要服务器环境的支持,并需要添加伪静态规则!"></span>
</P>
<P>
<input type="radio" name="url_rule_type" value="3" {if([$configs.url_rule_type.value]==3||![$configs.url_rule_type.value])} checked="checked" {/if} title="兼容模式,类似:/?product/1.html">
</P>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">栏目显示后缀</label>
<div class="layui-input-block">
<input type="radio" name="url_rule_sort_suffix" value="1" {if([$configs.url_rule_sort_suffix.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="url_rule_sort_suffix" value="0" {if([$configs.url_rule_sort_suffix.value]==0)} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit name="submit" value="urlrule">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
<div class="layui-tab-item">
<form action="{url./admin/Config/index}" method="post" class="layui-form">
<input type="hidden" name="formcheck" value="{$formcheck}" >
<div class="layui-form-item">
<label class="layui-form-label">常用组合标签: </label>
<div class="layui-input-block" style="line-height:36px;">
<p>全局标签:{pboot:sitetitle}站点标题、{pboot:sitesubtitle}站点副标题</p>
<p>列表或内容页:{sort:name}栏目名称、{sort:title}栏目标题</p>
<p>内容页:{content:title}内容标题</p>
<p>搜索结果页:{pboot:keyword}搜索关键字</p>
<p>个人中心:{user:nickname}会员昵称</p>
<p>例如定义内容页样式:{content:title}-{sort:name}-{pboot:sitetitle}-{pboot:sitesubtitle}</p>
<p>以下配置参数不设置时将使用系统默认规则。</p>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">首页</label>
<div class="layui-input-block">
<input type="text" name="index_title" value="{$configs.index_title.value}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">专题页</label>
<div class="layui-input-block">
<input type="text" name="about_title" value="{$configs.about_title.value}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">列表页</label>
<div class="layui-input-block">
<input type="text" name="list_title" value="{$configs.list_title.value}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">内容页</label>
<div class="layui-input-block">
<input type="text" name="content_title" value="{$configs.content_title.value}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">搜索结果页</label>
<div class="layui-input-block">
<input type="text" name="search_title" value="{$configs.search_title.value}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">会员注册页</label>
<div class="layui-input-block">
<input type="text" name="register_title" value="{$configs.register_title.value}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">会员登录页</label>
<div class="layui-input-block">
<input type="text" name="login_title" value="{$configs.login_title.value}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">个人中心页</label>
<div class="layui-input-block">
<input type="text" name="ucenter_title" value="{$configs.ucenter_title.value}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">资料修改页</label>
<div class="layui-input-block">
<input type="text" name="umodify_title" value="{$configs.umodify_title.value}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">其它页</label>
<div class="layui-input-block">
<input type="text" name="other_title" value="{$configs.other_title.value}" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit name="submit" value="pagetitle">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
<div class="layui-tab-item">
<form action="{url./admin/Config/index}" method="post" class="layui-form">
<input type="hidden" name="formcheck" value="{$formcheck}" >
<div class="layui-form-item">
<label class="layui-form-label">会员注册</label>
<div class="layui-input-block">
<input type="radio" name="register_status" value="1" {if([$configs.register_status.value]=='1'||[$configs.register_status.value]=='')} checked="checked" {/if} title="启用">
<input type="radio" name="register_status" value="0" {if([$configs.register_status.value]=='0')} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">会员注册类型</label>
<div class="layui-input-block">
<input type="radio" name="register_type" value="1" {if([$configs.register_type.value]=='1'||[$configs.register_type.value]=='')} checked="checked" {/if} title="用户名">
<input type="radio" name="register_type" value="2" {if([$configs.register_type.value]=='2')} checked="checked" {/if} title="邮箱账号">
<input type="radio" name="register_type" value="3" {if([$configs.register_type.value]=='3')} checked="checked" {/if} title="手机号码">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">会员注册验证码</label>
<div class="layui-input-block">
<input type="radio" name="register_check_code" value="0" {if([$configs.register_check_code.value]=='0')} checked="checked" {/if} title="禁用">
<input type="radio" name="register_check_code" value="1" {if([$configs.register_check_code.value]=='1'||[$configs.register_check_code.value]=='')} checked="checked" {/if} title="普通验证码">
<input type="radio" name="register_check_code" value="2" {if([$configs.register_check_code.value]=='2')} checked="checked" {/if} title="邮箱验证码">
<!-- <input type="radio" name="register_check_code" value="3" {if([$configs.register_check_code.value]=='3')} checked="checked" {/if} title="短信验证码"> -->
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">会员注册审核</label>
<div class="layui-input-block">
<input type="radio" name="register_verify" value="1" {if([$configs.register_verify.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="register_verify" value="0" {if([$configs.register_verify.value]==0)} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">会员登录</label>
<div class="layui-input-block">
<input type="radio" name="login_status" value="1" {if([$configs.login_status.value]=='1'||[$configs.login_status.value]=='')} checked="checked" {/if} title="启用">
<input type="radio" name="login_status" value="0" {if([$configs.login_status.value]=='0')} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">会员登录验证码</label>
<div class="layui-input-block">
<input type="radio" name="login_check_code" value="1" {if([$configs.login_check_code.value]=='1'||[$configs.login_check_code.value]=='')} checked="checked" {/if} title="启用">
<input type="radio" name="login_check_code" value="0" {if([$configs.login_check_code.value]=='0')} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">不等待跳登录</label>
<div class="layui-input-block">
<input type="radio" name="login_no_wait" value="1" {if([$configs.login_no_wait.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="login_no_wait" value="0" {if([$configs.login_no_wait.value]==0)} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">评论功能</label>
<div class="layui-input-block">
<input type="radio" name="comment_status" value="1" {if([$configs.comment_status.value]=='1'||[$configs.comment_status.value]=='')} checked="checked" {/if} title="启用">
<input type="radio" name="comment_status" value="0" {if([$configs.comment_status.value]=='0')} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">匿名评论</label>
<div class="layui-input-block">
<input type="radio" name="comment_anonymous" value="1" {if([$configs.comment_anonymous.value]==1)} checked="checked" {/if} title="启用">
<input type="radio" name="comment_anonymous" value="0" {if([$configs.comment_anonymous.value]==0)} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">评论验证码</label>
<div class="layui-input-block">
<input type="radio" name="comment_check_code" value="1" {if([$configs.comment_check_code.value]=='1'||[$configs.comment_check_code.value]=='')} checked="checked" {/if} title="启用">
<input type="radio" name="comment_check_code" value="0" {if([$configs.comment_check_code.value]=='0')} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">评论审核</label>
<div class="layui-input-block">
<input type="radio" name="comment_verify" value="1" {if([$configs.comment_verify.value]=='1'||[$configs.comment_verify.value]=='')} checked="checked" {/if} title="启用">
<input type="radio" name="comment_verify" value="0" {if([$configs.comment_verify.value]=='0')} checked="checked" {/if} title="禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">会员注册积分</label>
<div class="layui-input-inline">
<input type="text" name="register_score" value="{$configs.register_score.value}" placeholder="请输入会员注册初始积分" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">会员登录积分</label>
<div class="layui-input-inline">
<input type="text" name="login_score" value="{$configs.login_score.value}" placeholder="请输入会员每次登录积分" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">会员默认等级</label>
<div class="layui-input-inline">
<select name="register_gcode">
<option value="">请选择</option>
{foreach $groups(key,value)}
<option value="[value->gcode]" {if([$configs.register_gcode.value]==$value->gcode)}selected{/if}>[value->gname]</option>
{/foreach}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">允许上传格式</label>
<div class="layui-input-inline">
<input type="text" name="home_upload_ext" value="{$configs.home_upload_ext.value}" placeholder="以英文逗号隔开!" class="layui-input">
</div>
<span class="layui-icon layui-icon-about tips" data-content="以英文逗号隔开默认jpg, jpeg, png, gif, xls, xlsx, doc, docx, ppt, pptx, rar, zip, pdf, txt"></span>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit name="submit" value="member">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{include file='common/foot.html'}

View File

@@ -0,0 +1,178 @@
{include file='common/head.html'}
<div class="layui-body">
{if(![$dbsecurity]||![$session.pwsecurity])}
<blockquote class="layui-elem-quote layui-text-red" id="note">
{if(![$dbsecurity])}
<p>
<i class="fa fa-info-circle" aria-hidden="true"></i>
您的数据库文件存在安全隐患,可能被下载,请尽快修改数据库路径!<a class="layui-btn layui-btn-sm" href="{url./admin/Index/home}&action=moddb">自动修改</a>
</p>
{/if}
{if(![$session.pwsecurity])}
<p>
<i class="fa fa-info-circle" aria-hidden="true"></i>
您的账号密码为初始密码,存在安全隐患,请尽快修改密码!<a class="layui-btn layui-btn-sm" href="{url./admin/Index/ucenter}">立即修改</a>
</p>
{/if}
</blockquote>
{/if}
<blockquote class="layui-elem-quote">
当前登录用户:{$user_info->username} {$user_info->realname},登录时间:{$user_info->update_time}登录IP{fun=long2ip([$user_info->last_login_ip])},累计登录次数:{$user_info->login_count}
</blockquote>
<fieldset class="layui-elem-field">
<legend>快捷操作</legend>
<div class="layui-field-box">
<div class="layui-row">
{foreach $model_msg(key,value)}
<div class="layui-col-xs6 layui-col-sm4 layui-col-md3 layui-col-lg2">
{if($value->type==1)}
<a href="{url./admin/Single/index/mcode/'.$value->mcode.'}">
{else}
<a href="{url./admin/Content/index/mcode/'.$value->mcode.'}">
{/if}
<dl class="deskbox center-block">
<dt>[value->name]</dt>
<dd>[value->count]</dd>
</dl>
</a>
</div>
{/foreach}
<div class="layui-col-xs6 layui-col-sm4 layui-col-md3 layui-col-lg2">
<a href="{url./admin/Message/index}">
<dl class="deskbox center-block">
<dt>留言</dt>
<dd>{$sum_msg}</dd>
</dl>
</a>
</div>
</div>
</div>
</fieldset>
{if(CMSNAME=='PbootCMS')}
<div class="layui-row layui-col-space10">
<div class="layui-col-xs12 layui-col-md6">
<table class="layui-table table-two">
<thead>
<tr>
<th colspan="2">系统信息</th>
</tr>
</thead>
<tbody>
<tr>
<th width="100">应用版本</th>
<td>V{APP_VERSION}-{RELEASE_TIME}
{if(session('ucode')==10001)}
<a href="{url./admin/Upgrade/index}" class="layui-btn layui-btn-xs" id="check">在线更新</a>
{/if}
</td>
</tr>
<tr>
<th>主机系统</th>
<td>{$server->php_os}</td>
</tr>
<tr>
<th>主机地址</th>
<td>{$server->server_name}{$server->server_addr}:{$server->server_port}</td>
</tr>
<tr>
<th>WEB软件</th>
<td>{$server->server_software}</td>
</tr>
<tr>
<th>PHP版</th>
<td>{$server->php_version}</td>
</tr>
<tr>
<th>数据库驱动</th>
<td>{$server->db_driver}</td>
</tr>
<tr>
<th>文件上传限制</th>
<td>{$server->upload_max_filesize}</td>
</tr>
<tr>
<th>表单提交限制</th>
<td>{$server->post_max_size}</td>
</tr>
</tbody>
</table>
</div>
<div class="layui-col-xs12 layui-col-md6">
<table class="layui-table table-two">
<thead>
<tr>
<th colspan="2">开发信息</th>
</tr>
</thead>
<tbody>
<tr>
<th>系统名称</th>
<td>企业网站开发建设管理系统</td>
</tr>
<tr>
<th>模板下载</th>
<td>
<a href="http://www.adminbuy.cn/" style="color:#666" target="_blank">AB模板网</a>
</td>
</tr>
<tr>
<th>素材图标</th>
<td>
<a href="http://sc.adminbuy.cn/" style="color:#666" target="_blank">图标库</a>
</td>
</tr>
<tr>
<th>网站定制</th>
<td>
<a href="http://fang.adminbuy.cn/" style="color:#666" target="_blank">仿站</a>
</td>
</tr>
<tr>
<th>系统开发</th>
<td>星梦</td>
</tr>
<tr>
<th>友情贡献者</th>
<td>
感谢交流群各网友对我们发展的大力支持;
感谢LayUI提供的前端框架
感谢百度提供的富文本编辑器;
感谢星梦开发团队的日夜奋斗。
</td>
</tr>
</tbody>
</table>
</div>
</div>
{/if}
</div>
<script>
$.ajax({
type: 'GET',
url: 'https://www.pbootcms.com/index.php?p=/upgrade/check&version={APP_VERSION}.{RELEASE_TIME}.{$revise}&branch={$branch}&snuser={$snuser}&site={$site}',
dataType: 'json',
success: function (response, status) {
if(response.code==1){
$("#check").html($("#check").html()+'<span class="layui-badge-dot"></span>');
}
}
});
</script>
{include file='common/foot.html'}

View File

@@ -0,0 +1,196 @@
<?php
/**
* @copyright (C)2016-2099 Hnaoyun Inc.
* @author XingMeng
* @email hnxsh@foxmail.com
* @date 2016年12月25日
* 应用公共控制类
*/
namespace app\common;
use core\basic\Controller;
class AdminController extends Controller
{
public function __construct()
{
// 自动缓存基础信息
cache_config();
// 从配置文件读取cmsname参数来设置系统名称
define("CMSNAME", $this->config("cmsname") ?: 'PbootCMS');
// 检测登录,未登录跳转登录页面,已登录执行数据处理
if ($this->checkLogin()) {
// 权限检测
$this->checkLevel();
$this->getSecondMenu(); // 获取同级菜单
$this->assign('menu_tree', session('menu_tree')); // 注入菜单树
if (session('area_tree')) {
$area_html = make_area_Select(session('area_tree'), session('acode'));
$this->assign('area_html', $area_html);
if (count(session('area_tree')) == 1) {
$this->assign('one_area', true);
}
} else {
session_unset();
error('您账号的区域权限设置有误,无法正常登录!', url('/admin/Index/index'), 10);
}
// 内容模型菜单注入
$models = model('admin.content.Model');
$this->assign('menu_models', $models->getModelMenu());
// 注入编码后的回跳地址
$this->assign('btnqs', get_btn_qs());
$this->assign('backurl', get_backurl());
// 兼容模式form使用get搜索时注入pathinfo隐藏域
if ($_GET['p'] && $this->config('app_url_type') == 3) {
$this->assign('pathinfo', '<input name="p" type="hidden" value="' . get('p') . '">');
}
}
// 不进行表单检验的控制器
$nocheck = array(
'Upgrade'
);
// POST表单提交校验
if ($_POST && ! in_array(C, $nocheck) && session('formcheck') != post('formcheck')) {
// 检查会话目录权限问题
if (session_save_path()) {
preg_match('/^((\s+)?([0-9]+)(\s+)?;)?(.*)/', session_save_path(), $matches);
// 自动创建会话主目录
if (! check_dir($matches[5], true)) {
error('会话目录创建失败!' . $matches[5]);
}
// 检查会话目录写入权限
if (! is_writable($matches[5])) {
error('会话目录权限不足!' . $matches[5]);
}
// 自动创建层级会话目录
if ($matches[3]) {
create_session_dir($matches[5], $matches[3]);
}
} elseif (isset($_SERVER['TMP']) && ! file_exists($_SERVER['TMP'] . '/sess_' . session_id())) {
error(' 操作系统缓存目录写入权限不足!' . $_SERVER['TMP']);
}
alert_back('表单提交校验失败,请刷新后重试!');
}
// 首次加载时,生成页面验证码
if (! issetSession('formcheck')) {
session('formcheck', get_uniqid());
}
$this->assign('formcheck', session('formcheck')); // 注入formcheck模板变量
}
// 后台用户登录状态检查
private function checkLogin()
{
// 免登录可访问页面
$public_path = array(
'/admin/Index/index', // 登录页面
'/admin/Index/login' // 执行登录
);
if (session('sid') && $this->checkSid()) { // 如果已经登录直接true
return true;
} elseif (in_array('/' . M . '/' . C . '/' . F, $public_path)) { // 免登录可访问页面
return false;
} else { // 未登录跳转到登录页面
location(url('/admin/Index/index'));
}
}
// 检查会话id
private function checkSid()
{
$sid = encrypt_string(session_id() . session('id'));
if ($sid != session('sid') || session('M') != M) {
session_destroy();
return false;
} else {
return true;
}
}
// 访问权限检查
private function checkLevel()
{
// 免权限等级认证页面,即所有登录用户都可以访问
$public_path = array(
'/admin/Index/index', // 登录页
'/admin/Index/home', // 主页
'/admin/Index/loginOut', // 退出登录
'/admin/Index/ucenter', // 用户中心
'/admin/Index/area', // 区域选择
'/admin/Index/clearCache', // 清理缓存
'/admin/Index/upload' // 上传文件
);
$levals = session('levels');
$path1 = '/' . M . '/' . C;
$path2 = '/' . M . '/' . C . '/' . F;
if (session('id') == 1 || in_array(URL, $levals) || in_array($path2, $levals) || in_array($path1, $public_path) || in_array($path2, $public_path)) {
return true;
} else {
error('您的账号权限不足,您无法执行该操作!');
}
}
// 当前菜单的父类的子菜单,即同级菜单二级菜单
private function getSecondMenu()
{
$menu_tree = session('menu_tree');
$url = '/' . M . '/' . C . '/' . F;
$len = 0;
$primary_menu_url = '';
$second_menu = array();
// 直接比对找出最长匹配URL
foreach ($menu_tree as $key => $value) {
if (is_array($value->son)) {
foreach ($value->son as $key2 => $value2) {
if (! $value2->url) // 如果为空,则跳过
continue;
$pos = strpos($url, $value2->url);
if ($pos !== false) {
$templen = strlen($value2->url);
if ($templen > $len) {
$len = $templen;
$primary_menu_url = $value->url;
$second_menu = $value->son;
}
break; // 如果匹配到已经找到父类,则结束
}
}
}
}
// 前面第一种无法匹配,则选择子菜单匹配,只需控制器通过即可,如翻页、增、改、删操作
if (! $second_menu) {
foreach ($menu_tree as $key => $value) {
if (is_array($value->son)) {
foreach ($value->son as $key2 => $value2) {
if (strpos($value2->url, '/' . M . '/' . C . '/') === 0) {
$primary_menu_url = $value->url;
$second_menu = $value->son;
break;
}
}
}
if ($second_menu) { // 已经获取二级菜单到后退出
break;
}
}
}
$this->assign('primary_menu_url', $primary_menu_url);
$this->assign('second_menu', $second_menu);
}
}

View File

@@ -0,0 +1,12 @@
<?php
return array(
// 应用版本
'app_version' => '3.0.6',
// 发布时间
'release_time' => '20210929',
// 修订版本
'revise_version' => '0'
);

View File

@@ -0,0 +1,297 @@
<?php
/**
* @copyright (C)2016-2099 Hnaoyun Inc.
* @author XingMeng
* @email hnxsh@foxmail.com
* @date 2018年2月14日
* 首页控制器
*/
namespace app\home\controller;
use core\basic\Controller;
use app\home\model\ParserModel;
use core\basic\Config;
use core\basic\Url;
class IndexController extends Controller
{
protected $parser;
protected $model;
protected $htmldir;
public function __construct()
{
$this->parser = new ParserController();
$this->model = new ParserModel();
$this->htmldir = $this->config('tpl_html_dir') ? $this->config('tpl_html_dir') . '/' : '';
}
// 空拦截器, 实现文章路由转发
public function _empty()
{
// 地址类型
$url_rule_type = $this->config('url_rule_type') ?: 3;
if (P) { // 采用pathinfo模式及p参数伪静态模式
if ($url_rule_type == 2 && stripos(URL, $_SERVER['SCRIPT_NAME']) !== false) { // 禁止伪静态时带index.php访问
_404('您访问的内容不存在,请核对后重试!');
}
$path = explode('/', P);
if (! defined('URL_BIND')) {
array_shift($path); // 去除模块部分
}
} elseif ($url_rule_type == 3 && isset($_SERVER["QUERY_STRING"]) && $qs = $_SERVER["QUERY_STRING"]) { // 采用简短传参模式
parse_str($qs, $output);
unset($output['page']); // 去除分页
if ($output && ! current($output)) { // 第一个路径参数不能有值,否则非标准路径参数
$path = key($output); // 第一个参数为路径信息注意PHP数组会自动将key点符号转换下划线
$path = trim($path, '/'); // 去除两端斜杠
$url_rule_suffix = substr($this->config('url_rule_suffix'), 1);
if (preg_match('/_' . $url_rule_suffix . '$/', $path) && (! ! $pos = strripos($path, '_' . $url_rule_suffix))) {
$path = substr($path, 0, $pos); // 去扩展
}
$path = explode('/', $path);
} elseif (get('tag')) { // 对于兼容模式tag需要自动跳转tag独立页面
$tag = new TagController();
$tag->index();
} elseif (get('keyword')) { // 兼容模式搜索处理
$search = new SearchController();
$search->index();
}
}
if (isset($path) && is_array($path)) {
// 地址分隔符
$url_break_char = $this->config('url_break_char') ?: '_';
// 判断第一个参数中组合信息
if (strpos($path[0], $url_break_char)) {
$param = explode($url_break_char, $path[0]);
} else {
$param[] = $path[0];
}
// 判断第一个参数是模型还是自定义分类
if (! ! ($model = $this->model->checkModelUrlname($param[0])) || preg_match('/^(list_[0-9]+)|(^about_[0-9]+)/', $path[0])) {
$scode = $param[1];
if (isset($param[2])) {
$_GET['page'] = $param[2]; // 分页
}
} else {
define('CMS_PAGE_CUSTOM', true); // 自定义名称后分页比正常少了一个参数 (list_1_1=>product_1)
$scode = $param[0];
if (isset($param[1])) {
$_GET['page'] = $param[1]; // 分页
}
}
// 路由
switch ($param[0]) {
case 'search':
case 'keyword':
$search = new SearchController();
$search->index();
break;
case 'message':
$msg = new MessageController();
$msg->index();
break;
case 'form':
$_GET['fcode'] = $path[1];
$form = new FormController();
$form->index();
break;
case 'sitemap':
case 'Sitemap':
$sitemap = new SitemapController();
$sitemap->index();
break;
case 'tag':
$tag = new TagController();
$tag->index();
break;
case 'member':
$member = new MemberController();
$member->{$path[1]}();
break;
case 'comment':
$comment = new CommentController();
$comment->{$path[1]}();
break;
default:
if (get($param[0])) {
$this->getIndex();
} else {
if (count($path) > 1) {
define('CMS_PAGE', false); // 使用普通分页处理模型
if (! ! ($data = $this->model->getContent($path[1])) && ($data->scode == $scode || $data->sortfilename == $scode) && $data->type == 2) {
if ($data->acode != get_lg() && Config::get('lgautosw') !== '0') {
cookie('lg', $data->acode); // 调用内容语言与当前语言不一致时,自动切换语言
}
$this->getContent($data);
} else {
_404('您访问的内容不存在,请核对后重试!');
}
} else {
define('CMS_PAGE', true); // 使用cms分页处理模型
if (! ! $sort = $this->model->getSort($scode)) {
if ($sort->acode != get_lg() && Config::get('lgautosw') !== '0') {
cookie('lg', $sort->acode); // 调用栏目语言与当前语言不一致时,自动切换语言
}
if ($sort->type == 1) {
$this->getAbout($sort);
} else {
$this->getList($sort);
}
} else {
_404('您访问的栏目不存在,请核对后重试!');
}
}
}
}
} else {
$this->getIndex();
}
}
// 首页
private function getIndex()
{
$content = parent::parser($this->htmldir . 'index.html'); // 框架标签解析
$content = $this->parser->parserBefore($content); // CMS公共标签前置解析
$content = str_replace('{pboot:pagetitle}', $this->config('index_title') ?: '{pboot:sitetitle}-{pboot:sitesubtitle}', $content);
$content = $this->parser->parserPositionLabel($content, - 1, '首页', SITE_INDEX_DIR . '/'); // CMS当前位置标签解析
$content = $this->parser->parserSpecialPageSortLabel($content, 0, '', SITE_INDEX_DIR . '/'); // 解析分类标签
$content = $this->parser->parserAfter($content); // CMS公共标签后置解析
$this->cache($content, true);
}
// 列表
private function getList($sort)
{
if ($sort->listtpl) {
$this->checkPageLevel($sort->gcode, $sort->gtype, $sort->gnote);
$content = parent::parser($this->htmldir . $sort->listtpl); // 框架标签解析
$content = $this->parser->parserBefore($content); // CMS公共标签前置解析
$pagetitle = $sort->title ? "{sort:title}" : "{sort:name}"; // 页面标题
$content = str_replace('{pboot:pagetitle}', $this->config('list_title') ?: ($pagetitle . '-{pboot:sitetitle}-{pboot:sitesubtitle}'), $content);
$content = str_replace('{pboot:pagekeywords}', '{sort:keywords}', $content);
$content = str_replace('{pboot:pagedescription}', '{sort:description}', $content);
$content = $this->parser->parserPositionLabel($content, $sort->scode); // CMS当前位置标签解析
$content = $this->parser->parserSortLabel($content, $sort); // CMS分类信息标签解析
$content = $this->parser->parserListLabel($content, $sort->scode); // CMS分类列表标签解析
$content = $this->parser->parserAfter($content); // CMS公共标签后置解析
} else {
error('请到后台设置分类栏目列表页模板!');
}
$this->cache($content, true);
}
// 详情页
private function getContent($data)
{
// 读取模板
if (! ! $sort = $this->model->getSort($data->scode)) {
if ($sort->contenttpl) {
$this->checkPageLevel($sort->gcode, $sort->gtype, $sort->gnote); // 检查栏目权限
$this->checkPageLevel($data->gcode, $data->gtype, $data->gnote); // 检查内容权限
$content = parent::parser($this->htmldir . $sort->contenttpl); // 框架标签解析
$content = $this->parser->parserBefore($content); // CMS公共标签前置解析
$content = str_replace('{pboot:pagetitle}', $this->config('content_title') ?: '{content:title}-{sort:name}-{pboot:sitetitle}-{pboot:sitesubtitle}', $content);
$content = str_replace('{pboot:pagekeywords}', '{content:keywords}', $content);
$content = str_replace('{pboot:pagedescription}', '{content:description}', $content);
$content = $this->parser->parserPositionLabel($content, $sort->scode); // CMS当前位置标签解析
$content = $this->parser->parserSortLabel($content, $sort); // CMS分类信息标签解析
$content = $this->parser->parserCurrentContentLabel($content, $sort, $data); // CMS内容标签解析
$content = $this->parser->parserCommentLabel($content); // 文章评论
$content = $this->parser->parserAfter($content); // CMS公共标签后置解析
} else {
error('请到后台设置分类栏目内容页模板!');
}
} else {
_404('您访问内容的分类已经不存在,请核对后再试!');
}
$this->cache($content, true);
}
// 单页
private function getAbout($sort)
{
// 读取数据
if (! $data = $this->model->getAbout($sort->scode)) {
_404('您访问的内容不存在,请核对后重试!');
}
if ($sort->contenttpl) {
$this->checkPageLevel($sort->gcode, $sort->gtype, $sort->gnote);
$content = parent::parser($this->htmldir . $sort->contenttpl); // 框架标签解析
$content = $this->parser->parserBefore($content); // CMS公共标签前置解析
$pagetitle = $sort->title ? "{sort:title}" : "{content:title}"; // 页面标题
$content = str_replace('{pboot:pagetitle}', $this->config('about_title') ?: ($pagetitle . '-{pboot:sitetitle}-{pboot:sitesubtitle}'), $content);
$content = str_replace('{pboot:pagekeywords}', '{content:keywords}', $content);
$content = str_replace('{pboot:pagedescription}', '{content:description}', $content);
$content = $this->parser->parserPositionLabel($content, $sort->scode); // CMS当前位置标签解析
$content = $this->parser->parserSortLabel($content, $sort); // CMS分类信息标签解析
$content = $this->parser->parserCurrentContentLabel($content, $sort, $data); // CMS内容标签解析
$content = $this->parser->parserCommentLabel($content); // 文章评论
$content = $this->parser->parserAfter($content); // CMS公共标签后置解析
} else {
error('请到后台设置分类栏目内容页模板!');
}
$this->cache($content, true);
}
// 检查页面权限
private function checkPageLevel($gcode, $gtype, $gnote)
{
if ($gcode) {
$deny = false;
$gtype = $gtype ?: 4;
switch ($gtype) {
case 1:
if ($gcode <= session('pboot_gcode')) {
$deny = true;
}
break;
case 2:
if ($gcode < session('pboot_gcode')) {
$deny = true;
}
break;
case 3:
if ($gcode != session('pboot_gcode')) {
$deny = true;
}
break;
case 4:
if ($gcode > session('pboot_gcode')) {
$deny = true;
}
break;
case 5:
if ($gcode >= session('pboot_gcode')) {
$deny = true;
}
break;
}
if ($deny) {
$gnote = $gnote ?: '您的权限不足,无法浏览本页面!';
if (session('pboot_uid')) { // 已经登录
error($gnote);
} else {
if ($this->config('login_no_wait')) {
location(Url::home('member/login', null, "backurl=" . urlencode(get_current_url())));
} else {
error($gnote, Url::home('member/login', null, "backurl=" . urlencode(get_current_url())));
}
}
}
}
}
}

View File

@@ -0,0 +1,982 @@
<?php
/**
* @copyright (C)2016-2099 Hnaoyun Inc.
* @author XingMeng
* @email hnxsh@foxmail.com
* @date 2018年2月14日
* 标签解析引擎模型
*/
namespace app\home\model;
use core\basic\Model;
class ParserModel extends Model
{
// 存储分类及子编码
protected $scodes = array();
// 存储分类查询数据
protected $sorts;
// 存储栏目位置
protected $position = array();
// 上一篇
protected $pre;
// 下一篇
protected $next;
// 获取模型数据
public function checkModelUrlname($urlname)
{
return parent::table('ay_model')->where("urlname='$urlname'")->find();
}
// 站点配置信息
public function getSite()
{
return parent::table('ay_site')->where("acode='" . get_lg() . "'")->find();
}
// 公司信息
public function getCompany()
{
return parent::table('ay_company')->where("acode='" . get_lg() . "'")->find();
}
// 自定义标签,不区分语言,兼容跨语言
public function getLabel()
{
return parent::table('ay_label')->decode()->column('value,type', 'name');
}
// 单个分类信息,不区分语言,兼容跨语言
public function getSort($scode)
{
$field = array(
'a.*',
'c.name AS parentname',
'b.type',
'b.urlname',
'd.gcode'
);
$join = array(
array(
'ay_model b',
'a.mcode=b.mcode',
'LEFT'
),
array(
'ay_content_sort c',
'a.pcode=c.scode',
'LEFT'
),
array(
'ay_member_group d',
'a.gid=d.id',
'LEFT'
)
);
return parent::table('ay_content_sort a')->field($field)
->where("a.scode='$scode' OR a.filename='$scode'")
->join($join)
->find();
}
// 多个分类信息,不区分语言,兼容跨语言
public function getMultSort($scodes)
{
$field = array(
'a.*',
'c.name AS parentname',
'b.type',
'b.urlname'
);
$join = array(
array(
'ay_model b',
'a.mcode=b.mcode',
'LEFT'
),
array(
'ay_content_sort c',
'a.pcode=c.scode',
'LEFT'
)
);
return parent::table('ay_content_sort a')->field($field)
->in('a.scode', $scodes)
->join($join)
->order('a.sorting,a.id')
->select();
}
// 指定分类数量
public function getSortRows($scode)
{
$this->scodes = array(); // 先清空
// 获取多分类子类
$arr = explode(',', $scode);
foreach ($arr as $value) {
$scodes = $this->getSubScodes(trim($value));
}
// 拼接条件
$where1 = array(
"scode in (" . implode_quot(',', $scodes) . ")",
"subscode='$scode'"
);
$where2 = array(
"acode='" . get_lg() . "'",
'status=1',
"date<'" . date('Y-m-d H:i:s') . "'"
);
$result = parent::table('ay_content')->where($where1, 'OR')
->where($where2)
->column('id');
return count($result);
}
// 分类栏目列表关系树
public function getSortsTree()
{
$fields = array(
'a.*',
'b.type',
'b.urlname'
);
$join = array(
'ay_model b',
'a.mcode=b.mcode',
'LEFT'
);
$result = parent::table('ay_content_sort a')->where("a.acode='" . get_lg() . "'")
->where('a.status=1')
->join($join)
->order('a.pcode,a.sorting,a.id')
->column($fields, 'scode');
foreach ($result as $key => $value) {
if ($value['pcode']) {
$result[$value['pcode']]['son'][] = $value; // 记录到关系树
} else {
$data['top'][] = $value; // 记录顶级菜单
}
}
$data['tree'] = $result;
return $data;
}
// 获取分类名称
public function getSortName($scode)
{
$result = $this->getSortList();
return $result[$scode]['name'];
}
// 分类顶级编码
public function getSortTopScode($scode)
{
$result = $this->getSortList();
return $this->getTopParent($scode, $result);
}
// 获取位置
public function getPosition($scode)
{
$result = $this->getSortList();
$this->position = array(); // 重置
$this->getTopParent($scode, $result);
return array_reverse($this->position);
}
// 分类顶级编码
private function getTopParent($scode, $sorts)
{
if (! $scode || ! $sorts) {
return;
}
$this->position[] = $sorts[$scode];
if ($sorts[$scode]['pcode']) {
return $this->getTopParent($sorts[$scode]['pcode'], $sorts);
} else {
return $sorts[$scode]['scode'];
}
}
// 分类子类集
private function getSubScodes($scode)
{
if (! $scode) {
return;
}
$this->scodes[] = $scode;
$subs = parent::table('ay_content_sort')->where("pcode='$scode'")->column('scode');
if ($subs) {
foreach ($subs as $value) {
$this->getSubScodes($value);
}
}
return $this->scodes;
}
// 获取栏目清单
private function getSortList()
{
if (! isset($this->sorts)) {
$fields = array(
'a.id',
'a.pcode',
'a.scode',
'a.name',
'a.filename',
'a.outlink',
'b.type',
'b.urlname'
);
$join = array(
'ay_model b',
'a.mcode=b.mcode',
'LEFT'
);
$this->sorts = parent::table('ay_content_sort a')->where("a.acode='" . get_lg() . "'")
->join($join)
->column($fields, 'scode');
}
return $this->sorts;
}
// 获取筛选字段数据
public function getSelect($field)
{
return parent::table('ay_extfield')->where("name='$field'")->value('value');
}
// 列表内容,带分页,不区分语言,兼容跨语言
public function getLists($scode, $num, $order, $filter = array(), $tags = array(), $select = array(), $fuzzy = true, $start = 1, $lfield = null, $lg = null)
{
$ext_table = false;
if ($lfield) {
$lfield .= ',id,outlink,type,scode,sortfilename,filename,urlname'; // 附加必须字段
$fields = explode(',', $lfield);
$fields = array_unique($fields); // 去重
foreach ($fields as $key => $value) {
if (strpos($value, 'ext_') === 0) {
$ext_table = true;
$fields[$key] = 'e.' . $value;
} elseif ($value == 'sortname') {
$fields[$key] = 'b.name as sortname';
} elseif ($value == 'sortfilename') {
$fields[$key] = 'b.filename as sortfilename';
} elseif ($value == 'subsortname') {
$fields[$key] = 'c.name as subsortname';
} elseif ($value == 'subfilename') {
$fields[$key] = 'c.filename as subfilename';
} elseif ($value == 'type' || $value == 'urlname') {
$fields[$key] = 'd.' . $value;
} elseif ($value == 'modelname') {
$fields[$key] = 'd.name as modelname';
} else {
$fields[$key] = 'a.' . $value;
}
}
} else {
$ext_table = true;
$fields = array(
'a.*',
'b.name as sortname',
'b.filename as sortfilename',
'c.name as subsortname',
'c.filename as subfilename',
'd.type',
'd.name as modelname',
'd.urlname',
'e.*',
'f.gcode'
);
}
$join = array(
array(
'ay_content_sort b',
'a.scode=b.scode',
'LEFT'
),
array(
'ay_content_sort c',
'a.subscode=c.scode',
'LEFT'
),
array(
'ay_model d',
'b.mcode=d.mcode',
'LEFT'
),
array(
'ay_member_group f',
'a.gid=f.id',
'LEFT'
)
);
// 加载扩展字段表
if ($ext_table) {
$join[] = array(
'ay_content_ext e',
'a.id=e.contentid',
'LEFT'
);
}
$scode_arr = array();
if ($scode) {
// 获取所有子类分类编码
$this->scodes = array(); // 先清空
$arr = explode(',', $scode); // 传递有多个分类时进行遍历
foreach ($arr as $value) {
$scodes = $this->getSubScodes(trim($value));
}
// 拼接条件
$scode_arr = array(
"a.scode in (" . implode_quot(',', $scodes) . ")",
"a.subscode='$scode'"
);
}
$where = array(
'a.status=1',
'd.type=2',
"a.date<'" . date('Y-m-d H:i:s') . "'"
);
if ($lg) {
$where['a.acode'] = $lg;
}
// 筛选条件支持模糊匹配
return parent::table('ay_content a')->field($fields)
->where($scode_arr, 'OR')
->where($where)
->where($select, 'AND', 'AND', $fuzzy)
->where($filter, 'OR')
->where($tags, 'OR')
->join($join)
->order($order)
->page(1, $num, $start)
->decode()
->select();
}
// 列表内容,不带分页,不区分语言,兼容跨语言
public function getList($scode, $num, $order, $filter = array(), $tags = array(), $select = array(), $fuzzy = true, $start = 1, $lfield = null, $lg = null)
{
$ext_table = false;
if ($lfield) {
$lfield .= ',id,outlink,type,scode,sortfilename,filename,urlname'; // 附加必须字段
$fields = explode(',', $lfield);
$fields = array_unique($fields); // 去重
foreach ($fields as $key => $value) {
if (strpos($value, 'ext_') === 0) {
$ext_table = true;
$fields[$key] = 'e.' . $value;
} elseif ($value == 'sortname') {
$fields[$key] = 'b.name as sortname';
} elseif ($value == 'sortfilename') {
$fields[$key] = 'b.filename as sortfilename';
} elseif ($value == 'subsortname') {
$fields[$key] = 'c.name as subsortname';
} elseif ($value == 'subfilename') {
$fields[$key] = 'c.filename as subfilename';
} elseif ($value == 'type' || $value == 'urlname') {
$fields[$key] = 'd.' . $value;
} elseif ($value == 'modelname') {
$fields[$key] = 'd.name as modelname';
} else {
$fields[$key] = 'a.' . $value;
}
}
} else {
$ext_table = true;
$fields = array(
'a.*',
'b.name as sortname',
'b.filename as sortfilename',
'c.name as subsortname',
'c.filename as subfilename',
'd.type',
'd.name as modelname',
'd.urlname',
'e.*',
'f.gcode'
);
}
$join = array(
array(
'ay_content_sort b',
'a.scode=b.scode',
'LEFT'
),
array(
'ay_content_sort c',
'a.subscode=c.scode',
'LEFT'
),
array(
'ay_model d',
'b.mcode=d.mcode',
'LEFT'
),
array(
'ay_member_group f',
'a.gid=f.id',
'LEFT'
)
);
// 加载扩展字段表
if ($ext_table) {
$join[] = array(
'ay_content_ext e',
'a.id=e.contentid',
'LEFT'
);
}
$scode_arr = array();
if ($scode) {
// 获取所有子类分类编码
$this->scodes = array(); // 先清空
$arr = explode(',', $scode); // 传递有多个分类时进行遍历
foreach ($arr as $value) {
$scodes = $this->getSubScodes(trim($value));
}
// 拼接条件
$scode_arr = array(
"a.scode in (" . implode_quot(',', $scodes) . ")",
"a.subscode='$scode'"
);
}
$where = array(
'a.status=1',
'd.type=2',
"a.date<'" . date('Y-m-d H:i:s') . "'"
);
if ($lg) {
$where['a.acode'] = $lg;
}
// 筛选条件支持模糊匹配
return parent::table('ay_content a')->field($fields)
->where($scode_arr, 'OR')
->where($where)
->where($select, 'AND', 'AND', $fuzzy)
->where($filter, 'OR')
->where($tags, 'OR')
->join($join)
->order($order)
->limit($start - 1, $num)
->decode()
->select();
}
// 内容详情,不区分语言,兼容跨语言
public function getContent($id)
{
$field = array(
'a.*',
'b.name as sortname',
'b.filename as sortfilename',
'b.outlink as sortoutlink',
'c.name as subsortname',
'c.filename as subfilename',
'd.type',
'd.name as modelname',
'd.urlname',
'e.*',
'f.gcode'
);
$join = array(
array(
'ay_content_sort b',
'a.scode=b.scode',
'LEFT'
),
array(
'ay_content_sort c',
'a.subscode=c.scode',
'LEFT'
),
array(
'ay_model d',
'b.mcode=d.mcode',
'LEFT'
),
array(
'ay_content_ext e',
'a.id=e.contentid',
'LEFT'
),
array(
'ay_member_group f',
'a.gid=f.id',
'LEFT'
)
);
$result = parent::table('ay_content a')->field($field)
->where("a.id='$id' OR a.filename='$id'")
->where('a.status=1')
->join($join)
->decode()
->find();
return $result;
}
// 单篇详情,不区分语言,兼容跨语言
public function getAbout($scode)
{
$field = array(
'a.*',
'b.name as sortname',
'b.filename as sortfilename',
'c.name as subsortname',
'c.filename as subfilename',
'd.type',
'd.name as modelname',
'd.urlname',
'e.*',
'f.gcode'
);
$join = array(
array(
'ay_content_sort b',
'a.scode=b.scode',
'LEFT'
),
array(
'ay_content_sort c',
'a.subscode=c.scode',
'LEFT'
),
array(
'ay_model d',
'b.mcode=d.mcode',
'LEFT'
),
array(
'ay_content_ext e',
'a.id=e.contentid',
'LEFT'
),
array(
'ay_member_group f',
'a.gid=f.id',
'LEFT'
)
);
$result = parent::table('ay_content a')->field($field)
->where("a.scode='$scode' OR b.filename='$scode'")
->where('a.status=1')
->join($join)
->decode()
->order('id DESC')
->find();
return $result;
}
// 指定内容多图
public function getContentPics($id)
{
$result = parent::table('ay_content')->field("pics,picstitle")
->where("id='$id'")
->where('status=1')
->find();
return $result;
}
// 指定内容多选调用
public function getContentCheckbox($id, $field)
{
$result = parent::table('ay_content_ext')->where("contentid='$id'")->value($field);
return $result;
}
// 指定内容标签调用
public function getContentTags($id)
{
$result = parent::table('ay_content')->field('scode,tags')
->where("id='$id'")
->where('status=1')
->find();
return $result;
}
// 指定分类标签调用
public function getSortTags($scode)
{
$join = array(
array(
'ay_content_sort b',
'a.scode=b.scode',
'LEFT'
),
array(
'ay_model c',
'b.mcode=c.mcode',
'LEFT'
)
);
$scode_arr = array();
if ($scode) {
// 获取所有子类分类编码
$this->scodes = array(); // 先清空
$scodes = $this->getSubScodes(trim($scode)); // 获取子类
// 拼接条件
$scode_arr = array(
"a.scode in (" . implode_quot(',', $scodes) . ")",
"a.subscode='$scode'"
);
}
$result = parent::table('ay_content a')->where("c.type=2 AND a.tags<>''")
->where($scode_arr, 'OR')
->join($join)
->where('a.status=1')
->order('a.visits DESC')
->column('a.tags');
return $result;
}
// 上一篇内容
public function getContentPre($scode, $id)
{
if (! $this->pre) {
$this->scodes = array();
$scodes = $this->getSubScodes($scode);
$field = array(
'a.id',
'a.title',
'a.filename',
'a.ico',
'a.scode',
'b.filename as sortfilename',
'c.type',
'c.urlname'
);
$join = array(
array(
'ay_content_sort b',
'a.scode=b.scode',
'LEFT'
),
array(
'ay_model c',
'b.mcode=c.mcode',
'LEFT'
)
);
$this->pre = parent::table('ay_content a')->field($field)
->where("a.id<$id")
->join($join)
->in('a.scode', $scodes)
->where("a.acode='" . get_lg() . "'")
->where('a.status=1')
->order('a.id DESC')
->find();
}
return $this->pre;
}
// 下一篇内容
public function getContentNext($scode, $id)
{
if (! $this->next) {
$this->scodes = array();
$scodes = $this->getSubScodes($scode);
$field = array(
'a.id',
'a.title',
'a.filename',
'a.ico',
'a.scode',
'b.filename as sortfilename',
'c.type',
'c.urlname'
);
$join = array(
array(
'ay_content_sort b',
'a.scode=b.scode',
'LEFT'
),
array(
'ay_model c',
'b.mcode=c.mcode',
'LEFT'
)
);
$this->next = parent::table('ay_content a')->field($field)
->where("a.id>$id")
->join($join)
->in('a.scode', $scodes)
->where("a.acode='" . get_lg() . "'")
->where('a.status=1')
->order('a.id ASC')
->find();
}
return $this->next;
}
// 幻灯片
public function getSlides($gid, $num, $start = 1)
{
$result = parent::table('ay_slide')->where("gid='$gid'")
->order('sorting ASC,id ASC')
->limit($start - 1, $num)
->select();
return $result;
}
// 友情链接
public function getLinks($gid, $num, $start = 1)
{
$result = parent::table('ay_link')->where("gid='$gid'")
->order('sorting ASC,id ASC')
->limit($start - 1, $num)
->select();
return $result;
}
// 获取留言
public function getMessage($num, $page = true, $start = 1, $lg = null)
{
if ($lg == 'all') {
$where = array();
} elseif ($lg) {
$where = array(
'a.acode' => $lg
);
} else {
$where = array(
'a.acode' => get_lg()
);
}
$field = array(
'a.*',
'b.username',
'b.nickname',
'b.headpic'
);
$join = array(
'ay_member b',
'a.uid=b.id',
'LEFT'
);
if ($page) {
return parent::table('ay_message a')->field($field)
->join($join)
->where("a.status=1")
->where($where)
->order('a.id DESC')
->decode(false)
->page(1, $num, $start)
->select();
} else {
return parent::table('ay_message a')->field($field)
->join($join)
->where("a.status=1")
->where($where)
->order('a.id DESC')
->decode(false)
->limit($start - 1, $num)
->select();
}
}
// 新增留言
public function addMessage($data)
{
return parent::table('ay_message')->autoTime()->insert($data);
}
// 获取表单字段
public function getFormField($fcode)
{
$field = array(
'a.table_name',
'a.form_name',
'b.name',
'b.required',
'b.description'
);
$join = array(
'ay_form_field b',
'a.fcode=b.fcode',
'LEFT'
);
return parent::table('ay_form a')->field($field)
->where("a.fcode='$fcode'")
->join($join)
->order('b.sorting ASC,b.id ASC')
->select();
}
// 获取表单表名称
public function getFormTable($fcode)
{
return parent::table('ay_form')->where("fcode='$fcode'")->value('table_name');
}
// 获取表单数据
public function getForm($table, $num, $page = true, $start = 1)
{
if ($page) {
return parent::table($table)->order('id DESC')
->decode(false)
->page(1, $num, $start)
->select();
} else {
return parent::table($table)->order('id DESC')
->decode(false)
->limit($start - 1, $num)
->select();
}
}
// 新增表单数据
public function addForm($table, $data)
{
return parent::table($table)->insert($data);
}
// 文章内链
public function getTags()
{
return parent::table('ay_tags')->field('name,link')
->where("acode='" . get_lg() . "'")
->order('length(name) desc')
->select();
}
// 新增评论
public function addComment($data)
{
return parent::table('ay_member_comment')->insert($data);
}
// 文章评论
public function getComment($contentid, $pid, $num, $order, $page = false, $start = 1)
{
$field = array(
'a.*',
'b.username',
'b.nickname',
'b.headpic',
'c.username as pusername',
'c.nickname as pnickname',
'c.headpic as pheadpic'
);
$join = array(
array(
'ay_member b',
'a.uid=b.id',
'LEFT'
),
array(
'ay_member c',
'a.puid=c.id',
'LEFT'
)
);
if ($page) {
return parent::table('ay_member_comment a')->field($field)
->join($join)
->where("a.contentid='$contentid'")
->where('a.pid=' . $pid)
->where("a.status=1")
->order($order)
->page(1, $num, $start)
->select();
} else {
return parent::table('ay_member_comment a')->field($field)
->join($join)
->where("a.contentid='$contentid'")
->where('a.pid=' . $pid)
->where("a.status=1")
->order($order)
->limit($start - 1, $num)
->select();
}
}
// 我的评论
public function getMyComment($num, $order, $page = false, $start = 1)
{
$field = array(
'a.*',
'b.username',
'b.nickname',
'b.headpic',
'c.username as pusername',
'c.nickname as pnickname',
'c.headpic as pheadpic',
'd.title'
);
$join = array(
array(
'ay_member b',
'a.uid=b.id',
'LEFT'
),
array(
'ay_member c',
'a.puid=c.id',
'LEFT'
),
array(
'ay_content d',
'a.contentid=d.id',
'LEFT'
)
);
if ($page) {
return parent::table('ay_member_comment a')->field($field)
->join($join)
->where("uid='" . session('pboot_uid') . "'")
->order($order)
->page(1, $num, $start)
->select();
} else {
return parent::table('ay_member_comment a')->field($field)
->join($join)
->where("uid='" . session('pboot_uid') . "'")
->order($order)
->limit($start - 1, $num)
->select();
}
}
// 删除评论
public function delComment($id)
{
return parent::table('ay_member_comment')->where("uid='" . session('pboot_uid') . "'")
->where("id=$id")
->delete();
}
}

View File

@@ -0,0 +1,976 @@
<?php
/**
* @copyright (C)2016-2099 Hnaoyun Inc.
* @author XingMeng
* @email hnxsh@foxmail.com
* @date 2017年11月5日
*
*/
use core\basic\Config;
// 获取用户浏览器类型
function get_user_bs($bs = null)
{
if (isset($_SERVER["HTTP_USER_AGENT"])) {
$user_agent = strtolower($_SERVER["HTTP_USER_AGENT"]);
} else {
return null;
}
// 直接检测传递的值
if ($bs) {
if (strpos($user_agent, strtolower($bs))) {
return true;
} else {
return false;
}
}
// 固定检测
if (strpos($user_agent, 'micromessenger')) {
$user_bs = 'Weixin';
} elseif (strpos($user_agent, 'qq')) {
$user_bs = 'QQ';
} elseif (strpos($user_agent, 'weibo')) {
$user_bs = 'Weibo';
} elseif (strpos($user_agent, 'alipayclient')) {
$user_bs = 'Alipay';
} elseif (strpos($user_agent, 'trident/7.0')) {
$user_bs = 'IE11'; // 新版本IE优先避免360等浏览器的兼容模式检测错误
} elseif (strpos($user_agent, 'trident/6.0')) {
$user_bs = 'IE10';
} elseif (strpos($user_agent, 'trident/5.0')) {
$user_bs = 'IE9';
} elseif (strpos($user_agent, 'trident/4.0')) {
$user_bs = 'IE8';
} elseif (strpos($user_agent, 'msie 7.0')) {
$user_bs = 'IE7';
} elseif (strpos($user_agent, 'msie 6.0')) {
$user_bs = 'IE6';
} elseif (strpos($user_agent, 'edge')) {
$user_bs = 'Edge';
} elseif (strpos($user_agent, 'firefox')) {
$user_bs = 'Firefox';
} elseif (strpos($user_agent, 'chrome') || strpos($user_agent, 'android')) {
$user_bs = 'Chrome';
} elseif (strpos($user_agent, 'safari')) {
$user_bs = 'Safari';
} elseif (strpos($user_agent, 'mj12bot')) {
$user_bs = 'MJ12bot';
} else {
$user_bs = 'Other';
}
return $user_bs;
}
// 获取用户操作系统类型
function get_user_os($osstr = null)
{
if (isset($_SERVER["HTTP_USER_AGENT"])) {
$user_agent = strtolower($_SERVER["HTTP_USER_AGENT"]);
} else {
return null;
}
// 直接检测传递的值
if ($osstr) {
if (strpos($user_agent, strtolower($osstr))) {
return true;
} else {
return false;
}
}
if (strpos($user_agent, 'windows nt 5.0')) {
$user_os = 'Windows 2000';
} elseif (strpos($user_agent, 'windows nt 9')) {
$user_os = 'Windows 9X';
} elseif (strpos($user_agent, 'windows nt 5.1')) {
$user_os = 'Windows XP';
} elseif (strpos($user_agent, 'windows nt 5.2')) {
$user_os = 'Windows 2003';
} elseif (strpos($user_agent, 'windows nt 6.0')) {
$user_os = 'Windows Vista';
} elseif (strpos($user_agent, 'windows nt 6.1')) {
$user_os = 'Windows 7';
} elseif (strpos($user_agent, 'windows nt 6.2')) {
$user_os = 'Windows 8';
} elseif (strpos($user_agent, 'windows nt 6.3')) {
$user_os = 'Windows 8.1';
} elseif (strpos($user_agent, 'windows nt 10')) {
$user_os = 'Windows 10';
} elseif (strpos($user_agent, 'windows phone')) {
$user_os = 'Windows Phone';
} elseif (strpos($user_agent, 'android')) {
$user_os = 'Android';
} elseif (strpos($user_agent, 'iphone')) {
$user_os = 'iPhone';
} elseif (strpos($user_agent, 'ipad')) {
$user_os = 'iPad';
} elseif (strpos($user_agent, 'mac')) {
$user_os = 'Mac';
} elseif (strpos($user_agent, 'sunos')) {
$user_os = 'Sun OS';
} elseif (strpos($user_agent, 'bsd')) {
$user_os = 'BSD';
} elseif (strpos($user_agent, 'ubuntu')) {
$user_os = 'Ubuntu';
} elseif (strpos($user_agent, 'linux')) {
$user_os = 'Linux';
} elseif (strpos($user_agent, 'unix')) {
$user_os = 'Unix';
} else {
$user_os = 'Other';
}
return $user_os;
}
// 获取用户IP
function get_user_ip()
{
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$cip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
$cip = $_SERVER['HTTP_CLIENT_IP'];
} else {
$cip = $_SERVER['REMOTE_ADDR'];
}
if ($cip == '::1') { // 使用localhost时
$cip = '127.0.0.1';
}
if (! preg_match('/^[0-9\.]+$/', $cip)) { // 非标准的IP
$cip = '0.0.0.0';
}
return htmlspecialchars($cip);
}
// 执行URL请求并返回数据
function get_url($url, $fields = array(), $UserAgent = null, $vfSSL = false)
{
$SSL = substr($url, 0, 8) == "https://" ? true : false;
$ch = curl_init();
if ($UserAgent) { // 在HTTP请求中包含一个"User-Agent: "头的字符串。
curl_setopt($ch, CURLOPT_USERAGENT, $UserAgent);
} else {
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER["HTTP_USER_AGENT"]);
}
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60); // 在发起连接前等待的时间如果设置为0则无限等待
curl_setopt($ch, CURLOPT_TIMEOUT, 90); // 设置cURL允许执行的最长秒数
curl_setopt($ch, CURLOPT_URL, $url); // 设置请求地址
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // 设置cURL 参数,要求结果保存到字符串中还是输出到屏幕上。
// SSL验证
if ($SSL) {
if ($vfSSL) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, CORE_PATH . '/cacert.pem');
} else {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 信任任何证书
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); // 不检查证书中是否设置域名
}
}
// 数据字段
if ($fields) {
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
}
$output = curl_exec($ch);
if (curl_errno($ch)) {
error('请求远程地址错误:' . curl_error($ch));
}
curl_close($ch);
return $output;
}
// 返回时间戳格式化日期时间,默认当前
function get_datetime($timestamp = null)
{
if (! $timestamp)
$timestamp = time();
return date('Y-m-d H:i:s', $timestamp);
}
// 返回时间戳格式化日期,默认当前
function get_date($timestamp = null)
{
if (! $timestamp)
$timestamp = time();
return date('Y-m-d', $timestamp);
}
// 返回时间戳差值部分,年、月、日
function get_date_diff($startstamp, $endstamp, $return = 'm')
{
$y = date('Y', $endstamp) - date('Y', $startstamp);
$m = date('m', $endstamp) - date('m', $startstamp);
switch ($return) {
case 'y':
if ($y <= 1) {
$y = $m / 12;
}
$string = $y;
break;
case 'm':
$string = $y * 12 + $m;
break;
case 'd':
$string = ($endstamp - $startstamp) / 86400;
break;
}
return $string;
}
// 生成无限极树,$data为二维数组数据
function get_tree($data, $tid, $idField, $pidField, $sonName = 'son')
{
$tree = array();
foreach ($data as $key => $value) {
if (is_array($value)) {
if ($value[$pidField] == "$tid") { // 父亲找到儿子
$value[$sonName] = get_tree($data, $value[$idField], $idField, $pidField, $sonName);
$tree[] = $value;
}
} else {
if ($value->$pidField == "$tid") { // 父亲找到儿子
$temp = clone $value;
$temp->$sonName = get_tree($data, $value->$idField, $idField, $pidField, $sonName);
$tree[] = $temp;
}
}
}
return $tree;
}
// 获取数据数组的映射数组
function get_mapping($array, $vValue, $vKey = null)
{
if (! $array)
return array();
foreach ($array as $key => $value) {
if (is_array($value)) {
if ($vKey) {
$result[$value[$vKey]] = $value[$vValue];
} else {
$result[] = $value[$vValue];
}
} elseif (is_object($value)) {
if ($vKey) {
$result[$value->$vKey] = $value->$vValue;
} else {
$result[] = $value->$vValue;
}
} else {
return $array;
}
}
return $result;
}
// 页码赋值异常返回1
function get_page()
{
if (isset($_GET['page'])) {
$value = trim($_GET['page']);
if (preg_match('/^[0-9]+$/', $value)) {
return $value;
}
}
return 1;
}
// 返回请求类型
function get_request_method()
{
return $_SERVER['REQUEST_METHOD'];
}
// 获取当前完整URL地址
function get_current_url()
{
$http_type = is_https() ? 'https://' : 'http://';
return $http_type . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
}
// 获取字符串第N次出现位置
function get_strpos($string, $find, $n)
{
$pos = strpos($string, $find);
for ($i = 2; $i <= $n; $i ++) {
$pos = strpos($string, $find, $pos + 1);
}
return $pos;
}
// array_column向下兼容低版本PHP
if (! function_exists('array_column')) {
function array_column($input, $columnKey, $indexKey = null)
{
$columnKeyIsNumber = (is_numeric($columnKey)) ? true : false;
$indexKeyIsNull = (is_null($indexKey)) ? true : false;
$indexKeyIsNumber = (is_numeric($indexKey)) ? true : false;
$result = array();
foreach ((array) $input as $key => $row) {
if ($columnKeyIsNumber) {
$tmp = array_slice($row, $columnKey, 1);
$tmp = (is_array($tmp) && ! empty($tmp)) ? current($tmp) : null;
} else {
$tmp = isset($row[$columnKey]) ? $row[$columnKey] : null;
}
if (! $indexKeyIsNull) {
if ($indexKeyIsNumber) {
$key = array_slice($row, $indexKey, 1);
$key = (is_array($key) && ! empty($key)) ? current($key) : null;
$key = is_null($key) ? 0 : $key;
} else {
$key = isset($row[$indexKey]) ? $row[$indexKey] : 0;
}
}
$result[$key] = $tmp;
}
return $result;
}
}
/**
* 系统信息弹出解析函数
*
* @param string $info_tpl模板
* @param string $string内容
* @param string $jump_url跳转地址
* @param number $time时间
*/
function parse_info_tpl($info_tpl, $string, $jump_url = null, $time = 0)
{
if (file_exists($info_tpl)) {
$tpl_content = file_get_contents($info_tpl);
if ($jump_url) {
$timeout_js = "<script>var timeout = {time};var showbox = document.getElementById('time');show();function show(){showbox.innerHTML = timeout+ ' 秒后自动跳转';timeout--;if (timeout == 0) {window.location.href = '{url}';}else {setTimeout(function(){show();}, 1000);}}</script>";
} else {
$timeout_js = '';
}
$tpl_content = str_replace('{js}', $timeout_js, $tpl_content);
$tpl_content = str_replace('{info}', $string, $tpl_content);
$tpl_content = str_replace('{url}', $jump_url, $tpl_content);
$tpl_content = str_replace('{time}', $time, $tpl_content);
$tpl_content = str_replace('{sitedir}', SITE_DIR, $tpl_content);
$tpl_content = str_replace('{coredir}', CORE_DIR, $tpl_content);
$tpl_content = str_replace('{appversion}', APP_VERSION, $tpl_content);
$tpl_content = str_replace('{serveros}', PHP_OS, $tpl_content);
$tpl_content = str_replace('{serversoft}', $_SERVER['SERVER_SOFTWARE'], $tpl_content);
return $tpl_content;
} else {
exit('<div style="font-size:50px;">:(</div>提示信息的模板文件不存在!');
}
}
// 获取转义数据,支持字符串、数组、对象
function escape_string($string)
{
if (! $string)
return $string;
if (is_array($string)) { // 数组处理
foreach ($string as $key => $value) {
$string[$key] = escape_string($value);
}
} elseif (is_object($string)) { // 对象处理
foreach ($string as $key => $value) {
$string->$key = escape_string($value);
}
} else { // 字符串处理
$string = htmlspecialchars(trim($string), ENT_QUOTES, 'UTF-8');
$string = addslashes($string);
}
return $string;
}
// 字符反转义html实体及斜杠支持字符串、数组、对象
function decode_string($string)
{
if (! $string)
return $string;
if (is_array($string)) { // 数组处理
foreach ($string as $key => $value) {
$string[$key] = decode_string($value);
}
} elseif (is_object($string)) { // 对象处理
foreach ($string as $key => $value) {
$string->$key = decode_string($value);
}
} else { // 字符串处理
$string = stripcslashes($string);
$string = htmlspecialchars_decode($string, ENT_QUOTES);
}
$string = preg_replace_r('/pboot:if/i', 'pboot@if', $string); // 避免解码绕过问题
return $string;
}
// 字符反转义斜杠,支持字符串、数组、对象
function decode_slashes($string)
{
if (! $string)
return $string;
if (is_array($string)) { // 数组处理
foreach ($string as $key => $value) {
$string[$key] = decode_slashes($value);
}
} elseif (is_object($string)) { // 对象处理
foreach ($string as $key => $value) {
$string->$key = decode_slashes($value);
}
} else { // 字符串处理
$string = stripcslashes($string);
}
return $string;
}
// 字符串双层MD5加密
function encrypt_string($string)
{
return md5(md5($string));
}
// 生成唯一标识符
function get_uniqid()
{
return encrypt_string(uniqid(mt_rand(), true));
}
// 清洗html代码的空白符号
function clear_html_blank($string)
{
$string = str_replace("\r\n", '', $string); // 清除换行符
$string = str_replace("\n", '', $string); // 清除换行符
$string = str_replace("\t", '', $string); // 清除制表符
$string = str_replace(' ', '', $string); // 清除大空格
$string = str_replace('&nbsp;', '', $string); // 清除 &nbsp;
$string = preg_replace('/\s+/', ' ', $string); // 清除空格
return $string;
}
// 去除字符串两端斜线
function trim_slash($string)
{
return trim($string, '/');
}
// 驼峰转换下划线加小写字母
function hump_to_underline($string)
{
return strtolower(preg_replace('/(?<=[a-z])([A-Z])/', '_$1', $string));
}
// 转换对象为数组
function object_to_array($object)
{
return json_decode(json_encode($object), true);
}
// 转换数组为对象
function array_to_object($array)
{
return json_decode(json_encode($array));
}
// 值是否在对象中
function in_object($needle, $object)
{
foreach ($object as $value) {
if ($needle == $value)
return true;
}
}
// 结果集中查找指定字段父节点是否存在
function result_value_search($needle, $result, $skey)
{
foreach ($result as $key => $value) {
if ($value->$skey == $needle) {
return $key;
}
}
return false;
}
// 多维数组合并
function mult_array_merge($array1, $array2)
{
if (is_array($array2)) {
foreach ($array2 as $key => $value) {
if (is_array($value)) {
if (array_key_exists($key, $array1)) {
$array1[$key] = mult_array_merge($array1[$key], $value);
} else {
$array1[$key] = $value;
}
} else {
$array1[$key] = $value;
}
}
}
return $array1;
}
// 数组转换为带引号字符串
function implode_quot($glue, array $pieces, $diffnum = false)
{
if (! $pieces)
return "''";
foreach ($pieces as $key => $value) {
if ($diffnum && ! is_numeric($value)) {
$value = "'$value'";
} elseif (! $diffnum) {
$value = "'$value'";
}
if (isset($string)) {
$string .= $glue . $value;
} else {
$string = $value;
}
}
return $string;
}
// 是否为多维数组,是返回true
function is_multi_array($array)
{
if (is_array($array)) {
return (count($array) != count($array, 1));
} else {
return false;
}
}
// 是否为移动设备
function is_mobile()
{
$os = get_user_os();
if ($os == 'Android' || $os == 'iPhone' || $os == 'Windows Phone' || $os == 'iPad') {
return true;
}
}
// 是否为POST请求
function is_post()
{
if ($_POST) {
return true;
} else {
return false;
}
}
// 是否为GET请求
function is_get()
{
if ($_GET) {
return true;
} else {
return false;
}
}
// 是否为PUT请求
function is_put()
{
if ($_SERVER['REQUEST_METHOD'] == 'PUT') {
return true;
} else {
return false;
}
}
// 是否为PATCH请求
function is_patch()
{
if ($_SERVER['REQUEST_METHOD'] == 'PATCH') {
return true;
} else {
return false;
}
}
// 是否为DELETE请求
function is_delete()
{
if ($_SERVER['REQUEST_METHOD'] == 'DELETE') {
return true;
} else {
return false;
}
}
// 是否为AJAX请求
function is_ajax()
{
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
return true;
} else {
return false;
}
}
// 判断当前是否为https
function is_https()
{
if ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on')) {
return true;
} elseif (isset($_SERVER['REQUEST_SCHEME']) && strtolower($_SERVER['REQUEST_SCHEME']) == 'https') {
return true;
} elseif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') {
return true;
} elseif (isset($_SERVER['HTTP_X_CLIENT_SCHEME']) && strtolower($_SERVER['HTTP_X_CLIENT_SCHEME']) == 'https') {
return true;
} else {
return false;
}
}
// 获取当前访问地址
function get_http_url($noport = false)
{
if (is_https()) {
$url = 'https://' . $_SERVER['HTTP_HOST'];
} else {
$url = 'http://' . $_SERVER['HTTP_HOST'];
}
if ($noport) {
$url = str_replace(':' . $_SERVER['SERVER_PORT'], '', $url);
}
return $url;
}
// 获取当前访问域名
function get_http_host($noport = true)
{
if ($noport) {
return str_replace(':' . $_SERVER['SERVER_PORT'], '', $_SERVER['HTTP_HOST']);
} else {
return $_SERVER['HTTP_HOST'];
}
}
// 服务器信息
function get_server_info()
{
// 定义输出常量
define('YES', 'Yes');
define('NO', '<span style="color:red">No</span>');
// 服务器系统
$data['php_os'] = PHP_OS;
// 服务器访问地址
$data['http_host'] = $_SERVER['HTTP_HOST'];
// 服务器名称
$data['server_name'] = $_SERVER['SERVER_NAME'];
// 服务器端口
$data['server_port'] = $_SERVER['SERVER_PORT'];
// 服务器地址
$data['server_addr'] = isset($_SERVER['LOCAL_ADDR']) ? $_SERVER['LOCAL_ADDR'] : $_SERVER['SERVER_ADDR'];
// 服务器软件
$data['server_software'] = $_SERVER['SERVER_SOFTWARE'];
// 站点目录
$data['document_root'] = isset($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : DOC_PATH;
// PHP版本
$data['php_version'] = PHP_VERSION;
// 数据库驱动
$data['db_driver'] = Config::get('database.type');
// php配置文件
$data['php_ini'] = @php_ini_loaded_file();
// 最大上传
$data['upload_max_filesize'] = ini_get('upload_max_filesize');
// 最大提交
$data['post_max_size'] = ini_get('post_max_size');
// 最大提交文件数
$data['max_file_uploads'] = ini_get('max_file_uploads');
// 内存限制
$data['memory_limit'] = ini_get('memory_limit');
// 检测gd扩展
$data['gd'] = extension_loaded('gd') ? YES : NO;
// 检测imap扩展
$data['imap'] = extension_loaded('imap') ? YES : NO;
// 检测socket扩展
$data['sockets'] = extension_loaded('sockets') ? YES : NO;
// 检测curl扩展
$data['curl'] = extension_loaded('curl') ? YES : NO;
// 会话保存路径
$data['session_save_path'] = session_save_path() ?: $_SERVER['TMP'];
// 检测standard库是否存在
$data['standard'] = extension_loaded('standard') ? YES : NO;
// 检测多线程支持
$data['pthreads'] = extension_loaded('pthreads') ? YES : NO;
// 检测XCache支持
$data['xcache'] = extension_loaded('XCache') ? YES : NO;
// 检测APC支持
$data['apc'] = extension_loaded('APC') ? YES : NO;
// 检测eAccelerator支持
$data['eaccelerator'] = extension_loaded('eAccelerator') ? YES : NO;
// 检测wincache支持
$data['wincache'] = extension_loaded('wincache') ? YES : NO;
// 检测ZendOPcache支持
$data['zendopcache'] = extension_loaded('Zend OPcache') ? YES : NO;
// 检测memcache支持
$data['memcache'] = extension_loaded('memcache') ? YES : NO;
// 检测memcached支持
$data['memcached'] = extension_loaded('memcached') ? YES : NO;
// 已经安装模块
$loaded_extensions = get_loaded_extensions();
$extensions = '';
foreach ($loaded_extensions as $key => $value) {
$extensions .= $value . ', ';
}
$data['extensions'] = $extensions;
return json_decode(json_encode($data));
}
// 获取数据库类型
function get_db_type()
{
switch (Config::get('database.type')) {
case 'mysqli':
case 'pdo_mysql':
$db = 'mysql';
break;
case 'sqlite':
case 'pdo_sqlite':
$db = 'sqlite';
break;
case 'pdo_pgsql':
$db = 'pgsql';
break;
default:
$db = null;
}
return $db;
}
// 获取间隔的月份的起始及结束日期
function get_month_days($date, $start = 0, $interval = 1, $retamp = false)
{
$timestamp = strtotime($date) ?: $date;
$first_day = strtotime(date('Y', $timestamp) . '-' . date('m', $timestamp) . '-01 +' . $start . ' month');
$last_day = strtotime(date('Y-m-d', $first_day) . ' +' . $interval . ' month -1 day');
if ($retamp) {
$return = array(
'first' => $first_day,
'last' => $last_day
);
} else {
$return = array(
'first' => date('Y-m-d', $first_day),
'last' => date('Y-m-d', $last_day)
);
}
return $return;
}
// 框架地址地址前缀
function url_index_path($indexfile = null)
{
$indexfile = $indexfile ?: $_SERVER["SCRIPT_NAME"];
if (Config::get('app_url_type') == 2 && strripos($indexfile, 'index.php') !== false) {
return SITE_DIR;
} elseif (Config::get('app_url_type') == 3 && strripos($indexfile, 'index.php') !== false) {
return SITE_DIR . '/?p=';
} elseif (Config::get('app_url_type') == 3 && strripos($indexfile, 'index.php') === false) {
return $indexfile . '?p=';
} else {
return $indexfile;
}
}
// 获取服务端web软件
function get_server_soft()
{
$soft = strtolower($_SERVER["SERVER_SOFTWARE"]);
if (strpos($soft, 'iis')) {
return 'iis';
} elseif (strpos($soft, 'apache')) {
return 'apache';
} elseif (strpos($soft, 'nginx')) {
return 'nginx';
} else {
return 'other';
}
}
// 创建会话层级目录
function create_session_dir($path, $depth)
{
if ($depth < 1) {
return;
} else {
$depth --;
}
$char = array(
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
'r',
's',
't',
'u',
'v'
);
foreach ($char as $value) {
if (! check_dir($path . '/' . $value, true)) {
error('会话目录写入权限不足!');
}
create_session_dir($path . '/' . $value, $depth);
}
}
// 中英混合的字符串截取,以一个汉字为一个单位长度,英文为半个
function substr_both($string, $strat, $length)
{
$s = 0; // 起始位置
$i = 0; // 实际Byte计数
$n = 0; // 字符串长度计数
$str_length = strlen($string); // 字符串的字节长度
while (($n < $length) and ($i < $str_length)) {
$ascnum = Ord(substr($string, $i, 1)); // 得到字符串中第$i位字符的ascii码
if ($ascnum >= 224) { // 根据UTF-8编码规范将3个连续的字符计为单个字符
$i += 3;
$n ++;
} elseif ($ascnum >= 192) { // 根据UTF-8编码规范将2个连续的字符计为单个字符
$i += 2;
$n ++;
} else {
$i += 1;
$n += 0.5;
}
if ($s == 0 && $strat > 0 && $n >= $strat) {
$s = $i; // 记录起始位置
}
}
if ($n < $strat) { // 起始位置大于字符串长度
return;
}
return substr($string, $s, $i);
}
// 中英混合的字符串长度,以一个汉字为一个单位长度,英文为半个
function strlen_both($string)
{
$i = 0; // 实际Byte计数
$n = 0; // 字符串长度计数
$str_length = strlen($string); // 字符串的字节长度
while ($i < $str_length) {
$ascnum = Ord(substr($string, $i, 1)); // 得到字符串中第$i位字符的ascii码
if ($ascnum >= 224) { // 根据UTF-8编码规范将3个连续的字符计为单个字符
$i += 3;
$n ++;
} elseif ($ascnum >= 192) { // 根据UTF-8编码规范将2个连续的字符计为单个字符
$i += 2;
$n ++;
} else {
$i += 1;
$n += 0.5;
}
}
return $n;
}
// 获取地址参数
function query_string($unset = null)
{
if (isset($_SERVER["QUERY_STRING"]) && ! ! $qs = $_SERVER["QUERY_STRING"]) {
parse_str($qs, $output);
unset($output['page']);
$unset = strpos($unset, ',') ? explode(',', $unset) : $unset;
if (is_array($unset)) {
foreach ($unset as $value) {
if (isset($output[$value])) {
unset($output[$value]);
}
}
} else {
if (isset($output[$unset])) {
unset($output[$unset]);
}
}
// 避免路径参数编码
if (isset($output['p'])) {
$p = 'p=' . $output['p'];
unset($output['p']);
$qs = $output ? $p . '&' . http_build_query($output) : $p;
} else {
$qs = http_build_query($output);
}
}
return $qs ? '?' . $qs : '';
}
// 判断是否在子网
function network_match($ip, $network)
{
if (strpos($network, '/') > 0) {
$network = explode('/', $network);
$move = 32 - $network[1];
if ($network[1] == 0) {
return true;
}
return ((ip2long($ip) >> $move) === (ip2long($network[0]) >> $move)) ? true : false;
} elseif ($network == $ip) {
return true;
} else {
return false;
}
}
// 递归替换
function preg_replace_r($search, $replace, $subject)
{
while (preg_match($search, $subject)) {
$subject = preg_replace($search, $replace, $subject);
}
return $subject;
}
// 生成随机验证码
function create_code($len = 4)
{
$charset = 'ABCDEFGHKMNPRTUVWXY23456789';
$charset = str_shuffle($charset);
$charlen = strlen($charset) - 1;
$code = '';
for ($i = 0; $i < $len; $i ++) {
$code .= $charset[mt_rand(0, $charlen)];
}
return $code;
}

View File

@@ -0,0 +1,25 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>错误信息</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
</head>
<body>
<div style="margin-left:10%;margin-top:5%;">
<div style="margin-bottom:20px;"><img src="{coredir}/template/face02.png" height="120"></div>
<div style="font-size:20px;margin-bottom:20px;">{info} <span id="time" style="font-size:18px;"></span></div>
<div><span style="font-size:12px;border-top:1px solid #ccc;color:#ccc;padding-top:2px;">
程序版本:{appversion}
操作系统:{serveros}
WEB应用{serversoft}
</span></div>
</div>
{js}
</body>
</html>

View File

@@ -0,0 +1,669 @@
##########################################
官方网站https://www.pbootcms.com
标签手册https://www.pbootcms.com/docs.html
##########################################
PbootCMS V3.0.6 build 2021-09-29
1、新增文章多图标题功能,前台标签:[pics:title]
2、新增在config中定义cmsname变量修改系统显示名称
3、去除后台底部版权区域扩大操作范围
4、支持修改CMS名称后自动隐藏官方信息
5、栏目新增def1-def3三个备用描述字段
PbootCMS V3.0.5 build 2021-06-18
1、修复系统存在的安全漏洞重要
PbootCMS V3.0.4 build 2021-02-14
1、新增{pboot:sql sql="语句"}[sql:字段]{/pboot:sql}万能循环标签;
2、新增自动跳转HTTPS功能参数
3、新增自动跳转主域名功能参数
4、修复地址栏扩展后可附带任意字符问题;
5、修复部分主机CDN后台跳转异常
6、升级layui为最新版本
7、修复系统存在的安全问题
8、优化内容含有标签的处理
PbootCMS V3.0.3 build 2020-10-07
1、修复上版本出现的地址后缀不一致问题
2、修复搜索功能多语言混乱问题
3、新增{pboot:isregister}用于js检查用户名是否已经注册
4、修复已经注册的邮箱仍然发送验证码问题
5、修复系统存在的安全问题
PbootCMS V3.0.2 build 2020-08-04
1、修复会员评论无昵称时不解析标签问题
2、修复默认模板留言页面判断错误问题
3、修复两处存在安全隐患的漏洞
4、修复首页筛选兼容模式错误
5、修复tag标签地址错误问题
6、修复扩展类文件地址错误问题
7、修复文章关闭后tag依然调用问题
8、修复后台设置搜索词标题不解析问题
9、修复内置附件标签不支持截取问题
10、其他问题修复与优化
PbootCMS V3.0.1 build 2020-07-09
1、修复会员权限不足报错页面被404覆盖掉问题
2、新增对循环体标签整体进行访问权限控制如list,nav等
3、新增内容权限不足时调整登录界面“不等待跳登录”参数控制
PbootCMS V3.0.0 build 2020-07-06
1、新增会员功能支持注册、登录、资料、积分等操作;
2、支持对会员相关功能进行后台配置;
3、支持对栏目设置会员权限、权限类型、权限提示
4、支持对内容设置会员权限、权限类型、权限提示
5、支持模板中设置指定页面必须登录
6、支持模板中设置标签指定权限可见或隐藏
7、支持内容评论功能(参考默认模板)
8、支持会员注册邮件验证码功能
9、支持留言关联登录用户新增标签nickname、username、headpic
//相关表单字段
username、password、checkcode //登录必填
username、nickname、password、rpassword、checkcode //注册必填
comment、checkcode //评论必填
//会员页面标签
{pboot:ucenter} 个人中心地址
{pboot:login} 登录地址
{pboot:register} 注册地址
{pboot:umodify} 资料修改地址
{pboot:logout} 退出登录地址
{pboot:upload} 文件上传AJAX接口
{pboot:islogin} 是否登录状态
{pboot:mustlogin} 设置页面必须登录
{pboot:sendemail} 发送邮件验证码接口,参数to
{pboot:registercodestatus} 会员注册验证码状态0、1、2
{pboot:logincodestatus} 会员登录验证码状态
{pboot:registerstatus} 是否开启注册
{pboot:loginstatus} 是否开启登录
{pboot:commentstatus} 是否开启评论
//会员模板控制标签,如:{content:title showgcode=1}
showgcode=* 指定等级显示,支持多个逗号隔开
showucode=* 指定用户显示,支持多个逗号隔开
hidegcode=* 指定等级隐藏,支持多个逗号隔开
hideucode=* 指定用户隐藏,支持多个逗号隔开
showgcodelt=* 等级小于显示
showgcodegt=* 等级大于显示
showgcodele=* 等级小于等于显示
showgcodege=* 等级大于等于显示
hidegcodelt=* 等级小于隐藏
hidegcodegt=* 等级大于隐藏
hidegcodele=* 等级小于等于隐藏
hidegcodege=* 等级大于等于隐藏
showlogin=1 登录后显示
hidelogin=1 登录后隐藏
对于内容及栏目,也支持在后台直接控制
//会员资料标签,全局可用
{user:ucode} 会员编码
{user:username} 会员用户名
{user:useremail} 会员邮箱
{user:usermobile} 会员手机
{user:gcode} 等级编码
{user:gname} 等级名称
{user:registertime} 注册时间
{user:logincount} 登录次数
{user:lastloginip} 最后登录IP
{user:lastlogintime} 最后登录时间
{user:headpic} 头像URL
{user:***} 自定义会员字段,如果{user:sex}
//文章评论
{pboot:commentcodestatus} 验证码是否开启
{pboot:commentaction} 评论提交地址
{pboot:comment contentid={content:id}}
[comment:i] 序号0开始
[comment:n] 序号1开始
[comment:pid] 父评论ID
[comment:contentid] 评论文章ID
[comment:comment] 评论内容
[comment:ip] IP地址
[comment:os] 操作系统
[comment:bs] 浏览器
[comment:date] 日期
[comment:uid] 评论人ID
[comment:username] 评论人账号
[comment:nickname] 评论人昵称
[comment:headpic] 评论人头像
[comment:pid] 父评论人ID
[comment:pusername] 父评论人账号
[comment:pnickname] 父评论人昵称
[comment:pheadpic] 父评论人头像
[comment:likes] 点赞数量
[comment:oppose] 反对数量
[comment:replyaction] 评论回复提交地址
{pboot:commentsub} 子评论输出
[commentsub:***] 子评论调用字段同上
{/pboot:commentsub}
{/pboot:comment}
//我的评论
{pboot:mycommentpage} 我的评论页面地址
{pboot:mycomment}
[mycomment:i] 序号0开始
[mycomment:n] 序号1开始
[mycomment:pid] 父评论ID
[mycomment:contentid] 评论文章ID
[mycomment:comment] 评论内容
[mycomment:title] 文章标题
[mycomment:ip] IP地址
[mycomment:os] 操作系统
[mycomment:bs] 浏览器
[mycomment:date] 日期
[mycomment:uid] 评论人ID
[mycomment:username] 评论人账号
[mycomment:nickname] 评论人昵称
[mycomment:headpic] 评论人头像
[mycomment:pid] 父评论人ID
[mycomment:pusername] 父评论人账号
[mycomment:pnickname] 父评论人昵称
[mycomment:pheadpic] 父评论人头像
[mycomment:likes] 点赞数量
[mycomment:oppose] 反对数量
[mycomment:status] 评论状态1审核2待审核
[mycomment:replyaction] 评论回复提交地址
[mycomment:delaction] 评论删除地址
{/pboot:mycomment}
PbootCMS V2.0.9 build 2020-06-18
1、新增多语言分享链接自动切换功能并新增后台开关;
2、新增后台设置网站页面标题样式功能;
3、修复列表序号翻页不连续问题;
4、修复地址生成函数特殊情况后缀判断不准问题
5、新增百度快速推送功能
6、系统安全问题修复
PbootCMS V2.0.8 build 2020-04-26
1、修复兼容模式分享链接导致打不开页面问题
2、修复几处可能影响系统安全的漏洞
3、修改使用IP访问不再需要域名授权码
4、修复个别空间的兼容性问题。
PbootCMS V2.0.7 build 2020-04-06
1、修复后台被登录成功后系统更新处可能造成的安全漏洞
2、修复dropblank不支持全角空格过滤问题;
3、新增万能码用户后台SVIP尊贵标识
4、修复模板子目录在目标文件夹存在时失败问题
5、修复后台内容编辑页面切换语言导致无限循环问题
6、新增后台切换多语言时同步切换前台语言
PbootCMS V2.0.6 build 2020-03-18
1、修复搜索结果关键字标红无法正常匹配大小写问题
2、新增后台“安全配置”中配置模板文件子目录功能
3、修复operate参数无法使用小数问题
4、新增tags列表支持指定参数target=tag跳转到tag.html模板参考默认模板
5、新增home下ExtLabelController控制器文件扩展个人标签升级不覆盖
6、优化调整前台代码结构
7、新增后台内容列表每页显示数量选择
8、修复tags重复显示问题
9、新增config/route.php文件自定义二开路由支持
10、新增API内容列表返回自适应的内容网页链接地址contentlink
11、修复API内容API链接错误并修改参数为apilink
12、修复API留言及表单无法关闭功能问题
PbootCMS V2.0.5 build 2020-01-31
1、优化前台404.html并支持内容内{info}自适应提示文字;
2、优化内容列表排序方式,并修复api使用随机排序无效问题
3、修复后台入口文件修改名字后在线升级无法自适应问题
4、新增lfield="a,b,*"限制列表查询字段,提高大数据时速度;
5、新增系统自适应入口文件子目录的能力
6、新增留言及表单数据清空功能(管理员)
7、新增留言及表单数据导出功能
8、新增mark=1标签参数对搜索结果关键字进行标红[search:title mark=1]
9、其他问题修复与优化。
PbootCMS V2.0.4 build 2020-01-21
1、修复部分循环体控制参数无效问题
2、修复一处安全漏洞并全局加强系统安全过滤
3、修复面包屑参数中不能使用html的问题
4、修复API接口中post方式page无效问题
5、新增程序全自动修改数据库名
6、新增operate参数对标签进行加减乘除等运算[list:i operate=+100]
7、新增站点关闭功能
8、新增站点访问IP黑白名单功能
9、升级layui到最新版本。
PbootCMS V2.0.3 build 2019-10-25
1、修复一处PHP7环境下的安全漏洞
2、新增关闭留言、表单功能的开关
3、新增缩略图未上传时自动获取文章图片
4、其他问题修复与优化。
PbootCMS V2.0.2 build 2019-09-15
1、伪静态时不再允许访问普通模式地址
2、新增xx:ispics判断是否有多图
3、新增页面内容关键词过滤功能
4、升级layui到最新版本
5、其他问题修复与优化。
PbootCMS V2.0.1 build 2019-08-15
1、优化编辑器工具栏浮动功能
2、优化数据库备份文件名称;
3、优化基础环境组件检查功能
4、修复默认模板一处链接错误
5、修复API一处提示文字错误
6、修复内链替换alt、title内容的问题;
7、去除内置测试账号避免被恶意利用
PbootCMS V2.0.0 build 2019-08-12
1、全新多种URL地址模式上线模型、栏目、内容自由后台设置
2、后台不再依赖pathinfo提高环境兼容性
3、新增模型下面有栏目时不允许直接删除
4、调整跨语言区域调用内容不再自动切换区域;
5、新增上下篇preico标签调用缩略图
6、优化在线更新文件过多时下载问题
7、优化sitamap生成格式
8、其他大量系统框架优化及调整;
9、修复个别空间商的兼容性问题
PbootCMS V1.4.3 build 2019-08-10
1、修复调用指定内容单页链接指向错误问题
2、优化调整模板引擎链接生成过程
3、优化在线更新功能
4、新增升级到2.X分支版本的通道
5、其他问题修复与优化
PbootCMS V1.4.2 build 2019-07-22
1、修复内容tags为空时也有代码输出问题
2、新增文章内链替换次数系统配置参数
3、新增修改栏目时可选同步修改子栏目模板的功能
4、新增批量添加栏目功能
5、新增自定义表单添加到左侧导航菜单功能
6、修复角色修改时区域数量显示不全问题
7、修复IE浏览器翻页兼容性问题
8、优化调整内链替换为长关键字优先
9、新增连续多次登录失败后锁定IP功能
10、新增自动记住上次添加内容栏目功能
11、修复一处可能被利用的安全漏洞感谢stick.wang@Zionlab
12、新增表单提交验证码独立开关并优化邮箱提醒标题
13、其他问题修复与优化
PbootCMS V1.4.1 build 2019-07-12
1、扩大自定义字段默认长度
2、升级layui为最新版本
3、修复后台IE浏览器部分兼容性问题
4、修复新增区域无法绑定域名问题
5、修复图片无法拖动排序问题
6、修复单独修改用户角色不成功问题
7、修复微信分享参数导致安全拦截提示问题
8、修复登录失败时验证码不刷新问题
9、修复编辑器未能按设置大小缩放图片问题
10、优化合并邮箱配置功能到系统配置
11、增加会话文件路径后台切换功能
12、新增单页模型也在左侧导航中显示
13、新增文章图片水印功能
14、新增文章内容内链功能
15、其他问题修复与优化
PbootCMS V1.4.0 build 2019-06-07
1、修复部分浏览器多图无法删除的问题
2、新增万能授权码填写后自动后台隐藏功能
3、修复QQ中打开搜索页面附加参数导致错误问题
4、修复后台密码泄露后系统配置可能构成的安全问题
PbootCMS V1.3.9 build 2019-05-15
1、优化相关目录权限不足报错机制
2、修复PHP56有时后台更新无法使用问题
3、优化后台在线升级功能
4、新增中文路径部署检测
5、优化升级系统框架模板引擎
6、新增自定义路由正则匹配的支持
7、新增后台配置数字分页条数量
8、其他问题修复与优化
PbootCMS V1.3.8 build 2019-04-12
1、新增同时支持fsockopen及stream_socket_client发送邮件
2、优化邮件发送失败错误提示信息
3、新增手机版绑定域名后自动跳转到对应域名地址上
4、修改会话文件默认为使用系统环境缓存路径
5、修复mysqli配置文件读取端口不一致问题
6、修复tags为空时仍然会输出代码字符问题
7、修复开启缓存功能后异样地址会导致文件产生问题
8、修复编辑器在PHP7下多图上传名字重复问题
9、修复编辑器多图上传位置错乱问题
PbootCMS V1.3.7 build 2019-03-12
1、修复部分情况数据库语句执行发生的错误不能正常显示的问题
2、修复搜索时表单传递字段控制被过滤掉的问题
3、新增多个搜索通过传递searchtpl字段自定义不同搜索结果页模板
4、修复分享非默认语言链接后无法直接访问问题
5、新增跨语言调用内容及列表的支持
6、新增留言使用lg=*调取指定语言留言记录功能;
7、新增order=random调取随机排序内容列表
8、修复上传图片字段使用网络图片时地址错误问题
9、修复栏目seo标题使用自动标题时不显示问题
PbootCMS V1.3.6 build 2019-01-12
1、框架问题修复与优化;
2、优化后台在线升级功能;
3、修复api内容列表无法传递自定义排序问题;
4、去除后台执行sql语句功能;
5、新增超级管理员清空日志功能
6、修复测试邮件发送失败返回中文乱码的问题;
PbootCMS V1.3.5 build 2018-12-24
1、修复邮件测试功能被误拦截问题;
2、修复使用首页分页与筛选时出现两种链接类型问题;
3、修复编辑器工具栏不能正常浮动到顶部及视频插入问题;
4、修复gif不能正常缩放及png透明图片缩放后背景变黑问题;
5、新增内容截取时使用more='*'设置省略号内容;
6、新增调节参数maxwidth、maxheight、height、width对图片进行处理;
7、进一步加强系统入侵防御能力;
8、后台主页、验证码、上传、默认模板等的改进与优化;
9、其他问题修复与优化;
PbootCMS V1.3.3 build 2018-11-29
1、新增sort指定栏目输出支持后台排序规则;
2、修复PHP7.3环境下的一些兼容性问题;
3、修改自定义表单数据调用列表为formlist标签避免标签冲突问题;
4、修复多个列表的页面筛选对非筛选列表干扰问题;
5、修复if判断详情内容是否为空无效问题;
6、修复自定义字段英文单词之间空格被过滤掉的问题;
7、修复一处可能导致恶意利用的漏洞重要;
8、进一步增强系统框架安全防御策略;
9、验证码加入英文字母增强复杂度;
PbootCMS V1.3.2 build 2018-11-22
1、修复用户名验证规则不统一导致修改特殊字符后无法登录问题;
2、修复js无法获取到点赞及反对cookie的问题;
3、修复content标签无法使用scode调取单页问题;
4、新增start=*设置数据列表起始数据;
5、加强后台执行数据库脚本功能的安全性;
6、新增默认正文内容不再对PB标签进行解析;
7、修复上版本API搜索接口无法正常实现功能的问题;
8、新增lencn=* 截取长度,解决中英文显示长度不同问题;
9、其他问题修复与优化。
PbootCMS V1.3.1 build 2018-11-14
1、优化在线升级功能;
2、修复表单Ajax提交返回状态码不正确问题;
3、优化会话层级目录创建避免会话目录缺失导致登录失败的情况;
PbootCMS V1.3.0 build 2018-11-12
1、优化会话创建机制,避免会话文件过多问题;
2、修复一些可能导致注入的安全问题(感谢topsec(zhan_ran)及CNVD的反馈);
3、修复搜索结果无法按预期显示的的问题;
4、新增内容页、列表页404自动匹配的支持;
5、新增支持在根目录定义sn.html文件自定义免费授权码填写提示;
6、新增API通过scode来调用单篇内容;
7、新增[nav:rows]输出该菜单下内容数量;
8、新增[sort:rows]输出该栏目下内容数量;
9、新增[sort:toprows]输出顶级栏目下内容数量;
10、新增[sort:parentrows]输出父栏目下内容数量;
11、新增内置tags功能不再需要扩展字段实现;
12、新增输出指定内容或栏目tags标签功能;
13、新增列表使用参数tags='*,*'过滤列表;
14、新增列表使用参数scode=*匹配全部栏目;
15、新增指定内容输出单页时支持scode来指定内容;
16、新增栏目独立seo标题设置字段[nav:title];
17、新增开启iis\apache伪静态时自动拷贝伪静态规则;
18、新增后台内容列表百度站长推送及熊掌号推送;
19、新增多语言\区域绑定域名功能(站群系统);
20、新增留言及表单记录调用时使用page=0关闭分页;
21、其他问题修复与优化。
PbootCMS V1.2.2 build 2018-10-12
1、修复自定义表单多选类型提交数据错误问题;
2、修复发送邮件设置完成不立即生效问题;
3、修复发送测试邮件不能正确返回状态的问题;
4、修复分页代码数字条省略号不准问题;
5、修复后台编辑器的一些问题;
6、修复自定义标签的图片不自适应多级目录问题;
7、修复使用mysql数据库时可能导致的安全问题;
8、修复列表筛选与指定分类列表冲突问题;
9、修复多次调用内容标签导致重复计算访问量问题;
10、大幅提高Sqlite数据库数据写入速度;
11、优化后台登录错误处理机制;
12、优化数据列表排序方式;
13、新增模板嵌套引用的支持;
14、新增在线更新涉及数据库时自动备份数据库;
15、新增在线更新分支选择功能;
16、新增对指定代码块不做标签解析的标签;
17、新增列表多条件排序自定义任意组合的支持,如:order='istop desc,id asc'
18、新增MySQL数据库事务的支持;
19、新增自定义标签多行文本类型;
20、新增文章定时发布的支持;
21、其它问题修复与优化。
PbootCMS V1.2.1 build 2018-09-12
1、新增在线升级新版本红点提示;
2、新增程序部署到非根目录时虚拟目录大小写不区分;
3、新增表单提交频率安全检测;
4、调整程序非伪静态时不再显示html后缀;
5、调整程序留言表单外的自定义表单不再要求验证码;
6、修复上版本首页分页不正常问题;
7、优化完善默认模板;
PbootCMS V1.2.0 build 2018-09-04
1、系统优化及安全修复;
2、修复API搜索与页面实现不统一;
3、优化后台内容页栏目显示逻辑;
4、新增后台轮播、链接页面批量排序;
5、升级layui到最新版本;
6、新增列表标签isico、ispics、istop、isrecommend、isheadline调节参数;
7、新增面包屑连接符separatoriconc及indexicon参数设置字体图标class;
8、优化分页条代码;
9、新增内容截取时自动添加省略号;
10、基于bootstrap v4的全新默认模板正式上线;
11、修复在线更新浏览器兼容性问题;
PbootCMS V1.1.9 build 2018-08-17
1、系统优化及安全修复(重要);
2、修复自定义表单Mysql时添加失败问题;
3、修复后台模板一些小错误;
4、修复影响缓存效果的一些问题;
5、新增后台在线更新功能;
6、新增附件大小标签;
PbootCMS V1.1.8 build 2018-08-07
1、修复提交表单多选字段接收数据问题;
2、修复登录过程中二次登录在页面不刷新时验证失败问题;
3、新增搜索结果fuzzy参数来控制是否模糊匹配;
4、新增父分类、顶级分类名称及链接独立标签具体见手册;
5、新增内容多图拖动排序功能;
PbootCMS V1.1.7 build 2018-08-01
1、修复测试邮件不发送到填写的测试邮箱问题;
2、修复友情链接添加时排序报错问题;
3、修复API幻灯片及友情链接排序无效;
4、修复站内Ajax调用API数据时间戳过期问题;
5、新增自定义标签开关类型;
6、新增自定义表单数据调取标签;
7、新增单页设置跳转后内容不再出现管理列表中;
8、新增搜索支持多字段同时匹配;
9、新增点击上传的图片自动添加到编辑器;
10、优化表单提交验证;
11、其它问题修复与优化;
PbootCMS V1.1.6 build 2018-07-21
1、优化编辑器配置及安全加固;
2、优化内容管理列表布局;
3、增强系统后台及标签解析引擎安全性;
4、调整runtime标签展示方式;
5、新增Gzip页面压缩功能及后台开关;
6、新增支持根目录定义404.html匹配错误URL访问;
7、新增缩略图自动缩放更小图功能;
8、新增config/route.php文件里定义路由规则的支持;
9、新增调用指定栏目 标签scode支持多个分类;
10、新增如果栏目及内容关键字标签为空时自动使用全局关键字;
11、新增如果栏目及内容描述标签为空时自动使用全局描述;
12、新增全局自动页面标题标签{pboot:pagetitle};
13、新增全局自动页面关键字标签{pboot:pagekeywords};
14、新增全局自动页面描述标签{pboot:pagedescription}
15、新增留言表单添加更多字段的支持;
16、新增幻灯片、友情链接、扩展字段排序的支持;
17、新增sitemap生成读取地址/index.php/sitemap;
18、新增URL路径支持中文;
19、新增中文用户名登录的支持;
20、新增API正文内容返回图片路径自动添加网址路径;
21、新增邮件配置中发送测试邮件功能;
22、新增API调用自定义表单数据接口;
23、其它问题修复与优化;
注意:升级到此版本需要同时升级数据库,脚本见升级包中。
PbootCMS V1.1.5 build 2018-07-10
1、修复开启静态缓存后无法切换语言问题;
2、修复开启静态缓存后无法自动切换手机版;
3、修复数据库安全检查不准问题;
4、修复后台多选字段无法取消问题;
5、新增调试模式后台开关;
6、新增访问地址不存在时404状态信息;
7、新增运行时间标签{pboot:runtime};
8、新增留言验证码判断标签{pboot:checkcodestatus};
9、新增筛选全部按钮的class和active分别设置;
10、新增类似filter=title|php,asp多条件过滤支持;
11、新增搜索列表scode、field调节控制参数支持;
12、新增任意字段搜索及综合搜索支持;
13、新增列表零开头序号标签[list:n];
14、新增loop循环语句标签;
15、新增模型字段下拉选择类型;
16、优化内容页访问量代码插入方式;
17、优化会话文件处理方式;
18、优化框架模板解析引擎;
19、优化后台单页数据读取方式;
20、优化系统配置载入方式;
21、优化API数据读取;
PbootCMS V1.1.4 build 2018-06-25
1、修复自定义表单表名重复仍然添加成功问题;
2、修复分享到微信导致页面错误的问题;
3、修复静态缓存失效问题并提高缓存效果;
4、新增多条件筛选时多选类型支持;
5、新增全站多条件筛选的支持;
6、新增登录时数据库目录写入权限判断提示;
7、新增后台开启高速静态缓存功能;
8、新增后台填写授权码功能;
9、新增指定列表scode使用逗号调用多个分类功能;
10、新增{pboot:keyword}标签;
11、新增数据库安全提示及修改功能;
PbootCMS V1.1.3 build 2018-06-15
1、优化Sqlite查询过程高并发锁死问题;
2、优化编辑器配置;
3、优化标签参数获取方法;
4、修复部分环境截取描述文本出现乱码问题;
5、修复API搜索数据获取方式错误;
6、新增API获取指定分类子类接口;
7、新增多条件筛选功能;
8、新增无缩略图时自动调用默认图功能;
9、新增上下篇标签参数notext定义"没有了"文本;
10、新增内容管理复制和移动功能;
PbootCMS V1.1.2 build 2018-06-12
1、修复httpurl非标准端口时解析错误;
2、修复内容为空时提取描述报警告问题;
3、修复非根目录情况下图片路径使用IF判断不准问题;
4、修复授权码带空格时导致无法正常匹配问题;
5、修复数据库中存在乱码时读取异常问题;
6、修复面包屑不显示当前分类的问题;
7、修复API中数据调用的一些错误;
8、新增表单数据删除功能;
9、新增栏目自定义路径名称功能;
10、新增留言和自定义表单提交API;
PbootCMS V1.1.1 build 2018-06-03
1、更新Layui到最新版本;
2、修复表备份无数据时处理错误;
3、优化添加自定义字段数据库处理方式;
4、修复修改模型时类型默认不选中问题;
5、修复在单页面多次调用面包屑数据重复问题;
6、修复访客留言不显示问题;
7、新增删除栏目时彻底删除本类及子类内容;
8、修复单页预览按钮地址错误;
9、新增自定义表单功能,调用方法见手册;
10、新增二维码生成标签及当前域名获取标签;
11、新增添加内容时自动提取内容描述文字;
12、新增文件上传过程提示图标;
13、新增数据库管理执行Sql脚本功能;
注意:升级到此版本需要同时升级数据库,脚本见升级包中。
PbootCMS V1.1.0 build 2018-05-24
1、修复新增语言后站点和公司信息图片首次出现警告问题;
2、优化文章访问量计数方式;
3、新增扩展字段编辑器类型;
4、新增后台文章列表有图的标注;
5、修复模板部分手误错误;
6、增强搜索时字段安全性;
7、新增PHP环境自动转义判断;
8、新增总页数、总行数分页标签;
9、调整独立分页标签为不带文字的链接;
10、修复多图多次输出num干扰问题;
11、修复新增语言后未做保存导致手机版切换错误;
PbootCMS V1.0.9 build 2018-05-14
1、新增图片上传直接显示及删除功能;
2、修复内容过滤参数及状态失效问题;
3、优化后台菜单显示视觉流畅性;
4、框架入口文件安全加强;
5、面包屑新增indextext参数配置"首页"文字;
6、新增API认证签名生成标签方便进行Ajax加载具体见手册示例;
7、新增上一篇及下一篇链接及标题独立标签并支持len截取;
PbootCMS V1.0.8 build 2018-05-07
1、修复后台菜单高亮错误;
2、修改编辑器为不替换div和不自动拉高;
3、修复删除栏目时子类未全部删除问题;
4、新增后台栏目管理折叠功能;
5、新增手机版绑定独立域名功能;
6、修复多语言切换时栏目编码导致报错;
7、修复副栏目内容无法正常调取问题;
8、新增指定内容扩展字段多选输出标签;
PbootCMS V1.0.7 build 2018-05-02
1、采用LayUI新版管理后台;
2、修复后台单页无法显示更多问题;
3、调整默认分页数字条长度为5;
4、修复API调用全部自定义标签错误;
5、新增内容批量删除功能;
6、新增栏目批量删除功能;
7、修复面包屑对外链跳转问题;
8、修复栏目修改直接保存类型错误;
9、其它问题修复和优化;
PbootCMS V1.0.6 build 2018-04-24
1、修复无任何内容执行排序报错;
2、修复可能存在的跨站请求伪造漏洞;
PbootCMS V1.0.5 build 2018-04-23
1、新增后台配置项自动新增功能;
2、修复logo不自适应多级目录路径;
3、新增十类API调用方便小程序、APP、Ajax等数据获取;
4、修复个别虚拟主机分页代码报警告问题;
5、新增服务器未开启sockets导致非加密发送邮件错误提示;
PbootCMS V1.0.4 build 2018-04-19
1、优化框架配置文件载入方式;
2、修复当前分类列表页过滤参数无效;
3、新增首页分页功能大家可以做博客了;
4、新增模型类菜单桌面同步显示;
5、新增当前栏目位置标签;
PbootCMS V1.0.3 build 2018-04-16
1、修复多图输出只输出一张问题;
2、修复PHP7.1中合并多维数组警告;
3、修复登录地址末尾带有斜杠时错误;
4、新增配置文件自动去除Bom,避免空白;
PbootCMS V1.0.2 build 2018-04-14
1、新增自动去除模板的Bom信息避免空白;
2、优化编辑器可见按钮;
3、修复编辑器无法插入动态地图问题;
4、修复文章排序无法按预期排列问题;
PbootCMS V1.0.1 build 2018-04-13
1、修复数据库导出未正常解码问题;
2、修复系统栏目出现多个新闻内容问题;
3、新增默认及内置区域不允许删除;
4、新增删除区域后强制重新登录;
5、修复前端多语言无法正常切换问题;
6、修复新增语言无法匹配默认模板问题;
7、Mysql脚本默认内容解码有问题大家重新导入sql;
8、修复友情链接图片无法自适应多级目录;
PbootCMS V1.0.0 build 2018-04-12
1、正式发布第一个版本。