예제 #1
0
파일: Conv.php 프로젝트: 3116246/haolinju
 public function replaceContent($str, $facepath_pre)
 {
     $pre = $facepath_pre;
     $str1 = $str;
     $str1 = \Justsy\BaseBundle\Common\KeywordFilter::filterKeyword($str1);
     $str1 = htmlentities($str1, ENT_QUOTES, "UTF-8");
     $str1 = preg_replace('/((?:https?|mailto):\\/\\/.*?)(\\s|&nbsp;|<br|\'|\\"|:|,|。|!|$)/', '<a href="\\1" title="\\1" target="_blank" style="padding: 2px; font-weight: normal;"><img src="' . $pre . '../link16.png"> 链接地址</a>\\2', $str1);
     $str1 = preg_replace("/@(.*?)((\\{[^\\{\\}]*\\})|(?=&nbsp;|<br|@|\\'|\"| |\\.|\\,|\\/|\\!|\\:|\$))/", '@<a href="#" class="employee_name">\\1\\3</a>\\4', $str1);
     $str1 = preg_replace(\Justsy\BaseBundle\Common\Face::getFaceEmoteReg_GIF(), \Justsy\BaseBundle\Common\Face::getFaceEmoteImg_GIF("<img alt='' style='height: 24px; width: 24px;' src='{$pre}[IMGSRC]'>"), $str1);
     return $str1;
 }