* 獲取動態(tài)的分頁列表 * * @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); //當結(jié)果超過限制時,重設結(jié)果頁數(shù) 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"; } //獲得數(shù)字鏈接 |
版權聲明: 本站資源均來自互聯(lián)網(wǎng)或會員發(fā)布,如果侵犯了您的權益請與我們聯(lián)系,我們將在24小時內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: dedecms織夢模板下載搜索頁分頁樣式的修改及搜索單頁顯示條數(shù)的修改