fix: nav
This commit is contained in:
@@ -52,12 +52,15 @@ class IndexController extends Controller
|
||||
$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');
|
||||
}
|
||||
} elseif (file_exists(ROOT_PATH . '/data/pbootcms.db')) {
|
||||
rename(ROOT_PATH . '/data/pbootcms.db', ROOT_PATH . '/data/' . get_uniqid() . '.db');
|
||||
@@ -256,30 +259,34 @@ class IndexController extends Controller
|
||||
} 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'));
|
||||
}
|
||||
cache_config(); // 清理缓存后立即生成新的配置
|
||||
if ($rs) {
|
||||
if (extension_loaded('Zend OPcache')) {
|
||||
opcache_reset(); // 在启用了OPcache加速器时同时清理
|
||||
}
|
||||
$this->log('清理缓存成功!');
|
||||
alert_back('清理缓存成功!');
|
||||
alert_back('清理缓存成功!', 1);
|
||||
} else {
|
||||
$this->log('清理缓存失败!');
|
||||
alert_back('清理缓存失败!');
|
||||
alert_back('清理缓存失败!', 0);
|
||||
}
|
||||
}
|
||||
|
||||
// 清理会话
|
||||
public function clearSession()
|
||||
{
|
||||
$rs = path_delete(RUN_PATH . '/session');
|
||||
|
||||
if ($rs) {
|
||||
$this->log('清理会话成功!');
|
||||
alert_back('清理会话成功!');
|
||||
} else {
|
||||
$this->log('清理会话失败!');
|
||||
alert_back('清理会话失败!');
|
||||
}
|
||||
ignore_user_abort(true); // 后台运行
|
||||
set_time_limit(7200);
|
||||
ob_start();
|
||||
$output['code'] = 1;
|
||||
$output['data'] = '执行成功,后台自动清理中!';
|
||||
$output['tourl'] = '';
|
||||
echo json_encode($output);
|
||||
ob_end_flush();
|
||||
flush();
|
||||
$rs = path_delete(RUN_PATH . '/session', false, array(
|
||||
'sess_' . session_id()
|
||||
));
|
||||
}
|
||||
|
||||
// 文件上传方法
|
||||
|
||||
@@ -41,6 +41,8 @@ class ContentController extends Controller
|
||||
} else {
|
||||
$result = $this->model->findContentAll($mcode, get('keyword', 'vars'));
|
||||
}
|
||||
} elseif (! ! $scode = get('scode', 'int')) {
|
||||
$result = $this->model->findContent($mcode, $scode, '');
|
||||
} else {
|
||||
$result = $this->model->getList($mcode);
|
||||
}
|
||||
@@ -120,7 +122,7 @@ class ContentController extends Controller
|
||||
alert_back('文章标题不能为空!');
|
||||
}
|
||||
|
||||
if ($filename && ! preg_match('/^[a-zA-Z0-9\-]+$/', $filename)) {
|
||||
if ($filename && ! preg_match('/^[a-zA-Z0-9\-\/]+$/', $filename)) {
|
||||
alert_back('内容URL名称只允许字母、数字、横线组成!');
|
||||
}
|
||||
|
||||
@@ -129,6 +131,11 @@ class ContentController extends Controller
|
||||
$description = escape_string(clear_html_blank(substr_both(strip_tags($_POST['content']), 0, 150)));
|
||||
}
|
||||
|
||||
// 无缩略图时,自动提取文章第一张图为缩略图
|
||||
if (! $ico && preg_match('/<img\s+.*?src=\s?[\'|\"](.*?(\.gif|\.jpg|\.png|\.jpeg))[\'|\"].*?[\/]?>/i', decode_string($content), $srcs) && isset($srcs[1])) {
|
||||
$ico = $srcs[1];
|
||||
}
|
||||
|
||||
// 缩放缩略图
|
||||
if ($ico) {
|
||||
resize_img(ROOT_PATH . $ico, '', $this->config('ico.max_width'), $this->config('ico.max_height'));
|
||||
@@ -437,7 +444,7 @@ class ContentController extends Controller
|
||||
alert_back('文章标题不能为空!');
|
||||
}
|
||||
|
||||
if ($filename && ! preg_match('/^[a-zA-Z0-9\-]+$/', $filename)) {
|
||||
if ($filename && ! preg_match('/^[a-zA-Z0-9\-\/]+$/', $filename)) {
|
||||
alert_back('内容URL名称只允许字母、数字、横线组成!');
|
||||
}
|
||||
|
||||
@@ -446,6 +453,11 @@ class ContentController extends Controller
|
||||
$description = escape_string(clear_html_blank(substr_both(strip_tags($_POST['content']), 0, 150)));
|
||||
}
|
||||
|
||||
// 无缩略图时,自动提取文章第一张图为缩略图
|
||||
if (! $ico && preg_match('/<img\s+.*?src=\s?[\'|\"](.*?(\.gif|\.jpg|\.png|\.jpeg))[\'|\"].*?[\/]?>/i', decode_string($content), $srcs) && isset($srcs[1])) {
|
||||
$ico = $srcs[1];
|
||||
}
|
||||
|
||||
// 缩放缩略图
|
||||
if ($ico) {
|
||||
resize_img(ROOT_PATH . $ico, '', $this->config('ico.max_width'), $this->config('ico.max_height'));
|
||||
|
||||
@@ -66,29 +66,9 @@ class ContentSortController extends Controller
|
||||
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;
|
||||
foreach ($value as $k => $v) {
|
||||
$this->outData[$this->count]->$k = $v;
|
||||
}
|
||||
|
||||
if ($value->son) {
|
||||
$this->outData[$this->count]->son = true;
|
||||
|
||||
@@ -101,6 +101,10 @@ class ExtFieldController extends Controller
|
||||
$mysql = 'TEXT';
|
||||
$sqlite = 'TEXT(10000)';
|
||||
break;
|
||||
case '10': // 多图
|
||||
$mysql = 'varchar(1000)';
|
||||
$sqlite = 'TEXT(1000)';
|
||||
break;
|
||||
default:
|
||||
$mysql = 'varchar(200)';
|
||||
$sqlite = 'TEXT(200)';
|
||||
|
||||
@@ -188,6 +188,11 @@ class SingleController extends Controller
|
||||
$description = escape_string(clear_html_blank(substr_both(strip_tags($_POST['content']), 0, 150)));
|
||||
}
|
||||
|
||||
// 无缩略图时,自动提取文章第一张图为缩略图
|
||||
if (! $ico && preg_match('/<img\s+.*?src=\s?[\'|\"](.*?(\.gif|\.jpg|\.png|\.jpeg))[\'|\"].*?[\/]?>/i', decode_string($content), $srcs) && isset($srcs[1])) {
|
||||
$ico = $srcs[1];
|
||||
}
|
||||
|
||||
// 缩放缩略图
|
||||
if ($ico) {
|
||||
resize_img(ROOT_PATH . $ico, '', $this->config('ico.max_width'), $this->config('ico.max_height'));
|
||||
|
||||
@@ -28,7 +28,7 @@ class ConfigController extends Controller
|
||||
if (! ! $action = get('action')) {
|
||||
switch ($action) {
|
||||
case 'sendemail':
|
||||
$rs = sendmail($this->config(), get('to'), '【PbootCMS】测试邮件', '欢迎您使用PbootCMS网站开发管理系统!');
|
||||
$rs = sendmail($this->config(), get('to'), '【' . CMSNAME . '】测试邮件', '欢迎您使用' . CMSNAME . '网站开发管理系统!');
|
||||
if ($rs === true) {
|
||||
alert_back('测试邮件发送成功!');
|
||||
} else {
|
||||
@@ -41,14 +41,17 @@ class ConfigController extends Controller
|
||||
// 修改参数配置
|
||||
if ($_POST) {
|
||||
unset($_POST['upload']); // 去除上传组件
|
||||
if (isset($_POST['sn'])) {
|
||||
$_POST['licensecode'] = base64_encode(post('sn') . '/' . post('sn_user')) . substr(post('sn'), 1, 1);
|
||||
}
|
||||
foreach ($_POST as $key => $value) {
|
||||
if (! preg_match('/^[\w\-]+$/', $key)) {
|
||||
continue;
|
||||
}
|
||||
$config = array(
|
||||
'debug',
|
||||
'sn',
|
||||
'sn_user',
|
||||
// 'sn',
|
||||
// 'sn_user',
|
||||
'pagenum',
|
||||
'tpl_html_cache',
|
||||
'tpl_html_cache_time',
|
||||
@@ -103,8 +106,10 @@ class ConfigController extends Controller
|
||||
}
|
||||
$configs = $this->model->getList();
|
||||
$configs['debug']['value'] = $this->config('debug');
|
||||
$configs['sn']['value'] = $this->config('sn');
|
||||
$configs['sn_user']['value'] = $this->config('sn_user');
|
||||
if (! $configs['sn']['value']) {
|
||||
$configs['sn']['value'] = $this->config('sn');
|
||||
$configs['sn_user']['value'] = $this->config('sn_user');
|
||||
}
|
||||
$configs['session_in_sitepath']['value'] = $this->config('session_in_sitepath');
|
||||
$configs['pagenum']['value'] = $this->config('pagenum');
|
||||
$configs['url_type']['value'] = $this->config('url_type');
|
||||
|
||||
@@ -214,7 +214,7 @@ class DatabaseController extends Controller
|
||||
$sql .= $brackets;
|
||||
$comma = "";
|
||||
for ($i = 0; $i < $fieldNnum; $i ++) {
|
||||
$sql .= ($comma . "'" . decode_string($value[$i]) . "'");
|
||||
$sql .= ($comma . "'" . addslashes(decode_string($value[$i])) . "'");
|
||||
$comma = ",";
|
||||
}
|
||||
$sql .= ")";
|
||||
|
||||
@@ -16,7 +16,7 @@ class ContentModel extends Model
|
||||
protected $scodes = array();
|
||||
|
||||
// 获取文章列表
|
||||
public function getList($mcode)
|
||||
public function getList($mcode, $where = array())
|
||||
{
|
||||
$field = array(
|
||||
'a.id',
|
||||
@@ -61,6 +61,7 @@ class ContentModel extends Model
|
||||
->where("b.mcode='$mcode'")
|
||||
->where('d.type=2 OR d.type is null ')
|
||||
->where("a.acode='" . session('acode') . "'")
|
||||
->where($where)
|
||||
->join($join)
|
||||
->order('a.sorting ASC,a.id DESC')
|
||||
->page()
|
||||
|
||||
@@ -22,7 +22,8 @@ class ContentSortModel extends Model
|
||||
$field = array(
|
||||
'a.*',
|
||||
'b.type',
|
||||
'b.urlname'
|
||||
'b.urlname',
|
||||
'(select count(*) from ay_content c where c.scode=a.scode) wzcount'
|
||||
);
|
||||
$join = array(
|
||||
'ay_model b',
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
</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/comm.js?v=v2.0.0"></script>
|
||||
<script type="text/javascript" src="{APP_THEME_DIR}/js/mylayui.js?v=v3.0.6"></script>
|
||||
<script type="text/javascript" src="{APP_THEME_DIR}/js/comm.js?v=v3.1.1"></script>
|
||||
<script type="text/javascript" src="{APP_THEME_DIR}/js/mylayui.js?v=v3.1.0"></script>
|
||||
|
||||
|
||||
<!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
|
||||
|
||||
@@ -1,134 +1,137 @@
|
||||
<!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>
|
||||
<dd><a href="{url./admin/Upgrade/index}"><i class="fa fa-cloud-upload" aria-hidden="true"></i> 在线更新</a></dd>
|
||||
<dd><a href="{url./admin/Index/clearSession}"><i class="fa fa-trash-o" 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>
|
||||
<!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>{CMSNAME}管理中心-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}">
|
||||
<img src="{APP_THEME_DIR}/images/logo.png" height="30">
|
||||
{CMSNAME}
|
||||
{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}" class="ajaxlink"><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>
|
||||
{if(session('ucode')==10001)}
|
||||
<dd><a href="{url./admin/Upgrade/index}"><i class="fa fa-cloud-upload" aria-hidden="true"></i> 在线更新</a></dd>
|
||||
<dd><a href="{url./admin/Index/clearSession}" class="ajaxlink"><i class="fa fa-trash-o" aria-hidden="true"></i> 清理会话</a></dd>
|
||||
{/if}
|
||||
</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>
|
||||
@@ -1,113 +1,113 @@
|
||||
{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="postcode" value="{$companys->postcode}" 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"></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="blicense" value="{$companys->blicense}" 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="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'}
|
||||
{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="postcode" value="{$companys->postcode}" 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="请输入QQ号码" 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"></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="blicense" value="{$companys->blicense}" 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="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'}
|
||||
|
||||
@@ -76,45 +76,31 @@
|
||||
<td class="table-input"><input type="text" lay-ignore class="layui-input" name="sorting[]" value="[value->sorting]"></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>
|
||||
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/0}" class="switch"><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>
|
||||
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/1}" class="switch"><i class='fa fa-toggle-off' title="点击开启"></i></a>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if($value->istop)}
|
||||
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/istop/value/0}"><i class='fa fa-toggle-on' title="点击关闭"></i></a>
|
||||
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/istop/value/0}" class="switch"><i class='fa fa-toggle-on' title="点击关闭"></i></a>
|
||||
{else}
|
||||
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/istop/value/1}"><i class='fa fa-toggle-off' title="点击开启"></i></a>
|
||||
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/istop/value/1}" class="switch"><i class='fa fa-toggle-off' title="点击开启"></i></a>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if($value->isrecommend)}
|
||||
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/isrecommend/value/0}"><i class='fa fa-toggle-on' title="点击关闭"></i></a>
|
||||
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/isrecommend/value/0}" class="switch"><i class='fa fa-toggle-on' title="点击关闭"></i></a>
|
||||
{else}
|
||||
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/isrecommend/value/1}"><i class='fa fa-toggle-off' title="点击开启"></i></a>
|
||||
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/isrecommend/value/1}" class="switch"><i class='fa fa-toggle-off' title="点击开启"></i></a>
|
||||
{/if}
|
||||
</td>
|
||||
<td>[value->visits]</td>
|
||||
<td>
|
||||
{if(!$value->outlink)}
|
||||
{php}
|
||||
$sortfilename = $value->sortfilename;
|
||||
$contentfilename = $value->filename;
|
||||
$id = $value->id;
|
||||
$urlname = $value->urlname?:'list';
|
||||
$scode = $value->scode;
|
||||
$url_break_char= get_var('url_break_char');
|
||||
|
||||
if ($sortfilename && $contentfilename) {
|
||||
$link = homeurl('home/Index/' . $sortfilename . '/' . $contentfilename, true);
|
||||
} elseif ($sortfilename) {
|
||||
$link = homeurl('home/Index/' . $sortfilename . '/' . $id, true);
|
||||
} elseif ($contentfilename) {
|
||||
$link = homeurl('home/Index/' . $urlname . $url_break_char . $scode . '/' . $contentfilename, true);
|
||||
} else {
|
||||
$link = homeurl('home/Index/' . $urlname . $url_break_char . $scode . '/' . $id, true);
|
||||
}
|
||||
$Parser=new app\home\controller\ParserController();
|
||||
$link=$Parser->parserLink(2,$value->urlname,'content',$value->scode,$value->sortfilename,$value->id,$value->filename);
|
||||
{/php}
|
||||
|
||||
<input type="hidden" name="urls[[value->id]]" value="{php}echo $link{/php}">
|
||||
@@ -276,6 +262,19 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if($value->type==10)}<!-- 多图片 -->
|
||||
<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]" placeholder="请上传[value->description]" class="layui-input">
|
||||
</div>
|
||||
<button type="button" class="layui-btn uploads watermark" data-des="[value->name]">
|
||||
<i class="layui-icon"></i>上传多图
|
||||
</button>
|
||||
<div id="[value->name]_box" class="pic addedit"><dl></dl> <!-- 规避空内容拖动bug --></div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if($value->type==6)}<!-- 文件 -->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">[value->description]</label>
|
||||
@@ -445,7 +444,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">URL名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="filename" placeholder="请输入URL名称,如:test" class="layui-input">
|
||||
<input type="text" name="filename" placeholder="请输入URL名称,如:test,test/a/b" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -629,6 +628,34 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if($value->type==10)}<!-- 多图 -->
|
||||
<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 uploads watermark" data-des="[value->name]">
|
||||
<i class="layui-icon"></i>上传多图
|
||||
</button>
|
||||
<div id="[value->name]_box" class="pic addedit">
|
||||
<dl></dl> <!-- 规避空内容拖动bug -->
|
||||
{php}
|
||||
$name=$value->name;
|
||||
if([$content->$name]){
|
||||
$pics=explode(',',[$content->$name]);
|
||||
}else{
|
||||
$pics = array();
|
||||
}
|
||||
foreach ($pics as $key=>$value) {
|
||||
//需要留一个空,不然被解析为标签了
|
||||
echo "<dl><dt><img src='".SITE_DIR.$value."' data-url='".$value."'></dt><dd>删除</dd></dl>";
|
||||
}
|
||||
{/php}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/if}
|
||||
|
||||
{if($value->type==6)}<!-- 文件 -->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">[value->description]</label>
|
||||
@@ -825,7 +852,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">URL名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="filename" value="{$content->filename}" placeholder="请输入URL名称,如:test" class="layui-input">
|
||||
<input type="text" name="filename" value="{$content->filename}" placeholder="请输入URL名称,如:test,test/a/b" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -42,9 +42,16 @@
|
||||
<i class="fa fa-folder-open-o" aria-hidden="true"></i>
|
||||
{/if}
|
||||
[value->name]
|
||||
|
||||
|
||||
{if($value->outlink)}
|
||||
<span class="layui-badge layui-bg-black">链</span>
|
||||
<a href="[value->outlink]" target="_blank"><i class="fa fa-external-link" aria-hidden="true"></i></a>
|
||||
{else}
|
||||
{if($value->type==1)}
|
||||
<a href="{url./admin/Single/index/mcode}/[value->mcode]&scode=[value->scode]"><i class="fa fa-file-text-o" aria-hidden="true"></i> </a>
|
||||
{else}
|
||||
<a href="{url./admin/Content/index/mcode}/[value->mcode]&scode=[value->scode]"><i class="fa fa-file-text-o" aria-hidden="true"></i> </a>
|
||||
{/if}
|
||||
{/if}
|
||||
</td>
|
||||
<td>[value->scode]</td>
|
||||
@@ -61,24 +68,18 @@
|
||||
<td class="table-input"><input type="text" name="sorting[]" value="[value->sorting]" class="layui-input"></td>
|
||||
<td>
|
||||
{if($value->status)}
|
||||
<a href="{url./admin/'.C.'/mod/scode/'.$value->scode.'/field/status/value/0}"><i class='fa fa-toggle-on' title="点击禁用"></i></a>
|
||||
<a href="{url./admin/'.C.'/mod/scode/'.$value->scode.'/field/status/value/0}" class="switch"><i class='fa fa-toggle-on' title="点击禁用"></i></a>
|
||||
{else}
|
||||
<a href="{url./admin/'.C.'/mod/scode/'.$value->scode.'/field/status/value/1}"><i class='fa fa-toggle-off' title="点击启用"></i></a>
|
||||
<a href="{url./admin/'.C.'/mod/scode/'.$value->scode.'/field/status/value/1}" class="switch"><i class='fa fa-toggle-off' title="点击启用"></i></a>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
{if(!$value->outlink)}
|
||||
{if($value->type==1)}
|
||||
{php}$value->urlname=$value->urlname?:'about';{/php}
|
||||
{else}
|
||||
{php}$value->urlname=$value->urlname?:'list';{/php}
|
||||
{/if}
|
||||
|
||||
{if($value->filename)}
|
||||
<a href="{fun=homeurl('/home/Index/'.$value->filename)}" 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)}" class="layui-btn layui-btn-xs layui-btn-primary" target="_blank">查看</a>
|
||||
{/if}
|
||||
{php}
|
||||
$Parser=new app\home\controller\ParserController();
|
||||
$link=$Parser->parserLink($value->type,$value->urlname,'list',$value->scode,$value->filename,'','');
|
||||
{/php}
|
||||
<a href="{php}echo $link{/php}" class="layui-btn layui-btn-xs layui-btn-primary" target="_blank">查看</a>
|
||||
{/if}
|
||||
|
||||
{fun=get_btn_del($value->scode,'scode')}
|
||||
@@ -131,7 +132,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">URL名称 </label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="filename" placeholder="请输入URL名称,如:test" class="layui-input">
|
||||
<input type="text" name="filename" placeholder="请输入URL名称,如:test,test/a/b/c" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -418,7 +419,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">URL名称 </label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="filename" value="{$sort->filename}" placeholder="请输入URL名称,如:test" class="layui-input">
|
||||
<input type="text" name="filename" value="{$sort->filename}" placeholder="请输入URL名称,如:test,test/a/b/c" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -39,7 +39,8 @@
|
||||
{if($value->type==2)}多行文本{/if}
|
||||
{if($value->type==3)}单选按钮{/if}
|
||||
{if($value->type==4)}多选按钮{/if}
|
||||
{if($value->type==5)}图片上传{/if}
|
||||
{if($value->type==5)}单图上传{/if}
|
||||
{if($value->type==10)}多图上传{/if}
|
||||
{if($value->type==6)}附件上传{/if}
|
||||
{if($value->type==7)}日期选择{/if}
|
||||
{if($value->type==8)}编辑器{/if}
|
||||
@@ -94,7 +95,8 @@
|
||||
<option value="2">多行文本</option>
|
||||
<option value="3">单选按钮</option>
|
||||
<option value="4">多选按钮</option>
|
||||
<option value="5">图片上传</option>
|
||||
<option value="5">单图上传</option>
|
||||
<option value="10">多图上传</option>
|
||||
<option value="6">附件上传</option>
|
||||
<option value="7">日期选择</option>
|
||||
<option value="8">编辑器</option>
|
||||
@@ -181,11 +183,15 @@
|
||||
<option value="8" selected>编辑器</option>
|
||||
{/if}
|
||||
|
||||
{if([$extfield->type]!=2 && [$extfield->type]!=7 && [$extfield->type]!=8)}
|
||||
{if([$extfield->type]==10)}
|
||||
<option value="10" selected>多图上传</option>
|
||||
{/if}
|
||||
|
||||
{if([$extfield->type]!=2 && [$extfield->type]!=7 && [$extfield->type]!=8 && [$extfield->type]!=10)}
|
||||
<option value="1" {if([$extfield->type]==1)}selected{/if}>单行文本</option>
|
||||
<option value="3" {if([$extfield->type]==3)}selected{/if}>单选按钮</option>
|
||||
<option value="4" {if([$extfield->type]==4)}selected{/if}>多选按钮</option>
|
||||
<option value="5" {if([$extfield->type]==5)}selected{/if}>图片上传</option>
|
||||
<option value="5" {if([$extfield->type]==5)}selected{/if}>单图上传</option>
|
||||
<option value="6" {if([$extfield->type]==6)}selected{/if}>附件上传</option>
|
||||
<option value="9" {if([$extfield->type]==9)}selected{/if}>下拉选择</option>
|
||||
{/if}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<tbody>
|
||||
{foreach $links(key,value)}
|
||||
<tr>
|
||||
<td>分组[value->gid]</td>
|
||||
<td>[value->gid]</td>
|
||||
<td>[value->name]</td>
|
||||
<td>[value->link]</td>
|
||||
<td><img src="{SITE_DIR}[value->logo]" style="height:20px;"></td>
|
||||
@@ -113,15 +113,11 @@
|
||||
<div class="layui-tab-item layui-show">
|
||||
<form action="{url./admin/Link/mod/id/'.[$get.id].'}{$backurl}" method="post" class="layui-form">
|
||||
<input type="hidden" name="formcheck" value="{$formcheck}" >
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">分组</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="gid">
|
||||
{foreach $gids(key,value)}
|
||||
<option value="[value]" {if([$link->gid]==$value)}selected{/if}>分组[value]</option>
|
||||
{/foreach}
|
||||
<option value="" >自动新增分组</option>
|
||||
</select>
|
||||
<input type="text" name="gid" required lay-verify="required" value="{$link->gid}" placeholder="请输入分组" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -36,9 +36,9 @@
|
||||
<td>[value->contenttpl]</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>
|
||||
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/0}" class="switch"><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>
|
||||
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/1}" class="switch"><i class='fa fa-toggle-off' title="点击启用"></i></a>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -60,23 +60,19 @@
|
||||
<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>
|
||||
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/0}" class="switch"><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>
|
||||
<a href="{url./admin/'.C.'/mod/id/'.$value->id.'/field/status/value/1}" class="switch"><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';
|
||||
{/php}
|
||||
|
||||
{if($value->filename)}
|
||||
<a href="{fun=homeurl('/home/Index/'.$value->filename)}" 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)}" class="layui-btn layui-btn-xs layui-btn-primary" target="_blank">查看</a>
|
||||
{/if}
|
||||
{php}
|
||||
$Parser=new app\home\controller\ParserController();
|
||||
$link=$Parser->parserLink(1,$value->urlname,'about',$value->scode,$value->filename,'','');
|
||||
{/php}
|
||||
<a href="{php}echo $link{/php}" class="layui-btn layui-btn-xs layui-btn-primary" target="_blank">查看</a>
|
||||
{/if}
|
||||
|
||||
{if(check_level('mod'))}
|
||||
|
||||
@@ -1,107 +1,107 @@
|
||||
{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="subtitle" value="{$sites->subtitle}" 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"></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'}
|
||||
{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="subtitle" value="{$sites->subtitle}" 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"></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'}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<tbody>
|
||||
{foreach $slides(key,value)}
|
||||
<tr>
|
||||
<td>分组[value->gid]</td>
|
||||
<td>[value->gid]</td>
|
||||
<td><img src="{SITE_DIR}[value->pic]" style="height:30px;"></td>
|
||||
<td>[value->link]</td>
|
||||
<td>[value->title]</td>
|
||||
@@ -123,15 +123,11 @@
|
||||
<div class="layui-tab-item layui-show">
|
||||
<form action="{url./admin/Slide/mod/id/'.[$get.id].'}{$backurl}" method="post" class="layui-form">
|
||||
<input type="hidden" name="formcheck" value="{$formcheck}" >
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">分组</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="gid">
|
||||
{foreach $gids(key,value)}
|
||||
<option value="[value]" {if([$slide->gid]==$value)}selected{/if}>分组[value]</option>
|
||||
{/foreach}
|
||||
<option value="" >自动新增分组</option>
|
||||
</select>
|
||||
<input type="text" name="gid" required lay-verify="required" value="{$slide->gid}" placeholder="请输入分组" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,78 +1,82 @@
|
||||
<!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>{CMSNAME}管理中心-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>
|
||||
<!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>{CMSNAME}管理中心-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>
|
||||
<img src="{APP_THEME_DIR}/images/logo.png" height="40">
|
||||
{CMSNAME}管理中心
|
||||
</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>
|
||||
|
||||
{if(CMSNAME=='PbootCMS')}
|
||||
<div class="layui-trans user-login-footer">
|
||||
<p>© 2018-{fun=date('Y')} <a href="http://www.pbootcms.com/" target="_blank">pbootcms.com</a></p>
|
||||
<p><span><a href="http://demo.pbootcms.com" target="_blank">在线演示</a></span><span><a href="http://www.pbootcms.com" target="_blank">前往官网</a></span> </p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
</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>
|
||||
@@ -71,6 +71,42 @@ $(document).ready(function (e) {
|
||||
$(this).attr('href', $(this).attr('href')+hash);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//无刷新切换状态
|
||||
$('.switch').on("click",".fa-toggle-on",function(){
|
||||
$.get($(this).parent(".switch").attr("href"))
|
||||
$(this).addClass("fa-toggle-off");
|
||||
$(this).removeClass("fa-toggle-on");
|
||||
return false;
|
||||
})
|
||||
$('.switch').on("click",".fa-toggle-off",function(){
|
||||
$.get($(this).parent(".switch").attr("href"))
|
||||
$(this).addClass("fa-toggle-on");
|
||||
$(this).removeClass("fa-toggle-off");
|
||||
return false;
|
||||
})
|
||||
|
||||
$('.ajaxlink').on("click",function(){
|
||||
var url=$(this).attr("href");
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: url,
|
||||
dataType: 'json',
|
||||
data: {},
|
||||
success: function (response, status) {
|
||||
alert(response.data);
|
||||
if(response.tourl!=""){
|
||||
location.href=response.tourl;
|
||||
}
|
||||
},
|
||||
error:function(xhr,status,error){
|
||||
alert('返回数据异常!');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
@@ -112,6 +112,7 @@ layui.use(['element','upload','laydate','form'], function(){
|
||||
//执行多图片上传实例
|
||||
var files='';
|
||||
var html='';
|
||||
var html2='';
|
||||
var uploadsInst = upload.render({
|
||||
elem: '.uploads' //绑定元素
|
||||
,url: uploadurl //上传接口
|
||||
@@ -136,6 +137,7 @@ layui.use(['element','upload','laydate','form'], function(){
|
||||
html += "<dl><dt><img src='"+sitedir+res.data[0]+"' data-url='"+res.data[0]+"'></dt><dd>删除</dd>" +
|
||||
"<dt><input type='text' name='picstitle[]' style='width:95%' /></dt>"+
|
||||
"</dl>";
|
||||
html2 += "<dl><dt><img src='"+sitedir+res.data[0]+"' data-url='"+res.data[0]+"'></dt><dd>删除</dd>" + "</dl>";
|
||||
}else{
|
||||
layer.msg('有文件上传失败:'+res.data);
|
||||
}
|
||||
@@ -151,10 +153,15 @@ layui.use(['element','upload','laydate','form'], function(){
|
||||
}else{
|
||||
$('#'+des).val(files);
|
||||
}
|
||||
$('#'+des+'_box').append(html);
|
||||
if(des=='pics'){
|
||||
$('#'+des+'_box').append(html);
|
||||
}else{
|
||||
$('#'+des+'_box').append(html2);
|
||||
}
|
||||
layer.msg('成功上传'+obj.successful+'个文件!');
|
||||
files='';
|
||||
html='';
|
||||
html2='';
|
||||
}else{
|
||||
layer.msg('全部上传失败!');
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,173 +1,176 @@
|
||||
{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>PbootCMS 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>{CMSNAME}企业网站开发建设管理系统</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>官方网站</th>
|
||||
<td><a href="http://www.pbootcms.com" target="_blank" style="color:#666">www.pbootcms.com</a></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>星梦</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>友情贡献者</th>
|
||||
<td>
|
||||
感谢交流群各网友对PbootCMS发展的大力支持;
|
||||
感谢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'}
|
||||
{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>PbootCMS 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>{CMSNAME}企业网站开发建设管理系统</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>官方网站</th>
|
||||
<td><a href="http://www.pbootcms.com" target="_blank" style="color:#666">www.pbootcms.com</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>源码下载</th>
|
||||
<td>
|
||||
<a href="https://gitee.com/hnaoyun/PbootCMS/" style="color:#666" target="_blank">Gitee</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>系统开发</th>
|
||||
<td>星梦</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>版权协议</th>
|
||||
<td><a href="http://www.pbootcms.com/system-usage/277.html" style="color:#666" target="_blank">点击查看</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>技术交流群</th>
|
||||
<td>822430453、794519782</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>友情贡献者</th>
|
||||
<td>
|
||||
感谢交流群各网友对PbootCMS发展的大力支持;
|
||||
感谢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'}
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace app\api\controller;
|
||||
use core\basic\Controller;
|
||||
use app\api\model\CmsModel;
|
||||
use core\basic\Url;
|
||||
use app\home\controller\ParserController;
|
||||
|
||||
class AboutController extends Controller
|
||||
{
|
||||
@@ -40,15 +41,8 @@ class AboutController extends Controller
|
||||
$data->likeslink = url('/home/Do/likes/id/' . $data->id, false);
|
||||
$data->opposelink = url('/home/Do/oppose/id/' . $data->id, false);
|
||||
|
||||
$urlname = $data->urlname ?: 'about';
|
||||
$url_break_char = $this->config('url_break_char') ?: '_';
|
||||
|
||||
if ($data->sortfilename) {
|
||||
$data->contentlink = Url::home($data->sortfilename);
|
||||
} else {
|
||||
$data->contentlink = Url::home($urlname . $url_break_char . $data->scode);
|
||||
}
|
||||
|
||||
$Parser = new ParserController();
|
||||
$data->contentlink = $Parser->parserLink(1, $data->urlname, 'about', $data->scode, $data->sortfilename);
|
||||
$data->content = str_replace(STATIC_DIR . '/upload/', get_http_url() . STATIC_DIR . '/upload/', $data->content);
|
||||
json(1, $data);
|
||||
} else {
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace app\api\controller;
|
||||
use core\basic\Controller;
|
||||
use app\api\model\CmsModel;
|
||||
use core\basic\Url;
|
||||
use app\home\controller\ParserController;
|
||||
|
||||
class CmsController extends Controller
|
||||
{
|
||||
@@ -170,7 +171,7 @@ class CmsController extends Controller
|
||||
|
||||
// 获取主要参数
|
||||
$field = request('field');
|
||||
if (! preg_match('/^[\w\|\s]+$/', $field)) {
|
||||
if (! preg_match('/^[\w\|]+$/', $field)) {
|
||||
$field = '';
|
||||
}
|
||||
$keyword = request('keyword', 'vars');
|
||||
@@ -329,7 +330,7 @@ class CmsController extends Controller
|
||||
|
||||
// 读取数据
|
||||
$data = $this->model->getLists($acode, $scode, $num, $order, $where1, $where2, $where3, $fuzzy);
|
||||
$url_break_char = $this->config('url_break_char') ?: '_';
|
||||
$Parser = new ParserController();
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
if ($value->outlink) {
|
||||
@@ -342,16 +343,7 @@ class CmsController extends Controller
|
||||
$data[$key]->content = str_replace(STATIC_DIR . '/upload/', get_http_url() . STATIC_DIR . '/upload/', $value->content);
|
||||
|
||||
// 返回网页链接地址,便于AJAX调用内容
|
||||
$urlname = $value->urlname ?: 'list';
|
||||
if ($value->sortfilename && $value->filename) {
|
||||
$data[$key]->contentlink = Url::home($value->sortfilename . '/' . $value->filename, true);
|
||||
} elseif ($value->sortfilename) {
|
||||
$data[$key]->contentlink = Url::home($value->sortfilename . '/' . $value->id, true);
|
||||
} elseif ($value->filename) {
|
||||
$data[$key]->contentlink = Url::home($urlname . $url_break_char . $value->scode . '/' . $value->filename, true);
|
||||
} else {
|
||||
$data[$key]->contentlink = Url::home($urlname . $url_break_char . $value->scode . '/' . $value->id, true);
|
||||
}
|
||||
$data[$key]->contentlink = $Parser->parserLink(2, $value->urlname, 'content', $value->scode, $value->sortfilename, $value->id, $value->filename);
|
||||
}
|
||||
|
||||
// 输出数据
|
||||
@@ -427,7 +419,7 @@ class CmsController extends Controller
|
||||
if ($this->model->addMessage($value->table_name, $data)) {
|
||||
$this->log('API提交留言数据成功!');
|
||||
if ($this->config('message_send_mail') && $this->config('message_send_to')) {
|
||||
$mail_subject = "【PbootCMS】您有新的" . $value->form_name . "信息,请注意查收!";
|
||||
$mail_subject = "【" . CMSNAME . "】您有新的" . $value->form_name . "信息,请注意查收!";
|
||||
$mail_body .= '<br>来自网站' . get_http_url() . '(' . date('Y-m-d H:i:s') . ')';
|
||||
sendmail($this->config(), $this->config('message_send_to'), $mail_subject, $mail_body);
|
||||
}
|
||||
@@ -509,7 +501,7 @@ class CmsController extends Controller
|
||||
if ($this->model->addForm($value->table_name, $data)) {
|
||||
$this->log('API提交表单数据成功!');
|
||||
if ($this->config('form_send_mail') && $this->config('message_send_to')) {
|
||||
$mail_subject = "【PbootCMS】您有新的" . $value->form_name . "信息,请注意查收!";
|
||||
$mail_subject = "【" . CMSNAME . "】您有新的" . $value->form_name . "信息,请注意查收!";
|
||||
$mail_body .= '<br>来自网站' . get_http_url() . '(' . date('Y-m-d H:i:s') . ')';
|
||||
sendmail($this->config(), $this->config('message_send_to'), $mail_subject, $mail_body);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace app\api\controller;
|
||||
use core\basic\Controller;
|
||||
use app\api\model\CmsModel;
|
||||
use core\basic\Url;
|
||||
use app\home\controller\ParserController;
|
||||
|
||||
class ContentController extends Controller
|
||||
{
|
||||
@@ -38,21 +39,9 @@ class ContentController extends Controller
|
||||
$data->likeslink = url('/home/Do/likes/id/' . $data->id, false);
|
||||
$data->opposelink = url('/home/Do/oppose/id/' . $data->id, false);
|
||||
|
||||
$url_break_char = $this->config('url_break_char') ?: '_';
|
||||
$url_rule_sort_suffix = $this->config('url_rule_sort_suffix') ? true : null;
|
||||
$urlname = $data->urlname ?: 'list';
|
||||
|
||||
// 返回网页链接地址
|
||||
if ($data->sortfilename && $data->filename) {
|
||||
$data->contentlink = Url::home($data->sortfilename . '/' . $data->filename, true);
|
||||
} elseif ($data->sortfilename) {
|
||||
$data->contentlink = Url::home($data->sortfilename . '/' . $data->id, true);
|
||||
} elseif ($data->filename) {
|
||||
$data->contentlink = Url::home($urlname . $url_break_char . $data->scode . '/' . $data->filename, true);
|
||||
} else {
|
||||
$data->contentlink = Url::home($urlname . $url_break_char . $data->scode . '/' . $data->id, true);
|
||||
}
|
||||
|
||||
$Parser = new ParserController();
|
||||
$data->contentlink = $Parser->parserLink(2, $data->urlname, 'content', $data->scode, $data->sortfilename, $data->id, $data->filename);
|
||||
$data->content = str_replace(STATIC_DIR . '/upload/', get_http_url() . STATIC_DIR . '/upload/', $data->content);
|
||||
json(1, $data);
|
||||
} else {
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace app\api\controller;
|
||||
use core\basic\Controller;
|
||||
use app\api\model\CmsModel;
|
||||
use core\basic\Url;
|
||||
use app\home\controller\ParserController;
|
||||
|
||||
class ListController extends Controller
|
||||
{
|
||||
@@ -82,7 +83,7 @@ class ListController extends Controller
|
||||
|
||||
// 读取数据
|
||||
$data = $this->model->getLists($acode, $scode, $num, $order);
|
||||
$url_break_char = $this->config('url_break_char') ?: '_';
|
||||
$Parser = new ParserController();
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
if ($value->outlink) {
|
||||
@@ -95,16 +96,7 @@ class ListController extends Controller
|
||||
$data[$key]->content = str_replace(STATIC_DIR . '/upload/', get_http_url() . STATIC_DIR . '/upload/', $value->content);
|
||||
|
||||
// 返回网页链接地址,便于AJAX调用内容
|
||||
$urlname = $value->urlname ?: 'list';
|
||||
if ($value->sortfilename && $value->filename) {
|
||||
$data[$key]->contentlink = Url::home($value->sortfilename . '/' . $value->filename, true);
|
||||
} elseif ($value->sortfilename) {
|
||||
$data[$key]->contentlink = Url::home($value->sortfilename . '/' . $value->id, true);
|
||||
} elseif ($value->filename) {
|
||||
$data[$key]->contentlink = Url::home($urlname . $url_break_char . $value->scode . '/' . $value->filename, true);
|
||||
} else {
|
||||
$data[$key]->contentlink = Url::home($urlname . $url_break_char . $value->scode . '/' . $value->id, true);
|
||||
}
|
||||
$data[$key]->contentlink = $Parser->parserLink(2, $value->urlname, 'content', $value->scode, $value->sortfilename, $value->id, $value->filename);
|
||||
}
|
||||
|
||||
// 输出数据
|
||||
|
||||
@@ -18,6 +18,10 @@ class ApiController extends Controller
|
||||
{
|
||||
// 自动缓存基础信息
|
||||
cache_config();
|
||||
|
||||
// 从配置文件读取cmsname参数来设置系统名称
|
||||
define("CMSNAME", $this->config("cmsname") ?: 'PbootCMS');
|
||||
|
||||
$this->checkAccess($this->config());
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@ class HomeController extends Controller
|
||||
// 自动缓存基础信息
|
||||
cache_config();
|
||||
|
||||
// 从配置文件读取cmsname参数来设置系统名称
|
||||
define("CMSNAME", $this->config("cmsname") ?: 'PbootCMS');
|
||||
|
||||
// 站点关闭检测
|
||||
if (! ! $close_site = Config::get('close_site')) {
|
||||
$close_site_note = Config::get('close_site_note');
|
||||
@@ -38,6 +41,7 @@ class HomeController extends Controller
|
||||
} else {
|
||||
header("Location: http://" . $main_domain . ':' . $_SERVER['SERVER_PORT'], true, 301);
|
||||
}
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +96,8 @@ class HomeController extends Controller
|
||||
} else {
|
||||
$pre = 'http://';
|
||||
}
|
||||
header('Location:' . $pre . $this->config('wap_domain') . URL, true, 301); // 手机访问并且绑定了域名,但是访问域名不一致则跳转
|
||||
header('Location:' . $pre . $this->config('wap_domain') . URL, true, 302); // 手机访问并且绑定了域名,但是访问域名不一致则跳转
|
||||
exit();
|
||||
} elseif (is_mobile()) { // 其他情况手机访问则自动手机版本
|
||||
$this->setTheme(get_theme() . '/wap');
|
||||
} else { // 其他情况,电脑版本
|
||||
|
||||
@@ -184,7 +184,10 @@ function cache_config($refresh = false)
|
||||
$config_cache = RUN_PATH . '/config/' . md5('config') . '.php';
|
||||
if (! file_exists($config_cache) || $refresh) {
|
||||
$model = model('admin.system.Config');
|
||||
Config::set(md5('config'), $model->getConfig(), false, true);
|
||||
$config = $model->getConfig();
|
||||
unset($config['sn']);
|
||||
unset($config['sn_user']);
|
||||
Config::set(md5('config'), $config, false, true);
|
||||
}
|
||||
|
||||
// 多语言缓存
|
||||
|
||||
@@ -37,8 +37,9 @@ return array(
|
||||
|
||||
// 前台及接口路径统一小写URL
|
||||
// =======前台路由============
|
||||
'home/sitemap.xml' => 'home/Sitemap/index', // 站点地图1
|
||||
'home/sitemap' => 'home/Sitemap/index', // 站点地图2
|
||||
'home/sitemap.xml' => 'home/Sitemap/index', // 站点地图XML格式
|
||||
'home/sitemap.txt' => 'home/Sitemap/linkTxt', // 站点地图TXT格式
|
||||
'home/sitemap' => 'home/Sitemap/index', // 站点地图默认XML
|
||||
|
||||
// =======接口路由============
|
||||
'api/list' => 'api/list/index/scode',
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
return array(
|
||||
// 应用版本
|
||||
'app_version' => '3.0.9',
|
||||
'app_version' => '3.1.3',
|
||||
|
||||
// 发布时间
|
||||
'release_time' => '20211013',
|
||||
'release_time' => '20220103',
|
||||
|
||||
// 修订版本
|
||||
'revise_version' => '1'
|
||||
'revise_version' => '5'
|
||||
|
||||
);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @author XingMeng
|
||||
* @email hnxsh@foxmail.com
|
||||
* @date 2020年06月27日
|
||||
* 评论控制器
|
||||
* 评论控制器
|
||||
*/
|
||||
namespace app\home\controller;
|
||||
|
||||
@@ -91,7 +91,7 @@ class CommentController extends Controller
|
||||
session('lastsub', time()); // 记录最后提交时间
|
||||
$this->log('文章' . $contentid . '评论提交成功!');
|
||||
if ($this->config('comment_send_mail') && $this->config('message_send_to')) {
|
||||
$mail_subject = "【PbootCMS】您有新的文章评论信息,请注意查收!";
|
||||
$mail_subject = "【" . CMSNAME . "】您有新的文章评论信息,请注意查收!";
|
||||
$mail_body = '评论内容:' . $comment . '<br>';
|
||||
$mail_body .= '<br>来自网站 ' . get_http_url() . ' (' . date('Y-m-d H:i:s') . ')';
|
||||
sendmail($this->config(), $this->config('message_send_to'), $mail_subject, $mail_body);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @author XingMeng
|
||||
* @email hnxsh@foxmail.com
|
||||
* @date 2020年3月8日
|
||||
* 表单控制器
|
||||
* 表单控制器
|
||||
*/
|
||||
namespace app\home\controller;
|
||||
|
||||
@@ -89,7 +89,7 @@ class FormController extends Controller
|
||||
session('lastsub', time()); // 记录最后提交时间
|
||||
$this->log('提交表单数据成功!');
|
||||
if ($this->config('form_send_mail') && $this->config('message_send_to')) {
|
||||
$mail_subject = "【PbootCMS】您有新的" . $value->form_name . "信息,请注意查收!";
|
||||
$mail_subject = "【" . CMSNAME . "】您有新的" . $value->form_name . "信息,请注意查收!";
|
||||
$mail_body .= '<br>来自网站 ' . get_http_url() . ' (' . date('Y-m-d H:i:s') . ')';
|
||||
sendmail($this->config(), $this->config('message_send_to'), $mail_subject, $mail_body);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ class IndexController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// 地址去后缀,并且强制模式
|
||||
// 判断是否存在后缀
|
||||
$url_rule_suffix = substr($this->config('url_rule_suffix'), 1);
|
||||
$suffix = false;
|
||||
$slash = false;
|
||||
@@ -65,11 +65,12 @@ class IndexController extends Controller
|
||||
$slash = true;
|
||||
$path = trim($path, '/');
|
||||
}
|
||||
$path = escape_string($path);
|
||||
$path_arr = $path ? explode('/', $path) : array();
|
||||
|
||||
// 开始路由
|
||||
if (isset($path_arr) && count($path_arr) > 0) {
|
||||
switch ($path_arr[0]) {
|
||||
if (isset($path_arr) && count($path_arr) > 0 && preg_match('/^[\w\-\/]+$/', $path)) {
|
||||
switch (strtolower($path_arr[0])) {
|
||||
case 'search':
|
||||
case 'keyword':
|
||||
$search = new SearchController();
|
||||
@@ -85,10 +86,14 @@ class IndexController extends Controller
|
||||
$form->index();
|
||||
break;
|
||||
case 'sitemap':
|
||||
case 'Sitemap':
|
||||
case 'sitemap_xml':
|
||||
$sitemap = new SitemapController();
|
||||
$sitemap->index();
|
||||
break;
|
||||
case 'sitemap_txt':
|
||||
$sitemap = new SitemapController();
|
||||
$sitemap->linkTxt();
|
||||
break;
|
||||
case 'tag':
|
||||
$tag = new TagController();
|
||||
$tag->index();
|
||||
@@ -101,37 +106,68 @@ class IndexController extends Controller
|
||||
$comment = new CommentController();
|
||||
$comment->{$path_arr[1]}();
|
||||
break;
|
||||
case 'spider':
|
||||
$spider = new SpiderController();
|
||||
$spider->index();
|
||||
break;
|
||||
default:
|
||||
if (get($path_arr[0])) {
|
||||
$this->getIndex();
|
||||
|
||||
$url_break_char = $this->config('url_break_char') ?: '_';
|
||||
$url_rule_content_path = $this->config('url_rule_content_path') ? true : false;
|
||||
$err = '';
|
||||
$iscontent = false;
|
||||
|
||||
// 开始进行地址匹配
|
||||
if (! $suffix && ! ! $sort = $this->model->getSort($path)) {
|
||||
// 栏目名称,即栏目全路径匹配
|
||||
} elseif (preg_match('/^([a-zA-Z0-9\-\/]+)' . $url_break_char . '([0-9]+)$/i', $path, $matchs) && ! ! $sort = $this->model->getSort($matchs[1])) {
|
||||
// 栏目名称_分页,栏目分页的情况
|
||||
define('CMS_PAGE_CUSTOM', true); // 设置走自定义CMS分页
|
||||
$_GET['page'] = $matchs[2]; // 设置分页参数
|
||||
} else {
|
||||
|
||||
// 假设详情页地址,详情页匹配前段为栏目路径
|
||||
$temp = $path_arr;
|
||||
$contenturl = array_pop($temp);
|
||||
$sorturl = implode('/', $temp);
|
||||
$url_break_char = $this->config('url_break_char') ?: '_';
|
||||
|
||||
// 开始进行匹配
|
||||
if (! ! $sort = $this->model->getSort($path)) {
|
||||
// 栏目名称
|
||||
$iscontent = false;
|
||||
} elseif (preg_match('/^([a-zA-Z0-9\-\/]+)' . $url_break_char . '([0-9]+)$/i', $path, $matchs) && ! ! $sort = $this->model->getSort($matchs[1])) {
|
||||
// 栏目名称_分页
|
||||
$iscontent = false;
|
||||
define('CMS_PAGE_CUSTOM', true);
|
||||
$_GET['page'] = $matchs[2]; // 分页
|
||||
} elseif (! ! $sorturl && ! ! $sort = $this->model->getSort($sorturl)) {
|
||||
// 栏目名称/内容名称或ID(要在第2个判断【栏目名称_分页】后)
|
||||
$data = $this->model->getContent($contenturl);
|
||||
$iscontent = true;
|
||||
} elseif (preg_match('/^list' . $url_break_char . '[0-9]+|about' . $url_break_char . '[0-9]+$/', $sorturl)) {
|
||||
// 模型默认名称_栏目ID/内容名称或ID
|
||||
$data = $this->model->getContent($contenturl);
|
||||
$iscontent = true;
|
||||
} else {
|
||||
preg_match('/^([a-zA-Z0-9\-\/]+)(' . $url_break_char . '([0-9]+))?' . $url_break_char . '([0-9]+)$/i', $path, $matchs);
|
||||
if ($url_rule_content_path && ! ! $data = $this->model->getContent($path)) {
|
||||
$iscontent = true; // 短路径情况
|
||||
} elseif (! $url_rule_content_path) {
|
||||
// 详情页至少是2级,对地址进行栏目和内容路径拆分,访问详情页
|
||||
$part1 = dirname($path);
|
||||
$part2 = basename($path);
|
||||
while ($part1 != '.') {
|
||||
if ((! ! $sort = $this->model->getSort($part1)) && ! ! $data = $this->model->getContent($part2)) {
|
||||
// 栏目名称/内容名称或ID
|
||||
$iscontent = true;
|
||||
$scode = $sort->scode;
|
||||
break;
|
||||
} elseif (preg_match('/^([a-zA-Z0-9\-\/]+)' . $url_break_char . '([0-9]+)$/i', $part1, $matchs) && ! ! $model = $this->model->checkModelUrlname($matchs[1])) {
|
||||
// 模型名称_栏目ID/内容名称或ID
|
||||
$data = $this->model->getContent($part2);
|
||||
$iscontent = true;
|
||||
$scode = $matchs[2];
|
||||
// 限制串模型多路径
|
||||
if (! ! $data->urlname && $matchs[1] != $data->urlname) {
|
||||
$err = true;
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
$part2 = basename($part1) . '/' . $part2;
|
||||
$part1 = dirname($part1);
|
||||
}
|
||||
}
|
||||
|
||||
// 限制串栏目多路径
|
||||
if ($scode != $data->scode) {
|
||||
$err = true;
|
||||
}
|
||||
|
||||
// 限制串内容ID及名称多路径
|
||||
if (! ! $data->filename && $part2 != $data->filename) {
|
||||
$err = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 执行未配置栏目名称但是配置了模型路径的情况路径匹配
|
||||
if (! $iscontent) {
|
||||
preg_match('/^([a-zA-Z0-9\-\/]+)(' . $url_break_char . '([0-9]+))?' . $url_break_char . '([0-9]+)$/i', $path, $matchs);
|
||||
if ($matchs[2] && $model = $this->model->checkModelUrlname($matchs[1])) {
|
||||
// 模型名称_栏目ID_分页
|
||||
define('CMS_PAGE_CUSTOM', false);
|
||||
@@ -140,50 +176,47 @@ class IndexController extends Controller
|
||||
} elseif (! ! $model = $this->model->checkModelUrlname($matchs[1])) {
|
||||
// 模型名称_栏目ID
|
||||
$sort = $this->model->getSort($matchs[4]);
|
||||
} elseif (preg_match('/^([a-zA-Z0-9\-\/]+)' . $url_break_char . '([0-9]+)$/i', $sorturl, $matchs)) {
|
||||
// 模型名称_栏目ID/内容名称或ID
|
||||
if (! ! $model = $this->model->checkModelUrlname($matchs[1])) {
|
||||
$data = $this->model->getContent($contenturl);
|
||||
$iscontent = true;
|
||||
}
|
||||
}
|
||||
|
||||
// 限制串模型和栏目名称多路径,当栏目名称不为空时不允许使用模型路径
|
||||
if ($sort->filename != '') {
|
||||
$err = true;
|
||||
}
|
||||
|
||||
// 限制串模型多路径
|
||||
if (! ! $sort->urlname && $matchs[1] != $sort->urlname) {
|
||||
$err = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($iscontent) {
|
||||
define('CMS_PAGE', false); // 使用普通分页处理模型
|
||||
if (! ! $data && $suffix) {
|
||||
if ($data->acode != get_lg() && Config::get('lgautosw') !== '0') {
|
||||
cookie('lg', $data->acode); // 调用内容语言与当前语言不一致时,自动切换语言
|
||||
}
|
||||
$this->getContent($data);
|
||||
}
|
||||
|
||||
if ($iscontent) {
|
||||
define('CMS_PAGE', false); // 使用普通分页处理模型
|
||||
if (! ! $data && $suffix && ! $err) {
|
||||
$this->getContentPage($data);
|
||||
} else {
|
||||
_404('您访问的内容不存在,请核对后重试!');
|
||||
}
|
||||
} else {
|
||||
define('CMS_PAGE', true); // 使用cms分页处理模型
|
||||
if (! ! $sort && ! $suffix && ! $err) {
|
||||
if ($sort->type == 1) {
|
||||
$this->getAboutPage($sort);
|
||||
} else {
|
||||
_404('您访问的内容不存在,请核对后重试!');
|
||||
$this->getListPage($sort);
|
||||
}
|
||||
} else {
|
||||
define('CMS_PAGE', true); // 使用cms分页处理模型
|
||||
|
||||
if (! ! $sort && ! $suffix) {
|
||||
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('您访问的页面不存在,请核对后重试!');
|
||||
}
|
||||
_404('您访问的页面不存在,请核对后重试!');
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->getIndex();
|
||||
$this->getIndexPage();
|
||||
}
|
||||
}
|
||||
|
||||
// 首页
|
||||
private function getIndex()
|
||||
private function getIndexPage()
|
||||
{
|
||||
$content = parent::parser($this->htmldir . 'index.html'); // 框架标签解析
|
||||
$content = $this->parser->parserBefore($content); // CMS公共标签前置解析
|
||||
@@ -195,8 +228,12 @@ class IndexController extends Controller
|
||||
}
|
||||
|
||||
// 列表
|
||||
private function getList($sort)
|
||||
private function getListPage($sort)
|
||||
{
|
||||
// 调用栏目语言与当前语言不一致时,自动切换语言
|
||||
if ($sort->acode != get_lg() && Config::get('lgautosw') !== '0') {
|
||||
cookie('lg', $sort->acode);
|
||||
}
|
||||
if ($sort->listtpl) {
|
||||
$this->checkPageLevel($sort->gcode, $sort->gtype, $sort->gnote);
|
||||
$content = parent::parser($this->htmldir . $sort->listtpl); // 框架标签解析
|
||||
@@ -216,8 +253,14 @@ class IndexController extends Controller
|
||||
}
|
||||
|
||||
// 详情页
|
||||
private function getContent($data)
|
||||
private function getContentPage($data)
|
||||
{
|
||||
|
||||
// 调用内容语言与当前语言不一致时,自动切换语言
|
||||
if ($data->acode != get_lg() && Config::get('lgautosw') !== '0') {
|
||||
cookie('lg', $data->acode);
|
||||
}
|
||||
|
||||
// 读取模板
|
||||
if (! ! $sort = $this->model->getSort($data->scode)) {
|
||||
if ($sort->contenttpl) {
|
||||
@@ -243,8 +286,13 @@ class IndexController extends Controller
|
||||
}
|
||||
|
||||
// 单页
|
||||
private function getAbout($sort)
|
||||
private function getAboutPage($sort)
|
||||
{
|
||||
// 调用栏目语言与当前语言不一致时,自动切换语言
|
||||
if ($sort->acode != get_lg() && Config::get('lgautosw') !== '0') {
|
||||
cookie('lg', $sort->acode);
|
||||
}
|
||||
|
||||
// 读取数据
|
||||
if (! $data = $this->model->getAbout($sort->scode)) {
|
||||
_404('您访问的内容不存在,请核对后重试!');
|
||||
|
||||
@@ -290,10 +290,19 @@ class MemberController extends Controller
|
||||
$nickname = post('nickname');
|
||||
$useremail = post('useremail');
|
||||
$usermobile = post('usermobile');
|
||||
$opassword = post('opassword');
|
||||
$password = post('password');
|
||||
$rpassword = post('rpassword');
|
||||
$headpic = str_replace(SITE_DIR, '', post('headpic'));
|
||||
|
||||
if (! $opassword) {
|
||||
alert_back('请输入当前密码!');
|
||||
} else {
|
||||
if (! $this->model->checkUsername(" password='" . md5(md5($opassword)) . "' AND id='" . session('pboot_uid') . "'")) {
|
||||
alert_back('您输入的当前密码不正确!');
|
||||
}
|
||||
}
|
||||
|
||||
if ($useremail) { // 邮箱校验
|
||||
if (! preg_match('/^[\w]+@[\w\.]+\.[a-zA-Z]+$/', $useremail)) {
|
||||
alert_back('邮箱格式不正确,请输入正确的邮箱账号!');
|
||||
@@ -441,7 +450,7 @@ class MemberController extends Controller
|
||||
$rs = false;
|
||||
if ($to) {
|
||||
session('lastsend', time()); // 记录最后提交时间
|
||||
$mail_subject = "【PbootCMS】您有新的验证码信息,请注意查收!";
|
||||
$mail_subject = "【" . CMSNAME . "】您有新的验证码信息,请注意查收!";
|
||||
$code = create_code(4);
|
||||
session('checkcode', strtolower($code));
|
||||
$mail_body = "您的验证码为:" . $code;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @author XingMeng
|
||||
* @email hnxsh@foxmail.com
|
||||
* @date 2020年3月8日
|
||||
* 留言控制器
|
||||
* 留言控制器
|
||||
*/
|
||||
namespace app\home\controller;
|
||||
|
||||
@@ -96,7 +96,7 @@ class MessageController extends Controller
|
||||
session('lastsub', time()); // 记录最后提交时间
|
||||
$this->log('留言提交成功!');
|
||||
if ($this->config('message_send_mail') && $this->config('message_send_to')) {
|
||||
$mail_subject = "【PbootCMS】您有新的" . $value->form_name . "信息,请注意查收!";
|
||||
$mail_subject = "【" . CMSNAME . "】您有新的" . $value->form_name . "信息,请注意查收!";
|
||||
$mail_body .= '<br>来自网站 ' . get_http_url() . ' (' . date('Y-m-d H:i:s') . ')';
|
||||
sendmail($this->config(), $this->config('message_send_to'), $mail_subject, $mail_body);
|
||||
}
|
||||
|
||||
@@ -176,6 +176,17 @@ class ParserController extends Controller
|
||||
$content = str_replace('{pboot:registerstatus}', $this->config('register_status') === '0' ? 0 : 1, $content); // 是否开启注册
|
||||
$content = str_replace('{pboot:loginstatus}', $this->config('login_status') === '0' ? 0 : 1, $content); // 是否开启登录
|
||||
$content = str_replace('{pboot:commentstatus}', $this->config('comment_status') === '0' ? 0 : 1, $content); // 是否开启评论
|
||||
|
||||
// 记录蜘蛛爬行
|
||||
if ($this->config('spiderlog') !== '0') {
|
||||
if ($this->config('tpl_html_cache')) { // 缓存时插入script,否则直接执行
|
||||
$spidercode = "<script src='" . Url::home('Spider', null, 'url=' . URL) . "' async='async'></script>";
|
||||
$content = preg_replace('/(<\/body>)/i', $spidercode . "\n$1", $content);
|
||||
} else {
|
||||
$spider = new SpiderController(URL);
|
||||
$spider->index();
|
||||
}
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
@@ -184,8 +195,18 @@ class ParserController extends Controller
|
||||
public function parserSiteLabel($content)
|
||||
{
|
||||
$pattern = '/\{pboot:site([\w]+)(\s+[^}]+)?\}/';
|
||||
if (preg_match_all($pattern, $content, $matches)) {
|
||||
$data = array();
|
||||
|
||||
// 页面自适应标题避免多横线
|
||||
if (preg_match($pattern, $content)) {
|
||||
$data = $this->model->getSite();
|
||||
if (! $data->subtitle) {
|
||||
$content = str_replace('{pboot:sitetitle}-{pboot:sitesubtitle}', '{pboot:sitetitle}', $content);
|
||||
}
|
||||
}
|
||||
|
||||
if (preg_match_all($pattern, $content, $matches)) {
|
||||
$data = $data ?: $this->model->getSite();
|
||||
$count = count($matches[0]);
|
||||
for ($i = 0; $i < $count; $i ++) {
|
||||
$params = $this->parserParam($matches[2][$i]);
|
||||
@@ -386,6 +407,8 @@ class ParserController extends Controller
|
||||
}
|
||||
$parent = 0;
|
||||
$num = 0;
|
||||
$scode = 0;
|
||||
$scode_arr = array();
|
||||
foreach ($params as $key => $value) {
|
||||
switch ($key) {
|
||||
case 'parent':
|
||||
@@ -394,14 +417,20 @@ class ParserController extends Controller
|
||||
case 'num':
|
||||
$num = $value;
|
||||
break;
|
||||
case 'scode':
|
||||
$scode = $value;
|
||||
$scode_arr = explode(',', $scode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($parent) { // 非顶级栏目起始
|
||||
if (isset($data['tree'][$parent]['son'])) {
|
||||
$out_data = $data['tree'][$parent]['son'];
|
||||
} else {
|
||||
$out_data = array();
|
||||
if ($parent) { // 非顶级栏目起始,调用子栏目
|
||||
$parent_arr = explode(',', $parent);
|
||||
$out_data = array();
|
||||
foreach ($parent_arr as $vp) {
|
||||
if (isset($data['tree'][trim($vp)]['son'])) {
|
||||
$out_data = array_merge($out_data, $data['tree'][trim($vp)]['son']);
|
||||
}
|
||||
}
|
||||
} else { // 顶级栏目起始
|
||||
$out_data = $data['top'];
|
||||
@@ -422,6 +451,9 @@ class ParserController extends Controller
|
||||
$out_html = '';
|
||||
$key = 1;
|
||||
foreach ($out_data as $value) { // 按查询的数据条数循环
|
||||
if ($scode_arr && ! in_array($value['scode'], $scode_arr)) {
|
||||
continue;
|
||||
}
|
||||
$one_html = $matches[2][$i];
|
||||
if ($count2) {
|
||||
for ($j = 0; $j < $count2; $j ++) { // 循环替换数据
|
||||
@@ -1505,6 +1537,7 @@ class ParserController extends Controller
|
||||
// 获取调节参数
|
||||
$params = $this->parserParam($matches[1][$i]);
|
||||
$id = - 1;
|
||||
$field = "pics";
|
||||
|
||||
if (! self::checkLabelLevel($params)) {
|
||||
$content = str_replace($matches[0][$i], '', $content);
|
||||
@@ -1525,12 +1558,15 @@ class ParserController extends Controller
|
||||
case 'num':
|
||||
$num = $value;
|
||||
break;
|
||||
case 'field':
|
||||
$field = $value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 读取内容多图
|
||||
if (! ! $rs = $this->model->getContentPics(escape_string($id))) {
|
||||
$pics = explode(',', $rs->pics);
|
||||
if (! ! $rs = $this->model->getContentPics(escape_string($id), $field)) {
|
||||
$pics = explode(',', $rs->$field);
|
||||
$picstitle = explode(',', $rs->picstitle);
|
||||
} else {
|
||||
$pics = array();
|
||||
@@ -1552,7 +1588,7 @@ class ParserController extends Controller
|
||||
|
||||
$out_html = '';
|
||||
$key = 1;
|
||||
foreach ($pics as $key => $value) { // 按查询图片条数循环
|
||||
foreach ($pics as $vkey => $value) { // 按查询图片条数循环
|
||||
$one_html = $matches[2][$i];
|
||||
if (! $value)
|
||||
continue;
|
||||
@@ -1577,8 +1613,10 @@ class ParserController extends Controller
|
||||
}
|
||||
break;
|
||||
case 'title':
|
||||
$one_html = str_replace($matches2[0][$j], $this->adjustLabelData($params, isset($picstitle[$key]) ? $picstitle[$key] : ''), $one_html);
|
||||
$one_html = str_replace($matches2[0][$j], $this->adjustLabelData($params, isset($picstitle[$vkey]) ? $picstitle[$vkey] : ''), $one_html);
|
||||
break;
|
||||
default:
|
||||
$one_html = str_replace($matches2[0][$j], '', $one_html);
|
||||
}
|
||||
}
|
||||
$key ++;
|
||||
@@ -3270,7 +3308,7 @@ class ParserController extends Controller
|
||||
}
|
||||
|
||||
eval('if(' . $matches[1][$i] . '){$flag="if";}else{$flag="else";}');
|
||||
if (preg_match('/([\s\S]*)?\{else\}([\s\S]*)?/', $matches[2][$i], $matches2)) { // 判断是否存在else
|
||||
if (preg_match('/^([\s\S]*)\{else\}([\s\S]*)$/', $matches[2][$i], $matches2)) { // 判断是否存在else
|
||||
switch ($flag) {
|
||||
case 'if': // 条件为真
|
||||
if (isset($matches2[1])) {
|
||||
@@ -3870,12 +3908,13 @@ class ParserController extends Controller
|
||||
}
|
||||
|
||||
// 解析生成内容链接
|
||||
protected function parserLink($type, $urlname, $page, $scode, $sortfilename, $id, $contentfilename)
|
||||
public function parserLink($type, $urlname, $pagetype, $scode, $sortfilename, $id = '', $contentfilename = '')
|
||||
{
|
||||
$url_break_char = $this->config('url_break_char') ?: '_';
|
||||
$url_rule_sort_suffix = $this->config('url_rule_sort_suffix') ? true : null;
|
||||
$url_rule_content_path = $this->config('url_rule_content_path') ? true : false;
|
||||
|
||||
if ($type == 1) {
|
||||
if ($type == 1 || $pagetype == 'about') {
|
||||
$urlname = $urlname ?: 'about';
|
||||
if ($sortfilename) {
|
||||
$link = Url::home($sortfilename);
|
||||
@@ -3884,21 +3923,29 @@ class ParserController extends Controller
|
||||
}
|
||||
} else {
|
||||
$urlname = $urlname ?: 'list';
|
||||
if ($page == 'list') {
|
||||
if ($pagetype == 'list') {
|
||||
if ($sortfilename) {
|
||||
$link = Url::home($sortfilename);
|
||||
} else {
|
||||
$link = Url::home($urlname . $url_break_char . $scode);
|
||||
}
|
||||
} elseif ($page == 'content') {
|
||||
if ($sortfilename && $contentfilename) {
|
||||
$link = Url::home($sortfilename . '/' . $contentfilename, true);
|
||||
} elseif ($sortfilename) {
|
||||
$link = Url::home($sortfilename . '/' . $id, true);
|
||||
} elseif ($contentfilename) {
|
||||
$link = Url::home($urlname . $url_break_char . $scode . '/' . $contentfilename, true);
|
||||
} elseif ($pagetype == 'content') {
|
||||
if ($url_rule_content_path) {
|
||||
if ($contentfilename) {
|
||||
$link = Url::home($contentfilename, true);
|
||||
} else {
|
||||
$link = Url::home($id, true);
|
||||
}
|
||||
} else {
|
||||
$link = Url::home($urlname . $url_break_char . $scode . '/' . $id, true);
|
||||
if ($sortfilename && $contentfilename) {
|
||||
$link = Url::home($sortfilename . '/' . $contentfilename, true);
|
||||
} elseif ($sortfilename) {
|
||||
$link = Url::home($sortfilename . '/' . $id, true);
|
||||
} elseif ($contentfilename) {
|
||||
$link = Url::home($urlname . $url_break_char . $scode . '/' . $contentfilename, true);
|
||||
} else {
|
||||
$link = Url::home($urlname . $url_break_char . $scode . '/' . $id, true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$link = 'javascript:;';
|
||||
|
||||
@@ -26,48 +26,28 @@ class SitemapController extends Controller
|
||||
{
|
||||
header("Content-type:text/xml;charset=utf-8");
|
||||
$str = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
|
||||
$str .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:mobile="http://www.baidu.com/schemas/sitemap-mobile/1/">' . "\n";
|
||||
$str .= $this->makeNode('', date('Y-m-d'), '1.00'); // 根目录
|
||||
|
||||
$url_break_char = $this->config('url_break_char') ?: '_';
|
||||
$str .= '<urlset>' . "\n";
|
||||
$str .= $this->makeNode('', date('Y-m-d'), '1.00', 'always'); // 根目录
|
||||
|
||||
$sorts = $this->model->getSorts();
|
||||
$Parser = new ParserController();
|
||||
foreach ($sorts as $value) {
|
||||
if ($value->outlink) {
|
||||
continue;
|
||||
} elseif ($value->type == 1) {
|
||||
$value->urlname = $value->urlname ?: 'list';
|
||||
if ($value->filename) {
|
||||
$link = Url::home($value->filename);
|
||||
} else {
|
||||
$link = Url::home($value->urlname . $url_break_char . $value->scode);
|
||||
}
|
||||
$str .= $this->makeNode($link, date('Y-m-d'), '0.80');
|
||||
$link = $Parser->parserLink(1, $value->urlname, 'about', $value->scode, $value->filename);
|
||||
$str .= $this->makeNode($link, date('Y-m-d'), '0.80', 'daily');
|
||||
} else {
|
||||
$value->urlname = $value->urlname ?: 'list';
|
||||
if ($value->filename) {
|
||||
$link = Url::home($value->filename);
|
||||
} else {
|
||||
$link = Url::home($value->urlname . $url_break_char . $value->scode);
|
||||
}
|
||||
$str .= $this->makeNode($link, date('Y-m-d'), '0.80');
|
||||
$link = $Parser->parserLink(2, $value->urlname, 'list', $value->scode, $value->filename);
|
||||
$str .= $this->makeNode($link, date('Y-m-d'), '0.80', 'daily');
|
||||
$contents = $this->model->getSortContent($value->scode);
|
||||
foreach ($contents as $value2) {
|
||||
if ($value2->outlink) { // 外链
|
||||
continue;
|
||||
} else {
|
||||
$value2->urlname = $value2->urlname ?: 'list';
|
||||
if ($value2->filename && $value2->sortfilename) {
|
||||
$link = Url::home($value2->sortfilename . '/' . $value2->filename, true);
|
||||
} elseif ($value2->sortfilename) {
|
||||
$link = Url::home($value2->sortfilename . '/' . $value2->id, true);
|
||||
} elseif ($value2->contentfilename) {
|
||||
$link = Url::home($value2->urlname . $url_break_char . $value2->scode . '/' . $value2->filename, true);
|
||||
} else {
|
||||
$link = Url::home($value2->urlname . $url_break_char . $value2->scode . '/' . $value2->id, true);
|
||||
}
|
||||
$link = $Parser->parserLink(2, $value2->urlname, 'content', $value2->scode, $value2->sortfilename, $value2->id, $value2->filename);
|
||||
}
|
||||
$str .= $this->makeNode($link, date('Y-m-d'), '0.60');
|
||||
$str .= $this->makeNode($link, date('Y-m-d', strtotime($value2->date)), '0.60', 'daily');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,16 +55,44 @@ class SitemapController extends Controller
|
||||
}
|
||||
|
||||
// 生成结点信息
|
||||
private function makeNode($link, $date, $priority = 0.60)
|
||||
private function makeNode($link, $date, $priority = 0.60, $changefreq = 'always')
|
||||
{
|
||||
$node = '
|
||||
<url>
|
||||
<mobile:mobile type="pc,mobile"/>
|
||||
<loc>' . get_http_url() . $link . '</loc>
|
||||
<priority>' . $priority . '</priority>
|
||||
<lastmod>' . $date . '</lastmod>
|
||||
<changefreq>Always</changefreq>
|
||||
<changefreq>' . $changefreq . '</changefreq>
|
||||
</url>';
|
||||
return $node;
|
||||
}
|
||||
|
||||
// 文本格式
|
||||
public function linkTxt()
|
||||
{
|
||||
header("Content-type:text/plain;charset=utf-8");
|
||||
$sorts = $this->model->getSorts();
|
||||
$Parser = new ParserController();
|
||||
$str = get_http_url() . "\n";
|
||||
foreach ($sorts as $value) {
|
||||
if ($value->outlink) {
|
||||
continue;
|
||||
} elseif ($value->type == 1) {
|
||||
$link = $Parser->parserLink(1, $value->urlname, 'about', $value->scode, $value->filename);
|
||||
} else {
|
||||
$link = $Parser->parserLink(2, $value->urlname, 'list', $value->scode, $value->filename);
|
||||
$str .= get_http_url() . $link . "\n";
|
||||
$contents = $this->model->getSortContent($value->scode);
|
||||
foreach ($contents as $value2) {
|
||||
if ($value2->outlink) { // 外链
|
||||
continue;
|
||||
} else {
|
||||
$link = $Parser->parserLink(2, $value2->urlname, 'content', $value2->scode, $value2->sortfilename, $value2->id, $value2->filename);
|
||||
}
|
||||
$str .= get_http_url() . $link . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo $str;
|
||||
}
|
||||
}
|
||||
88
apps/home/controller/SpiderController.php
Normal file
88
apps/home/controller/SpiderController.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* @copyright (C)2016-2099 Hnaoyun Inc.
|
||||
* @license This is not a freeware, use is subject to license terms
|
||||
* @author XingMeng
|
||||
* @email hnxsh@foxmail.com
|
||||
* @date 2021年10月27日
|
||||
*
|
||||
*/
|
||||
namespace app\home\controller;
|
||||
|
||||
use core\basic\Controller;
|
||||
|
||||
class SpiderController extends Controller
|
||||
{
|
||||
|
||||
private $url;
|
||||
|
||||
public function __construct($url = null)
|
||||
{
|
||||
$this->url = $url ? escape_string($url) : get('url');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$rs = $this->getSpider();
|
||||
if ($rs !== false) {
|
||||
$this->log($rs . '爬行' . $this->url);
|
||||
}
|
||||
}
|
||||
|
||||
private function getSpider()
|
||||
{
|
||||
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
|
||||
if (strpos($useragent, 'googlebot') !== false) {
|
||||
return 'Google';
|
||||
} elseif (strpos($useragent, 'baiduspider') !== false) {
|
||||
return 'Baidu';
|
||||
} elseif (strpos($useragent, 'webscan') !== false) {
|
||||
return '360WebScan';
|
||||
} elseif (strpos($useragent, '360spider') !== false) {
|
||||
return '360So';
|
||||
} elseif (strpos($useragent, 'adsbot') !== false) {
|
||||
return 'Adwords';
|
||||
} elseif (strpos($useragent, 'bingbot') !== false) {
|
||||
return 'Bing';
|
||||
} elseif (strpos($useragent, 'slurp') !== false) {
|
||||
return 'Yahoo';
|
||||
} elseif (strpos($useragent, 'sosospider') !== false) {
|
||||
return 'Soso';
|
||||
} elseif (strpos($useragent, 'sogou') !== false) {
|
||||
return 'Sogou';
|
||||
} elseif (strpos($useragent, 'yodaobot') !== false) {
|
||||
return 'Yodao';
|
||||
} elseif (strpos($useragent, 'speedy') !== false) {
|
||||
return 'Speedy';
|
||||
} elseif (strpos($useragent, 'yandexbot') !== false) {
|
||||
return 'Yandex';
|
||||
} elseif (strpos($useragent, 'easouspider') !== false) {
|
||||
return 'Easou';
|
||||
} elseif (strpos($useragent, 'symantecspider') !== false) {
|
||||
return 'Symantec';
|
||||
} elseif (strpos($useragent, 'qiniu') !== false) {
|
||||
return 'Qiniu';
|
||||
} elseif (strpos($useragent, 'jiankongbao') !== false) {
|
||||
return 'JianKongBao';
|
||||
} elseif (strpos($useragent, 'dnspod') !== false) {
|
||||
return 'DNSPod';
|
||||
} elseif (strpos($useragent, 'linkpadbot') !== false) {
|
||||
return 'Linkpad';
|
||||
} elseif (strpos($useragent, 'mj12bot') !== false) {
|
||||
return 'MJ12';
|
||||
} elseif (strpos($useragent, 'dingtalkbot') !== false) {
|
||||
return 'DingTalk';
|
||||
} elseif (strpos($useragent, 'bytespider') !== false) {
|
||||
return 'Byte';
|
||||
} elseif (strpos($useragent, 'zoominfobot') !== false) {
|
||||
return 'Zoominfo';
|
||||
} elseif (strpos($useragent, 'yisouspider') !== false) {
|
||||
return 'Yisou';
|
||||
} elseif (strpos($useragent, 'spider') !== false) {
|
||||
return 'other-spider';
|
||||
} elseif (strpos($useragent, 'bot') !== false) {
|
||||
return 'other-bot';
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -58,6 +58,7 @@ class ParserModel extends Model
|
||||
// 单个分类信息,不区分语言,兼容跨语言
|
||||
public function getSort($scode)
|
||||
{
|
||||
$scode = escape_string($scode);
|
||||
$field = array(
|
||||
'a.*',
|
||||
'c.name AS parentname',
|
||||
@@ -262,6 +263,7 @@ class ParserModel extends Model
|
||||
// 列表内容,带分页,不区分语言,兼容跨语言
|
||||
public function getLists($scode, $num, $order, $filter = array(), $tags = array(), $select = array(), $fuzzy = true, $start = 1, $lfield = null, $lg = null)
|
||||
{
|
||||
$scode = escape_string($scode);
|
||||
$ext_table = false;
|
||||
if ($lfield) {
|
||||
$lfield .= ',id,outlink,type,scode,sortfilename,filename,urlname'; // 附加必须字段
|
||||
@@ -376,6 +378,7 @@ class ParserModel extends Model
|
||||
// 列表内容,不带分页,不区分语言,兼容跨语言
|
||||
public function getList($scode, $num, $order, $filter = array(), $tags = array(), $select = array(), $fuzzy = true, $start = 1, $lfield = null, $lg = null)
|
||||
{
|
||||
$scode = escape_string($scode);
|
||||
$ext_table = false;
|
||||
if ($lfield) {
|
||||
$lfield .= ',id,outlink,type,scode,sortfilename,filename,urlname'; // 附加必须字段
|
||||
@@ -490,6 +493,7 @@ class ParserModel extends Model
|
||||
// 内容详情,不区分语言,兼容跨语言
|
||||
public function getContent($id)
|
||||
{
|
||||
$id = escape_string($id);
|
||||
$field = array(
|
||||
'a.*',
|
||||
'b.name as sortname',
|
||||
@@ -533,6 +537,7 @@ class ParserModel extends Model
|
||||
$result = parent::table('ay_content a')->field($field)
|
||||
->where("a.id='$id' OR a.filename='$id'")
|
||||
->where('a.status=1')
|
||||
->where("a.date<'" . date('Y-m-d H:i:s') . "'")
|
||||
->join($join)
|
||||
->decode()
|
||||
->find();
|
||||
@@ -542,6 +547,7 @@ class ParserModel extends Model
|
||||
// 单篇详情,不区分语言,兼容跨语言
|
||||
public function getAbout($scode)
|
||||
{
|
||||
$scode = escape_string($scode);
|
||||
$field = array(
|
||||
'a.*',
|
||||
'b.name as sortname',
|
||||
@@ -592,11 +598,18 @@ class ParserModel extends Model
|
||||
}
|
||||
|
||||
// 指定内容多图
|
||||
public function getContentPics($id)
|
||||
public function getContentPics($id, $field)
|
||||
{
|
||||
$result = parent::table('ay_content')->field("pics,picstitle")
|
||||
->where("id='$id'")
|
||||
->where('status=1')
|
||||
$join = array(
|
||||
'ay_content_ext b',
|
||||
'a.id=b.contentid',
|
||||
'LEFT'
|
||||
);
|
||||
$result = parent::table('ay_content a')->field($field . ',picstitle')
|
||||
->join($join)
|
||||
->where("a.id='$id'")
|
||||
->where('a.status=1')
|
||||
->where("a.date<'" . date('Y-m-d H:i:s') . "'")
|
||||
->find();
|
||||
return $result;
|
||||
}
|
||||
@@ -614,6 +627,7 @@ class ParserModel extends Model
|
||||
$result = parent::table('ay_content')->field('scode,tags')
|
||||
->where("id='$id'")
|
||||
->where('status=1')
|
||||
->where("date<'" . date('Y-m-d H:i:s') . "'")
|
||||
->find();
|
||||
return $result;
|
||||
}
|
||||
@@ -693,6 +707,7 @@ class ParserModel extends Model
|
||||
->in('a.scode', $scodes)
|
||||
->where("a.acode='" . get_lg() . "'")
|
||||
->where('a.status=1')
|
||||
->where("a.date<'" . date('Y-m-d H:i:s') . "'")
|
||||
->order('a.id DESC')
|
||||
->find();
|
||||
}
|
||||
@@ -736,6 +751,7 @@ class ParserModel extends Model
|
||||
->in('a.scode', $scodes)
|
||||
->where("a.acode='" . get_lg() . "'")
|
||||
->where('a.status=1')
|
||||
->where("a.date<'" . date('Y-m-d H:i:s') . "'")
|
||||
->order('a.id ASC')
|
||||
->find();
|
||||
}
|
||||
|
||||
@@ -67,7 +67,8 @@ class SitemapModel extends Model
|
||||
|
||||
$where = array(
|
||||
'a.status=1',
|
||||
'c.type=2'
|
||||
'c.type=2',
|
||||
"a.date<'" . date('Y-m-d H:i:s') . "'"
|
||||
);
|
||||
|
||||
return parent::table('ay_content a')->field($fields)
|
||||
|
||||
Reference in New Issue
Block a user