您当前的位置: 主页 > 优化教程
在英文站中列表分页导航出现“首页 上一页 下一页 末页”,当前位置:首页>about>,这样的问题改如何解决呢?本文就来解决一下这两个问题。
 
1:列表分页英文设置教程
用arc.listview.class.php覆盖include/arc.listview.class.php
 
调用方法:
{dede:pagelist listsize='5'/}
{dede:pagelist pagelang='en' listsize='5'/} 
pagelang:en为英文,cn为中文,默认语言中文
 
扩展阅读:
/**
     *  获取静态的分页列表
     *
     * @access    public
     * @param     string  $list_len  列表宽度
     * @param     string  $list_len  列表样式
     * @return    string
     */
    function GetPageListST($list_len,$listitem="index,end,pre,next,pageno",$pagelang)
    {
                    /*****************************************************************************************/
                      if($pagelang='cn'){
                                $uahome="首页";
                               $uaprevious="上一页";
                               $uanext="下一页";
                               $ualastpage="末页";
                               $uapage="页";
                               $uatotal="共";
                               $uarecords="条记录";
                            }else{
                              $uahome=" Home ";
                               $uaprevious=" Previous ";
                               $uanext=" Next ";
                               $ualastpage=" Last Page ";
                               $uapage=" Page ";
                               $uatotal=" Total ";
                               $uarecords=" Records. ";
                          }
                    
        $prepage = $nextpage = '';
        $prepagenum = $this->PageNo-1;
        $nextpagenum = $this->PageNo+1;
        if($list_len=='' || ereg("[^0-9]",$list_len))
        {
            $list_len=3;
        }
        $totalpage = ceil($this->TotalResult/$this->PageSize);
        if($totalpage<=1 && $this->TotalResult>0)
        {
           return "<li><span class=\"pageinfo\">".$uatotal." <strong>1</strong> ".$uapage." <strong>".$this->TotalResult."</strong> 
 
".$uarecords."</span></li>\r\n";
        }
        if($this->TotalResult == 0)
        {
        return "<li><span class=\"pageinfo\">".$uatotal." <strong>0</strong> ".$uapage." <strong>".$this->TotalResult."</strong> 
 
".$uarecords."</span></li>\r\n";
  
        }
        $purl = $this->GetCurUrl();
              $maininfo = "<li><span class=\"pageinfo\">".$uatotal." <strong>{$totalpage}</strong> ".$uapage." <strong>".$this->TotalResult."</strong> 
 
".$uarecords."</span></li>\r\n";
           
        $tnamerule = $this->GetMakeFileRule($this->Fields['id'],"list",$this->Fields['typedir'],$this->Fields['defaultname'],$this->Fields
 
['namerule2']);
        $tnamerule = ereg_replace('^(.*)/','',$tnamerule);
 
        //获得上一页和主页的链接
        if($this->PageNo != 1)
        {
            $prepage.="<li><a href='".str_replace("{page}",$prepagenum,$tnamerule)."'>".$uaprevious."</a></li>\r\n";
            $indexpage="<li><a href='".str_replace("{page}",1,$tnamerule)."'>".$uahome."</a></li>\r\n";
        }
        else
        {
            $indexpage="<li>".$uahome."</li>\r\n";
        }
 
        //下一页,未页的链接
        if($this->PageNo!=$totalpage && $totalpage>1)
        {
            $nextpage.="<li><a href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>".$uanext."</a></li>\r\n";
            $endpage="<li><a href='".str_replace("{page}",$totalpage,$tnamerule)."'>".$ualastpage."</a></li>\r\n";
        }
        else
        {
            $endpage="<li>".$ualastpage."</li>\r\n";
        }
 
        //option链接
        $optionlist = '';
 
        $optionlen = strlen($totalpage);
        $optionlen = $optionlen*12 + 18;
        if($optionlen < 36) $optionlen = 36;
        if($optionlen > 100) $optionlen = 100;
        $optionlist = "<li><select name='sldd' style='width:{$optionlen}px' onchange='location.href=this.options[this.selectedIndex].value;'>\r\n";
        for($mjj=1;$mjj<=$totalpage;$mjj++)
        {
            if($mjj==$this->PageNo)
            {
                $optionlist .= "<option value='".str_replace("{page}",$mjj,$tnamerule)."' selected>$mjj</option>\r\n";
            }
            else
            {
                $optionlist .= "<option value='".str_replace("{page}",$mjj,$tnamerule)."'>$mjj</option>\r\n";
            }
        }
        $optionlist .= "</select></li>\r\n";
 
        //获得数字链接
        $listdd="";
        $total_list = $list_len * 2 + 1;
        if($this->PageNo >= $total_list)
        {
            $j = $this->PageNo-$list_len;
            $total_list = $this->PageNo+$list_len;
            if($total_list>$totalpage)
            {
                $total_list=$totalpage;


关键词:网站建设,网站设计,网站制作,网站优化    标签:
    更多资讯请收藏关注 网站模板(www.1yc.cn)

织梦dede备份数据库表结构空间数据库名不能有中横线如果你的织梦数据库名有中横线的话,你后台备份数据,表结构只有几行,没有... 2021-07-22
Pbootcms调用正副标题和摘要字数限制的技巧长度截取使用len=* 或 lencn=* ,使用第二个将避免中英文长... 2022-05-07
织梦添加一个函数,实现任意字段调用先上代码 function table($table, $field,... 2021-07-22
dedecms列表页和内容页调用顶级栏目ID的方法dedecms 织梦模板 中添加顶级栏目id的方法总结,使用dede顶... 2021-07-22
织梦dedecms php常用函数function checkStr($str){ $output=; ... 2021-07-30
针对织梦程序列表字段内可有可无的显示方法这个方法就和Dedecms的文章列表没有缩略图的不显示图片,如果有缩略... 2021-08-14
织梦后台编辑器回车的换行怎么修改为换段落对于dedecms后台编辑器回车的换行怎么修改为换段落的这个问题,这边... 2021-08-14
织梦tag显示每个tag相应的文章数量有些时候我们想实现类似于wordpress那样的tag,就是在显示ta... 2021-08-14
dedecms的sql标签中传入参数的方法本文实例讲述了dede:sql标签中传入参数的方法。分享给大家供大家参... 2021-07-27
织梦DEDECMS模板中内容页分页数目太多时自动隐藏的方法在dede程序的文章或图集模型,内容页分页过多,假如分页80页,那么d... 2021-07-22
dedecms 调用文章简介[field:description /]如何限制字数在用 织梦模板 时,用[field:description /]标签调... 2021-07-30
织梦模板标签的书写格式以及注意事项一、 织梦模板 标签的书写格式以及注意事项: 1. 书写格式: ① {... 2021-07-27
DedeCms Runphp 标签中调用其他变量的方法DedeCms Runphp 标签中调用其他变量的方法 我们都知道,在... 2021-07-22
织梦后台编辑器div标签自动转P标签的方法从记事本里复制的文字。放到编辑器发布后。段落会自动加上DIV。下面方法... 2021-07-22

线
咨询热线:
135-0038-3336
在线客服:
点击这里给我发消息
微信交流:
公司官网: www.1yc.cn