This is a solution for automatic code tabbing in miniBB posts. It adds a new BBcode
[script]....[/script] - everything in between these tags will be tabbed automatically
based on { ... } so called "begin" and "end" programming language constructs.
$post_word_maxlenght (the variable from the setup_options.php file used to determine the maximum word
length) based wordwrapping will be applied to everything inside the tabbed script paragraph. Lines longer
than the $post_word_maxlenght value will be splitted!
The algorythm is simple - it adds spaces/tabs once a { symbol is found on the line and deducts spaces once the } symbol is found. Of course, the algorythm could be more precise and complicated, but we wanted it simple. Any suggestions on how to make this thing more "intelligent" without dramatical performance decrease are welcome.
Check it in action in our test forums
here .