首頁  >  文章  >  後端開發  >  photoshop cs5 官方中文正式原版下載 php 分頁類別 擴充程式碼

photoshop cs5 官方中文正式原版下載 php 分頁類別 擴充程式碼

WBOY
WBOY原創
2016-07-29 08:40:071122瀏覽

原來發表過一個脫離資料庫的分頁類,最近使用的時候發現有些時候搜尋的東西過於大的時候,採用url傳遞參數的方式,可能會有一定的影響或叫已知的bug,這次做了一些擴展,同時相容了先前的模式,使用上面很簡單的,只需要多設定一個參數就可以了程式碼如下:

複製程式碼 程式碼如下:


/**
* 功能: 分頁類,根據提供的資料總量和頁面大小
* 建立日期:Fri Apr 20 16:45:21 CST 2007
* 最後更新:
* 作者: sanshi
*/
class pagination
{
    var $result = array();
    var $result = "myvar $p. ;//page參數分頁記數
    var $urlParamStr = ""; //頁面的所有參數
    var $sqlMoveNumber = 0; //資料的偏移
  var $sqlMoveNumber = 0; //資料的偏移
  🎜>    public function pagination()
    {
    }
           $this-> is_post = $is_post;
        $this->pVar = defined('PAGE_BAR') ? PAGE_BAR : 'myp' ;
    '];
        //計算總頁數
        $curPage = $this->getCurPage(); //修改了,頁碼超出的bug
        if($curPage>$temp['sumPage']) $curPage=$temp['sumPage'];
    
        $temp['nextPage'] = $temp['sumPage'] > $curPage ? ($curPage+1) : $temp['sumPage'];
  temp. $ >1 ? $curPage-1 :1;
        $temp['endPage'] = $temp['sumPage'];
        $this->urlParamStrake> >        $temp['urlPageStr'] = ($page=="") ? $this->_makeUrl($url) : $page.$this->urlParamStr;
    ?0 : ($curPage-1)*$pageSize;
        $temp['sqlMoveNumber'] = $this->sqlMoveNumber;
    >result = $temp;
        return $this->result;
        //print_r($temp);    {
return $this->sqlMoveNumber;
    }
    public function getFooter()
    {
  =$0$OR>(Nof.com$Sstr 條result['upPage']}'";
        if($this->is_post) $str .=" ";
        $str .=" >上頁
";
        $str .=" $str .=" 共有{$this->result['sumPage']} 頁";
        $str .=" result['nextPage']}'";
        if($this->is_post) $str .=" ";
        $str .=" >下一頁
    }
    public function getJumpPage()
    {
                $str = " 跳到第 頁";
         // 輸出表單
           $str .="";
            $str .="";
          ;
            $_POST = isset($_POST) ? $_POST:在陣列中();
           {
                $str .="";
            }
   🎜>        }
回傳$str;
    }
    公用函數getCurPage() pVar]) : 1 ;
    }
    //分析出url的參數回傳?後面的參數,頁碼為空白包含問號
    private function _makeUrl($url)
    {
       
        if(isset($arrayUrl['query']))
        {
   
            parse_str($q,$qParam);
            //print_r($qParam);
            if(array_key_exists($this->pVar,$qParam))
       each ($qParam AS $k=>$v)
                {
       this->pVar) $temp[$k] = $v;
                }
               
                if(function_exists("http_build_query"))
     );
                其他與其他
               
             在}else {
               
            }
        }否則{
       
        }
    }
}
function sanshi_http_build_query($a,$b='',$c=0)     foreach ((array)$a as $k=>$v)
    {
        if ($c)
        if ($c)
       
        elseif (is_int($k))
            $k=$b.$k;
        if (is_array($v)||is_object($v))
        {
  
            繼續使用(
        }
       
    }
    返回內爆("&",$r);
}
/*
//print_r($_SERVER);
$p = 新分頁();
$p->set(10,2,'thi.php');
echo $p->getFooter();
echo $p->getJumpPage();
*/
?>


以上就介紹了photoshop cs5 官方中文正式版下載 php 頁類擴充程式碼,包含了 photoshop cs5 官方中文正式版下載方面的內容,希望對 PHP 教學有興趣的朋友有所幫助。

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn