dedecms模板实现{dede:sql=""}分页功能分解
//add by Gump 2011-12-31 http://gump.me//***
通过listsql标签中sql属性传入的参数来获得一个单列的文档列表* */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->SetQuery($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’){//传递整个数组,在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
☉本站提供的源码、模板、软件工具等其他资源,都不包含技术服务,请大家谅解!
pbootcms模板网 » dedecms模板实现{dede:sql=""}分页功能分解