I have managed to change some old bbcode not used anymore on elkarte. I used
UPDATE [icode]elkarte_messages[/icode] SET [icode]body[/icode] = REPLACE([icode]body[/icode],'text1','text2')
I had an old version of tapatalk that was not supporting emoticons and now I have some bbcode like [emoji2] or [emoji123]
How could I remove all these old bbcodes? Thank you
Do you want to replace them with something or just nothing?
I would like to remove them.
I forgot regex do not work on replace in mysql... darn.
I guess you have two options:
1) hide them via a function (for example some kind of replacement in parse_bbc) (I'm just throwing out ideas, don't worry about the implementation. ;))
2) for each tag do the replacement like you did in the other cases
3) write a php script to run on the db to convert the codes.
too complicate, I thought there was a simply way to do this. I'll do a simple search and use the method in the first post for every smiley ;)
What
@emanuele said ...
To my knowledge you can not use wildcards on an update :( So your options are if there are just a few combo's you would have to do each one as its own update. Otherwise its a script that goes post by post and does the wildcard search and remove.
Well, the parse_bbc code would look something like:
function replace_tapatalk_bbcode($message)
{
return preg_replace('~\[emoji\d+\]~i', '', $message);
}
Nothing too complex. ;)
I solved this, it took me almost an hour but I replaced manually about 90% of smileys from Tapatalk with my own smileys. I removed the rest of them ;)
A heck of a job! :(
maybe I was not so clear, I did not edit the post one by one, but I searched the forum for [emoji* and then used the sql command UPDATE.. REPLACE ;) not an elegant solution but I solve it ;)