PHP代码
discuz分页 funtion list(){ $page=empty($_GET['page'])?1:intval($_GET['page']); if($page<1) $page=1; $perpage=40; $perpage=mob_perpage($perpage); $start=($page-1)*$perpage; ckstart($start,$perpage); $count=DB::result(DB::query("SELECT COUNT(*) FROM ".DB::table('portal_article_title')." WHERE $wheresql"), 0); if($count) { $query = DB::query("SELECT * FROM ".DB::table('portal_article_title')." WHERE $wheresql ORDER BY dateline DESC LIMIT $start,$perpage"); while($value = BD::fetch($query)) { if($value['thumb']) { $value['pic'] = "data/attachment/portal/".$value['pic']; }else{ $value['pic'] = "data/attachment/portal/".$value['pic']; } $value['dateline'] = date('Y-m-d', $value['dateline']); $value['summary'] = cutstr($value['summary'], 200); $value['subject'] = getstr($value['subject'], 34);//截取字符串长度,多余省略号 $list[] = $value; } $multi=multi($count,$perpage,$page,"ask/index.php"); if($list){ $data[] = $list; $data[] = $multi; return $data; }else { return false; } } $matchname=empty($_GET['matchname']) ? '' : $_GET['matchname']; 在调用方法时 $data=list(); $list = $data[0]; $multi = $data[1]; 在显示页 <div class="box channel_list"> <ul> <!--{if $list}--> <!--{loop $list $v}--> <li><span class="f3">·</span><a href="home.php?mod=space&uid={$v['uid']}&do=blog&id={$v['blogid']}" target="_blank">$v['subject']</a><span class="channel_date">$v['dateline']</span><span class="channel_lofts">$v['username']</span></li> <!--{/loop}--> <!--{/if}--> </ul> <div class="box"><!--{if $multi}--><div class="pgs cl mtm">$multi</div><!--{/if}--></div> </div>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Dreamweaver Mac version
Visual web development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools
