久久机这里只有精品,国产69精品一区二区亚洲孕妇,91精品国产综合久久婷婷香蕉,午夜久久久久久电影

最新活動:電腦PC端+手機(jī)端+微網(wǎng)站+自適應(yīng)網(wǎng)頁多模板選擇-建站388元起價!!!
當(dāng)前位置:主頁 > 網(wǎng)站建設(shè) > 織夢dedecms程序sql標(biāo)簽實(shí)現(xiàn)分頁功能,dedecms

織夢dedecms程序sql標(biāo)簽實(shí)現(xiàn)分頁功能,dedecms

時間:2023-07-22 13:07:22 閱讀: 文章分類: 網(wǎng)站建設(shè) 作者: dede開發(fā)者

導(dǎo)讀:dedecmsdedecms{ dede :list pagesize='7'}{/dede:list}改用{dede:listsql}調(diào)用的方法 打開include/arc.listvidede后臺模板織夢文章模板。

dede后臺模板織夢文章模板

 {dede:list pagesize='7'}{/dede:list}改用{dede:listsql}調(diào)用的方法 打開include/arc.listview.class.php 找到: if(!is_object($ctag)) { $ctag = $this->dtp->GetTag("list"); } 這一段,在其后添加如下代碼: if(!is_object($ctag)) { $ctag = $this->dtp->GetTag("listsql"); if (is_object($ctag)) { $cquery = $ctag->GetAtt("sql"); $cquery = preg_replace("/SELECT(.*?)FROM/is", " SELECT count(*) as dd FROM ", $cquery); $cquery = preg_replace("/ORDER(.*?)SC/is", "", $cquery); $row = $this->dsql->GetOne($cquery); if(is_array($row)) { $this->TotalResult = $row['dd']; } else { $this->TotalResult = 0; } } } //end 然后找到: if($ctag->GetName()=="list") { $limitstart = ($this->PageNo-1) * $this->PageSize; $row = $this->PageSize; if(trim($ctag->GetInnerText())=="") { $InnerText = GetSysTemplets("list_fulllist.htm"); } else { $InnerText = trim($ctag->GetInnerText()); } $this->dtp->Assign($tagid, $this->GetArcList( $limitstart, $row, $ctag->GetAtt("col"), $ctag->GetAtt("titlelen"), $ctadede5.7模板g->GetAtt("infolen"), $ctag->GetAtt("imgwidth"), $ctag->GetAtt("imgheight"), $ctag->GetAtt("listtype"), $ctag->GetAtt("orderby"), $InnerText, $ctag->GetAtt("tablewidth"), $ismake, $ctag->GetAtt("orderway") ) ); } 這一段,在其后添加如下代碼: else if($ctag->GetName()=="listsql") { $limitstart = ($this->PageNo-1) * $this->PageSize; $row = $this->PageSize; if(trim($ctag->GetInnerText())=="") { $InnerText = GetSysTemplets("list_fulllist.htm"); } else { $InnerText = trim($ctag->GetInnerText()); } $this->dtp->Assign($tagid, $this->GetSqlList( $limitstart, $row, $c織夢模板安裝tag->GetAtt("sql"), $InnerText ) ); } //end 最后找到function GetArcList這個方法,在其后添加一個可以通過傳入sql參數(shù)獲取指定數(shù)據(jù)源的方法,代碼如下: /** * 通過listsql標(biāo)簽中sql屬性傳入的參數(shù)來獲得一個單列的文檔列表 * */ function GetSqlList($limitstart = 0, $row = 10, $sql = '', $innertext){ global $cfg_list_son; $innertext = trim($innertext); if ($innertext == '') { $innertext = GetSysTemplets('list_fulllist.htm'); } //處理SQL語句 $limitStr = " LIMIT {$limitstart},{$row}"; $this->dsql->SetQuerydede免費(fèi)校板下戰(zhàn)($sql . $limitStr); $this->dsql->Execute('al'); $t2 = ExecTime(); //echo $t2-$t1; $sqllist = ''; $this->dtp2->LoadSource($innertext); $GLOBALS['autoindex'] = 0; //獲取字段 while($row = $this->dsql->GetArray("al")) { $GLOBALS['autoindex']++; if(is_array($this->dtp2->CTags)) { foreach($this->dtp2->CTags as $k=>$ctag) { if($ctag->GetName()=='array') { //傳遞整個數(shù)組,在runphp模式中有特殊作用 $this->dtp2->Assign($k,$row); } else { if(isset($row[$ctag->GetName()])) { $this->dtp2->Assign($k,$row[$ctag->GetName()]); } else { $this->dtp2->Assign($k,''); } } } } $sqllist .= $this->dtp2->GetResult(); }//while $t3 = ExecTime(); //echo ($t3-$t2); $this->dsql->FreeResult('al'); return $sqllist; } //end  

關(guān)鍵詞標(biāo)簽: 分頁 標(biāo)簽 織夢

聲明: 本文由我的SEOUC技術(shù)文章主頁發(fā)布于:2023-07-22 ,文章織夢dedecms程序sql標(biāo)簽實(shí)現(xiàn)分頁功能,dedecms主要講述標(biāo)簽,分頁,織夢網(wǎng)站建設(shè)源碼以及服務(wù)器配置搭建相關(guān)技術(shù)文章。轉(zhuǎn)載請保留鏈接: http://www.bifwcx.com/article/web_34455.html

我的IDC 網(wǎng)站建設(shè)技術(shù)SEOUC.COM
專注網(wǎng)站建設(shè),SEO優(yōu)化,小程序設(shè)計制作搭建開發(fā)定制網(wǎng)站等,數(shù)千家網(wǎng)站定制開發(fā)案例,網(wǎng)站推廣技術(shù)服務(wù)。
  • 5000+合作客服
  • 8年從業(yè)經(jīng)驗(yàn)
  • 150+覆蓋行業(yè)
  • 最新熱門源碼技術(shù)文章

    主站蜘蛛池模板: 常德市| 嵩明县| 浦北县| 漳州市| 乌苏市| 北辰区| 碌曲县| 桃园市| 库伦旗| 张家港市| 东乡族自治县| 滕州市| 长岭县| 县级市| 株洲县| 烟台市| 东乡族自治县| 大足县| 虹口区| 原平市| 上栗县| 佛教| 柳河县| 鹤壁市| 尚义县| 杭州市| 阿城市| 松滋市| 罗城| 逊克县| 顺昌县| 贞丰县| 靖边县| 临海市| 广德县| 竹溪县| 永安市| 淮安市| 黄陵县| 信宜市| 万载县|