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


最近用了交叉栏目
发现
当为手动指定交叉栏目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 始终为空


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM