由于网站栏目多次需要调用同一栏目下的栏目比如顶级栏目6 下级栏目5.4.3.2.1 需要分两次分别调出543和21 感觉channel就比较吃力了全部写SQL又太多,可能是我还不知道有其他方法吧。row调用不出这种效果所以就把row改为了Limit用法了比较方便 修改文件include\taglib/下面的channel.lib.php 在函数lib_channel里面加上

01 //limit条件
02     $limit = trim(eregi_replace('limit','',$limit));
03     if($limit!='') $limitsql = " limit $limit ";
04     else $limitsql = " limit 0,7 ";
05
06     $orwhere = '';
07     if(isset($orwheres[0])) {
08         $orwhere = join(' And ',$orwheres);
09         $orwhere = ereg_replace("^ And",'',$orwhere);
10         $orwhere = ereg_replace("And[ ]{1,}And",'And ',$orwhere);
11     }
12     if($orwhere!='') $orwhere = " where $orwhere ";//二次开发

 

——————————————————————————–

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

1 function lib_channel(&$ctag,&$refObj)
2 {
3     global $dsql;
4
5     $attlist = "typeid|0,reid|0,row|100,col|1,type|son,currentstyle|,cacheid|";
6     FillAttsDefault($ctag->CAttribute->Items,$attlist);
7     extract($ctag->CAttribute->Items, EXTR_SKIP);
8     $innertext = $ctag->GetInnerText();
9     $line = empty($row) ? 100 : $row;

———————————————————-
这段代码后面
所有查询条件的limit 0,$row改为$limitsql OK 保存

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。