您当前的位置: 主页 > 优化教程
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)

DedeCMS用channelartlist调用顶级栏目及列表这个标签全局都可使用,可以减少多次使用 {dede:arclist t... 2021-07-30
dedecms织梦模板后台编辑器将回车&amp;lt;br&amp;gt;改为&amp;lt;p&amp;gt;的方法DEDECMS编辑器默认回车[确认键]是返回br /这样的。 有时候我... 2021-07-22
如何让Dedecms留言板自动邮件通知管理员网站中使用较广泛的一种与用户沟通、交流的方式。一般都是通过留言板,留言... 2021-08-14
织梦安装访问提示(PHP 5.3 and above) Please XX部分DEDECMS程序在安装或访问的时候提示 (PHP 5.3 and... 2021-09-12
dedecms栏目列表页文章标题设置推荐后加粗的取消方法在织梦dedecms中,文章标题加粗可以在文章发布的时候设置加粗,还有... 2021-07-27
Dedecms5.7任意调整水印在图片的位置教程在使用DEDECMS过程中,本站发现,开启DEDECMS水印功能后,后... 2021-07-22
织梦教程:巧用sonchannel标签做三级菜单!导读:织梦怎么做三级菜单,这可能是很多人遇到过的问题,织梦确实不太好做... 2021-07-30
dedecms自动审核会员发表的最新文章实现方法本文介绍了dedecms中自动审核会员发表的最新文章的方法,DEDE的... 2021-07-22
织梦dedecms后台更新栏目提示:这个类目是动态类目的解决方法经常使用织梦dedecms程序建站的站长们都知道这款CMS程序功能强大... 2021-07-30
织梦dedecms友情链接调用方法织梦dedecms友情链接调用方法 {dede:flink type=... 2021-07-22
织梦 sql语句调用推荐图片小编打算做个功能, 在会员中心直接把指定带图片的文档调用出来,研究了下... 2021-08-14
织梦CMS实现复制文章自动加出处信息假如发现自己辛苦创作的很多文章被别人复制或者采集而去,一个链接都不留下... 2021-07-30
织梦DEDECMS自定义表单提示数据校验不对,程序自动返回怎么办?在做 织梦模板 网站建设时,涉及到dedecms自定义表单问题数据校验... 2021-07-22
让DEDECMS会员中,留言,订单等模板支持系统标签最近在仿员中心的时候发现默认会员模板中无法调用系统标签,记得之前有人教... 2021-07-27
织梦模板DEDE获取当前栏目ID适用于做banner的图片地址织梦获取当前栏目ID..适用于做banner判断不同的图片 {dede... 2021-07-22
如何修改dedecmsDEDECMS模板tags标签字数限制在织梦dedecms的TAG标签中默认字数较少,只能写12个字符,多出... 2021-08-09
DedeCMS教程:投票模块漏洞解决方法DedeCMS投票模块有朋友反映投票主题的选项经常被sql注入删除,经... 2021-07-22

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