Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 public function replaceFaceEmote($str)
 {
     $pre = $this->get('templating.helper.assets')->geturl('bundles/fafatimewebase/images/face/');
     $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" target="_blank">\\1</a>\\2', $str1);
     $str1 = preg_replace("/@(.*?)(&nbsp;|<br|\\'|\"| |\\.|\\,|\\/|\\!|\\:|\\;|:|,|。|!|\$)/", '@<a href="#" class="employee_name">\\1</a>\\2', $str1);
     $str1 = preg_replace(\Justsy\BaseBundle\Common\Face::getFaceEmoteReg(), \Justsy\BaseBundle\Common\Face::getFaceEmoteImg("<img alt='' src='{$pre}[IMGSRC]'>"), $str1);
     return $str1;
 }