ShowPage = $ShowPage;
$this->CountPage = ceil ( $CountNum / $PageSize );
$this->Floorp = floor ( $ShowPage / 2 ); // 偏移量
$this->PageClass = is_null ( $PageClass ) ? '' : $PageClass;
$this->CurClass = is_null ( $CurClass ) ? '' : $CurClass;
// $ServerURL = ( preg_match('/\?/i', $_SERVER['REQUEST_URI']))?preg_replace('/\&p\=[0-9]+/i', "", $_SERVER['REQUEST_URI']) : $_SERVER['REQUEST_URI']."?";
// if( substr($ButURL,0,2)=='//' ){
// $ServerURL = substr($ServerURL,1);
// }
// $url = preg_replace('/p=[\d]*/i', '', $ServerURL);
$url = '';
//推荐自己传url,不传也可以打开上面的代码自动获取
$this->PageUrl = is_null ( $PageUrl ) ? $url : $PageUrl;
}
/**
*
* @param number $Page
* @param string $ShowToPage
* 首页,上下页,尾页
* @param string $Html 标签元素,li,p
* @return string
*/
public function getPage($Page = 1, $ShowToPage = true, $Html = null) {
$StartPage = ($Page - $this->Floorp); // 开始页码
$EndPage = ($Page + $this->Floorp); // 结束页码
if ($this->CountPage < $this->ShowPage) {
$StartPage = 1;
$EndPage = $this->CountPage;
}
if ($StartPage < 1) {
$StartPage = 1;
$EndPage = $this->ShowPage;
}
if ($EndPage > $this->CountPage) {
$StartPage = $this->CountPage - $this->ShowPage + 1;
$EndPage = $this->CountPage;
}
$PageHtml = '';
if (! is_null ( $Html )) {
if ($Html == 'li') {
$Shtml = '';
$Ehtml = '';
} else {
$Shtml = '';
$Ehtml = '';
}
}
if (true == $ShowToPage) {
$PageHtml .= "$ShtmlPageUrl}p=1.html" _href="{$this->PageUrl}p=1.html">« 首页$Ehtml";
$PrveUrl = $this->getPrve($Page);
$PageHtml .= "$Shtml« 上一页$Ehtml";
}
for($i = $StartPage; $i getNext($Page);
$PageHtml .= "$Shtml下一页 »$Ehtml";
$PageHtml .= "$ShtmlPageUrl}p={$this->CountPage}.html" _href="{$this->PageUrl}p={$this->CountPage}.html">尾页 »$Ehtml";
}
return $PageHtml;
}
public function getPrve($Page){
if ($Page != 1) {
$Prve = $Page - 1;
$PrveUrl = "{$this->PageUrl}p={$Prve}";
} else {
$PrveUrl = "{$this->PageUrl}p=1";
}
return $PrveUrl;
}
public function getNext($Page){
if ($Page != $this->CountPage) {
$Next = $Page + 1;
$NextUrl = "{$this->PageUrl}p={$Next}";
} else {
$NextUrl = "{$this->PageUrl}p={$this->CountPage}";
}
return $NextUrl;
}
}
2. [图片] page.png
一套专业的网上书店程序,可以作为新华书店及大中型书店网上销售的首选,满足在线支付及汇款确认机制。功能简介:图书分类、查询、排行、最新、特价、关注排行、销售排行,新闻系统、汇款确认机制、求购书籍、在线咨询、热门图书定义、全站广告后台管理、后台采用WEBEDIT编辑器、集成"支付宝"在线支付等...v3.5版特殊功能说明(前台):1.自带5种风格主题。2.友好的页面提示(对网站全部











