让dedecms支持notypeid的属性


文章介绍

 打开/include/taglib/arclist.lib.php文件,找这段代码(大概在130行):

  return lib_arclistDone

  (

  $refObj, $ctag, $typeid, $ctag->GetAtt(‘row’), $ctag->GetAtt(‘col’), $titlelen, $infolen,

  $ctag->GetAtt(‘imgwidth’), $ctag->GetAtt(‘imgheight’), $listtype, $orderby,

  $ctag->GetAtt(‘keyword’), $innertext, $envs[‘aid’], $ctag->GetAtt(‘idlist’), $channelid,

  $ctag->GetAtt(‘limit’), $flag,$ctag->GetAtt(‘orderway’), $ctag->GetAtt(‘subday’), $ctag->GetAtt(‘noflag’),

  $tagid,$pagesize,$isweight

  );

  在最后括号最后加上(注意前面的逗号):

  ,$ctag->GetAtt(‘notypeid’)

  然后再找到这一段代码(大概在168行):

  function lib_arclistDone(&$refObj, &$ctag, $typeid=0, $row=10, $col=1, $titlelen=30, $infolen=160,

  $imgwidth=120, $imgheight=90, $listtype=’all’, $orderby=’default’, $keyword=”,

  $innertext=”, $arcid=0, $idlist=”, $channelid=0, $limit=”, $att=”, $order=’desc’, $subday=0, $noflag=”,$tagid=”, $pagesize=0, $isweight=’N’)

  在括号的最后加上(注意前面的逗号):

  ,$notypeid=0

  最后再找到这一句:

  $orwheres[] = ‘ arc.arcrank > -1 ‘;

  在其前面增加以下代码:

  if(!empty($notypeid))

  {

  $orwheres[] = ” and arc.typeid NOT IN (“.GetSonIds($notypeid).”)”;

  }

  这样,代码就修改完毕了。保存之后就在arclist标签里试试看notypeid属性吧。对于网站栏目多,内容显示时又错综复杂的情况,这样的属性还是蛮实用的。

  使用方法:

  {dede:arclist row=6 orderby=pubdate type=’image.’ imgwidth=’108′ imgheight=’150′ channelid=’1′ notypeid=’1′}