// ###################### Start bbcodeparse ####################### function bbcode($bbcode) { $bbcode = str_replace("<","<",$bbcode); $bbcode = str_replace(">",">",$bbcode); $bbcode = str_replace("<","<",$bbcode); $bbcode = str_replace(">",">",$bbcode); $bbcode = nl2br($bbcode); $searcharray = array( "/(\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/list)(((=)(\\4)([^\"']*)(\\4]))|(\]))/siU", "/(\[)(list)(])(.*)(\[\/list\])/siU", "/(\[\*\])/siU", "/(\[)(url)(=)(['\"]?)(www\.)([^\"']*)(\\4)(.*)(\[\/url\])/siU", "/(\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\[\/url\])/siU", "/(\[)(url)(])(www\.)([^\"]*)(\[\/url\])/siU", "/(\[)(url)(])([^\"]*)(\[\/url\])/siU", "/(\[)(b)(])(\r\n)*(.*)(\[\/b\])/siU", "/(\[)(u)(])(\r\n)*(.*)(\[\/u\])/siU", "/(\[)(i)(])(\r\n)*(.*)(\[\/i\])/siU", "/(\[)(php)(])(\r\n)*(.*)(\[\/php\])/siU", "/(\[)(code)(])(\r\n)*(.*)(\[\/code\])/siU", "/(\[)(pre)(])(\r\n)*(.*)(\[\/pre\])/siU", "/javascript:/si", "/about:/si" ); //'" $replacearray = array( "
", "código:
\\5
", "código:
\\5
código:\\5", "java script:", "about :" ); $bbcode = preg_replace($searcharray, $replacearray, $bbcode); $bbcode = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "", $bbcode); //$bbcode = preg_replace("/(\[)(img)(])(\r\n)*([^\"]*)(\[\/img\])/siU", "\\5", $bbcode); $bbcode = str_replace("\\'", "'", $bbcode); $codebits = explode("
código:",$val); $newbits = str_replace("",$bbcode); list($key,$bbcode) = each($codebits); while (list($key,$val) = each($codebits)) { $sbbits = explode("
code:".$newbits; } return $bbcode; }