MyBB Community Forums

Full Version: MySQL query question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I recently converted my forum (on a test board) from IPB and I was wondering how to fix my smiley problem through MySQL.

All the old smileys on my forum have been converted to this bb code:
[img]http://example.com/public/style_emoticons/<#EMO_DIR#>/smiley.png[/img]

Is there a MySQL query I could run to replace all instances of "http://example.com/public/style_emoticons/<#EMO_DIR#>/" to a url that works?
Anyone?
if you have a lot of posts, it could take a long time

UPDATE mybb_posts SET message = REPLACE(message, 'http://example.com/public/style_emoticons/<#EMO_DIR#>/', '<your url you want>') WHERE message LIKE '%http://example.com/public/style_emoticons/<#EMO_DIR#>/%'
Thanks for the help but it doesnt seem to work. Maybe I am doing something wrong?
In mybb the smilies are stored in images/smilies did you include that in the url when you ran the query.

So it would be
 [img]http://example.com/public/images/smilies/smiley.png[/img]
Wait, I forgot to change the "example.com" to my url. It worked! Thanks, pavemen, you are a life saver! I can use this code to fix lots of broken things on my converted forum. Smile
make a backup of your posts table first btw.

please copy/paste the query you are running
Got it sorted, I also used it to delete some old font tags used in IPB like [font=tahoma, geneva, sans-serif]

Im glad there is an easy way to clean up hundreds of thousands of posts all at once. Smile