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

织梦织梦 插件plus文件调用头部尾部的方法织梦dedecms 插件plus文件调用头部尾部的方法 。 方法一: ... 2021-08-14
dedecms在IIS下不能生成HTML文件!我的服务器是WIN 2003 IIS PHP5 MYSQL5! 现在浏... 2021-07-22
DedeCMS“系统无此标签,可能已经移除”的解决方法今天在AB模板网开发新网站搜索标签的时候,居然有2个标签提示系统无此标... 2021-07-30
解决dedecms中不能解析.html扩展名的模板问题找到/include/arc.archives.class.php 把... 2021-07-22
DEDE织梦当前系统时间标签带时分:[field:pubdate function=GetDate... 2021-07-22
织梦dedecms在网站底部添加备案号链接到工信部的办法大家可能收到过这样的短信:根据《非经营性互联网信息服务备案管理方法》规... 2021-07-22
织梦dedecms5.7“不添加水印”功能勾选无效的解决办法织梦dedecms5.7不添加水印功能勾选无效的解决办法 找到incl... 2021-07-27
织梦DedeCMS首页登录后返回首页的方法织梦DedeCMS首页登录后,默认为登录到会员页面,想要返回到首页,解... 2021-07-22
dedecms实现自动打包文章中图片并下载的方法本文实例讲述了dedecms实现自动打包文章中图片并下载的方法。分享给... 2021-07-30
织梦CMS内容摘要字数限制不能自动换行今天遇到一个奇葩的问题,那就是在织梦 dedecms 针对 5.7 版... 2021-07-22
Dedecms5.7搜索结果页空白无内容的解决方法Dedecms5.7搜索结果页空白、没有内容的解决方法 许多网友在修改... 2021-07-22
织梦dedeCMS系统通过Tag标签获取相关文章织梦的相关文章是根据tag和文章关键词来的,不过效果不是特别的好,获取... 2021-07-27
dedecms标签:arclist文章列表调用标签标签名称:arclist 标记简介:织梦常用标记,也称为自由列表标记,... 2021-07-27
织梦搜索结果只能显示10条的问题在用 织梦模板 建站时,经常会用自己的个人模板,这里有个常见问题,当我... 2021-07-27
织梦Dedecms会员留言表被SQL注入如何快速删除Dedecms这款开源程序总会有很多漏洞让攻击者有机可乘,AB模板网也... 2021-07-30

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