分页类——尾部页码导航
<?php /** * 生成Comment的尾部分页导航 * @author 李俊 * */ class cmtTail{ private $currentPage; private $totalPage; /** * 生成页码导航--总控函数 * @param string $currentPage 当前页码 * @param string $totalPage 总页数 * @throws Exception 页码小于1将会抛出异常 * @return string */ function __do($currentPage, $totalPage) { $this->currentPage=$currentPage; $this->totalPage=$totalPage; if($this->totalPage<=10){//总页数小于等于10页 if($this->currentPage==1){//当前页是第一页 $str='上一页'.$this->currentTag(); for ($i = 2; $i <= $this->totalPage; $i++) { $str=$str.$this->commonTag($i); } $str=$str.$this->next(); }elseif ($this->currentPage==$this->totalPage){//已跳至最后一页 $str=$this->up(); for ($i = 1; $i <= $this->totalPage-1; $i++) { $str=$str.$this->commonTag($i); } $str=$str.$this->currentTag(); $str=$str.$this->next(); }else{ $str=$this->up(); for($i=1; $i<$this->currentPage; $i++){ $str=$str.$this->commonTag($i); } $str=$str.$this->currentTag();//生成当前页标签 for ($i = $this->currentPage+1; $i <= $this->totalPage; $i++) { $str=$str.$this->commonTag($i); } $str=$str.$this->next(); } }elseif ($this->totalPage>10){//页码大于10 if($this->currentPage==1){//8+2 $str='上一页'.$this->currentTag(); for ($i = 2; $i <= 8; $i++) { $str=$str.$this->commonTag($i); } $str=$str.'...';//添加省略号 $str=$str.$this->commonTag($this->totalPage-1); $str=$str.$this->commonTag($this->totalPage); }elseif($this->currentPage==$this->totalPage) {//当前为最后一页 $str=$this->up(); $str=$str.$this->commonTag(1); $str=$str.'...';//添加省略号 for ($i = $this->totalPage-6; $i < $this->totalPage; $i++) { $str=$str.$this->commonTag($i); } $str=$str.$this->currentTag(); $str=$str.$this->next(); }else { if ($this->currentPage<6) { $str=$this->up(); for ($i = 1; $i < $this->currentPage; $i++) { $str=$str.$this->commonTag($i); } $str=$str.$this->currentTag(); for ($i = $this->currentPage+1; $i <= 7; $i++) { $str=$str.$this->commonTag($i); } $str=$str.'...';//添加省略号 $str=$str.$this->commonTag($this->totalPage); $str=$str.$this->next(); }else { if ($this->currentPage>=$this->totalPage-4) { $str=$this->up(); $str=$str.$this->commonTag(1); $str=$str.'...';//添加省略号 for ($i = $this->totalPage-6; $i < $this->currentPage; $i++) { $str=$str.$this->commonTag($i); } $str=$str.$this->currentTag(); for ($i = $this->currentPage+1; $i <= $this->totalPage; $i++) { $str=$str.$this->commonTag($i); } $str=$str.$this->next(); }elseif ($this->currentPage<$this->totalPage-4){//1+5+1 $str=$this->up(); $str=$str.$this->commonTag(1); $str=$str.'...';//添加省略号 $str=$str.$this->commonTag($this->currentPage-2); $str=$str.$this->commonTag($this->currentPage-1); $str=$str.$this->currentTag(); $str=$str.$this->commonTag($this->currentPage+1); $str=$str.$this->commonTag($this->currentPage+2); $str=$str.'...';//添加省略号 $str=$str.$this->commonTag($this->totalPage); $str=$str.$this->next(); } }; } }elseif ($this->totalPage<=0){ throw new Exception("页面不可能小于1"); } return $str; } /** * 一般标签 * @param int $param 页码 * @return string */ function commonTag($param) { return '<a page="'.$param.'">'.$param.'</a>'; } /** * 生成当前页标签 * @param int $param 页码 * @return string */ function currentTag() { return '<strong id="on">'.$this->currentPage.'</strong>'; } /** * 生成下一页标签 * @param int $param 下一页页码 * @return string */ function next() { if ($this->currentPage==$this->totalPage) { return '下一页'; } return '<a page="'.($this->currentPage+1).'">下一页</a>'; } /** * 生成上一页标签 * @param int $param 上一页页码 * @return string */ function up() { if ($this->currentPage==1){ return '上一页'; }else{ return '<a page="'.($this->currentPage-1).'">上一页</a>'; } } /** * 实例化cmtTail, * 功能:生成Comment的尾部分页导航 * @param string $currentPage 当前页码 * @param string $totalPage 总页数 * @return string 返回html标签字符串 */ static function GO($currentPage, $totalPage) { $p=new cmtTail(); return $p->__do($currentPage, $totalPage); } }

ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

AI Hentai Generator
AIヘンタイを無料で生成します。

人気の記事

ホットツール

PhpStorm Mac バージョン
最新(2018.2.1)のプロフェッショナル向けPHP統合開発ツール

Dreamweaver Mac版
ビジュアル Web 開発ツール

SecLists
SecLists は、セキュリティ テスターの究極の相棒です。これは、セキュリティ評価中に頻繁に使用されるさまざまな種類のリストを 1 か所にまとめたものです。 SecLists は、セキュリティ テスターが必要とする可能性のあるすべてのリストを便利に提供することで、セキュリティ テストをより効率的かつ生産的にするのに役立ちます。リストの種類には、ユーザー名、パスワード、URL、ファジング ペイロード、機密データ パターン、Web シェルなどが含まれます。テスターはこのリポジトリを新しいテスト マシンにプルするだけで、必要なあらゆる種類のリストにアクセスできるようになります。

DVWA
Damn Vulnerable Web App (DVWA) は、非常に脆弱な PHP/MySQL Web アプリケーションです。その主な目的は、セキュリティ専門家が法的環境でスキルとツールをテストするのに役立ち、Web 開発者が Web アプリケーションを保護するプロセスをより深く理解できるようにし、教師/生徒が教室環境で Web アプリケーションを教え/学習できるようにすることです。安全。 DVWA の目標は、シンプルでわかりやすいインターフェイスを通じて、さまざまな難易度で最も一般的な Web 脆弱性のいくつかを実践することです。このソフトウェアは、

MinGW - Minimalist GNU for Windows
このプロジェクトは osdn.net/projects/mingw に移行中です。引き続きそこでフォローしていただけます。 MinGW: GNU Compiler Collection (GCC) のネイティブ Windows ポートであり、ネイティブ Windows アプリケーションを構築するための自由に配布可能なインポート ライブラリとヘッダー ファイルであり、C99 機能をサポートする MSVC ランタイムの拡張機能が含まれています。すべての MinGW ソフトウェアは 64 ビット Windows プラットフォームで実行できます。
