[Snippet] Remove Default BBcode and replace it with Custom

Remove Default BBcode and replace it with Custom
first
make a complete backup of your database and further named files and close the board
second
better don't change the complex [ quote ] bbcode, bcs. it's a very specialized bbcode,
or u are a hardcore php crack. best is, change only 'simple' standard (formatting) bbocdes.
---------------------------
ok, here is a simple example of [ b ] standard-bbcode.
u can transform this change-syntax on each standard formatting bbcode.
i make testwise a bbcode [ b ]
screens
http://4seven.bplaced.net/BBCodes_1.png
http://4seven.bplaced.net/BBCodes_2.png
http://4seven.bplaced.net/BBCodes_3.png
Instruction
open
includes/bbcode.php
find
replace with
open
includes/acp/acp_bbcodes.php
find
replace with
open
styles/prosilver/template/posting_buttons.html
find
replace with
note
if you get a sql-error
follow this solution
http://www.phpbb.com/community/viewtopi ... 5#p7551325
also note
all old [ b ] bbcodes in posts must be reparsed with Support Toolkit (STK)
http://www.phpbb.com/support/stk/
see screen (first post = old [ b ] bbcode, further post = new custom [ b ] bbcode)
http://4seven.bplaced.net/BBCodes_4.png
------------------------------
my tip:
best is, test-out the reparse with Support Toolkit (STK) on a local copy of your board,
or, if STK not work for this constellation, use this snippet, before u start a board.
first
make a complete backup of your database and further named files and close the board
second
better don't change the complex [ quote ] bbcode, bcs. it's a very specialized bbcode,
or u are a hardcore php crack. best is, change only 'simple' standard (formatting) bbocdes.
---------------------------
ok, here is a simple example of [ b ] standard-bbcode.
u can transform this change-syntax on each standard formatting bbcode.
i make testwise a bbcode [ b ]
- Code: Select all
[b]{TEXT}[/b]
- Code: Select all
<span style="background-color:darkred;color:white;font-weight:bolder;">
{TEXT}
</span>
screens
http://4seven.bplaced.net/BBCodes_1.png
http://4seven.bplaced.net/BBCodes_2.png
http://4seven.bplaced.net/BBCodes_3.png
Instruction
open
includes/bbcode.php
find
- Code: Select all
case 1:
$this->bbcode_cache[$bbcode_id] = array(
'str' => array(
'[b:$uid]' => $this->bbcode_tpl('b_open',
$bbcode_id),
'[/b:$uid]' => $this->bbcode_tpl('b_close',
$bbcode_id),
)
);
break;
replace with
- Code: Select all
case 1:
$this->bbcode_cache[$bbcode_id] = array(
'str' => array(
'[b_out_of_order:$uid]' => $this->bbcode_tpl('b_open',
$bbcode_id),
'[/b_out_of_order:$uid]' => $this->bbcode_tpl
('b_close', $bbcode_id),
)
);
break;
open
includes/acp/acp_bbcodes.php
find
- Code: Select all
// Make sure the user didn't pick a "bad" name for the BBCode tag.
$hard_coded = array('code', 'quote', 'quote=', 'attachment', 'attachment=', 'b', 'i', 'url', 'url=', 'img', 'size', 'size=', 'color', 'color=', 'u', 'list', 'list=', 'email', 'email=', 'flash', 'flash=');
replace with
- Code: Select all
// Make sure the user didn't pick a "bad" name for the BBCode tag.
$hard_coded = array('code', 'quote', 'quote=', 'attachment', 'attachment=', 'b_out_of_order', 'i', 'url', 'url=', 'img', 'size', 'size=', 'color', 'color=', 'u', 'list', 'list=', 'email', 'email=', 'flash', 'flash=');
open
styles/prosilver/template/posting_buttons.html
find
- Code: Select all
<input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" title="{L_BBCODE_B_HELP}" />
replace with
- Code: Select all
<!-- <input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" title="{L_BBCODE_B_HELP}" /> -->
note
if you get a sql-error
- Code: Select all
Out of range value adjusted for column 'bbcode_id'
follow this solution
http://www.phpbb.com/community/viewtopi ... 5#p7551325
also note
all old [ b ] bbcodes in posts must be reparsed with Support Toolkit (STK)
http://www.phpbb.com/support/stk/
see screen (first post = old [ b ] bbcode, further post = new custom [ b ] bbcode)
http://4seven.bplaced.net/BBCodes_4.png
------------------------------
my tip:
best is, test-out the reparse with Support Toolkit (STK) on a local copy of your board,
or, if STK not work for this constellation, use this snippet, before u start a board.