婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁(yè) > 網(wǎng)站建設(shè) > 建站知識(shí) > 讓織夢(mèng)arclist支持notypeid屬性的方法

讓織夢(mèng)arclist支持notypeid屬性的方法

POST TIME:2017-11-13 00:02

織夢(mèng)默認(rèn)的arclist標(biāo)簽支持typeid的調(diào)用,也就是給文章列表指定來(lái)源欄目,有時(shí)候欄目過(guò)多,一個(gè)一個(gè)寫就很復(fù)雜,所以用排除的方法寫更方便,以此引入notypeid屬性。

主要修改文件是/include/taglib/下的arclist.lib.php文件,首先搜索:

return lib_arclistDone

在函數(shù)末尾加上:,$ctag->GetAtt('notypeid'),原來(lái)的代碼變成如下的樣子:

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')

);

然后再搜索function lib_arclistDone,同樣在這個(gè)函數(shù)的后面加上一句代碼:,$notypeid=0,修改后的函數(shù)變成下面的樣子:

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 ';,在這個(gè)代碼的前面加入如下代碼:

if(!empty($notypeid))

{

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

}

上傳覆蓋之后即可使用arclist的notypeid屬性,使用方法如下:

{dede:arclist row=6 orderby=pubdate notypeid='7,8,9'}

意思是按更新時(shí)間,調(diào)用除了欄目id是7,8,9的其余欄目中的6條數(shù)據(jù)。



收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266
主站蜘蛛池模板: 平武县| 三河市| 区。| 独山县| 台中市| 台北市| 鄄城县| 道孚县| 剑河县| 中方县| 佛坪县| 中山市| 娱乐| 雅安市| 海伦市| 个旧市| 孟州市| 资阳市| 龙江县| 稷山县| 财经| 江山市| 龙州县| 清水县| 扶余县| 宁陵县| 四川省| 彰化县| 汉源县| 清水县| 茌平县| 浦北县| 新乐市| 周至县| 郧西县| 青神县| 昭通市| 塘沽区| 郧西县| 张家口市| 石泉县|