err, yes there is...
// // Convert a series of smilies to images // function do_smilies($text) { global $smiley_text, $smiley_img; $text = ' '.$text.' '; $num_smilies = count($smiley_text); for ($i = 0; $i < $num_smilies; ++$i) $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); return substr($text, 1, -1); }
Ah, good call.
Now how do I edit it to only parse a max of 5 emoticons per post?