由于網(wǎng)站欄目多次需要調(diào)用同一欄目下的欄目比如頂級欄目6 下級欄目5.4.3.2.1 需要分兩次分別調(diào)出543和21 感覺channel就比較吃力了全部寫SQL又太多,可能是我還不知道有其他方法吧。row調(diào)用不出這種效果所以就把row改為了Limit用法了比較方便 修改文件include\taglib/下面的channel.lib.php 在函數(shù)lib_channel里面加上
//limit條件
復制代碼
$limit = trim(eregi_replace('limit','',$limit)); if($limit!='') $limitsql = " limit $limit "; else $limitsql = " limit 0,7 "; $orwhere = ''; if(isset($orwheres[0])) { $orwhere = join(' And ',$orwheres); $orwhere = ereg_replace("^ And",'',$orwhere); $orwhere = ereg_replace("And[ ]{1,}And",'And ',$orwhere); } if($orwhere!='') $orwhere = " where $orwhere ";//二次開發(fā)
--------------------------------------------------------------------------------
把上面的代碼,添加到函數(shù)lib_channel(具體位置為:)
復制代碼
function lib_channel(&$ctag,&$refObj) { global $dsql; $attlist = "typeid|0,reid|0,row|100,col|1,type|son,currentstyle|,cacheid|"; FillAttsDefault($ctag->CAttribute->Items,$attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); $innertext = $ctag->GetInnerText(); $line = empty($row) ? 100 : $row;
----------------------------------------------------------
這段代碼后面
所有查詢條件的limit 0,$row改為$limitsql OK 保存