Before it is outputted, you need to pass it through str_replace:
code:
$search = array('','');
$replace = array('<img src="img/tongue.gif">', '<img src="img/smile.gif">');
echo str_replace($search, $replace, $post):
That's an example of using it... customise it for yourself. You could also add the image code to each as you replace it in by doing a foreach loop