帝国cms Smalltext 去除html 标签

找到文件 e\class\connect.php

//截取简介
function SubSmalltextVal($value,$len){
 if(empty($len))
 {
  return '';
 }
 $value=str_replace(array("\r\n","<br />","<br>","&nbsp;","[!--empirenews.page--]","[/!--empirenews.page--]"),array("","\r\n","\r\n"," ","",""),$value);
 $value=strip_tags($value);
 if($len)
 {
  $value=sub($value,0,$len,false);
 }
 $value=trim($value,"\r\n");
 $value=str_replace('&amp;ldquo;','&ldquo;',$value);
 $value=str_replace('&amp;rdquo;','&rdquo;',$value);
 $value=str_replace('&amp;mdash;','&mdash;',$value);
 return $value;
} 

替换成

//截取简介
function SubSmalltextVal($value,$len){
 if(empty($len))
 {
  return '';
 }
 //$value=str_replace(array("\r\n","<br />","<br>","&nbsp;","[!--empirenews.page--]","[/!--empirenews.page--]"),array("","\r\n","\r\n"," ","",""),$value);
 $value=str_replace(array("\r\n","<br />","<br>","&nbsp;","[!--empirenews.page--]","[/!--empirenews.page--]"),array("","",""," ","",""),$value);
 $value=strip_tags($value);
 if($len)
 {
  $value=sub($value,0,$len,false);
 }
 $value=trim($value,"\r\n");
 $value=str_replace('&amp;ldquo;','"',$value);
 $value=str_replace('&amp;rdquo;','"',$value); 
 $value=str_replace('&amp;mdash;','',$value);
     return $value;
} 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
方法: 1、先做两个标签 a、标签一(名字随意) 页面模板内容(*) [!--empirenews.listtemp--]<!--list.var1-->[!--empirenews.listtemp--] 列表内容模板(list.var) (*)       <div class="img_item">         <div><a ><img /></a></div>         <div class="desc">           <h5><a >[!--title--]</a></h5>           <p>[!--smalltext--]</p>           <div><a >                   <span><img /></span>[!--oldtitle--]</a></div>         </div>       </div> b、标签二(名字随意) 页面模板内容(*) [!--empirenews.listtemp--]<!--list.var1-->[!--empirenews.listtemp--] 列表内容模板(list.var) (*) <li><a ><img /></a></li> 2、将如下代码置入你要插入幻灯的位置!(温馨提示可以做成“模板变量”,方便修改呀!) <div class="c-cols-C1 c-section">         <div class="c-colB">                 <!-- HEADER_BEGIN 一屏滑动图片-->                           <div id="img_slide" class="md img_slide">     <div class="cons"><div class="con2">       [ecmsinfo]'2',7,16,0,12,33,1[/ecmsinfo]万能标签置入(对应标签一)     </div></div>     <div class="ctl_bar">       <ul class="imgs">             [ecmsinfo]'2',7,16,0,12,34,1[/ecmsinfo]万能标签置入(对应标签二)                 <li class="cur_box"><i></i></li>           </ul>     </div>   </div><!--remian-->                 <!-- HEADER_END 一屏滑动图片-->         </div>        </div> [removed][removed] 3、修改页面 a、在页面<head></head>处插入如下代码 [removed](function(){hp_theme_cookiename='hp_theme_id2';hp_layout_lstid_cookiename='hplayout_lstid'; hp_layout_lstid_i_cookiename='hplayout_lstid_i';hp_theme_default='blue'; get_theme_csspath=function(t){return"/skin/lvbihu/css/theme-" t "/theme.css";};var cc,Tp=';',c=hp_theme_cookiename '=',d=String([removed]);for(var e=-1;(e=d.indexOf(c,e 1))>=0;){var f=e;while(--f>=0){var g=d.charAt(f);if(g==Tp){f=-1;break}} if(f==-1){var h=d.indexOf(Tp,e);if(h<0){h=d.length} cc=d.substring(e c.length,h);break}} if(!cc){cc=hp_theme_default;window.theme_cookie_to_save=cc;} window.theme_cookie_str=cc;[removed]('<link href="' get_theme_csspath(cc) '" id="link_for_theme" rel="stylesheet" type="text/css" />');})();[removed] [removed][removed] b、在紧挨<body>下插入下面代码 [removed] var wr_Begin_Time = new Date().getTime(); [removed] 红色路径部分请根据自己实际情况调整! 如有问题请回贴,我尽量提供帮助! 附件为所需的js和css以及图片文件。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值