MySQL Request - changing BBCODE in Messages

kankan

Well-known member
Hello,

I have just migrated my PunBB messages to a fresh Xenforo set up.
I got some tweaked BBCode in my PunBB forum like : [imgz]picture.jp[/imgz] (to make a thumbnail of the picture) and (to center the image)
Of course those BBcodes are not understood by Xenforo and asking myself if i could run a MySQL request to parse the message database and automatically change those BBCodes from [imgz] to

As i am not very involved into MySQL, how do i have to write the command ?

Kindest regards,

Nicolas
 
Hello,

I have just migrated my PunBB messages to a fresh Xenforo set up.
I got some tweaked BBCode in my PunBB forum like : [imgz]picture.jp[/imgz] (to make a thumbnail of the picture) and (to center the image)
Of course those BBcodes are not understood by Xenforo and asking myself if i could run a MySQL request to parse the message database and automatically change those BBCodes from [imgz] to

As i am not very involved into MySQL, how do i have to write the command ?

Kindest regards,

Nicolas[/quote]

Use [URL='http://xenforo.com/community/resources/custom-bb-code-manager.173/']this addon [/URL]to recreate your bbcodes. And if your bbcode is using an url to parse an image for example, also use [URL='http://xenforo.com/community/resources/stop-autolinking-patch.527/']this addon[/URL].
You might need [URL='http://xenforo.com/community/threads/post-content-find-replace.6548/']this addon[/URL] too to perform search & replace.
 
Hi Jake
Thank you for your answer
Just tested this addon
Met the following pb :

I have filled the info as followed :
Quick Find: [imgz

Regular Expression: [imgz]

Replacement String:
Code:
[img]

But the results in the post were like this :
Code:
[[img]]

Anything i did wrong ?
 
Use this regex for imgz bbcodes (the imgz opening tag can't contain any options)
Code:
#\[imgz\](.+?)\[/imgz\]#ui
=> [] are escaped

In replacement string you can use \1 for your bbcode content; for example:
Code:
[newbbcode]\1[/newbbcode]
=> [] are not escaped
 
Question: your
?
 
Thank you Cedric :

Getting this message :
Server Error

preg_match_all() [function.preg-match-all]: Delimiter must not be alphanumeric or backslash
  1. XenForo_Application::handlePhpError()
  2. preg_match_all() in PostReplace/ControllerAdmin/PostReplace.php at line 26
  3. PostReplace_ControllerAdmin_PostReplace->actionReplace() in XenForo/FrontController.php at line 310
  4. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 13
 
What would be the query to change :
Code:
[video][media=youtube]m6XEB9Aj9KA[/media] into Xen ?
I tried :
Code:
#\[video\]http:.+youtube.+v=(\w+)\1\].+\[/video\]#siU
then in replacement :
Code:
[media=youtube]\2[/media]

But nothing

Thank you
 
What would be the query to change :
Code:
[video][media=youtube]m6XEB9Aj9KA[/media] into Xen ?
I tried :
Code:
#\[video\]http:.+youtube.+v=(\w+)\1\].+\[/video\]#siU
then in replacement :
Code:
[media=youtube]\2[/media]

But nothing

Thank you
Are you sure about this pattern:
Code:
[video][media=youtube]m6XEB9Aj9KA[/media] into Xen ?
I think you mixed up both bbcodes
What is the source?
 
Back
Top Bottom