top-image

OLDER ARTICLES

  • 打开 /core/function/helper.php 文件
  • 找到第 162 行左右的代码:
    echo '<script type="text/javascript">alert("' . clear_html_blank($info) . '");location.href="' . $url . '";</script>';
  • 修改为:
    echo '<script type="text/javascript">alert("' . clear_html_blank($info) . '");location.href="目标网址";</script>';
  • 将 http://www.91084.com 替换为你需要跳转的地址。
  • 进入后台右上角清理缓存。
  1. 修改 catalog_edit.php 文件

    • 打开 /dede/catalog_edit.php 文件。
    • 找到大约第 68 行的 ShowMsg("保存当前栏目更改时失败,请检查你的输入资料是否存在问题!", "-1");
    • 在其上方加入以下代码:
      php
       
      echo $upquery;
      die;
    • 保存文件。
  2. 测试并获取错误信息

    • 编辑某个栏目,查看页面输出的 SQL 语句。
    • 将输出的 SQL 语句复制到后台-系统-SQL命令行工具中执行,查看错误提示。
  3. 修复数据表字段

    • 根据错误提示,执行以下 SQL 语句:
      sql
       
      ALTER TABLE `dede_arctype` ADD `字段名称` CHAR(255) NOT NULL DEFAULT '';
    • 如果缺少多个字段,执行多条上述 SQL 语句。
  4. 删除调试代码

    • 删除 /dede/catalog_edit.php 文件中加入的 echo $upquery; die; 代码。
    • 保存文件,再次编辑栏目,确认不再出现报错。
  • 问题1:更新网站时错误问题:Call to a member function GetInnerText() on a non-object

    • 解决方法
      1. 打开 \include\taglib\channel\img.lib.php 文件,找到 $innerTmp = $arcTag->GetInnerText();
      2. 修改为 $innerTmp = ($arcTag=="") ? trim($arcTag) : trim($arcTag->GetInnerText());
  • 问题2:网页中图片不显示问题:图片 src 地址显示不对。

    • 解决方法
      1. 打开 \include\extend.func.php 文件,在最后添加以下代码:
        function GetOneImgUrl($img, $ftype=1) {
          if($img <> '') {
            $dtp = new DedeTagParse();
            $dtp->LoadSource($img);
            if(is_array($dtp->CTags)) {
              foreach($dtp->CTags as $ctag) {
                if($ctag->GetName()=='img') {
                  $width = $ctag->GetAtt('width');
                  $height = $ctag->GetAtt('height');
                  $imgurl = trim($ctag->GetInnerText());
                  $img = '';
                  if($imgurl != '') {
                    if($ftype==1) {
                      $img .= $imgurl;
                    } else {
                      $img .= '<img src="'.$imgurl.'" width="'.$width.'" height="'.$height.'" />';
                    }
                  }
                }
              }
            }
            $dtp->Clear();
            return $img;
          }
        }
      2. 调用该图片的代码:
        • 列表页和首页调用方法:
          [field:bigpic function='GetOneImgUrl(@me,0)'/] // 调用图片的信息,自动调用宽度和高度(已包含Html代码的<img />)
          [field:bigpic function='GetOneImgUrl(@me,1)'/] // 只调用图片地址,一般可用于背景图
        • 内容页调用方法:
          {dede:field name='bigpic' function='GetOneImgUrl(@me,1)'/}
  • 问题3:增加用户时,提示用户名已存在。

    • 解决方法
      1. 删除添加的用户后,同时也要删除会员中心的注册会员列表里的该会员。

PbootCMS dedecms程序出现request_order解决方法
解决方法:
如果使用 PHP5.3,将 request_order 配置选项更改为 CGP。
建议使用 PHP5.6 版本。

代码如下:
{pboot:list istop=1}
[list:title]
{/pboot:list}

代码详解:
- 只显示置顶:`istop=1`
- 只显示推荐:`isrecommend=1`
- 只显示头条:`isheadline=1`
- 只显示带图:`isico=1`
- 只显示无图:`isico=0`
- 只显示有多图的:`ispics=1`

 

  1. 数字型变量

     
     
    $page = (int)$_GET['page'];
    $page = intval($_GET['page']);
  2. 带小数点的数字型变量

     
     
    $money = (float)$money;
    $money = floatval($money);
  3. 字符型处理

    • 不带空格或其他特殊符号:
       
       
      $var = RepPostVar($_POST['var']);
    • 带空格或其他特殊符号:
       
       
      $var = RepPostVar2($_POST['var']);
    • 写入数据库时:
       
       
      $var = RepPostStr($_POST['var']);
  1. 调用图片广告

    • 示例代码:
      [e:loop={"select * from xxx_enewsad where classid=3 and t=0 order by adid desc limit 3",0,24}]
      <a href="<?= $bqr['url'] ?>" target="_blank" title="<?= $bqr['title'] ?>">
          <img src="<?= $bqr['picurl'] ?>">
      </a><br>
      [/e:loop]
  2. 调用文字广告

    • 示例代码:
      [e:loop={"select * from xxx_enewsad where classid=3 and t=1 order by adid desc limit 3",0,24}]
      <a href="<?= $bqr['url'] ?>" target="_blank" title="<?= $bqr['title'] ?>">
          <?= $bqr['title'] ?>
      </a><br>
      [/e:loop]

       

  • 修改 e/class/user.php 文件。
  • 在 islogin 函数中找到 OutTimeZGroup 并添加清零积分的 SQL 语句:
$empire->query("update " . $user_tablename . " set " . $user_userfen . "=0 where " . $user_userid . "='" . $cr[$user_userid] . "'");

 

  • 判断内容页正文是否包含图片,若无图片则显示广告:
    <?php
    $string = $navinfor['newstext']; // 内容字段
    $some = "<img ";
    $num = explode($some, $string);
    if(count($num) > 1) { // 判断内容中是否有图片
    ?>
        [!--newstext--]
    <?php
    } else {
    ?>
        <div id="ad">这里放你的广告代码</div>
        [!--newstext--]
    <?php
    }
    ?>
  • 默认将广告放在内容前,可根据需要调整位置。
  • <?php
    if ($class_r[$GLOBALS['navclassid']]['bclassid'] == 0) {
        $classid = $GLOBALS['navclassid'];
        $classname = $class_r[$classid]['classname'];
    } else {
        $classid = $class_r[$GLOBALS['navclassid']]['bclassid'];
        $classname = $class_r[$classid]['classname'];
    }
    ?>
  • 说明: 在模板中插入以上代码,如果当前栏目的父栏目id为0,就直接获取当前栏目id。
Page 521 of 1049:« First« 518 519 520 521 522 523 524 »Last »
bottom-img