织梦dedecms拓展channel标签实现limit功能
更多精彩就在: 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
热门阅读