Heres one i made earlier:
PHP Code:
<?
function smilies($content) {
$content = str_replace(":)", "<IMG SRC=\"images/smile.gif\" alt=\"\">", $content);
$content = str_replace(":-)", "<IMG SRC=\"images/smile.gif\" alt=\"\">", $content);
$content = str_replace(":(", "<IMG SRC=\"images/sad.gif\" alt=\"\">", $content);
$content = str_replace(":-(", "<IMG SRC=\"images/sad.gif\" alt=\"\">", $content);
$content = str_replace(":o", "<IMG SRC=\"images/icon_surprised.gif\" alt=\"\">", $content);
$content = str_replace(":-o", "<IMG SRC=\"images/icon_surprised.gif\" alt=\"\">", $content);
$content = str_replace(":0", "<IMG SRC=\"images/icon_surprised.gif\" alt=\"\">", $content);
$content = str_replace(":D", "<IMG SRC=\"images/bigsmile.gif\" alt=\"\">", $content);
$content = str_replace(":-D", "<IMG SRC=\"images/bigsmile.gif\" alt=\"\">", $content);
$content = str_replace(":d", "<IMG SRC=\"images/bigsmile.gif\" alt=\"\">", $content);
$content = str_replace(":-d", "<IMG SRC=\"images/bigsmile.gif\" alt=\"\">", $content);
$content = str_replace(":p", "<IMG SRC=\"images/icon_razz.gif\" alt=\"\">", $content);
$content = str_replace(":-p", "<IMG SRC=\"images/icon_razz.gif\" alt=\"\">", $content);
$content = str_replace(":P", "<IMG SRC=\"images/icon_razz.gif\" alt=\"\">", $content);
$content = str_replace(":-P", "<IMG SRC=\"images/icon_razz.gif\" alt=\"\">", $content);
$content = str_replace(";)", "<IMG SRC=\"images/wink.gif\" alt=\"\">", $content);
$content = str_replace(";-)", "<IMG SRC=\"images/wink.gif\" alt=\"\">", $content);
$content = str_replace(":shocked:", "<IMG SRC=\"images/shocked.gif\" alt=\"\">", $content);
$content = str_replace(":rolleyes:", "<IMG SRC=\"images/rolleyes.gif\" alt=\"\">", $content);
$content = str_replace(":cool:", "<IMG SRC=\"images/cool.gif\" alt=\"\">", $content);
$content = str_replace(":angry:", "<IMG SRC=\"images/angry.gif\" alt=\"\">", $content);
return($content);
}
?>
As your posting the news / comment / anything your posting into the database, get the variable
$content = $_GET['content']; <-- that has been posted using a form
$content = smilies($content);
INSERT INTO...
Then once you pull it out of the database it will have the images

One thing you need to look out for though are the slashes!
PHP Code:
$content = $_GET['content'];
$content = smilies($content);
addslashes($content);
Then when drawing from the database in your "news" script:
PHP Code:
stripslashes($content);
echo("$content");
Hope that helps ya at all mate!