织梦园模板网提供云优cms模板,pbootcms模板,Wordpress主题模板等各类企业新闻资讯网站模板下载服务。织梦园网站模板交流群
用户名:
密码:
注册
注册后享受折扣价

让dede织梦支持notypeid的属性

织梦园模板 / 2018-05-21 / 收藏

  打开/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'}

相关织梦技巧

收缩