/** * 功能:分頁類 * 作者:phpox * 時間:Sat Jul 14 18:15:02 CST 2007 */

defined('PHPOX') or die(header("HTTP/1.1 403 Not Forbidden"));

class page{ public $infocount; public " /> 亚洲国产高清福利视频,亚洲无线码一区在线观看,成人性生交大片免费看中文

天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

php仿ZOL分頁類代碼

大小: 3.86 K
尺寸: 289 x 42
瀏覽: 6 次
點擊打開新窗口瀏覽全圖

大小: 3.31 K
尺寸: 215 x 52
瀏覽: 1 次
點擊打開新窗口瀏覽全圖

大小: 5.56 K
尺寸: 500 x 46
瀏覽: 11 次
點擊打開新窗口瀏覽全圖
復制代碼 代碼如下:
<?php

/**
* 功能:分頁類
* 作者:phpox
* 時間:Sat Jul 14 18:15:02 CST 2007
*/

defined('phpOX') or die(header("HTTP/1.1 403 Not Forbidden"));

class page{
public $infocount;
public $pagecount;
public $items;
public $pageno;
public $start;
public $next;
public $prev;
public $maxpages;

public function __construct($infocount,$items,$pageno){
$this->infocount = $infocount;
$this->items = $items;
$this->pageno = $pageno;
$this->pagecount = $this->getpagecount();
$this->justpageno();
$this->start = $this->getstart();
$this->gotoprev();
$this->gotonext();
}

private function justpageno(){
if (emptyempty($this->pageno) || $this->pageno < 1){
$this->pageno = 1;
}
if ($this->pageno > $this->pagecount){
$this->pageno = $this->pagecount;
}
}

private function gotonext(){
$next = $this->pageno + 1;
if ($next > $this->pagecount){
$this->next = $this->pagecount;
}else {
$this->next = $next;
}

}

private function gotoprev(){
$prev = $this->pageno -1;
if ($prev < 1){
$this->prev = 1;
}else {
$this->prev = $prev;
}
}

private function getpagecount(){
return ceil($this->infocount / $this->items);
}

private function getstart(){
if ($this->pageno <= 1){
return 0;
}else {
return ($this->pageno - 1) * $this->items;
}
}

/**
* 樣式0(php)
*/
public function showpage($ctlname,$actname,$args = null){
if ($args !== null){
if (is_array($args)){
$str = '&'.encode_url_args($args);
}
}
$out = '';
$out .= "每頁顯示{$this->items}條信息 ";
$out .= "當前頁<strong><font color=/"#FF0000/">{$this->pageno}</font>/{$this->pagecount}</strong> ";
$out .= "共有{$this->infocount}條信息 ";
$out .= "<a href='?ctl={$ctlname}&act={$actname}&p=1$str'>首頁</a> ";
$out .= "<a href='?ctl={$ctlname}&act={$actname}&p={$this->prev}$str'></a> ";
$out .= "<a href='?ctl={$ctlname}&act={$actname}&p={$this->next}$str'></a> ";
$out .= "<a href='?ctl={$ctlname}&act={$actname}&p={$this->pagecount}$str'>尾頁</a> ";
$out .= "跳轉到:";
$out .= "<select id=/"page/" name=/"page/" onchange=/"Javascript:window.location='?ctl={$ctlname}&act={$actname}$str&p='+this.options[this.selectedIndex].value;/">/n";
$out .= " <option value=/"1/">請選擇</option>/n";
for ($i = 1;$i <= $this->pagecount;$i++){
$out .= " <option value=/"$i/">第{$i}頁</option>/n";
}
$out .= "</select>/n";
return $out;
}

/**
* 樣式1(html)
*/
function htmlshowpage($path,$list,$film){
$out = '';
$out .= "每頁顯示{$this->items}條信息 ";
$out .= "當前頁<strong><font color=/"#FF0000/">{$this->pageno}</font>/{$this->pagecount}</strong> ";
$out .= "共有{$this->infocount}條信息 ";
$out .= "<a href='{$path}$list/{$film}_1.html'>首頁</a> ";
$out .= "<a href='{$path}$list/{$film}_{$this->prev}.html'></a> ";
$out .= "<a href='{$path}$list/{$film}_{$this->next}.html'></a> ";
$out .= "<a href='{$path}$list/{$film}_{$this->pagecount}.html'>尾頁</a> ";
$out .= "跳轉到:";
$out .= "<select id=/"page/" name=/"page/" onchange=/"Javascript:window.location='{$path}html/$list/{$film}_'+this.options[this.selectedIndex].value +'.html'/">/n";
$out .= " <option value=/"1/">請選擇</option>/n";
for ($i = 1;$i <= $this->pagecount;$i++){
$out .= " <option value=/"$i/">第{$i}頁</option>/n";
}
$out .= "</select>/n";
return $out;
}

/**
* 樣式2(discuz)
*/
function multi($mpurl,$page = 10) {

$multipage = '';
$mpurl .= strpos($mpurl, '?') !== false ? '&' : '?';
$realpages = 1;
if($this->infocount > $this->items) {
$offset = 2;

$realpages = @ceil($this->infocount / $this->items);
$pages = $this->maxpages && $this->maxpages < $realpages ? $this->maxpages : $realpages;

if($page > $pages) {
$from = 1;
$to = $pages;
} else {
$from = $this->pageno - $offset;
$to = $from + $page - 1;
if($from < 1) {
$to = $this->pageno + 1 - $from;
$from = 1;
if($to - $from < $page) {
$to = $page;
}
} elseif($to > $pages) {
$from = $pages - $page + 1;
$to = $pages;
}
}

$multipage = ($this->pageno - $offset > 1 && $pages > $page ? '<a href="'.$mpurl.'page=1" class="first">1 ...</a>' : '').
($this->pageno > 1 ? '<a href="'.$mpurl.'page='.($this->pageno - 1).'" class="p_redirect"><<</a>' : '');
for($i = $from; $i <= $to; $i++) {
$multipage .= $i == $this->pageno ? '<a class="p_curpage"><strong>'.$i.'</strong></a>' :'<a href="'.$mpurl.'page='.$i.'" class="p_num">'.$i.'</a>';
}

$multipage .= ($this->pageno < $pages ? '<a href="'.$mpurl.'page='.($this->pageno + 1).'" class="p_redirect">>></a>' : '').
($to < $pages ? '<a href="'.$mpurl.'page='.$pages.'" class="last">... '.$realpages.'</a>' : '').
($pages > $page ? '<kbd><input type="text" name="custompage" size="3" onkeydown="if(event.keyCode==13) {window.location=/''.$mpurl.'page=/'+this.value; return false;}" /></kbd>' : '');

$multipage = $multipage ? '<div class="p_bar"><a class="p_total"> '.$this->infocount.' </a><a class="p_pages"> '.$this->pageno.'/'.$pages.' </a>'.$multipage.'</div>' : '';
}
return $multipage;
}

/**
* 樣式3(zol)
*/
public function zol($mpurl)
{
$mpurl .= strpos($mpurl, '?') !== false ? '&' : '?';
$code = '<div class="f22 mt10 hei14">';
$code .= '<div style="line-height:30px">第<font class="a_hong14b">'.$this->pageno.'</font><font class="a_hei14">/'.$this->pagecount.'</font>頁 每頁<font class="a_hei14">'.$this->items.'</font> 共<font class="a_hong14b">'.$this->infocount.'</font>款產品</div>';
$code .= '<table border="0" align="right" cellpadding="0" cellspacing="3">';
$code .= '<tr>';
if ($this->pageno == $this->prev)
{
$code .= "<td width='64' align='center' class='bd_hui huei14b'><a disabled='disabled' class='a_hui12b'><<</a></td>";
}
else
{
$code .= "<td width='64' align='center' class='bd_lan a_lan14'><a href='{$mpurl}page={$this->prev}' class='a_lan12b'><<</a></td>";
}
$i = 10 ;
$k = 1;
if ($this->pageno < 1)
{
$this->pageno = 1;
}
if ($this->pageno > $this->pagecount)
{
$this->pageno = $this->pagecount;
}
$s = $this->pageno-2;
if ($s <= 0)
{
$s = 1;
}
$e = $this->pageno+2;
if ($e < 5 )
{
$e = 5;
}
if ($e > $this->pagecount)
{
$e = $this->pagecount;
}
for ($j=$s;$j<=$e;$j++)
{
if ($this->pageno == $j)
{
$code .= '<td width="22" bgcolor="#2E6AB1" class="bei14" align="center">'.$j.'</td>';
}
else
{
$code .= "<td width='22' align='center' class='bd_lan a_lan14' onMouseOver=/"this.style.border='1px solid #2062A4'/" onMouseOut=/"this.style.border='1px solid #AACCEE'/" style=/"CURSOR: hand/" onClick=/"Javascript:window.location=('{$mpurl}page={$j}')/">$j</td>";
}
}
if ($this->pageno == $this->pagecount)
{
$code .= "<td align='center' width='64' class='bd_hui huei14b'><a disabled='disabled' >>></a></td>";
}
else
{
$code .= "<td align='center' width='64' class='bd_lan lan14b'><a href='{$mpurl}page={$this->next}' class='a_lan12b'>>></a></td>";
}
$code .= '</tr>';
$code .= '</table>';
$code .= '</div>';
return $code;
}
}

php技術php仿ZOL分頁類代碼,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 欧美色图天堂网 | 亚洲精品高清在线观看 | 精品国产高清自在线看 | RUNAWAY韩国动漫免费官网版 | 激情办公室 | 亚洲第一页在线播放 | 国产视频成人 | 刘梓晨啪啪啪 | 国产精品18久久久久久欧美 | 强开乳罩摸双乳吃奶视频 | 9久久99久久久精品齐齐综合色圆 | 亚洲欧美国产综合在线 | 亚洲国产精品久久无套麻豆 | 大睾丸内射老师 | 99热成人精品国产免男男 | 亚洲中文日韩日本在线视频 | 忘忧草在线影院WWW日本二 | 成人小视频在线观看免费 | av网站视频在线观看 | 亚洲第一成年人网站 | 毛片在线不卡 | 久久中文字幕人妻熟AV女蜜柚M | 日本电影免费久久精品 | 亚洲欧美日韩精品久久奇米色影视 | 两个女人互添下身高潮自视频 | 九九热精品视频在线观看 | 最新国产三级在线不卡视频 | 黄色片软件大全 | 狠狠久久免费视频在线 | 一攻多受h嗯啊巨肉bl巨污 | 川师 最美老师 | 国产午夜精品福利久久 | 桃花论坛POWERED2019 | 97视频在线播放 | adc影院欢迎您大驾光临入口 | 欧美 亚洲 日韩 中文2019 | 混乱家庭电影完整版在线看 | 免费A级毛片无码无遮挡 | 日本美女抠逼 | 18岁男人女人插孔 | 亚洲AV色香蕉一区二区三区 |