易优cms—安全好用,商用授权只需要188元,网址:https://www.eyoucms.com
{dede:memberlist orderby='sc[ j _ E I iores' row='30'}
<tr>
<td width="15" aligQ $ nn="center" class="di0 E 3 @ , d"></td>
<td heiH & 7 : u M = H 5ght="22" class="titleld">[field:uname/]&S } A 5 W $ ] klt;/td>
</tr>
{/dede:memberlist}
用js把dedecms的s# C [ T r l &ql标签从数据库中读取的+ y y i数据进行分B u \ R \页的方法
<table id="loop">
{dede:sql sql="select * from leavewo! K \ 1 g \ n Crd order by lyid desc"}
<tr class="looptr">
<td class="loop-lefm Q Q ` ] @ g It-td" valign="top">
<p class="loopp">姓a v s f P j Y r名:[field:name/]</p&g} Y Bt;
<p class="loopp">联系电话:[field:phone/]</p>
<p class="loopp">Q Q:[field:qq/]</p>
<p class="loopp">E-mai. = @ . W 1l:[field:email/]</p>
</td>
<td class="loop-right-td" valign="top"&g1 S : .t;
<p class='lytitle'><strong>留言题目:[field:lytitle/]</strong><span><strong>留言时间:[field:lytime/]</strong></span>&lF [ ?t;/p>
<p class='lycontent'><p><strong>留言内容:</st4 M - 2rong></p>[field:lycontent/]</p>
<p class=Y x [ w -'hfcontent'><p><strong>回复:</strong></p><` [ J f f 5 0 % xspan>[field:hfcontent/]<d D b 8 )/span></p>
&lO 8 _ l dt;/td>\ x ` ` ; 3 c 8 _
</tr>
{/dede:sql}
<p id="changpage"></p>
<script language="javascript">~ \ x k P ];
var obj,j;r F L : 0 A
var page=0;
var nowPage=0;//当前页
var listNum=5;//每页显示<ul>数
var PagesLen;//总页数
var PageNum=4;//分页链接接数(5$ h Z ` 7 J a y个)
onload=function(){
obj=document.getElementById("loop").getElementsByTagName("tr");
j=obj.length
PagesLD 6 / R den=M\ 8 C x J A B Z Oath.ceil(j{ , i D m o $ T/listNum);
upPage(0)
}
function upPage(p){
no5 e H ` X ~wPage=p
//内容变换 34
for (var i=0;i<j;i++){
obj.style.display="noneQ j # ) w p K"
}
for (var i=p*listNum;i<(p+1)*listNum;i++){
if(obj)obj.style.display="block"
}
strS='<a href="###" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" onclick="u& ] { cpPage(0)">首页</a> '
var PageNum_2=PageNum%2==0?Math.ceil(PageNum/2)+1:Math.ceil(PageNum/2)
var PageNum_R f 2 $ - A @ ^3=PageNum%2==0?Math.ceil(PageNum/2):Math.ceil(PageNum/2)+1
var strC="",startPage,endPaA & R $ge;
if (PageNum>=Pag\ @ B r qesLen) {startPagP F _ de=0;endPage=PagesLen-1}
else if (nowPage<PagZ X k s d C 0 )eNum_2){startPage=0;endPage=PagesLen-1>PageNum?PageNum:PagesLen-1}//首页
else {startPage=nowPage+PageNum_3>=PagesLen?PagesLen-PageNum-1: nowPage-PageNum_2+1;var t=startPage+PageNum;endPage=t>Pages4 a [ 5 )Len?PagesLen-1:= D w pt}
fs E * i Wor (var i=startPage;i<=endPage;i++){
if (i==nowPage)strC+='<a href="###" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" onclick="upPage('+i+')">'+(i+1)+'</a> '
else strC+='<a href="###" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" onclick="upPage('+i+')">'+(i+1)+'</a> '
}
strE=' <a href="###" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" onclick="upPage(] $ U : X - E'+(PagesLen-1)+')">尾页</a> '\ 0 9 X ~ D m F
stW D 0 RrE2=nowPage+1+"/"+PagesLen+"页"+" 共"+j+"条"
document
getElementById("changpage").innerHTML=strS+strC+strE+strE2
}
</script>
</table>