织梦中通过dede:pagelist实现中英文分页效果
$nextpage.="<li><a href='".$purl."PageNo=$nextpagenum'>".$uanext."</a></li>\r\n";
}
$uanext="下一页";
//下一页,未页的链接
* @param string $list_len 列表样式
if($pagelang=='en'){
}
{
* @access public
$total_list=$totalpage;
* 获取静态的分页列表
$listdd="";
else
{
* @param string $list_len 列表样式
}
if(eregi('next',$listitem)) $plist .= $nextpage;
}
if($list_len=='' || ereg("[^0-9]",$list_len))
if($pagelang=='en'){
{
function GetPageListDM($list_len,$listitem="index,end,pre,next,pageno",$pagelang)
if(eregi('info',$listitem)) $plist .= $maininfo;
{
$listdd.= "<li class=\"thisclass\"><a>$j</a></li>\r\n";
//option链接
{
$maininfo = "<li><span class=\"pageinfo\">".$uatotal." <strong>{$totalpage}</strong>".$uapage."<strong>".$this->TotalResult."</strong>".$uarecords."</span></li>\r\n";
}
$ualastpage="末页";
if($this->PageNo >= $total_list)
$optionlist = '';
{
if($this->PageNo!=$totalpage && $totalpage>1)
$plist = '';
{
return "<li><span class=\"pageinfo\">".$uatotal." 1 ".$uapage."/".$this->TotalResult."".$uarecords."</span></li>\r\n";
$totalpage = ceil($this->TotalResult/$this->PageSize);
//获得数字链接
return "<li><span class=\"pageinfo\">".$uatotal." 0 ".$uapage."/".$this->TotalResult."".$uarecords."</span></li>\r\n";
if($cfg_rewrite == 'Y')
//获得上一页和下一页的链接
if($total_list>$totalpage)
}
if(eregi('pre',$listitem)) $plist .= $prepage;
}
}
if(eregi('index',$listitem)) $plist .= $indexpage;
{
{
if(eregi('pageno',$listitem)) $plist .= $listdd;
}
* @access public
$uarecords="条记录";
$prepagenum = $this->PageNo-1;
$plist = str_replace('.php?tid=', '-', $plist);
if($cfg_rewrite == 'Y')
$optionlist .= "<option value='".str_replace("{page}",$mjj,$tnamerule)."'>$mjj</option>\r\n";
$optionlen = $optionlen*12 + 18;
{
if(eregi('option',$listitem)) $plist .= $optionlist;
/**
$uaprevious=" Previous ";
{
$nextpagenum = $this->PageNo+1;
{
$ualastpage=" Last Page ";
$nextpagenum = $this->PageNo+1;
* @return string
if($this->PageNo!=$totalpage && $totalpage>1)
上面代码已经做了如下的修改:
$nowurls = explode("?", $nowurls);
}
}
if($optionlen < 36) $optionlen = 36;
if(eregi('pageno',$listitem)) $plist .= $listdd;
if($j==$this->PageNo)
if($total_list>$totalpage)
*/
$uatotal="共";
}
$endpage="<li><a href='".$purl."PageNo=$totalpage'>".$ualastpage."</a></li>\r\n";
* @param string $list_len 列表宽度
if($this->PageNo != 1)
$indexpage="<li>".$uahome."</li>\r\n";
2、从页面中读取数据,并去除空格
$optionlist .= "<option value='".str_replace("{page}",$mjj,$tnamerule)."' selected>$mjj</option>\r\n";
for($mjj=1;$mjj<=$totalpage;$mjj++)
$nextpage.="<li><a href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>".$uanext."</a></li>\r\n";
$listdd.="<li><a href='".str_replace("{page}",$j,$tnamerule)."'>".$j."</a></li>\r\n";
}
{
{
}
$uanext="下一页";
$purl = $this->GetCurUrl();
if($total_list>$totalpage)
{
$uapage=" Page ";
else
}
$optionlist = '';
}
* @return string
if($optionlen > 100) $optionlen = 100;
{
{
$uahome="首页";
首先需要找到安装目录下的include/arc.listview.class.php
$total_list=$totalpage;
$uarecords=" Records. ";
1、添加变量$pagelang
$list_len=3;
}
$total_list = $this->PageNo+$list_len;

$uahome="首页";
$prepage.="<li><a href='".str_replace("{page}",$prepagenum,$tnamerule)."'>".$uaprevious."</a></li>\r\n";
$total_list=$totalpage;
$nowurls = ereg_replace("\-", ".php?", $purl);
{
$prepagenum = $this->PageNo-1;
$uanext=" Next ";
else
{
$uahome=" Home ";
/*****************************************************************************************/
$prepage = $nextpage = '';
$optionlist = "<li><select name='sldd' style='width:{$optionlen}px' onchange='location.href=this.options[this.selectedIndex].value;'>\r\n";
}
{
for($j;$j<=$total_list;$j++)
}
}
$indexpage="<li><a>".$uahome."</a></li>\r\n";
$indexpage="<li><a href='".$purl."PageNo=1'>".$uahome."</a></li>\r\n";
if(eregi('option',$listitem)) $plist .= $optionlist;
在页面中可以调用
{
//获取静态的分页列表
}
}
//$hidenform .= "<input type='hidden' name='TotalResult' value='".$this->TotalResult."'>\r\n";
*
$uarecords="条记录";
/*****************************************************************************************/
$uatotal=" Total ";
$optionlist .= "</select></li>\r\n";
$uarecords=" Records. ";
$uaprevious="上一页";
$purl .= '?'.$geturl;
if($this->PageNo >= $total_list)
}
$uahome=" Home ";
if(eregi('next',$listitem)) $plist .= $nextpage;
{
if(eregi('info',$listitem)) $plist .= $maininfo;
else
global $cfg_rewrite;
{
$plist = preg_replace("/&PageNo=(\d+)/i",'-\\1.html',$plist);
$j=1;
}
*
if(eregi('index',$listitem)) $plist .= $indexpage;
{dede:pagelist listsize='5'/}{
}
}
$total_list = $list_len * 2 + 1;
}
$listdd.= "<li class=\"thisclass\">$j</li>\r\n";
else
{
$plist = str_replace('&TotalResult=', '-', $plist);
if($list_len=='' || ereg("[^0-9]",$list_len))
$endpage="<li><a>".$ualastpage."</a></li>\r\n";
if($total_list>$totalpage)
*/
return "<li><span class=\"pageinfo\">".$uatotal." <strong>0</strong> ".$uapage." <strong>".$this->TotalResult."</strong> ".$uarecords."</span></li>\r\n";
}else{
$tnamerule = ereg_replace('^(.*)/','',$tnamerule);
}
}
//获得数字链接
if($mjj==$this->PageNo)
}
{
//$hidenform = "<input type='hidden' name='tid' value='".$this->TypeID."'>\r\n";
else
$uaprevious=" Previous ";
$prepage.="<li><a href='".$purl."PageNo=$prepagenum'>".$uaprevious."</a></li>\r\n";
{
$maininfo = "<li><span class=\"pageinfo\">".$uatotal." <strong>{$totalpage}</strong> ".$uapage." <strong>".$this->TotalResult."</strong> ".$uarecords."</span></li>\r\n";
$purl = $this->GetCurUrl();
$j = $this->PageNo-$list_len;
$j=1;
}
else
3、找到里面的2个同名方法 GetPageListDM()--动态和静态的
}
}
$uanext=" Next ";
{
$tnamerule = $this->GetMakeFileRule($this->Fields['id'],"list",$this->Fields['typedir'],$this->Fields['defaultname'],$this->Fields['namerule2']);
//获得上一页和主页的链接
pagelang:en为英文,cn为中文,默认语言中文$listdd="";
$uapage=" Page ";
$uapage="页";
}
for($j;$j<=$total_list;$j++)
{
$total_list = $this->PageNo+$list_len;
if($totalpage<=1 && $this->TotalResult>0)
if($this->TotalResult == 0)
$endpage="<li>".$ualastpage."</li>\r\n";
$total_list=$totalpage;
$prepage = $nextpage = '';
{

注意是修改方法的参数,为其添加$pagelang个参数;
$uatotal=" Total ";
$indexpage="<li><a href='".str_replace("{page}",1,$tnamerule)."'>".$uahome."</a></li>\r\n";
* 获取动态的分页列表
}
return $plist;
$ualastpage=" Last Page ";
$uapage="页";
return $plist;
$uaprevious="上一页";
{
{
$purl = $nowurls[0];
将里面的方法进行如下替换
if(eregi('end',$listitem)) $plist .= $endpage;
$ualastpage="末页";
$list_len=3;
function GetPageListST($list_len,$listitem="index,end,pre,next,pageno",$pagelang)
if(eregi('pre',$listitem)) $plist .= $prepage;
$optionlen = strlen($totalpage);
{
}else{
if($j==$this->PageNo)
* @param string $list_len 列表宽度
$plist = '';
$totalpage = ceil($this->TotalResult/$this->PageSize);
{dede:pagelist pagelang='en' listsize='5'/}
if($this->TotalResult == 0)
$endpage="<li><a href='".str_replace("{page}",$totalpage,$tnamerule)."'>".$ualastpage."</a></li>\r\n";
else
if($totalpage<=1 && $this->TotalResult>0)
$listdd.="<li><a href='".$purl."PageNo=$j'>".$j."</a></li>\r\n";
$geturl = "tid=".$this->TypeID."&TotalResult=".$this->TotalResult."&";
/**
return "<li><span class=\"pageinfo\">".$uatotal." <strong>1</strong> ".$uapage." <strong>".$this->TotalResult."</strong> ".$uarecords."</span></li>\r\n";
{
}
if($this->PageNo != 1)
{
else
$total_list = $list_len * 2 + 1;
if(eregi('end',$listitem)) $plist .= $endpage;
$j = $this->PageNo-$list_len;
$uatotal="共";
}
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://www.juheyunku.com/jz/dedecms/5226.shtml
相关文章
热门TAG
命令 权重 外链 企业网站 白帽 php 织梦教程 dedecms修改内容 javascript 织梦 功能 标签 调用 详解 服务器 网站流量 实例解析 Dedecms 织梦cms HTML tags标签 python jquery教程 jquery windows SEO优化 蜘蛛 搜索引擎 网站收录 JSP最新文章
-
织梦友情链接调用和图片
时间:2020-12-29
-
dedecms织梦会员登录二级域
时间:2020-12-29
-
织梦cms手机站首页不更新
时间:2020-12-29
-
织梦DEDECMS提示信息提示框
时间:2020-12-24
-
使用织梦cms做多语言的网
时间:2020-12-24
-
织梦去掉上传图片的水印
时间:2020-12-24
-
DedeCMS Error:Tag disabled:"p
时间:2020-12-24
-
DEDECMS图文分离存放在另一
时间:2020-12-24
热门文章
-
DedeCMS站点高级安全策略(Linux篇)
时间:2020-12-16
-
阿里云主机安装织梦系统出现data无写入权
时间:2020-12-17
-
织梦教程:织梦怎么整合Discuz站点
时间:2020-12-14
-
织梦批量删除文章内容数据库里所有超链
时间:2020-12-17
-
织梦dedecms系统UTF8版编辑器中多图发布按
时间:2020-12-16
-
织梦更换UEditor编辑器后栏目内容、单页无
时间:2020-12-17
-
织梦关键词自动添加链接设置方法
时间:2020-12-15
-
如何防止别人盗用你的织梦模板
时间:2020-12-14
-
织梦dedecms熊掌号时间因子改造教程
时间:2020-12-13
-
DedeCms织梦系统后台把某篇文章设置置顶
时间:2020-12-15
