- 增加自定义函数:
function dp_GetKeyboard($num = 100) { global $empire, $public_r, $class_r, $fun_r, $dbtbpre, $class_r, $navinfor; $keyid = $navinfor['keyid']; $classid = $navinfor['classid']; $id = $navinfor['id']; $link_num = $class_r[$classid]['link_num']; if (!$link_num) { return $fun_r['NotLinkNews']; } $tr = $empire->fetch1("select otherlinktemp, otherlinktempsub, otherlinktempdate from " . GetTemptb("enewspubtemp") . " limit 1"); $temp_r = explode("[!--empirenews.listtemp--]", $tr['otherlinktemp']); if ($keyid) { $add = "id in(" . $keyid . ")"; } else { $e = $id + $num; $s = $id - $num; $add = "classid=" . $classid . " and id>" . $s . " and id<" . $e; } $key_sql = $empire->query("select id, newstime, title, isurl, titleurl, classid, titlepic from {$dbtbpre}ecms_" . $class_r[$classid]['tbname'] . " where " . $add . " order by newstime desc limit $link_num"); while ($link_r = $empire->fetch($key_sql)) { if ($link_r['id'] == $id) { continue; } $keyboardtext .= RepOtherTemp($temp_r[1], $link_r, $tr); } if (empty($keyboardtext)) { return $fun_r['NotLinkNews']; } $keyboardtext = $temp_r[0] . $keyboardtext . $temp_r[2]; return $keyboardtext; }

OLDER ARTICLES
- 新建
show.php
文件,放到e
目录里。 show.php
内容如下:
<?php
require("class/connect.php");
include("class/db_sql.php");
include("class/config.php");
include("data/dbcache/class.php");
$link=db_connect();
$empire=new mysqlquery();
$classid=intval($_GET['classid']);
$id=intval($_GET['id']);
$muserid=(int)getcvar('mluserid'); // 用户ID
$musername=RepPostVar(getcvar('mlusername')); // 用户名
$mgroupid=(int)getcvar('mlgroupid'); // 会员组ID
if($classid && $id && $class_r[$classid][tbname] && $muserid){
$r=$empire->fetch1("select id,phone from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where id='$id' and classid='$classid' limit 1");
if($r[id]){
?>
document.write('<li style="margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; font-size: 12px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden;">'.$r[phone].'</li>');
<?php
}
}
?>
- 在需要显示内容的地方使用以下代码:
<script src="[!--news.url--]e/show.php?classid=[!--classid--]&id=[!--id--]"></script>
- 后台设置:
- 添加
parameter
字段,选择字符型0-255字节(VARCHAR),设置列数2,行数3。
- 添加
- PHP调用方案:
<?php $phome = explode('||||||', $navinfor['parameter']); foreach ($phome as $k => $v) { $phome2 = explode('::::::', $v); $phomeauto .= "<span>" . $phome2[0] . "</span>"; $phomehoto .= "<span>" . $phome2[1] . "</span>"; } ?>
- 页面调用示例:
<?=$phomeauto?> <?=$phomehoto?>
- 原因:官方程序早期版本中的 Bug。
- 解决方法:
- 打开
/include/customfields.func.php
文件。 - 将
(大概在539行)$innerTmp = ($arcTag=="") ? trim($arcTag) : trim($arcTag->GetInnerText());
改为$fvalue = ($ntag=="") ? trim($ntag) : trim($ntag->GetInnerText());
。
- 打开
- 问题:没有子栏目时重复显示同级栏目。
- 解决办法:
- 打开
/include/taglib/channel.lib.php
文件,找到:$type=='son' && $reid!=0 && $totalRow==0
修改为:
$type=='son' && $reid!=0 && $totalRow==0 && $noself==''
- 在
dede:channel
标签中加入noself=yes
。
- 打开
- 问题描述:使用织梦后台发布文章时,如果给文章添加了跳转属性,有时候会出现跳转页面什么都不显示,在后台编辑时,也全是空白页。
- 解决方法:
- 打开
include/arc.archives.class.php
文件,找到header("location:{$this->Fields['redirecturl']}");
,改为echo '<META HTTP-EQUIV="REFRESH" CONTENT="0; URL='.$this->Fields['redirecturl'].'">';
- 打开
dede/archives_do.php
文件,找到header("location:{$gurl}?aid=$aid");
,改为echo '<META HTTP-EQUIV="REFRESH" CONTENT="0; URL='.$gurl.'?aid='.$aid.'">';
- 打开
#### 首页高亮代码
```html
<li {pboot:if(0=='{sort:scode}')}class="on"{/pboot:if}>
<a href="{pboot:sitepath}/" title="">网站首页</a>
</li>
- 解决方法:
- 打开
include/dedetag.class.php
文件,找到以下代码:if (strpos($path, $this->clean(DEDEROOT)) !== 0) { die('Error:check Snooping out of bounds @ ' . $path); }
- 修改为:
if (stripos($path, $this->clean(DEDEROOT)) !== 0) { die('Error:check Snooping out of bounds @ ' . $path); }
- 打开
- 解决方法:
- 修改文件夹/文件的权限为777,确保有写入权限:
- 根目录
index.html
改成777,能够读写。 - 其他栏目的文件夹无法生成的,也改成777,可以读写。
- 根目录
- 修改文件夹/文件的权限为777,确保有写入权限:
- 问题:如何在帝国CMS7.5中跳过或取消选择注册会员类型?
- 答案:修改
e/config/config.php
文件。// 修改 e/config/config.php 文件 $ecms_config['member']['changeregisterurl']=""; // 删除 ChangeRegister.php
