top-image

OLDER ARTICLES

PbootCMS上传图片会被压缩像素,只需要打开根目录config文件夹下的config.php和core文件夹下的convention.php

上传配置

'upload' => array(
   'format' => 'jpg,jpeg,png,gif,xls,xlsx,doc,docx,ppt,pptx,rar,zip,pdf,txt,mp4,avi,flv,rmvb,mp3,otf,ttf',
   'max\_width' => '1920',
    'max\_height' => ''
  ),

缩略图配置

 'ico' => array(
 'max_width' => '1000', 
 'max_height' => '1000' 
), 

代码中的’max_width跟max_height参数调大即可,建议10000即可。 这样就解决了上传图片被压缩的问题。

 

由于pbootcms3.2版本不支持php7以下,所以打不开

解决方法

把站点环境切换至 php7.3就可以打开了,如果还是不行的话切换到7.0试试

网站提示:”会话目录写入权限不足“
对必备写入权限的文件夹添加755或者777权限,根目录下有:config目录(存放授权码与数据库配置文件)、data目录(存放sqlite数据库文件)、runtime目录(存放日志文件),注意的是为了更好的安全考虑,可自行调整权限,推荐755权限设置。

后台图片上传提示:”上传失败:存储目录创建失败!“
给静态资源目录(根目录下的static文件夹)增加权限,一般755或者777权限,推荐755权限设置。

网站打开提示:”未检测到您服务器环境的sqlite3数据库扩展…“
按照提示信息操作,检查php.ini中是否已经开启sqlite3扩展。

网站打开提示:”No input file specifed.“
检查根目录是不是含有.user.ini文件,有的话删除掉,一般就可以了。如果还不行或者是在本地尝试重启Apache或者Nginx服务。

  1. PC和移动站共用一套数据库,两套CMS系统,操作方法:

首先默认安装PC端CMS系统到服务器,然后再复制PC端完整CMS到移动端网站目录

  1. 选择PC或者M端进入后台,创建如下全局变量:

  1. static.example.com目录下按照之前章节的介绍创建对应的目录
  2. 在服务器nginx上配置好访问规则:
#  禁止使用常规URL访问附件
 location ^~ /uploads/img {

    return 404;

  }

  location ^~ /uploads/thumb {
   
   return 404;

 }
  1. 同时创建一个附件主机
server {
  listen 443 ssl http2;
  server_name uploads.example.com;
  access_log off;
  index index.html index.htm index.php;
  # 这里是实际的附件物理路径
  root /alidata1/web/www.example.com/uploads;
  ...
  }
  1. 创建前台前端资源主机
  # 前端CSS
  server {
  listen 443 ssl http2;
  server_name css.example.com;
  access_log off;
  index index.html index.htm index.php;
  root /alidata1/web/static.example.com/css;
  ...
  }
  # 前端JS
  server {
  listen 443 ssl http2;
  server_name js.example.com;
  access_log off;
  index index.html index.htm index.php;
  root /alidata1/web/static.example.com/js;
  ...
  }
  # 前端图片
  server {
  listen 443 ssl http2;
  server_name img.example.com;
  access_log off;
  index index.html index.htm index.php;
  root /alidata1/web/static.example.com/img;
  ...
  }
  
防止外链脚本未申明正确编码导致乱码的问题,脚本中如用到中文,必须转为unicode码

/* 不推荐 */
document.write("关于腾讯游戏")
/* 推荐 */
document.write("\u5173\u4e8e\u817e\u8baf\u6e38\u620f")
对“<”“>”之类的符号进行实体转义

<!--不推荐-->
<a href="/wiki/">more>></a>
<!--推荐-->
<a href="/wiki/">more&gt;&gt;</a>

 

lang 语言包变量标签

【基础用法】
名称:lang
功能:获取语言包变量的数据。
语法:
{eyou:lang name='这里填写变量名' /}
参数:
name=” 指定语言包变量名(来自网站后台 – 多语言功能 – 模板语言变量 / 官方语言包变量)
底层字段:
请查阅易优Cms官方提供的数据字典,找到表名 ey_language_pack

【更多示例】
——————————-示例1——————————–
描述:把模板里的中文“网站首页”替换成支持多语言调法
{eyou:lang name='sys9' /}

language 多语言列表标签

【基础用法】
名称:language
功能:获取多语言列表内容。
语法:

{eyou:language type='default'}
<a href="{$field.url}"><img src="{$field.logo}" alt="{$field.title}">{$field.title}</a>
{/eyou:language}
参数:
type='default' 默认格式,不包括当前语言
type='list' 列表格式,包括当前语言
limit='起始ID,记录数' (起始ID从0开始)表示限定的记录范围(如:limit='1,2' 表示从ID为1的记录开始,取2条记录)
titlelen='30' 标题长度
empty='' 没有数据时显示的文案
mod='' 每隔N行输出的内容
id='' 可以任意指定循环里的变量名替代field,假设id='field1',模板调用如:{$field.title} 变成 {$field1.title}
底层字段:
请查阅易优Cms官方提供的数据字典,找到表名 ey_language

【更多示例】
-------------------------------示例1--------------------------------
描述:罗列所有语言列表

{eyou:language type='default'}
<a href="{$field.url}"><img src="{$field.logo}" alt="{$field.title}">{$field.title}</a>
{/eyou:language}

 

Page 942 of 1049:« First« 939 940 941 942 943 944 945 »Last »
bottom-img