Updated the Advanced BBCode Box to version 4, which is the stable release version. Thanks to Dr. Bantham who helped me find the bugs and fix them before release.
The table function has been added and the Gotopost has been fixed to allow for linking to anchors created within the same post.
If you installed the previous beta version, in order to update to the latest version, download the Update to 4 ZIP file in the first post. Once downloaded and extracted, make the following changes:
COPY: bbcode_box.js to mods/bbcode_box/bbcode_box.js
COPY: table.gif to mods/bbcode_box/images/table.gif
OPEN: includes/bbcode.php
FIND:
// Gotopost global $phpEx; $bbcode_tpl['gotopost_open_1'] = str_replace('{URL}', append_sid("viewtopic.$phpEx?p=" . '\1') . '#\1', $bbcode_tpl['gotopost_open']); $bbcode_tpl['gotopost_open_2'] = str_replace('{URL}', append_sid("viewtopic.$phpEx?p=" . '\1') . '#\1_\2', $bbcode_tpl['gotopost_open']);
AFTER, ADD] $bbcode_tpl['gotopost_open_3'] = str_replace('{URL}', '#%s_\1', $bbcode_tpl['gotopost_open']); $bbcode_tpl['table_mainrow_color'] = str_replace('{TABMRCOLOR}', '\1', $bbcode_tpl['table_mainrow_color']); $bbcode_tpl['table_mainrow_size'] = str_replace('{TABMRSIZE}', '\1', $bbcode_tpl['table_mainrow_size']); $bbcode_tpl['table_mainrow_cs1'] = str_replace('{TABMRCSCOLOR}', '\1', $bbcode_tpl['table_mainrow_cs']); $bbcode_tpl['table_mainrow_cs1'] = str_replace('{TABMRCSSIZE}', '\2', $bbcode_tpl['table_mainrow_cs1']); $bbcode_tpl['table_maincol_color'] = str_replace('{TABMCCOLOR}', '\1', $bbcode_tpl['table_maincol_color']); $bbcode_tpl['table_maincol_size'] = str_replace('{TABMCSIZE}', '\1', $bbcode_tpl['table_maincol_size']); $bbcode_tpl['table_maincol_cs1'] = str_replace('{TABMCCSCOLOR}', '\1', $bbcode_tpl['table_maincol_cs']); $bbcode_tpl['table_maincol_cs1'] = str_replace('{TABMCCSSIZE}', '\2', $bbcode_tpl['table_maincol_cs1']); $bbcode_tpl['table_row_color'] = str_replace('{TABRCOLOR}', '\1', $bbcode_tpl['table_row_color']); $bbcode_tpl['table_row_size'] = str_replace('{TABRSIZE}', '\1', $bbcode_tpl['table_row_size']); $bbcode_tpl['table_row_cs1'] = str_replace('{TABRCSCOLOR}', '\1', $bbcode_tpl['table_row_cs']); $bbcode_tpl['table_row_cs1'] = str_replace('{TABRCSSIZE}', '\2', $bbcode_tpl['table_row_cs1']); $bbcode_tpl['table_col_color'] = str_replace('{TABCCOLOR}', '\1', $bbcode_tpl['table_col_color']); $bbcode_tpl['table_col_size'] = str_replace('{TABCSIZE}', '\1', $bbcode_tpl['table_col_size']); $bbcode_tpl['table_col_cs1'] = str_replace('{TABCCSCOLOR}', '\1', $bbcode_tpl['table_col_cs']); $bbcode_tpl['table_col_cs1'] = str_replace('{TABCCSSIZE}', '\2', $bbcode_tpl['table_col_cs1']); $bbcode_tpl['table_size'] = str_replace('{TABSIZE}', '\1', $bbcode_tpl['table_size']); $bbcode_tpl['table_color'] = str_replace('{TABCOLOR}', '\1', $bbcode_tpl['table_color']); $bbcode_tpl['table_cs1'] = str_replace('{TABCSCOLOR}', '\1', $bbcode_tpl['table_cs']); $bbcode_tpl['table_cs1'] = str_replace('{TABCSSIZE}', '\2', $bbcode_tpl['table_cs1']);[/code]
FIND:
// gotopost $text = preg_replace("/[gotopost=([d]+?)]/si", $bbcode_tpl['gotopost_open_1'], $text); $text = preg_replace("/[gotopost=([d]+?),([a-zA-Z]w*?):$uid]/si", $bbcode_tpl['gotopost_open_2'], $text); $text = preg_replace("/[gotopost=([a-zA-Z]w*?):$uid]/si", sprintf($bbcode_tpl['gotopost_open_3'],$post_id), $text);
AFTER, ADD:
$text = str_replace("[/gotopost]", $bbcode_tpl['gotopost_close'], $text); // [table] and [/table] for making tables. // beginning code [table], along with attributes $text = str_replace("[table:$uid]", $bbcode_tpl['table_open'], $text); $text = preg_replace("/[table color=(#[0-9A-F]{6}|[a-z]+):$uid]/si", $bbcode_tpl['table_color'], $text); $text = preg_replace("/[table fontsize=([1-2]?[0-9]):$uid]/si", $bbcode_tpl['table_size'], $text); $text = preg_replace("/[table color=(#[0-9A-F]{6}|[a-z]+) fontsize=([1-2]?[0-9]):$uid]/si", $bbcode_tpl['table_cs1'], $text); // mainrow tag [mrow], along with attributes $text = str_replace("[mrow:$uid]", $bbcode_tpl['table_mainrow'], $text); $text = preg_replace("/[mrow color=(#[0-9A-F]{6}|[a-z]+):$uid]/si", $bbcode_tpl['table_mainrow_color'], $text); $text = preg_replace("/[mrow fontsize=([1-2]?[0-9]):$uid]/si", $bbcode_tpl['table_mainrow_size'], $text); $text = preg_replace("/[mrow color=(#[0-9A-F]{6}|[a-z]+) fontsize=([1-2]?[0-9]):$uid]/si", $bbcode_tpl['table_mainrow_cs1'], $text); // maincol tag [mcol], along with attributes $text = str_replace("[mcol:$uid]", $bbcode_tpl['table_maincol'], $text); $text = preg_replace("/[mcol color=(#[0-9A-F]{6}|[a-z]+):$uid]/si", $bbcode_tpl['table_maincol_color'], $text); $text = preg_replace("/[mcol fontsize=([1-2]?[0-9]):$uid]/si", $bbcode_tpl['table_maincol_size'], $text); $text = preg_replace("/[mcol color=(#[0-9A-F]{6}|[a-z]+) fontsize=([1-2]?[0-9]):$uid]/si", $bbcode_tpl['table_maincol_cs1'], $text); // row tag [row], along with attributes $text = str_replace("[row:$uid]", $bbcode_tpl['table_row'], $text); $text = preg_replace("/[row color=(#[0-9A-F]{6}|[a-z]+):$uid]/si", $bbcode_tpl['table_row_color'], $text); $text = preg_replace("/[row fontsize=([1-2]?[0-9]):$uid]/si", $bbcode_tpl['table_row_size'], $text); $text = preg_replace("/[row color=(#[0-9A-F]{6}|[a-z]+) fontsize=([1-2]?[0-9]):$uid]/si", $bbcode_tpl['table_row_cs1'], $text); // column tag [col], along with attributes $text = str_replace("[col:$uid]", $bbcode_tpl['table_col'], $text); $text = preg_replace("/[col color=(#[0-9A-F]{6}|[a-z]+):$uid]/si", $bbcode_tpl['table_col_color'], $text); $text = preg_replace("/[col fontsize=([1-2]?[0-9]):$uid]/si", $bbcode_tpl['table_col_size'], $text); $text = preg_replace("/[col color=(#[0-9A-F]{6}|[a-z]+) fontsize=([1-2]?[0-9]):$uid]/si", $bbcode_tpl['table_col_cs1'], $text); // ending tag [/table] $text = str_replace("[/table:$uid]", $bbcode_tpl['table_close'], $text);
FIND:
// [gotopost] $text = preg_replace("#[gotopost=([d]+?)](.*?)[/gotopost]#si", "[gotopost=\1]\2[/gotopost:$uid]", $text); $text = preg_replace("#[gotopost=([d]+?),([a-zA-Z]w*?)](.*?)[/gotopost]#si", "[gotopost=\1,\2:$uid]\3[/gotopost:$uid]", $text);
AFTER, ADD:
$text = preg_replace("#[gotopost=([a-zA-Z]w*?)](.*?)[/gotopost]#si", "[gotopost=\1]\2[/gotopost:$uid]", $text); // [table] and [/table] for making tables. // beginning code [table], along with attributes $text = preg_replace("#[table](.*?)[/table]#si", "[table:$uid]\1[/table:$uid]", $text); $text = preg_replace("#[table color=(#[0-9A-F]{6}|[a-z-]+)](.*?)[/table]#si", "[table color=\1:$uid]\2[/table:$uid]", $text); $text = preg_replace("#[table fontsize=([1-2]?[0-9])](.*?)[/table]#si", "[table fontsize=\1:$uid]\2[/table:$uid]", $text); $text = preg_replace("#[table color=(#[0-9A-F]{6}|[a-z-]+) fontsize=([1-2]?[0-9])](.*?)[/table]#si", "[table color=\1 fontsize=\2:$uid]\3[/table:$uid]", $text); $text = preg_replace("#[table fontsize=([1-2]?[0-9]) color=(#[0-9A-F]{6}|[a-z-]+)](.*?)[/table]#si", "[table color=\2 fontsize=\1:$uid]\3[/table:$uid]", $text); // mainrow tag [mrow], along with attributes $text = preg_replace("#[mrow](.*?)#si", "[mrow:$uid]\1", $text); $text = preg_replace("#[mrow color=(#[0-9A-F]{6}|[a-z-]+)](.*?)#si", "[mrow color=\1:$uid]\2", $text); $text = preg_replace("#[mrow fontsize=([1-2]?[0-9])](.*?)#si", "[mrow fontsize=\1:$uid]\2", $text); $text = preg_replace("#[mrow color=(#[0-9A-F]{6}|[a-z-]+) fontsize=([1-2]?[0-9])](.*?)#si", "[mrow color=\1 fontsize=\2:$uid]\3", $text); $text = preg_replace("#[mrow fontsize=([1-2]?[0-9]) color=(#[0-9A-F]{6}|[a-z-]+)](.*?)#si", "[mrow color=\2 fontsize=\1:$uid]\3", $text); // maincol tag [mcol], along with attributes $text = preg_replace("#[mcol](.*?)#si", "[mcol:$uid]\1", $text); $text = preg_replace("#[mcol color=(#[0-9A-F]{6}|[a-z-]+)](.*?)#si", "[mcol color=\1:$uid]\2", $text); $text = preg_replace("#[mcol fontsize=([1-2]?[0-9])](.*?)#si", "[mcol fontsize=\1:$uid]\2", $text); $text = preg_replace("#[mcol color=(#[0-9A-F]{6}|[a-z-]+) fontsize=([1-2]?[0-9])](.*?)#si", "[mcol color=\1 fontsize=\2:$uid]\3", $text); $text = preg_replace("#[mcol fontsize=([1-2]?[0-9]) color=(#[0-9A-F]{6}|[a-z-]+)](.*?)#si", "[mcol color=\2 fontsize=\1:$uid]\3", $text); // row tag [row], along with attributes $text = preg_replace("#[row](.*?)#si", "[row:$uid]\1", $text); $text = preg_replace("#[row color=(#[0-9A-F]{6}|[a-z-]+)](.*?)#si", "[row color=\1:$uid]\2", $text); $text = preg_replace("#[row fontsize=([1-2]?[0-9])](.*?)#si", "[row fontsize=\1:$uid]\2", $text); $text = preg_replace("#[row color=(#[0-9A-F]{6}|[a-z-]+) fontsize=([1-2]?[0-9])](.*?)#si", "[row color=\1 fontsize=\2:$uid]\3", $text); $text = preg_replace("#[row fontsize=([1-2]?[0-9]) color=(#[0-9A-F]{6}|[a-z-]+)](.*?)#si", "[row color=\2 fontsize=\1:$uid]\3", $text); // column tag [col], along with attributes $text = preg_replace("#[col](.*?)#si", "[col:$uid]\1", $text); $text = preg_replace("#[col color=(#[0-9A-F]{6}|[a-z-]+)](.*?)#si", "[col color=\1:$uid]\2", $text); $text = preg_replace("#[col fontsize=([1-2]?[0-9])](.*?)#si", "[col fontsize=\1:$uid]\2", $text); $text = preg_replace("#[col color=(#[0-9A-F]{6}|[a-z-]+) fontsize=([1-2]?[0-9])](.*?)#si", "[col color=\1 fontsize=\2:$uid]\3", $text); $text = preg_replace("#[col fontsize=([1-2]?[0-9]) color=(#[0-9A-F]{6}|[a-z-]+)](.*?)#si", "[col color=\2 fontsize=\1:$uid]\3", $text);
OPEN: languages/lang_english/lang_bbcode.php
FIND:
$faq[] = array("--", "Showing images in posts");$faq[] = array("Adding an image to a post", "phpBB BBCode incorporates a tag for including images in your posts. Two very important things to remember when using this tag are]</b>http://www.phpbb.com/images/phplogo.gif<b>[/flash:3akei1vb]</b><br><br>As noted in the URL section above you can wrap an image in a <b></b> tag if you wish, eg.<br><br><b>[url=http][flash=,:3akei1vb]</b>http://www.phpbb.com/images/phplogo.gif<b>[/flash:3akei1vb][/url]</b><br><br>would generate:<br><br><a><img></a><br>");// LEFT-RIGHT-start$faq[] = array("Aligning images and wrapping text", "This forum has the Left-Right IMG tag MOD installed. Through the use of these tags, you can better format your posts by aligning text to the left or right side of the post body. Additionally, through the use of these tags, text will now neatly wrap around the images as opposed to being in-line as with a normal [flash=,:3akei1vb]tag. For example:<br><br><b>With img tags:</b><br>A really really <b>[img]</b>phplogo.gif<b>[/flash:3akei1vb]</b>%20<b>[flash=,:3akei1vb]</b>phplogo.gif<b>[/flash:3akei1vb]</b>%20really%20really%20really%20really%20really%20really%20long%20sentence.%20<table><tr><td><br>A%20really%20really%20<img>%20<img>%20really%20really%20really%20really%20really%20really%20long%20sentence.<br><br></td></tr></table><br>%20<b>With%20left%20and%20right%20tags:</b><br>A%20really%20really%20<b>[img=left:3akei1vb]</b>phplogo.gif<b>[/img]</b> <b>[img=right:3akei1vb]</b>phplogo.gif<b>[/img]</b> really really really really really really long sentence. <table><tr><td><br><img> <img> A really really really really really really really really long sentence.<br><br><br></td></tr></table>") ;// LEFT-RIGHT-end
AFTER, ADD:
$faq[] = array("--", "<a></a>Making Tables");$faq[] = array("What do the [table] and [/table] tags do?", "You use [table] and [/table] to start and end the table<br>Use <b>[table]</b> at the very beginning of the table, <br>and <b>[/table]</b> at the very end.");$faq[] = array("What does the [mrow] tag do?", "You use [mrow] for a new row that starts with a header column (Centered, Bold text).<br>Note] is NOT required<br><br><b><u>For example:</u></b><br><br>[table]<b>[mrow]</b>Main Row[/table]<br><br>Will show up as<br><br><table><tr><td>Main Row</td></tr></table>");$faq[] = array("What does the [mcol] tag do?", "You use [mcol] for each new header column (Centered, Bold text).<br>Note: [/mcol] is NOT required<br><br><b><u>For example:</u></b><br><br>[table][mrow]Main Row Column 1<b>[mcol]</b>Main Row Column 2[col]Main Row Regular Column[/table]<br><br>Will show up as<br><br><table><tr><td>Main Row Column 1</td><td>Main Row Column 2</td><td>Main Row Regular Column</td></tr></table>");$faq[] = array("What does the [row] tag do?", "You use [row] for each new row (plain, uncentered)<br>Note: [/row] is NOT required<br><br><b><u>For example:</u></b><br><br>[table][mrow]Main Row<b>[row]</b>Regular Row[/table]<br><br>Will show up as...<br><br><table><tr><td>Main Row</td></tr><tr><td>Regular Row</td></tr></table>");$faq[] = array("What does the [col] tag do?", "Use [col] to create a new column (plain, uncentered)<br>Note: [/col] is NOT required<br><br><b><u>For example:</u></b><br><br>[table][mrow]Main Row Column 1[mcol]Main Row Column 2[row]Regular Row Column 1<b>[col]</b>Regular Row Column 2[/table]<br><br>Will show up as<br><br><table><tr><td>Main Row Column 1</td><td>Main Row Column 2</td></tr><tr><td>Regular Row Column 1</td><td>Regular Row Column 2</td></tr></table>");$faq[] = array("Do I need to add closing tags for the [mrow], [mcol], [row], or [col] tags?", "No, the Table BBCode is set up to eliminate the need for any closing tags other than the [/table] tag, which is required.");$faq[] = array("What are the different attributes?", "You can use <a>"color="</a> and <a>"fontsize="</a> with any tag. You use them the same way you would an html attribute by seperating each tag with a single space. The order in which you use them does not matter.<br><br><a><br></a><span><b><u>Color</u></b></span><br><br>The "color=" attribute allows you to change the background color.<br>You can specify either a recognised colour name (eg. red, blue, yellow, etc.) or the hexadecimal triplet alternative, eg. #FFFFFF, #000000.<br><br><b><u>Example:</u></b><br>[table color=blue][mrow color=green]Main Row Column 1[mcol color=red]Main Row Column 2[row color=#00FF00]Regular Row 1 Column 1[col color=#FF0000]Regular Row 1 Column 2[row]Regular Row 2 Column 1[col]Regular Row 2 Column 2[/table]<br> Will show up as<br><table><tr><td>Main Row Column 1</td><td>Main Row Column 2</td></tr><tr><td>Regular Row 1 Column 1</td><td>Regular Row 1 Column 2</td></tr><tr><td>Regular Row 2 Column 1</td><td>Regular Row 2 Column 2</table><br><hr><br><a></a><br><span><b><u>Fontsize</u></b></span><br><br>The "fontsize=" attribute allows you to change the text size.<br>The default font size is set to the FONTSIZE3 setting in the current template, however this can be changed by using the attribute in the [table] tag.<br><br><b><u>Example:</u></b><br>[table fontsize=18][mrow fontsize=10]Main Row Column 1[mcol fontsize=14]Main Row Column 2[row fontsize=5]Regular Row 1 Column 1[col fontsize=28]Regular Row 1 Column 2[row]Regular Row 2 Column 1[col]Regular Row 2 Column 2[/table]<br> Will show up as<br><table><tr><td>Main Row Column 1</td><td>Main Row Column 2</td></tr><tr><td>Regular Row 1 Column 1</td><td>Regular Row 1 Column 2</td></tr><tr><td>Regular Row 2 Column 1</td><td>Regular Row 2 Column 2</table>");
OPEN: templates/fisubice/admin/blocks_edit_body.tpl
FIND:
AFTER, ADD] <td><img></td> <td><img></td>[/code]
OPEN: templates/fisubice/profilcp/profil_signature_body.tpl
FIND:
AFTER, ADD] <td><img></td> <td><img></td>[/code]
OPEN: templates/fisubice/bbcode.tpl
FIND:
<BEGIN><a><END> <BEGIN></a><END>
AFTER, ADD]<BEGIN><table><END><BEGIN></td></tr></table><END><BEGIN><table><END><BEGIN><table><END><BEGIN><table><END><BEGIN></td></tr><tr><td><END><BEGIN></td></tr><tr><td><END><BEGIN></td></tr><tr><td><END><BEGIN></td></tr><tr><td><END><BEGIN></td><td><END><BEGIN></td><td><END><BEGIN></td><td><END><BEGIN></td><td><END><BEGIN></td></tr><tr><td><END><BEGIN></td></tr><tr><td><END><BEGIN></td></tr><tr><td><END><BEGIN></td></tr><tr><td><END><BEGIN></td><td><END><BEGIN></td><td><END><BEGIN></td><td><END><BEGIN></td><td><END>[/code]
OPEN: templates/fisubice/kb_add_body.tpl
FIND:
AFTER, ADD] <td><img></td> <td><img></td>[/code]
OPEN: templates/fisubice/posting_body.tpl
FIND:
AFTER, ADD] <td><img></td> <td><img></td>[/code]