当前位置: 代码迷 >> Web前端 >> dede目前位置去掉后面的>
  详细解决方案

dede目前位置去掉后面的>

热度:34   发布时间:2013-03-21 10:08:17.0
dede当前位置去掉后面的>
Dedecms当前位置{dede:field name='position'/}修改,如何去掉>
--------------------------
一、修改{dede:field name='position'/}的文字间隔符,官方默认的是>
?
?在include/typelink.class.php第101行左右将>修改为你想要的符号即可
?
二、去掉{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];
  相关解决方案