强大php 分页代码类
本教程为各位朋友提供一款类型discuz论坛风格的分页代码了,我们把这段代码写成了一个函数哦,下面来看看吧。
本教程为各位朋友提供一款类型discuz论坛风格的分页代码了,我们把这段代码写成了一个函数哦,下面来看看吧。
//分页当页面数
function getPage($page,$pageSize){
$this->getRowsCount();
$this->getPageCount($pageSize);
//print $this->pageCount;
if(($page =="") || ($page $this->notePage = "1";
}else if($page>$this->pageCount){
$this->notePage = $this->pageCount;
}else{
$this->notePage = $page;
}
return $this->notePage;
}
//取得记录总数
function getRowsCount(){
$this->getRes($this->sql_number);
$row = $this->getRows();
$this->number = $row[0];
return $this->number;
}
//取得页面数量
function getPageCount($pageSize){
$this->pageCount = ceil($this->number/$pageSize);
return $this->pageCount;
}
//分页代码
function getPageContent($page,$url,$pageSize){
if($page=="1"){
$view.=" [首页]";
$view.=" [上一页]";
}else{
$view.=" [首页]";
$view.=" [上一页]";
}
if($pagepageCount){
$view.=" [下一页]";
$view.=" [尾页]";
}else{
$view.=" [下一页]";
$view.=" [尾页]";
}
return $view." 当前第".$page."页/共".$this->pageCount."页 ".$this->number."条记录"." 前往第 ".$this->getUrl($url,$page);
}
//分页转至页面
function getUrl($url,$page){
$go =" 页
";
return $go;
}
//跳转页面
function refUrl($url,$speak){
print("");
}

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Linux new version
SublimeText3 Linux latest version