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

织梦dede手机站关闭自动生成首页index.html织梦dede的手机站,如果你的PC站首页用的生成静态,那么手机站m文件... 2021-07-22
织梦dedeCMS搜索时间间隔如何修改我们大家是否经常碰到这样的为,如果想用 织梦模板 的搜索功能搜索某些关... 2021-07-27
DEDE织梦文章列表中添加hot和new图标方法或许我们经常浏览网页发现文章列表中出现有new或者hot字样,对于织梦... 2021-07-27
织梦dedecms用于dede:channel 的数字递增调用方法dede织梦用于dede:channel 的数字递增调用方法 在inc... 2021-07-27
dedecmscms文章如没有上传图片,则自动替换为百度/谷歌广告的方法织梦DedeCMS发布文档时有的上传有图片,有的没有图片,没有图片的文... 2021-08-09
织梦模板DedeCMS新增调用栏目内容标签typecontent的用法此标签是在上一版本上拓展而来。 用途:任意位置调用栏目内容 示例:{d... 2021-07-22
织梦dede编辑器附件和自定义字段附件上传文件点击无反应dede编辑器上的【附件】或者自定义字段【附件类型】,刚刚上传的文件不... 2021-07-22
取消DEDECMS织梦栏目列表页文章标题设置推荐后的加粗的方法织梦dedecms的文章标题加粗可以在文章发布的时候设置加粗,还有选择... 2021-07-22
dede织梦 {dede:channelartlist}标签栏目序号调用方法dedecms频道模板中调用栏目分类并排序: {dede:channe... 2021-07-22
织梦模板dede:arclist 标签排序具体实现教程标签dede:arclist的排序是通过orderby来指定的,如下:... 2021-07-22
织梦头部导航通过在标签加判断实现高亮显示教程当我们用 织梦模板 建站时,经常遇到当前导航高亮的调用,用JS方式也能... 2021-07-22
dedecms织梦图片(仅网址)自定义字段远程图片保存只有数字的解决方法织梦后台模型添加自定义字段【图片(仅网址)】类型时,添加文档如果填的是... 2021-07-22
dedecms怎么快速删除指定ip发表的评论很多的站长朋友都有 织梦模板 进行建站,但是站长朋友们要保留文章留言的... 2021-07-30
织梦用sql命令删除系统全局自定义变量如果后台添加变量后不想要了,可删除。有两种方法,一种是直接登录数据库,... 2021-07-22
如何防止织梦程序被注册机的恶意注册发信息织梦cms喜欢被注册机的恶意注册和发贴是很多织梦模板的使用者所头疼的问... 2021-07-22
如何在dede:channel 调用{dede:field.seotitle/}网上很多人说 dede:channel 调用{dede:field.s... 2021-08-14
DedeCMS注册会员默认100积分不能修改的解决办法织梦后台的会员级别设置里面的注册会员默认积分100是不能修改的,即使改... 2021-07-30
关于DEDECMS的URL优化的一些心得从07年进入站长行列以来已经差都十几年了,从之前的对做站的一窍不通到慢... 2021-07-22
DEDECMS 如何修改系统默认style文件夹要修改系统默认文件夹,必须首先得了解相关配置文件的功能作用: ./da... 2021-07-30

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