您当前的位置: 主页 > 优化教程
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织梦给后台管理员列表增加搜索功能最近用织梦系统给一个客户做了一个管理系统,客户分配的管理员账户达到了3... 2021-07-27
DedeCMS Error:Tag disabled:php错误的完整处理方法网站提示DedeCMS Error:Tag disabled:php ... 2021-08-09
DEDECMS织梦提示Fatal error: Call to a member错误怎么解决?在管理目录找到index_top.php,找开在96行找到如下代码: ... 2021-07-22
怎样DEDEcms修改取消或者替换子栏目列表名称中”/”符号在使用DEDECMS时,创建的子栏目列表名称是这样的例子:顶级栏目名称... 2021-07-22
实现DedeCMSv57缩略图自动裁剪自动适应比例教程实现DedeCMSv57缩略图自动裁剪自动适应比例教程。dedecms... 2021-08-09
织梦模板dedecms当前位置position标签代码的5种写法dede当前位置标签代码方法一: {dede:field name=p... 2021-07-22
如何修改DedeCms验证码的样式修改文件 验证码文件位置 include\validateimg.ph... 2021-07-30
织梦内容页调用会员的其他文章用织梦做装修站WEB开发时,内容页经常会用到设计师和相关案例的匹配,方... 2021-07-22
织梦channel导航标签不支持typeid指定栏目解决办法{/dede:channel} 但是很多情况下需要单独指定栏目(比如:... 2021-07-22
Dedecms教程:获取上一篇下一篇的URL地址有些客户问到dedecms是怎么调用上一篇下一篇的url地址的,只调用... 2021-08-14
dedecms问题Cannot modify header information headers already昨天使用appsevr本地架设一个站,因为需要调试一个页面模板,因此改... 2021-07-27
织梦文章模型文章转入新的自定义模型的方法教大家如何实现织梦文章模型文章转入新的自定义模型 假设以前的栏目为文章... 2021-07-22
织梦文章内容页{dede:memberinfos}标签不调用管理员的解决办法织梦文章内容页模板里面的{dede:memberinfos}标签默认是... 2021-07-30
织梦文章页怎么调用有相同tag标签或关键词的文章列表今天需要做一个视频栏目,相同的主题下有多个视频,想要实现类似连播的效果... 2021-07-22
织梦当天发布文章标题加红色(new)让每次到访网站的用户都能明显看到新增加的内容,这对用户体验来说是非常好... 2021-07-22
如何利用dedecms织梦模板autoindex属性让文章列表加上序号当我们在制作模板时,需要在文章标题前面加上序号,可以通过织梦自带的au... 2021-07-22
织梦取消article标签调用隐藏栏目的文章很多用 织梦模板 建站的站长在用article标签调用全站的最新文章时... 2021-07-22

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