here is the bbcode function..
function getbbcode($text, $sid="")
{
$unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM hfjgn_private WHERE unread='1' AND touid='".$uid."'"));
$pmtotl=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM hfjgn_private WHERE touid='".$uid."'"));
$unrd="[".$unreadinbox[0]."l".$pmtotl[0]."]";
$text = preg_replace("/\[inbox]/is","<a href=\"121inbox121.php?action=main&sid=$sid\">Inbox $unrd</a>",$text);
$text = preg_replace("/\[updatepro]/is","<a href=\"index.php?action=uset&sid=$sid\">Update Profie</a>",$text);
$text = preg_replace("/\[image\=((.*?)(.php|php4|php5|xhtml|html))\]/i","Im trying To Hack", $text);
$text = preg_replace("/\[b\](.*?)\[\/b\]/i","<b>\\1</b>", $text);
$text = preg_replace("/\[i\](.*?)\[\/i\]/i","<i>\\1</i>", $text);
$text = preg_replace("/\[u\](.*?)\[\/u\]/i","<u>\\1</u>", $text);
$text = preg_replace("/\[big\](.*?)\[\/big\]/i","<big>\\1</big>", $text);
$text = preg_replace("/\[small\](.*?)\[\/small\]/i","<small>\\1</small>", $text);
$text=ereg_replace("http://[A-Za-z0-9./=?-_]+","<a href=\"\\0\">\\0</a>", $text);
//$text=preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is","<a href=\"http://$1\">$2</a>",$text);
$text = preg_replace("/\[img\=(.*?)\]/is","<img src=\"$1\">",$text);
$text = preg_replace("/\[clr\=(.*?)\](.*?)\[\/clr\]/is","<font color=\"$1\">$2</font>",$text);
$text = preg_replace("/\[topic\=(.*?)\](.*?)\[\/topic\]/is","<a href=\"index.php?action=viewtpc&tid=$1&sid=$sid\">$2</a>",$text);
$text = preg_replace("/\[forum\=(.*?)\](.*?)\[\/forum\]/is","<a href=\"index.php?action=viewfrm&tid=$1&sid=$sid\">$2</a>",$text);
$text = preg_replace("/\[club\=(.*?)\](.*?)\[\/club\]/is","<a href=\"index.php?action=gocl&clid=$1&sid=$sid\">$2</a>",$text);
$text = preg_replace("/\[blog\=(.*?)\](.*?)\[\/blog\]/is","<a href=\"index.php?action=viewblog&bid=$1&sid=$sid\">$2</a>",$text);
//$text = ereg_replace("http://[A-Za-z0-9./=?-_]+","<a href=\"\\0\">\\0</a>", $text);
if(substr_count($text,"[br/]")<=5){
$text = str_replace("[br/]","<br/>",$text);
}
return $text;
}
.. it all is like External image (may be gone) .. i want it like img(http://xxx.com/xx.gif) .. i want to replace all codes with mine desired1 .. which i already told in my topic message.. wat i want for which code.