正则提取主帖里的提示,放到想要的位置,原来位置的过滤掉,如果匹配不到提示标签就用$psot[message]。
主帖位置的$psot[message]替换为:
- <!--{eval $preg_message = '/\<i class\=\"pstatus\"\>(.*?)\<\/i\>/si';preg_match_all($preg_message, $post[message], $lastedit);}-->
- <!--{if $lastedit[1][0]}-->
- <!--{eval $preg_guolv = preg_replace("/\<i class\=\"pstatus\"\>(.*?)\<\/i\>/si","","$post[message]");$preg_mes=substr($preg_guolv,13);}-->
- <!--{$preg_mes}-->
- <div class="alert alert-success"><a href="#" class="close" data-dismiss="alert">×</a><!--{$lastedit[1][0]}--></div>
- <!--{else}-->
- <!--{$post[message]}-->
- <!--{/if}-->
回帖里过滤不显示,回帖位置的$psot[message]替换为:
- <!--{eval $preg_message = '/\<i class\=\"pstatus\"\>(.*?)\<\/i\>/si';preg_match_all($preg_message, $post[message], $lastedit);}-->
- <!--{if $lastedit[1][0]}-->
- <!--{eval $preg_guolv = preg_replace("/\<i class\=\"pstatus\"\>(.*?)\<\/i\>/si","","$post[message]");$preg_mes=substr($preg_guolv,13);}-->
- <!--{$preg_mes}-->
- <!--{else}-->
- <!--{$post[message]}-->
- <!--{/if}-->