<?php
/**
* @copyright (C)2016-2099 Hnaoyun Inc.
* @author XingMeng
* @email hnxsh@foxmail.com
* @date 2018年2月14日
* 标签解析引擎控制器
*/
namespace app\home\controller;
use core\basic\Controller;
use app\home\model\ParserModel;
use core\basic\Url;
use app\home\model\DoModel;
use app\home\model\MemberModel;
class ParserController extends Controller
{
protected $model;
protected $pre = array();
protected $var = array();
public function __construct()
{
$this->model = new ParserModel();
}
public function _empty()
{
_404('您访问的地址有误,请核对后重试!');
}
// 解析全局前置公共标签
public function parserBefore($content)
{
// 处理模板中不需要解析的标签
$content = $this->savePreLabel($content);
$content = $this->parserSingleLabel($content); // 单标签解析
$content = $this->parserUserLabel($content); // 自定义标签
return $content;
}
// 解析全局后置公共标签
public function parserAfter($content,$city= null,$ishome=0)
{
// 默认页面信息替换
$content = str_replace('{pboot:pagetitle}', $this->config('other_title') ?: '{pboot:sitetitle}-{pboot:sitesubtitle}', $content);
$content = str_replace('{pboot:pagekeywords}', '{pboot:sitekeywords}', $content);
$content = str_replace('{pboot:pagedescription}', '{pboot:sitedescription}', $content);
$content = str_replace('{pboot:keyword}', get('keyword', 'vars'), $content); // 当前搜索的关键字
// 解析个人扩展标签,升级不覆盖
if (file_exists(APP_PATH . '/home/controller/ExtLabelController.php')) {
if (class_exists('app\home\controller\ExtLabelController')) {
$extlabel = new ExtLabelController();
$content = $extlabel->run($content);
}
}
$content = $this->parserSiteLabel($content,$city); // 站点标签
$content = $this->parserCompanyLabel($content); // 公司标签
$content = $this->parserMemberLabel($content); // 会员标签
$content = $this->parserNavLabel($content,$city); // 分类列表
$content = $this->parserCityLabel($content);
$content = $this->parserSelectAllLabel($content); // CMS筛选全部标签解析
$content = $this->parserSelectLabel($content); // CMS筛选标签解析
$content = $this->parserSpecifySortLabel($content,$city); // 指定分类
$content = $this->parserListLabel($content,'',$city);// 指定列表
$content = $this->parserSpecifyContentLabel($content); // 指定内容
$content = $this->parserContentPicsLabel($content); // 内容多图
$content = $this->parserContentCheckboxLabel($content); // 内容多选调取
$content = $this->parserContentTagsLabel($content); // 内容tags调取
$content = $this->parserSlideLabel($content); // 幻灯片
$content = $this->parserLinkLabel($content); // 友情链接
$content = $this->parserMessageLabel($content); // 留言板
$content = $this->parserFormLabel($content); // 自定义表单
$content = $this->parserSubmitFormLabel($content); // 自定义表单提交
$content = $this->parserSqlListLabel($content); // 自定义SQL输出
$content = $this->parserQrcodeLabel($content); // 二维码生成
$content = $this->parserPageLabel($content); // CMS分页标签解析(需置后)
$content = $this->parserIfLabel($content); // IF语句(需置最后)
$content = $this->parserLoopLabel($content); // LOOP语句(需置后,不可放到if前面,否则有安全风险)
$content = $this->restorePreLabel($content); // 还原不需要解析的内容
$content = $this->parserReplaceKeyword($content); // 页面关键词替换
$content = $this->parserCity($content,$city,$ishome);
return $content;
}
// 保存保留内容
public function savePreLabel($content)
{
$pattern = '/\{pboot:pre}([\s\S]*?)\{\/pboot:pre\}/';
if (preg_match_all($pattern, $content, $matches)) {
$count = count($matches[0]);
for ($i = 0; $i < $count; $i ++) {
$this->pre[] = $matches[1][$i];
end($this->pre);
$content = str_replace($matches[0][$i], '#pre:' . key($this->pre) . '#', $content);
}
}
return $content;
}
// 还原保留内容
public function restorePreLabel($content)
{
$pattern = '/\#pre:([0-9]+)\#/';
if (preg_match_all($pattern, $content, $matches)) {
$count = count($matches[0]);
for ($i = 0; $i < $count; $i ++) {
$content = str_replace($matches[0][$i], $this->pre[$matches[1][$i]], $content);
}
}
$content = str_replace('pboot@if', 'pboot:if', $content); // 还原系统解析if标签
return $content;
}
// 解析单标签
public function parserSingleLabel($content)
{
$content = str_replace('{pboot:ucenter}', Url::home('member/ucenter'), $content); // 用户中心
if (! ! $url = get("backurl")) { // 获取会跳地址
$content = str_replace('{pboot:login}', Url::home('member/login', null, "backurl=" . urlencode($url)), $content); // 登录地址
} else {
$content = str_replace('{pboot:login}', Url::home('member/login'), $content); // 登录地址
}
$content = str_replace('{pboot:register}', Url::home('member/register'), $content); // 注册地址
$content = str_replace('{pboot:retrieve}', Url::home('member/retrieve'), $content); //找回密码
$content = str_replace('{pboot:isregister}', Url::home('member/isRegister'), $content); // 检查是否注册地址
$content = str_replace('{pboot:umodify}', Url::home('member/umodify'), $content); // 修改资料地址
$content = str_replace('{pboot:logout}', Url::home('member/logout'), $content); // 推出登录
$content = str_replace('{pboot:upload}', Url::home('member/upload'), $content); // 上传资料
if (strpos($content, '{pboot:sendemail}')) {
session('sendemail', true); // 避免非法外部提交
$content = str_replace('{pboot:sendemail}', Url::home('member/sendEmail'), $content); // 上传资料
} else {
session('sendemail', false);
}
$content = str_replace('{pboot:islogin}', session('pboot_uid') ? 1 : 0, $content); // 是否登录
if (strpos($content, '{pboot:mustlogin}') !== false) {
$content = str_replace('{pboot:mustlogin}', '', $content);
if (! session('pboot_uid')) { // 没有经登录
if ($this->config('login_no_wait')) {
location(Url::home('member/login', null, "backurl=" . urlencode(get_current_url())));
} else {
error('您的权限不足,无法浏览本页面!', Url::home('member/login', null, "backurl=" . urlencode(get_current_url())));
}
}
}
$content = str_replace('{pboot:msgaction}', Url::home('message'), $content); // 留言提交路径
$content = str_replace('{pboot:scaction}', Url::home('search'), $content); // 搜索提交路径
$content = str_replace('{pboot:msgcodestatus}', $this->config('message_check_code') === '0' ? 0 : 1, $content); // 是否开留言启验证码
$content = str_replace('{pboot:formcodestatus}', $this->config('form_check_code') === '0' ? 0 : 1, $content); // 是否开启表单验证码
$content = str_replace('{pboot:checkcode}', CORE_DIR . '/code.php', $content); // 验证码路径
$content = str_replace('{p
没有合适的资源?快使用搜索试试~ 我知道了~
pbootcms城市分站插件及操作指南
共566个文件
php:135个
gif:120个
png:87个
3 下载量 170 浏览量
2024-03-09
15:52:58
上传
评论
收藏 46.34MB RAR 举报
温馨提示
1、备份网站所有文件 2、替换apps、config、core三个文件夹 3、navicat premium15破解版下载(数据库编辑软件) 4、导入ay_content_city.sql 5、修改ay_content_sort数据表,增加 def1 def2 def3字段 6、修改ay_content数据表,增加picstitle字段 至此数据库修改完成,上传替换数据库 7、进入后台重新修改下,全局配置 配置参数 系统授权码 8、后台增加城市管理菜单 浏览器中输入 网址/admin.php?p=menu /admin/ContentCity/index 9、修改模板,需要显示城市的地方加入{city}标签 <a href="/city.html" title="城市分站">城市分站</a> <p>城市分站: {pboot:city} <a href= "[city:link]">[city:name]</a> {/pboot:city} <a href= "{pboot:sitedomain}/city.html">更多城市</a></p> 10、后台增加
资源推荐
资源详情
资源评论
收起资源包目录
pbootcms城市分站插件及操作指南 (566个子文件)
layui.css 73KB
ueditor.css 44KB
font-awesome.css 37KB
font-awesome.min.css 30KB
video.css 15KB
layer.css 14KB
attachment.css 14KB
image.css 14KB
layui.mobile.css 10KB
laydate.css 7KB
shCoreDefault.css 7KB
comm.css 4KB
scrawl.css 4KB
codemirror.css 3KB
background.css 2KB
emotion.css 2KB
dialogbase.css 2KB
login.css 2KB
edittable.css 1KB
code.css 1KB
template.css 1KB
iframe.css 832B
jquery.treetable.css 652B
webuploader.css 515B
help.css 389B
fontawesome-webfont.eot 162KB
iconfont.eot 46KB
wface.gif 49KB
jxface2.gif 40KB
yface.gif 28KB
bface.gif 27KB
icons.gif 20KB
file-icons.gif 20KB
file-icons.gif 20KB
tface.gif 19KB
fface.gif 18KB
59.gif 10KB
22.gif 10KB
cface.gif 8KB
24.gif 8KB
13.gif 7KB
16.gif 7KB
39.gif 6KB
64.gif 6KB
63.gif 6KB
50.gif 6KB
loading-0.gif 6KB
4.gif 6KB
1.gif 5KB
42.gif 5KB
71.gif 5KB
21.gif 5KB
20.gif 5KB
29.gif 5KB
70.gif 4KB
5.gif 4KB
17.gif 4KB
27.gif 4KB
9.gif 4KB
44.gif 4KB
11.gif 4KB
8.gif 4KB
3.gif 4KB
23.gif 4KB
icons-all.gif 4KB
34.gif 4KB
41.gif 4KB
38.gif 4KB
65.gif 3KB
32.gif 3KB
45.gif 3KB
7.gif 3KB
12.gif 3KB
26.gif 3KB
60.gif 3KB
2.gif 3KB
40.gif 3KB
25.gif 3KB
19.gif 3KB
66.gif 3KB
18.gif 3KB
46.gif 3KB
10.gif 3KB
28.gif 3KB
51.gif 3KB
57.gif 3KB
67.gif 3KB
0.gif 3KB
48.gif 3KB
43.gif 3KB
30.gif 2KB
61.gif 2KB
33.gif 2KB
69.gif 2KB
14.gif 2KB
47.gif 2KB
36.gif 2KB
49.gif 2KB
58.gif 2KB
6.gif 2KB
共 566 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
lanxinga
- 粉丝: 11
- 资源: 28
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- RB305A-SOT-23封装 单节锂电池保护IC 深圳市可芯电子有限公司.pdf
- javaweb 期末复习
- unity简单数字拼图小游戏(源码)
- 危包证办理培训教材(出境危险货物运输包装使用鉴定结果单)
- Vissim9 用户手册(英文版)
- 基于Selenium的Java爬虫实战(内含谷歌浏览器Chrom和Chromedriver版本124.0.6350.0)
- ThinkPHP微信独立互换红包系统开源版.zip
- ChromeDriver-87.0.4280.88.zip 下载
- RB306A-SOT23-5封装 单节锂电池保护IC 深圳市可芯电子有限公司.pdf
- IMG_20240615_134614.jpg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功