I wonder if anyone is really using it? Nice hack, but I found a bug where this new bbcode is only being parsed on the 1st post view. Because of this bug, parsed presentation isn't saved to post_parsed table, and consequent views of post will show unparsed [attachment]...[/attachment] code.
The solution is to move line starting with
$post['message'] = preg_replace_callback(...
ABOVE the line starting with
$post['message'] = parse_bbcode($post...
in an original code.
The effect is that attachment bbcode will be parsed before all other bbcodes, and parsed post presentation will be stored correctly afterwards by parse_bbcode() function.
UPDATE: did some testing, the above won't work either. All parsing should be done in parse_bbcode2() from functions_bbcodeparse.php. I was able to fix this, if anyone interested, I can release the necessary updates here.
|