zoukankan      html  css  js  c++  java
  • dedecms _ 当前位置问题的代码

    {dede:field name='position' runphp='yes'}
        $tc=" > ";                  
        $tf=split($tc,@me);                        
        $tn=count($tf);
        for($iij=0;$iij<($tn-1);$iij++){
            if($iij==($tn-2)){$tf[$iij]=strip_tags($tf[$iij]);}
             $tl=$tl." > ".$tf[$iij]; 
        }
        @me=$tl;
       echo @me;
    {/dede:field}



    ------------------------------天王盖地虎------------------------------------


    方法一.Dedecms当前位置{dede:field name='position'/}

    方法二.dede:field name='position' runphp='yes'}

              $a=mb_strlen(@me);//计算字符串的长度

              @me=cn_substr(@me,$a-2,-1);//截取字符

             {/dede:field}

    (这是去掉“去掉>”得得方法)
    方法三.、{dede:field name='position'/} 中去掉 > 并去掉最后一个文本的链接的解决方案

         {dede:field name='position' runphp='yes'}

        $tc=" > ";                  

        $tf=split($tc,@me);                        

        $tn=count($tf);

        for($iij=0;$iij<($tn-1);$iij++){

            if($iij==($tn-2)){$tf[$iij]=strip_tags($tf[$iij]);}

            $tl=$tl.$tf[$iij];

        }

        @me=$tl;

       echo @me;

    {/dede:field}

    如果还需要分隔符的话,就把$tl=$tl.$tf[$iij]; 换成

    $tl=$tl."空格分隔符空格".$tf[$iij];

    方法四.

        您当前所在的位置:<a href="/">本站首页</a> >{dede:channel type='top' currentstyle="
                 <a href='~typelink~'>~typename~</a>
                  "}
                  {/dede:channel} >


    方法五.dede:channel currentstyle="
                 <a href='#'>~typename~</a>
                  "}
                  {/dede:channel}

    当前位置的    >  这个符号  可以在后台进行修改 

    人如代码,规矩灵活;代码如诗,字句精伦。
  • 相关阅读:
    SqlServer2005自动备份
    在Win7下运行使用BDE的程序
    Hibernate连接SqlServer时的小问题
    使用Delphi在SqlServer中对日期的设置
    Flex中连接J2ee的一个小问题
    np使用创建图像 霍夫圆检测 video操作,显示canny边缘
    Web.config的配置
    SQL 进制间如何转换
    jQuery 设置和获取HTML,文本和值
    通过LINQ to XML生成 XML
  • 原文地址:https://www.cnblogs.com/xinlinux/p/4028939.html
Copyright © 2011-2022 走看看