[eluser]sophistry[/eluser]
here's a hack the core way to do it, and just may fit your requirements:
EDIT: bah! ::bug:: the forum messed up the PHP code, but the important parts are still showing.
the smiley helper is just a silly old str_replace()
Code:
// ------------------------------------------------------------------------
/**
* Parse Smileys
*
* Takes a string as input and swaps any contained smileys for the actual image
*
* @access public
* @param string the text to be parsed
* @param string the URL to the folder containing the smiley images
* @return string
*/
if ( ! function_exists('parse_smileys'))
{
function parse_smileys($str = '', $image_url = '', $smileys = NULL)
{
if ($image_url == '')
{
return $str;
}
if ( ! is_array($smileys))
{
if (FALSE === ($smileys = _get_smiley_array()))
{
return $str;
}
}
// Add a trailing slash to the file path if needed
$image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url);
foreach ($smileys as $key => $val)
{
$str = str_replace($key, "<img />", $str);
}
return $str;
}
}
if you require that smileys be proceeded by a space character, then str_replace() will only find those and not the entities.
so, just put a space char in front of $key in the foreach loop:
Code:
// added spsce char to first param of str_replace()
$str = str_replace(' '.$key, "<img />", $str);
now that i am looking at this, it does seem that smiley helper should know this already! is it a bug?