Location: PHPKode > scripts > WH Board > wh_board/functions/bbcode.php
<?php

	function bbcode($msg) {
		$msg = $msg;
		$msg = preg_replace("/\[b\](.*?)\[\/b\]/", "<b>$1</b>", $msg);
		$msg = preg_replace("/\[i\](.*?)\[\/i\]/", "<i>$1</i>", $msg);
		$msg = preg_replace("/\[u\](.*?)\[\/u\]/", "<u>$1</u>", $msg);
		$msg = str_replace("/\[s\](.*?)\[\/s\]/", "<s>$1</s>", $msg);
		$msg = str_replace("/\[left\](.*)\[/left\]/", "<s>$1</s>", $msg);
		$msg = str_replace("/\[center\](.*)\[/center\]/", "<s>$1</s>", $msg);
		$msg = str_replace("/\[right\](.*)\[/right\]/", "<s>$1</s>", $msg);
		
		$msg = preg_replace('#\[url\](.*)\[/url\]#isU', "<a href=\"$1\" target=\"_blank\">$1</a>", $msg);
		$msg = preg_replace('#\[url=(.*)\](.*)\[/url\]#isU', "<a href=\"$1\">$2</a>", $msg);
		$msg = preg_replace('#\[email\](.*)\[/email\]#isU', "<a mailto=\"$1\">$1</a>", $msg);
		
		$msg = str_replace("/\n/", "<br/>\n", $msg);
		$msg = str_replace(":P","<img src=\"style/images/smileys/000.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg);
		$msg = str_replace(":)","<img src=\"style/images/smileys/001.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg);
		$msg = str_replace(";)","<img src=\"style/images/smileys/002.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg);
		$msg = str_replace(":(","<img src=\"style/images/smileys/003.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg);
		$msg = str_replace("*grr*","<img src=\"style/images/smileys/004.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg);
		$msg = str_replace("o_o","<img src=\"style/images/smileys/005.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg);
		$msg = str_replace("*_*","<img src=\"style/images/smileys/006.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg);
		$msg = str_replace("._.","<img src=\"style/images/smileys/007.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg);
		$msg = str_replace("-_-","<img src=\"style/images/smileys/008.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg);
		$msg = str_replace(":D","<img src=\"style/images/smileys/009.gif\" width=\"15\" height=\"14\" border=\"0\">",$msg);

    return $msg;
	}

?>
Return current item: WH Board