Dede栏目交叉的问题

原文地址:Dede栏目交叉的问题 作者:Captain
  最近用了交叉栏目,发现当为手动指定交叉栏目ID时用arclist标签不能调出相关文章
  最后发现是arclist标签有问题。
  要修改的地方是:
  include/taglib/arclist.lib.php
  找到如下:
  if($ctag->GetAtt('cross')=='1')
  改为
  if($ctag->GetAtt('cross')!='0')
  再找:
  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 始终为空
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值