Code: Select all
UPDATE phpbb_posts
SET post_text = REPLACE(post_text, '[oldtag]', '[newtag]') ;
Code: Select all
UPDATE phpbb_posts
SET post_text = REPLACE(post_text, '[/oldtag]', '[/newtag]') ;
andy
Code: Select all
UPDATE phpbb_posts
SET post_text = REPLACE(post_text, '[oldtag]', '[newtag]') ;
Code: Select all
UPDATE phpbb_posts
SET post_text = REPLACE(post_text, '[/oldtag]', '[/newtag]') ;
[b:3pkg1i5c] [/b:3pkg1i5c]
. The bbcode_uid is stored in the same record in the posts table."Per post" seems to imply the uid is unique to each post, and therefore there's no way to do a global search-and-replace like I want. Or is there some other way to do what I'm trying to do?HGN wrote:No that will not work.
Per post a bbcode_uid is added to the BBCode, e.g. for bold it will look like[b:3pkg1i5c] [/b:3pkg1i5c]
. The bbcode_uid is stored in the same record in the posts table.
[oldtag][/oldtag]
and not something like [oldtag=DATA][/oldtag]
, then this should work:Code: Select all
UPDATE phpbb_posts SET post_text = REPLACE(post_text, '[oldtag:', '[newtag:');
UPDATE phpbb_posts SET post_text = REPLACE(post_text, '[/oldtag:', '[/newtag:');
_posts
table before executing these SQL commands...just in case.Replace the close-bracket with a colon? That's it?DionDesigns wrote:If the BBcode you want to replace is of the form[oldtag][/oldtag]
and not something like[oldtag=DATA][/oldtag]
, then this should work:
Make a backup of yourCode: Select all
UPDATE phpbb_posts SET post_text = REPLACE(post_text, '[oldtag:', '[newtag:'); UPDATE phpbb_posts SET post_text = REPLACE(post_text, '[/oldtag:', '[/newtag:');
_posts
table before executing these SQL commands...just in case.
[color=#FF0000][before:[/color]3pkg1i5c] [i]text[/i] [color=#FF0000][/before:[/color]3pkg1i5c]
[color=#FF0000][after:[/color]3pkg1i5c] [i]text[/i] [color=#FF0000][/after:[/color]3pkg1i5c]
Ah ha. Thanks for the explanation Dion, and the clarification Oyabun1Oyabun1 wrote:No. What DionDesigns is suggesting is that if you have have a BBCode:
[color=#FF0000][before:[/color]3pkg1i5c] [i]text[/i] [color=#FF0000][/before:[/color]3pkg1i5c]
You could change just the parts in red, so that you will end up with:
[color=#FF0000][after:[/color]3pkg1i5c] [i]text[/i] [color=#FF0000][/after:[/color]3pkg1i5c]
Make sure you backup the database before trying it. You may also need to reparse the BBCodes after making the change. The Support Toolkit has a tool to do that.