top-image

OLDER ARTICLES

  • 解决办法
    • 对必备写入权限的文件夹添加 755 或者 777 权限,根目录下有:
      • config 目录(存放授权码与数据库配置文件)
      • data 目录(存放 SQLite 数据库文件)
      • runtime 目录(存放日志文件)
    • 注意:为了更好的安全考虑,可自行调整权限,推荐 755 权限设置。

PbootCMS附件上传失败报错UNKNOW: Code: 8192; Desc: stripos()

  • 解决办法
    • 打开/core/function/file.php,搜索以下代码:
      php
       
      if (stripos($types, $ext) !== false)
    • 替换成:
      php
       
      if (stripos($types, chr($ext)) !== false)
  • PbootCMS V3.0.4 build 2021-02-14版本新增了{pboot:sql sql=”语句”}[sql:字段]{/pboot:sql}万能循环标签。实测支持多表联合查询,速度OK。
  • 示例代码:
    {pboot:sql sql="select pb_content.*, pb_content_sort.name from pb_content_sort,pb_content"}
    <a href="[sql:id]">[sql:title] [sql:name]</a>
    {/pboot:sql}
    
    {pboot:sql sql="select ay_content.*, ay_content_sort.<?php echo 'mcode';?> from ay_content_sort,ay_content"}
    <a href="[sql:id]">[sql:title] [sql:<?php echo 'mcode';>]</a>
    {/pboot:sql}

     

{pboot:nav num=10 parent={sort:tcode}}
{pboot:if('[nav:scode]'=='{sort:scode}')}
<li><a class="biglink left_active" href="[nav:link]">[nav:name]</a></li>
{else}
<li><a class="biglink" href="[nav:link]">[nav:name]</a></li>
{/pboot:if}
{/pboot:nav}

 

  1. 打开文件 config/config.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'
    ),
  2. 调整 max_width 和 max_height 的数值,例如:
    'ico' => array(
        'max_width' => '1920',
        'max_height' => '1080'
    ),

     

  • 实现方法
    1. 打开文件 \APPs\home\model\ParserModel.php,找到 getSortTags($scode) 方法。
    2. 修改查询语句,增加文章状态判断:
      $result = parent::table('ay_contenta')
          ->where('a.status=1')
          ->where("c.type=2 AND a.tags<>'")
          ->where($scode_arr, 'OR')
          ->join($join)
          ->order('a.visits DESC')
          ->column('a.tags');
      return $result;

       

  • 列表页调用

    html
     
    {pboot:tagsid=[list:id]}[tags:text]{/pboot:tags}
    • 注意:嵌套在 {pboot:list} 标签中。
  • 内容页调用

    html
     
    {pboot:tagsid={content:id}}[tags:text]{/pboot:tags}
  • 标签{pboot:link num=3 gid=1}<a href="[link:link]" target="_blank">[link:name]</a>|{/pboot:link}
  • 控制参数
    • gid=*:分组,必填,用于控制需要输出的友情链接分组
    • num=*:数量,非必填,用于控制需要输出的数量,默认为10个
  • 可使用的列表标签
    • [link:n]:序号从0开始
    • [link:i]:序号从1开始
    • [link:id]:编号
    • [link:name]:链接名称
    • [link:link]:链接地址
    • [link:logo]:链接Logo图
  • 操作步骤:
    1. 打开 /config/config.php 文件。
    2. 找到 //缩略图配置 部分。
    3. 修改 max_width 和 max_height 的值,使其更大。
  • 解决方法:
    1. 切换 PHP 版本到7.0或7.3。
    2. 如果使用宝塔面板,在宝塔上安装 PHP7.0或7.3,然后在站点中选择对应的 PHP 版本。
Page 591 of 1049:« First« 588 589 590 591 592 593 594 »Last »
bottom-img