织梦dedecms 用交叉栏目时arclist标签调用不出内容文章的问题(纯转载)

本文转自:http://www.cnblogs.com/cnteam/articles/4056702.html

最近用了交叉栏目
发现
当为手动指定交叉栏目ID时用arclist标签不能调出相关文章
最后发现是
arclist标签有问题
要修改的地方是:
include/taglib/arclist.lib.php
第167行

if($ctag->GetAtt('cross')=='1')

改为

if($ctag->GetAtt('cross')!='0')

再修改第184行

if($arr['crossid']!='') $selquery = "Select id,topid From `#@__arctype` where id in('{$arr['crossid']}') And id<>'{$typeid}' And topid<>'{$typeid}'  ";

改为:

if($arr['crossid']!='') $selquery = "Select id,topid From `#@__arctype` where id in({$arr['crossid']}) And id<>'{$typeid}' And topid<>'{$typeid}'  ";

(这一行只去了一对单引号,应该是程序员手误多出来了)
就可以了

分析:
从数据库可以看出
当栏目为不交叉时cross的值为0
当栏目为自动获取同名栏目时cross的值为1
当栏目为手动指定ID时cross的值为2
显然

if($ctag->GetAtt('cross')=='1')

是错的,在手动指定ID时$CrossID 始终为空

上一篇:织梦dedecms后台发布文章不自动更新首页与栏目列表页


下一篇:织梦dedecms后台发布文章提示“标题不能为空”