Resource icon

Post Content Find / Replace 2.0.1

No permission to download
I'm getting this error when using this - how can I solve it? Thanks.

ErrorException: [E_WARNING] preg_match_all(): Empty regular expression in src/addons/XFPR/Admin/Controller/PostReplace.php at line 41
  1. XF::handlePhpError()
  2. preg_match_all() in src/addons/XFPR/Admin/Controller/PostReplace.php at line 41
  3. XFPR\Admin\Controller\PostReplace->actionReplace() in src/XF/Mvc/Dispatcher.php at line 249
  4. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
  5. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  6. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1931
  7. XF\App->run() in src/XF.php at line 328
  8. XF::runApp() in admin.php at line 13
 
I need to do a search and replace ASAP and getting getting the above error. Thoughts on how to solve this?
Thanks.
 
Are there any alternatives to this plugin as I can't get it working as mentioned above. Would much appreciate some help. Thanks.
 
I'm still getting this error when using this. Are there any alternatives I can try if this error can't be fixed? Thanks.

ErrorException: [E_WARNING] preg_match_all(): Empty regular expression in src/addons/XFPR/Admin/Controller/PostReplace.php at line 41
  1. XF::handlePhpError()
  2. preg_match_all() in src/addons/XFPR/Admin/Controller/PostReplace.php at line 41
  3. XFPR\Admin\Controller\PostReplace->actionReplace() in src/XF/Mvc/Dispatcher.php at line 249
  4. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
  5. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  6. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1931
  7. XF\App->run() in src/XF.php at line 328
  8. XF::runApp() in admin.php at line 13
 
Hello all -

I ran query with the save box checked, it found 50+ instances. However, the posts were not changed. Do I need to rebuild posts after I run this tool?
 
Hello! And sorry, im not familiar with regular expressions and things like that. I have pretty big forum which i upgraded from SMF 2.0.15 to Xenforo 2.0.10 (did import to Xen 1.5.18 first and then upgraded it to 2.0.10). I have a little problem with urls. I have lot of links in forum posts to another posts.

Old SMF link looks like this:
http://lampopumput.info/foorumi/index.php/topic,12368.msg322713.html#msg322713

And now it should be convert to look like this:
http://lampopumput.info/foorumi/index.php?threads/12368/post-322713.html

(and i have lot of links like these)

I googled and find this addon. I have already installed addon, but i cant understand how that regex code work... Can someone explain me the code i need to put in those two middle fields (attachment)

http://lampopumput.info/foorumi/index.php stays same, but /topic,xxxxxx.msgyyyyyy.html#msgyyyyy should be converter to ?threads/xxxxx/post-yyyyyy.html

Some script inside index.php which converts old links to new would be even better. Then google search links and links from other sites will also work..
 

Attachments

  • regexlpf.webp
    regexlpf.webp
    27.6 KB · Views: 51
Last edited:
Ok, this is now solved. We did change to .htaccess file and there are redirecting code. That way links from outside works also
 
Howdy,

So I used the following:

Quick Find: [ame

Reg Exp: #\[ame=("|'|)http:.+youtube.+v=(\w+)\1\].+\[/ame\]#siU

Rep String: [media=youtube]\2[/media]

And that worked great.

I then added s to the end of http and ran it again. That also worked great.

I still have some links though that look like this [ame="https://youtu.be/EScDcanF4S4"]BMW K1600 Villa Santina P1-D6 - YouTube[/ame]

How should the regex be changed to allow for the youtu.be part of the link?

Please be patient with me as I know nothing at all about how Regex works...
 
So I have been playing around with this site: https://regex101.com/

And when I run the debugger on this regex: \[ame=("|'|)https:\/\/youtu\.be\/(\w+)\1\](\w+)\[\/ame\]

trying to match this string: [ame="https://youtu.be/EScDcanF4S4"]BMW K1600 Villa Santina P1-D6 - YouTube[/ame]

It looks like everything is working up until it reaches the end of BMW and then it starts back tracking and won't go past the blank space. I don't care at all about the video title between the ] and [. Is there a way to pattern match with some kind of wildcard that will ignore whatever is between those two characters?
 
May help some:

I had a BBCODE for instagram: [INSTAGRAM]xXxXxXxXxXx[/INSTAGRAM]

I ran the following to update the code:

Quick Find: [INSTA
REGEX: #\[INSTAGRAM](\w+)\[\/INSTAGRAM]#
Replacement: [MEDIA=instagram]\1[/MEDIA]
 
How can I clear all smiley code on post?
All my smilies is using this: :emoji_xxx:

Where xxx is name of the smiley.
 
How can I clear all smiley code on post?
All my smilies is using this: :emoji_xxx:

Where xxx is name of the smiley.
Do a test run (don't save) and see what results you get from:

Quick Find: :emoji

RegEx: :emoji_(\w+):

Replacement: :\1:

This should remove the emoji_ to :xxx:
 
  • Love
Reactions: rdn
Hi! Could you please help me with the correct regex, please?
I just moved from the broken vB 4 to XF, and I've got a filter on the old vB version, so all external links were something like (just an example):


Ofcourse thy are not working now.
I need to make them just

Do a test run (don't save) and see what results you get from:

RegEx: #(http|https):\/\/site\.com\/redirector\.php\?url=https%3A%2F%2Fvk.cc%2F(\w+)#

Replacement: https://vk.cc/\1
 
Last edited:
So it will replace all XF1 smiley code?
From:
:emoji_xx:
:emoji_cc:
:emoji_zz:

To:

:cool:
:cool:
:cool:


That way I can replace all depreciated smiley code with a single smiley. 🆒
 
So it will replace all XF1 smiley code?
From:
:emoji_xx:
:emoji_cc:
:emoji_zz:

To:

:cool:
:cool:
:cool:


That way I can replace all depreciated smiley code with a single smiley. 🆒
If you want it to replace all :emoji_XX: to 🆒 then you won't need to insert the matched wildcard. (\1). Just do this:

Quick Find: :emoji

RegEx: #:emoji_(\w+):#

Replacement: :cool:

** Remember do a test run before you save the settings **
 
Back
Top Bottom