织梦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 始终为空

转载于:https://www.cnblogs.com/dream-w/p/4825550.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值