* 获取动态的分页列表 * * @access public * @param string $list_len 列表宽度 * @return string */ function GetPageListDM($list_len) { global $oldkeyword; $prepage=""; $nextpage=""; $prepagenum = $this->PageNo - 1; $nextpagenum = $this->PageNo + 1; if($list_len=="" || preg_match("/[^0-9]/", $list_len)) { $list_len=3; } $totalpage = ceil($this->TotalResult / $this->PageSize); if($totalpage<=1 && $this->TotalResult>0) { return "共1页/".$this->TotalResult."条记录"; } if($this->TotalResult == 0) { return "共0页/".$this->TotalResult."条记录"; } $purl = $this->GetCurUrl(); $oldkeyword = (empty($oldkeyword) ? $this->Keyword : $oldkeyword); //当结果超过限制时,重设结果页数 if($this->TotalResult > $this->SearchMaxRc) { $totalpage = ceil($this->SearchMaxRc/$this->PageSize); } $infos = "<li>找到<b>".$this->TotalResult."</b>条记录/只显示<b>{$totalpage}</b>页 </li>rn"; $geturl = "keyword=".urlencode($oldkeyword)."&searchtype=".$this->SearchType; $hidenform = "<input type='hidden' name='keyword' value='".rawurldecode($oldkeyword)."'>rn"; $geturl .= "&channeltype=".$this->ChannelType."&orderby=".$this->OrderBy; $hidenform .= "<input type='hidden' name='channeltype' value='".$this->ChannelType."'>rn"; $hidenform .= "<input type='hidden' name='orderby' value='".$this->OrderBy."'>rn"; $geturl .= "&kwtype=".$this->KType."&pagesize=".$this->PageSize; $hidenform .= "<input type='hidden' name='kwtype' value='".$this->KType."'>rn"; $hidenform .= "<input type='hidden' name='pagesize' value='".$this->PageSize."'>rn"; $geturl .= "&typeid=".$this->TypeID."&TotalResult=".$this->TotalResult."&"; $hidenform .= "<input type='hidden' name='typeid' value='".$this->TypeID."'>rn"; $hidenform .= "<input type='hidden' name='TotalResult' value='".$this->TotalResult."'>rn"; $purl .= "?".$geturl; //获得上一页和下一页的链接 if($this->PageNo != 1) { $prepage.="<li><a href='".$purl."PageNo=$prepagenum'>上一页</a></li>rn"; $indexpage="<li><a href='".$purl."PageNo=1'>首页</a></li>rn"; } else { $indexpage="<li>首页</li>rn"; } if($this->PageNo!=$totalpage && $totalpage>1) { $nextpage.="<li><a href='".$purl."PageNo=$nextpagenum'>下一页</a></li>rn"; $endpage="<li><a href='".$purl."PageNo=$totalpage'>末页</a></li>rn"; } else { $endpage="<li>末页</li>rn"; } //获得数字链接
新闻热点
疑难解答