// Parse bbcode into HTML code function parseubb($text) { $text = preg_replace('#\[img\]([\r\n]*)(http://|https://)([^\s\'\";:\+]*?)([\r\n]*)\[/img\]#si', '', $text); $text = preg_replace('#\[b\](.*?)\[/b\]#si', '\1', $text); [b]TU JEST 355[/b] $text = preg_replace('#\[i\](.*?)\[/i\]#si', '\1', $text); $text = preg_replace('#\[u\](.*?)\[/u\]#si', '\1', $text); $text = preg_replace('#\[center\](.*?)\[/center\]#si', '
\1
', $text); $text = preg_replace('#\[url\]([\r\n]*)(http://|https://)([^\s\'\";:\+]*?)([\r\n]*)\[/url\]#si', '\2\3', $text); $text = preg_replace('#\[url\]([\r\n]*)([^\s\'\";:\+]*?)([\r\n]*)\[/url\]#si', '\2', $text); $text = preg_replace('#\[url=([\r\n]*)(http://|https://)([^\s\'\";:\+]*?)\](.*?)([\r\n]*)\[/url\]#si', '\4', $text); $text = preg_replace('#\[url=([\r\n]*)([^\s\'\";:\+]*?)\](.*?)([\r\n]*)\[/url\]#si', '\3', $text); $text = preg_replace('#\[mail\]([\r\n]*)([^\s\'\";:\+]*?)([\r\n]*)\[/mail\]#si', '\2', $text); $text = preg_replace('#\[mail=([\r\n]*)([^\s\'\";:\+]*?)\](.*?)([\r\n]*)\[/mail\]#si', '\2', $text); $text = preg_replace('#\[small\](.*?)\[/small\]#si', '\1', $text); $text = preg_replace('#\[color=(black|blue|brown|cyan|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|violet|white|yellow)\](.*?)\[/color\]#si', '\2', $text); $text = preg_replace('#\[flash width=([0-9]*?) height=([0-9]*?)\]([^\s\'\";:\+]*?)(\.swf)\[/flash\]#si', '', $text); $text = preg_replace_callback("#\[img\]((http|ftp|https|ftps)://)(.*?)(\.(jpg|jpeg|gif|png|JPG|JPEG|GIF|PNG))\[/img\]#si","isImage",$text); $qcount = substr_count($text, "[quote]"); $ccount = substr_count($text, "[code]"); for ($i=0;$i < $qcount;$i++) $text = preg_replace('#\[quote\](.*?)\[/quote\]#si', '
\1
', $text); for ($i=0;$i < $ccount;$i++) $text = preg_replace('#\[code\](.*?)\[/code\]#si', '
\1


', $text); $text = descript($text,false); return $text; }