dede 完美分页效果! pagelist修改
2016-03-21 10:46
323 查看
1.找到根目录下的“include”文件夹下的“arc.listview.class.php”文件,打开。
网站根目录/include/arc.listview.class.php
2.ctrl+f找到“//获取静态的分页列表”。
把“//获取静态的分页列表”到“//获取动态的分页列表”之间的代码(GetPageListST函数)修改为以下:
function
GetPageListST($list_len,$listitem="index,end,pre,next,pageno")
{
$prepage
= $nextpage = '';
$prepagenum = $this->PageNo-1;
$nextpagenum =
$this->PageNo+1;
if($list_len=='' ||
ereg("[^0-9]",$list_len))
{
$list_len=2;
}
$totalpage =
ceil($this->TotalResult/$this->PageSize);
if($totalpage<=1
&& $this->TotalResult>0)
{
return "";
}
if($this->TotalResult == 0)
{
return
"";
}
$purl = $this->GetCurUrl();
$maininfo =
"";
$tnamerule =
$this->GetMakeFileRule($this->Fields['id'],"list",$this->Fields['typedir'],$this->Fields['defaultname'],$this->Fields['namerule2']);
$tnamerule
= ereg_replace('^(.*)/','',$tnamerule);
//分页第一页链接 12.15
李楠修改
$typedir=
ereg_replace('{cmspath}',$GLOBALS['cfg_cmspath'],$this->Fields['typedir']);
//变量:默认文档名称,比如index.html $defaultname=
ereg_replace('{cmspath}',$GLOBALS['cfg_cmspath'],$this->Fields['defaultname']);
//获得上一页和主页的链接
if($this->PageNo
!= 1)
{
if($this->PageNo == 2)
{
$prepage.="<a
href=\"".$typedir."/\" class=\"pageNum
prepage\">上一页";
}
else
{
$prepage.="<a
href='".str_replace("{page}",$prepagenum,$tnamerule)."' class=\"pageNum
prepage\">上一页";
}
if($totalpage <=
10)
{
$indexpage="<A class=\ href="http://edit.jfsky.com/"
pageNum\?? ?.$typedir.? _xhe_href="\"
\??>1";
}
else
{
if($this->PageNo <
$list_len*2+1)
{
$indexpage="<A class=\
href="http://edit.jfsky.com/" pageNum\?? ?.$typedir.? _xhe_href="\"
\??>1";
}
else
{
$indexpage="<A class=\
href="http://edit.jfsky.com/" pageNum\?? ?.$typedir.? _xhe_href="\"
\??>1<SPAN class=\ pageBreak\??>…";
&nbs
网站根目录/include/arc.listview.class.php
2.ctrl+f找到“//获取静态的分页列表”。
把“//获取静态的分页列表”到“//获取动态的分页列表”之间的代码(GetPageListST函数)修改为以下:
function
GetPageListST($list_len,$listitem="index,end,pre,next,pageno")
{
$prepage
= $nextpage = '';
$prepagenum = $this->PageNo-1;
$nextpagenum =
$this->PageNo+1;
if($list_len=='' ||
ereg("[^0-9]",$list_len))
{
$list_len=2;
}
$totalpage =
ceil($this->TotalResult/$this->PageSize);
if($totalpage<=1
&& $this->TotalResult>0)
{
return "";
}
if($this->TotalResult == 0)
{
return
"";
}
$purl = $this->GetCurUrl();
$maininfo =
"";
$tnamerule =
$this->GetMakeFileRule($this->Fields['id'],"list",$this->Fields['typedir'],$this->Fields['defaultname'],$this->Fields['namerule2']);
$tnamerule
= ereg_replace('^(.*)/','',$tnamerule);
//分页第一页链接 12.15
李楠修改
$typedir=
ereg_replace('{cmspath}',$GLOBALS['cfg_cmspath'],$this->Fields['typedir']);
//变量:默认文档名称,比如index.html $defaultname=
ereg_replace('{cmspath}',$GLOBALS['cfg_cmspath'],$this->Fields['defaultname']);
//获得上一页和主页的链接
if($this->PageNo
!= 1)
{
if($this->PageNo == 2)
{
$prepage.="<a
href=\"".$typedir."/\" class=\"pageNum
prepage\">上一页";
}
else
{
$prepage.="<a
href='".str_replace("{page}",$prepagenum,$tnamerule)."' class=\"pageNum
prepage\">上一页";
}
if($totalpage <=
10)
{
$indexpage="<A class=\ href="http://edit.jfsky.com/"
pageNum\?? ?.$typedir.? _xhe_href="\"
\??>1";
}
else
{
if($this->PageNo <
$list_len*2+1)
{
$indexpage="<A class=\
href="http://edit.jfsky.com/" pageNum\?? ?.$typedir.? _xhe_href="\"
\??>1";
}
else
{
$indexpage="<A class=\
href="http://edit.jfsky.com/" pageNum\?? ?.$typedir.? _xhe_href="\"
\??>1<SPAN class=\ pageBreak\??>…";
&nbs
相关文章推荐
- 不同浏览器字符间距不同原因。font-size和 font-family,
- 控制dede 留言板 显示条数。
- div与span区别及用法
- apache conf Order Allow,Deny
- filter:alpha(opacity=60)只在IE起作用,如何在多浏览器中实现?
- ie6的padding加倍解决方法
- 怎样防上网页中图片过大撑破布局 100
- 解决IE中img.onload失效的方法
- 企业网站常用中英文对照
- dede怎样调用全站相关文章dede:likearticle
- dede {cmspath}的意思,DedeCms安装目录
- Jquery中$(document).ready()的作用类似于传统JavaScript中的window.onload方法
- 改dede留言板的分页标签样式 和留言条数
- dede调出文章的列表的内容出来,
- 网页中插入FLASH代码的参数解释与使用技巧
- dede:arclist标签按自定义字段排序orderby
- dedecms v5.6 dede5.7列表页标签{dede:list}增加按权重排序标签
- 最全前端问题及答案总结[转]
- css中的媒介查询
- java只有值传递,不存在引用传递