您当前的位置: 主页 > 优化教程
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="&quot;.str_replace(&quot;{page}&quot;,$prepagenum,$tnamerule).&quot;">".$uaprevious."</a></li>\r\n"; 
            $indexpage="<li><a href="&quot;.str_replace(&quot;{page}&quot;,1,$tnamerule).&quot;">".$uahome."</a></li>\r\n"; 
        } 
        else 
        { 
            $indexpage="<li>".$uahome."</li>\r\n"; 
        } 
 
        //下一页,未页的链接 
        if($this->PageNo!=$totalpage && $totalpage>1) 
        { 
            $nextpage.="<li><a href="&quot;.str_replace(&quot;{page}&quot;,$nextpagenum,$tnamerule).&quot;">".$uanext."</a></li>\r\n"; 
            $endpage="<li><a href="&quot;.str_replace(&quot;{page}&quot;,$totalpage,$tnamerule).&quot;">".$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="&quot;.str_replace(&quot;{page}&quot;,$mjj,$tnamerule).&quot;" selected="selected">$mjj</option>\r\n"; 
            } 
            else 
            { 
                $optionlist .= "<option value="&quot;.str_replace(&quot;{page}&quot;,$mjj,$tnamerule).&quot;">$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; 
            } 
        } 
        else 
        { 
            $j=1; 
            if($total_list>$totalpage) 
            { 
                $total_list=$totalpage; 
            } 
        } 
        for($j;$j<=$total_list;$j++) 
        { 
            if($j==$this->PageNo) 
            { 
                $listdd.= "<li class=\"thisclass\">$j</li>\r\n"; 
            } 
            else 
            { 
                $listdd.="<li><a href="&quot;.str_replace(&quot;{page}&quot;,$j,$tnamerule).&quot;">".$j."</a></li>\r\n"; 
            } 
        } 
        $plist = ''; 
        if(preg_match('/index/i', $listitem)) $plist .= $indexpage; 
        if(preg_match('/pre/i', $listitem)) $plist .= $prepage; 
        if(preg_match('/pageno/i', $listitem)) $plist .= $listdd; 
        if(preg_match('/next/i', $listitem)) $plist .= $nextpage; 
        if(preg_match('/end/i', $listitem)) $plist .= $endpage; 
        if(preg_match('/option/i', $listitem)) $plist .= $optionlist; 
        if(preg_match('/info/i', $listitem)) $plist .= $maininfo; 
         
        return $plist; 
    } 
 
2:{dede:field name='position'}中英文双语 
替换前面的“首页”两成“Home”就行了,后台的栏目用英文就行 
标签:{dede:field name='position'  function='str_replace("首页","Home",Html2Text("@me"))'/}
 

关键词:织梦,dedecms,做,英文,站,分页,、,当前,位置,    标签:
    更多资讯请收藏关注 网站模板(www.1yc.cn)

织梦上传本地视频后文件管理器中不显示解决办法以上传mp4文件为例 首先修改后台设置后才可以上传mp4文件 系统基本... 2021-07-22
织梦DedeCms如何获取缩略图的高度和宽度织梦DedeCms获取缩略图的高度和宽度 某些瀑布流的代码要求图片必须... 2021-07-22
dedecmsdedecmslist标签按照权重排序织梦默认的列表页排列顺序是按照时间修改顺序,但是有些产品的重要性是有区... 2021-08-09
dedecms织梦批量删除会员的后台SQL语句代码网站如果开启会员注册功能,将可能会被批量注册,如果需要删除这些会员,就... 2021-07-22
织梦DeDeCms织梦模板列表页隔行换色标签代码织梦DeDeCms列表页隔行换色标签代码: CSS代码: style ... 2021-07-22
织梦dedecms 循环+1的方法让dedecms autoindex,itemindex 从0到1开始... 2021-07-27
织梦教程发布文章未传图让其自动插入广告图的方法很多站长朋友发布文章的时候都喜欢插入几张图片,再在图片上打上网站的lo... 2021-08-14
DeDecms留言本未输入或验证码错误不返回的解决方法关于留言本未输入验证码或验证码错误不返回的问题 不知道大家有没有注意到... 2021-07-22
DedeCMS织梦模板快速批量删除所有未审核文档 评论的方法网站只要是开放会员系统,开放投稿功能,难免会遇到许多恶意注册的会员大量... 2021-07-22
dedecms内容列表orderby排序方式目前dede的排序只能有以下的排序方式: orderby=sortra... 2021-08-09
DEDECMS标题长度60字节限制解决办法dedecms 对文章的标题长度作了限制,最长为60字节,这显然不够用... 2021-07-27
织梦CMS有短标题则显示短标题,没有则显示文章标题织梦CMS有短标题则显示短标题,没有则显示文章标题: [field:a... 2021-08-14
dedecms列表页文章摘要字数的设置方法本文实例讲述了dedecms列表页文章摘要字数的设置方法。分享给大家供... 2021-07-27
DEDECMS显示英文日期时间的方法本文实例讲述了DEDECMS显示英文日期时间的方法。分享给大家供大家参... 2021-07-30
DEDECMS实现“文章标题-栏目名称-网站名”第一种: 在 /include/inc_archives_view.p... 2021-07-22
织梦会员投稿时增加金币或者积分改为管理员审核通过再增加很多站长朋友使用织梦(dedecms)程序做一些下载站,这些网站上面都... 2021-07-22
织梦修改默认keywords字符长度的方法关键词在搜索引擎优化这一方面有着非常重要的作用,简单来讲,关键词一般指... 2021-08-14

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