ok i have this code right here its for the forum tags like [ b ] and so on. I want to make it so if a user puts in : ) it shows a gif pic of a smily face how would i do that. Here is the code i have
<?
$message = $parray['body'];
$preg = array(
// Font and text manipulation ( [color] [size] [font] [align] )
'/\[color=(.*?)(?::\w+)?\](.*?)\[\/color(?::\w+)?\]/si' => "<font color=\"\\1\">\\2</font>",
'/\[color=(.*?)(?::\w+)?\](.*)$/si' => "<font color=\"\\1\">\\2</font>",
'/\[size=(.*?)(?::\w+)?\](.*?)\[\/size(?::\w+)?\]/si' => "<font size=\"\\1\">\\2</font>",
'/\[size=(.*?)(?::\w+)?\](.*)$/si' => "<font size=\"\\1\">\\2</font>",
'/\[font=(.*?)(?::\w+)?\](.*?)\[\/font(?::\w+)?\]/si' => "<font face=\"\\1\">\\2</font>",
'/\[font=(.*?)(?::\w+)?\](.*)$/si' => "<font face=\"\\1\">\\2</font>",
'/\[bgcolor=(.*?)(?::\w+)?\](.*?)\[\/bgcolor(?::\w+)?\]/si' => "<font style=\"background-color:\\1;\">\\2</font>",
'/\[bgcolor=(.*?)(?::\w+)?\](.*)$/si' => "<font style=\"background-color:\\1;\">\\2</font>",
'/\[b(?::\w+)?\](.*?)\[\/b(?::\w+)?\]/si' => "<b>\\1</b>",
'/\[b\](.*)$/si' => "<b>\\1</b>",
'/\[s(?::\w+)?\](.*?)\[\/s(?::\w+)?\]/si' => "<strike>\\1</strike>",
'/\[s\](.*)$/si' => "<strike>\\1</strike>",
'/\[i(?::\w+)?\](.*?)\[\/i(?::\w+)?\]/si' => "<i>\\1</i>",
'/\[i\](.*)$/si' => "<i>\\1</i>",
'/\[u(?::\w+)?\](.*?)\[\/u(?::\w+)?\]/si' => "<u>\\1</u>",
'/\[u\](.*)$/si' => "<u>\\1</u>",
'/\[align=(.*?)(?::\w+)?\](.*?)\[\/align(?::\w+)?\]/si' => "<div style=\"text-align:\\1\">\\2</div>",
'/\[align=(.*?)(?::\w+)?\](.*)$/si' => "<div style=\"text-align:\\1\">\\2</div>",
//'/\[center(?::\w+)?\](.*?)\[\/center(?::\w+)?\]/si' => "<center>\\1</center>",
//'/\[center\](.*)$/si' => "<center>\\1</center>",
'/\[user=(.*?)(?::\w+)?\]/si' => '<a href="/fullview.php?id=\\1">\\1</a>',
// [url]
'/\[url(?::\w+)?\]www\.(.*?)\[\/url(?::\w+)?\]/si' => "<a href=\"http://www.\\1\" target=\"_blank\">\\1</a>",
'/\[url=www\.(.*?)(?::\w+)?\](.*?)\[\/url(?::\w+)?\]/si' => "<a href=\"http://www.\\1\" target=\"_blank\">\\2</a>",
'/\[url(?::\w+)?\](.*?)\[\/url(?::\w+)?\]/si' => "<a href=\"\\1\" target=\"_blank\">\\1</a>",
'/\[url=(.*?)(?::\w+)?\](.*?)\[\/url(?::\w+)?\]/si' => "<a href=\"\\1\" target=\"_blank\">\\2</a>",
'/\[url\](.*?)/si' => "<a href=\"\\1\">\\1</a>",
'/\[url=(.*?)(?::\w+)?\](.*?)/si' => "<a href=\"\\1\" target=\"_blank\">\\2</a>",
'/\[url=www\.(.*?)(?::\w+)?\](.*?)/si' => "<a href=\"http://www.\\1\">\\2</a>",
// [img]
'/\[img(?::\w+)?\](.*?)\[\/img(?::\w+)?\]/si' => "<img src=\"\\1\" border=\"0\" />",
// [quote]
'/\[quote(?::\w+)?\](.*?)\[\/quote(?::\w+)?\]/si' => "<div class=\"quote\"><i>Quote</i>:<div class=\"quotebody\">\\1</div></div>",
'/\[quote=(?:"|"|\')?(.*?)["\']?(?:"|"|\')?\](.*?)\[\/quote(?::\w+)?\]/si' => "<div class=\"quote\"><i>Originally posted by</i> <b>\\1</b>:<div class=\"quotebody\">\\2</div></div>",
//the following lines clean up our output a bit
'/<ol(.*?)>(?:.*?)<li(.*?)>/si' => "<ol\\1><li\\2>",
'/<ul(.*?)>(?:.*?)<li(.*?)>/si' => "<ul\\1><li\\2>"
);
$body = preg_replace(array_keys($preg), array_values($preg), $message);
$body = preg_replace("/\[\/(.*?)\]/si", "", $body);
$blocks = $row['blocks'];
$blocks = explode(";", $blocks);