[solved] BBCode [Code]

Posted:
Thu Aug 09, 2007 10:56 am
Author: Max Paint
The code-tag on my homepage does not work correctly. It posts the UID of the BBCode of that post.
When I write:
- Code: Select all
[code][align=center][flash=,:vb42fhvq]http://www.pk-pro.de/bilder/new-decking-bases.jpg[/flash:vb42fhvq][/align:vb42fhvq][/code]
the posting shows the UID-code of that BBCode in that post:
- Code: Select all
[align=center][img]http://www.pk-pro.de/bilder/new-decking-bases.jpg[/img][/align:ee8ca6301f]

Posted:
Sat Aug 18, 2007 2:46 am
Author: Max Paint
solved it!
[code] ##-----[ OPEN ]------------------------------------------#includes/bbcode.php##-----[ FIND ]------------------------------------------# // PHP MOD // [php] and [/php] for posting PHP code in your posts. $text = bbencode_first_pass_pda($text, $uid, '[php]', '[/php]', '', true, ''); ##-----[ REPLACE WITH ]------------------------------------------## Removing the above lines.# ##-----[ FIND ]------------------------------------------# if ($open_tag[0] == '[code]') { $between_tags = preg_replace('#&##', '&#', $between_tags); $between_tags = preg_replace('/:[0-9a-z:]+]/si', ']', $between_tags); } ##-----[ REPLACE WITH ]------------------------------------------# if ($open_tag[0] == '[code]') { $code_entities_match = array('#<#', '#>#', '#"#', '#:#', '#[#', '#]#', '#(#', '#)#', '#{#', '#}#'); $code_entities_replace = array('<', '>', '"', ':', '[', ']', '(', ')', '{', '}'); $between_tags = preg_replace($code_entities_match, $code_entities_replace, $between_tags); } ##-----[ FIND ]------------------------------------------# // now Replace space occurring at the beginning of a line $after_replace = preg_replace("/^ {1}/m", " ", $after_replace); // Replace ":", "(" & ")" by their HTML codes to prevent smilies replacements $code_entities_match = array('#:#', '#(#', '#)#'); $code_entities_replace = array(':', '(', ')'); $after_replace = preg_replace($code_entities_match, $code_entities_replace, $after_replace); ##-----[ REPLACE WITH ]------------------------------------------# // now Replace space occurring at the beginning of a line $after_replace = preg_replace("/^ {1}/m", " ", $after_replace); [/code]