Hello again~
Sorry for resurrecting this posts, but I thought it would be better than creating a new one.
I seem to have broken it. I moved the BBCode function onto a file called fun.php. Which is included correctly on the post_reply file. But now it seems like it broke the youtube tag (which was working fine with your help). All of the other BBcode works except for this. ???
Anyone know what might be wrong? '_'
Thanks,
Henaro
EDIT:
And here's the full code:
<?php
function BBCode ($str) {
$simple_search = array(
'/\[b\](.*?)\[\/b\]/is',
'/\[i\](.*?)\[\/i\]/is',
'/\[u\](.*?)\[\/u\]/is',
'/\[url\=(.*?)\](.*?)\[\/url\]/is',
'/\[url\](.*?)\[\/url\]/is',
'/(>>)([0-9]+)/',
'/\[img\](.*?)\[\/img\]/is',
'/\[yt\]http:\/\/youtube.com\/watch\?v=(.*?)\[\/yt\]/',
'/\[em\](.*?)\[\/em\]/is',
'/\[txt\](.*?)\[\/txt\]/is'
);
$simple_replace = array(
'<strong>$1</strong>',
'<em>$1</em>',
'<u>$1</u>',
'<a href="$1">$2</a>',
'<a href="$1">[link]</a>',
'<a href=\'index.php#$2\'>$1$2</a>',
'<a href="$1"><img src="$1" boarder=0 /></a>',
'<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/$1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>',
'<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="550" HEIGHT="400" id="Embeded File"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="$1" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400" NAME="Embeded File" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>',
'<div class="code">$1</div>'
);
// Do simple BBCode's
$str = preg_replace ($simple_search, $simple_replace, $str);
return $str;
}
?>