search
Homephp教程php手册Change the paging mode based on the original

My system is an audio website, and all audio data is written in one field. If there are thousands of pieces! Without pagination, the website will basically freeze when you open it. Share the front-end and back-end code with everyone, hope you can learn the functions
后台代码//分页开始<br>         $rs = M('Vod');<br>         $user = array();<br>         $user['q_islock'] = $_REQUEST['q_islock'];<br>         $selectType = $_REQUEST['q_selectType'];<br>         $wd = urldecode(trim($_REQUEST['wd']));<br>         $user['selectType'] = $selectType;<br>         $user['wd'] = $wd;<br>         $user['p'] = '';<br> <br>         if ($user['q_islock'] == 1) {<br>             $where['islock'] = array('eq', 1);<br>         }<br>         else if ($user['q_islock'] == 2) {<br>             $where['islock'] = array('eq', 0);<br>         }<br> <br>         if (!empty($selectType) && !empty($wd)) {<br>             $where[$selectType] = array('like', '%' . $wd . '%');<br>         }<br>         $ida=$_GET['id'];<br>         $vod_url=$rs->where("vod_id=$ida")->getfield("vod_url");<br>         $count=(substr_count($vod_url,"$")-3)/2;<br>         $limit = C('url_num_admin');<br>         $totalpages = ceil($count / $limit);<br>         $currentpage = (!empty($_GET['p']) ? intval($_GET['p']) : 1);<br>         $currentpage = get_maxpage($currentpage, $totalpages);<br>         $pageurl = U('/read-id-'.$ida, $user, false, false) . '{!page!}' . C('url_html_suffix');<br>         $user['p'] = $currentpage;<br>         $_SESSION['user_jumpurl'] = U('/read-id-'.$ida, $user) . C('url_html_suffix');<br>         $page = '共' . $count . '个 当前:' . $currentpage . '/' . $totalpages . '页 ' . getpage($currentpage, $totalpages, 3, $pageurl, 'pagego('' . $pageurl . '',' . $totalpages . ')');<br>         $user['page'] = $page;<br>         $f['currentpage']=$currentpage;<br>         $sq['vod_id']=$ida;<br>         $vod_playlist=$rs->find($ida);<br>         $this->assign($f);<br>         $this->assign($user);<br>         //分页结束模板代码块<php>$fj=($currentpage-1)*20</php><br>                 <volist> <br> <if><br>         <fflist><br> <br>                    <li> <time>更新时间:{$vod_addtime|date='Y-m-d H:i:s',###}</time><i></i><a>{$gxlcmsson.playname}</a> </li> <br>                     </fflist><br>                       <br>                 </if> </volist>Change the paging mode based on the original

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.