punbb/include/parser.php
changeset 3 c0c445d4a13e
parent 0 f9ffdbd96607
equal deleted inserted replaced
2:a8a21e1c7afa 3:c0c445d4a13e
   361 
   361 
   362 	$text = ' '.$text.' ';
   362 	$text = ' '.$text.' ';
   363 
   363 
   364 	$num_smilies = count($smiley_text);
   364 	$num_smilies = count($smiley_text);
   365 	for ($i = 0; $i < $num_smilies; ++$i)
   365 	for ($i = 0; $i < $num_smilies; ++$i)
   366 		$text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);
   366 		$text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="' . scriptPath . '/punbb/img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);
   367 
   367 
   368 	return substr($text, 1, -1);
   368 	return substr($text, 1, -1);
   369 }
   369 }
   370 
   370 
   371 
   371