"景先生毕设|www.jxszl.com

织梦dedecms拓展channel标签实现limit功能

2022-10-29 16:29编辑: www.jxszl.com景先生毕设
由于网站栏目多次需要调用同I.栏目下的栏目比如顶级栏目VI下级栏目V.IV.III.II.I.需要分两次分别调出VIVIII和III.感觉channel就比较吃力了全部写SQL又太多,可能是我还不知道有其他方法吧.row调用不出这种效果所以就把row改为了Limit用法了比较方便修改文件includ

 更多精彩就在: 51免费论文网|www.jxszl.com 
e aglib/下面的channel.lib.php在函数lib_channel里面加上
//limit条件

复制代码
$limit=trim(eregi_replace(limit,,$limit));if($limit!=)$limitsql="limit$limit";else$limitsql="limit0,VII";$orwhere=;if(isset($orwheres[0])){$orwhere=join(And,$orwheres);$orwhere=ereg_replace("^And",,$orwhere);$orwhere=ereg_replace("And[]{I.,}And",And,$orwhere);}if($orwhere!=)$orwhere="where$orwhere";//II次开发
--------------------------------------------------------------------------------

把上面的代码,添加到函数lib_channel(具体位置为:)

复制代码
functionlib_channel(&$ctag,&$refObj){global$dsql;$attlist="typeid|0,reid|0,row|I.00,col|I.,type|son,currentstyle|,cacheid|";FillAttsDefault($ctag->CAttribute->Items,$attlist);extract($ctag->CAttribute->Items,EXTR_SKIP);$innertext=$ctag->GetInnerText();$line=empty($row)?I.00:$row;
----------------------------------------------------------
这段代码后面
所有查询条件的limit0,$row改为$limitsqlOK保存


原文链接:http://www.jxszl.com/biancheng/dedecms/75334.html