织梦cms

推荐列表 站点导航

当前位置:首页 > 建站教程 > 织梦cms >

织梦中通过dede:pagelist实现中英文分页效果

来源:网络整理  作者:  发布时间:2020-12-18 14:57
效果如下: 首先需要找到安装目录下的include/arc.listview.class.php 上面代码已经做了如下的修改: 1、添加变量$pagelang...

$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;

 织梦中通过dede:pagelist实现中英文分页效果

 $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 = '';

{

 织梦中通过dede:pagelist实现中英文分页效果

注意是修改方法的参数,为其添加$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="共";

}

相关热词: 织梦 dede 分页

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://www.juheyunku.com/jz/dedecms/5226.shtml

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

织梦中通过dede:pagelist实现中英文分页效果

2020-12-18 编辑:

$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;

 织梦中通过dede:pagelist实现中英文分页效果

 $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 = '';

{

 织梦中通过dede:pagelist实现中英文分页效果

注意是修改方法的参数,为其添加$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

相关文章

风云图片

推荐阅读

返回织梦cms频道首页