dede如何控制隱藏欄目的顯示與調(diào)用
許多時(shí)候有些欄目想在某些頁(yè)面隱藏,在另外一些頁(yè)面顯示,怎么辦?
貌似,織夢(mèng)的channel標(biāo)簽不能獲取隱藏的欄目,于是我自己動(dòng)手修改channel標(biāo)簽
首先找到include/taglib/channel.lib.php
1.
$attlist = "typeid|0,reid|0,row|100,col|1,type|son,currentstyle|,cacheid|";
修改為:
$attlist = "typeid|0,reid|0,row|100,col|1,type|son,currentstyle|,cacheid|,showhide|no";
2.
在這兩句下
$innertext = $ctag->GetInnerText();
$line = empty($row) ? 100 : $row;
增加:
$showhideArr = array( 'yes' => 0, 'no' => 1, 'both'=> -1, ); $hideflag = $showhideArr[$showhide]; |
3.
if($type=='top') { $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath From `dede_arctype` WHERE reid=0 And ishidden<>1 order by sortrank asc limit 0, $line "; } else if($type=='son') { if($typeid==0) return ''; $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath From `dede_arctype` WHERE reid='$typeid' And ishidden<>1 order by sortrank asc limit 0, $line "; } else if($type=='self') { if($reid==0) return ''; $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath FROM `dede_arctype` WHERE reid='$reid' And ishidden<>1 order by sortrank asc limit 0, $line "; } |
修改為:
if($type=='top') { $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath From `dede_arctype` WHERE reid=0 And ishidden<>$hideflag order by sortrank asc limit 0, $line "; } else if($type=='son') { if($typeid==0) return ''; $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath From `dede_arctype` WHERE reid='$typeid' And ishidden<>$hideflag order by sortrank asc limit 0, $line "; } else if($type=='self') { if($reid==0) return ''; $sql = "SELECT id,typename,typedir,isdefault,ispart,defaultname |
版權(quán)聲明: 本站資源均來(lái)自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請(qǐng)注明: 織夢(mèng)中{dede:channel}無(wú)法調(diào)用隱藏欄目解決方法