Solution for PREFORMATTED TEXT inside forum posts.
Release date: November 11, 2005.
Last update: March 17, 2008.
miniBB version: 2.0 RC6 (tested on but may work on earlier releases as well)
SQL server: [Not required]
Author: Sergei Larionov (minibb.com).


This is a solution for preformatted (spaced/tabbed) text in miniBB posts. It adds a new BBcode
[pre]....[/pre] - everything in between these tags will hold the original spacing/tabbing. 

$post_word_maxlength (the variable from the setup_options.php file used to determine the maximum word
length) based wordwrapping will be applied to everything inside the preformatted text paragraph. Lines longer
than the $post_word_maxlength value will be splitted!


==INSTALLATION & SETUP==

1) Edit bb_plugins.php file, at the top of the file pasting the code provided under bb_plugins.code.txt.

!!Note: in the function above $GLOBALS['post_word_maxlength'] is used to split long text lines, ie for
for so called wordwrapping - so the value of this variable will affect the amount of wordwrapping in your 
preformatted paragraph.

2) Modify the file bb_codes.php file adding the codes provided under bb_codes.encode.txt and bb_codes.decode.txt. The code under bb_codes.encode.txt should be pasted in the function enCodeBB before the line which says

$msg=preg_replace($pattern, $replacement, $msg);

The code under bb_codes.decode.txt should be pasted in the function deCodeBB before the aforementioned line.

3) Now it's time to edit the board's CSS file and add the jscript class there - which as you can see we're using
to separate the code in posts. Example of such CSS class could be found under css.code.txt.

Add it anywhere in the bb_default_style.css file or any other CSS file you're using in the main forums directory..
You can add it to the very bottom of the file for example.

4) Now we need to make appropriate button in the main_post_form.html template.

Open the main_post_form.html template and add the javascript/HTML code provided under main_post_form.code.txt; most likely it should be added in the place where other BB buttons are coming.

5) Copy the button_pre.gif icon from the solution archive to your forums/img directory.


==FINALLY==
Enjoy using miniBB! Our live forums will help you in any question regarding it:
http://www.minibb.com/forums/11_3823_0.html