Resource icon

Post Content Find / Replace 2.0.1

No permission to download
We are looking to use this tool to try and convert a Vbulltin 5.5 IMG tag which looks like this:
[IMG2=JSON]{"data-align":"none","data-size":"full","height":"960","width":"600","src":"https:\/\/i.imgur.com\/tLynES6.jpg"}[/IMG2]

To something that can be read by Xenforo 2.1. Does anybody have any insight on how to format the expressions for this?
 
I just converted from Sonnb XenGallery to XFMG and I was looking for a regex to change the old BBcodes and I did not find it.
If could be useful I solved with some queries on database:
Code:
UPDATE xf_post SET message = REPLACE(message, '[photo=small]', '[GALLERY=media, ');
UPDATE xf_post SET message = REPLACE(message, '[photo=medium]', '[GALLERY=media, ');
UPDATE xf_post SET message = REPLACE(message, '[photo=large]', '[GALLERY=media, ');
UPDATE xf_post SET message = REPLACE(message, '[/photo]', '][/GALLERY]');
UPDATE xf_post SET message = REPLACE(message, '[album=small]', '[GALLERY=album, ');
UPDATE xf_post SET message = REPLACE(message, '[album=medium]', '[GALLERY=album, ');
UPDATE xf_post SET message = REPLACE(message, '[album=large]', '[GALLERY=album, ');
UPDATE xf_post SET message = REPLACE(message, '[/album]', '][/GALLERY]');
 
For static replacements such as that, queries are much simpler than using an add-on and regex.
 
32f387c5a8ae0ce8f2578e0e22c912a1.png


Hello, I am trying to replace hshop by hshopp on my forum once the addons launch nothing changes however the addons finds the text to be replaced would you have an idea? Thank you
 
@Chris D, the supplement is not planned to correspond? Especially the fact that it is carried out immediately in bulk, and not performed by the job. With the job for large forums, an add-on would fit better that would perform a replacement.
 
No further improvements are planned and the add-on does a reasonable job as it is.

If you hit timeouts or limits they should be temporarily increased. Sometimes it may take a few runs of the tool to entirely finish but it should complete at least some of the replacements on each run.
 
@Overscan hi, I think this will solve your problem.

Quick Find:
[url=http://www.youtube.com

Regular Expression:
/\[url=http:\/\/(?:www\.)*+youtube\.com\/watch\?v=([\w\-]+)\].+\[\/url\]/siU

Replacement string:
[media=youtube]\1[/media]

@Chris D — #1184317
Please can someone explain me better from where to change these things? Because I'm having the same error...
I have tried to search
[url=http://www.youtube.com

but it didn't found anything
 
Does it find anything if you change from http to https before the youtube URL?

If the forum you're converting isn't that old you may not have any links to the old, unsecured, youtube URL.
 
Hi BOP and thanks for the answer.

Yes I found it and I have followed the instructions told by Eagle present in my previous post quote, but it go in error and I still have this problem:

Code:
SERVER REGISTRY ERROR
ErrorException: [E_WARNING] preg_match_all(): Empty regular expression src/addons/XFPR/Admin/Controller/PostReplace.php:41
Generated da: marko 7 Aprile 2020 alle 15:36
STACK CHECK
#0 [internal function]: XF::handlePhpError(2, '[E_WARNING] pre...', '/home/users/roo...', 41, Array)
#1 src/addons/XFPR/Admin/Controller/PostReplace.php(41): preg_match_all('', 'ciao,
assolutam...', NULL)
#2 src/XF/Mvc/Dispatcher.php(350): XFPR\Admin\Controller\PostReplace->actionReplace(Object(XF\Mvc\ParameterBag))
#3 src/XF/Mvc/Dispatcher.php(261): XF\Mvc\Dispatcher->dispatchClass('XFPR:PostReplac...', 'Replace', Object(XF\Mvc\RouteMatch), Object(XFPR\Admin\Controller\PostReplace), NULL)
#4 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XFPR\Admin\Controller\PostReplace), NULL)
#5 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#6 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
#7 src/XF.php(391): XF\App->run()
#8 admin.php(13): XF::runApp('XF\\Admin\\App')
#9 {main}
REQUEST STATUS
array(4) {
  ["url"] => string(31) "/admin.php?post-replace/replace"
  ["referrer"] => string(65) "https://www.sigarettaelettronicaforum.com/admin.php?post-replace/"
  ["_GET"] => array(1) {
    ["post-replace/replace"] => string(0) ""
  }
  ["_POST"] => array(4) {
    ["quick_find"] => string(8) "Fasttech"
    ["regex"] => string(0) ""
    ["replace"] => string(2) "FT"
    ["_xfToken"] => string(8) "********"
  }
}
 
so... is there a simple method to remove all tinypic bbcodes from the post content through the forum! a sample code is like this:
[IMG]http://i64.tinypic.com/2zgg086.jpg[/IMG]

thanks!
 
Back
Top Bottom