Resource icon

Post Content Find / Replace 1.0.0

No permission to download
Hi - Can someone please guide me to finding the correct inputs for Find & Replace to convert this.

old vb imported bbcode
[gpx]45212;10[/gpx]

XF2 required version of the same
[GPX=45212;10]Gpx Viewer[/GPX]

Thank you
 
Last edited:
@Allyra Assuming the content of your bbcode is always digits separated by a semicolon, use this:

Find: #\[gpx\](\d+;\d+)\[/gpx\]#siU
Replace: [GPX=\1]Gpx Viewer[/GPX]

If you're not sure then use this:

Find: #\[gpx\]([^\[]+ )\[/gpx\]#siU
Replace: [GPX=\1]Gpx Viewer[/GPX]

Please make sure to backup your database before executing the code.
 
Hello friends :) I feel like a real numpty and need help again.

I have posts from vB4.2 imported into XF2 and all instances of single speech or double speech marks have failed to parse.

Can I use Post content find / replace to find all instances of “ ” ‘ ’ and replace appropriately.

Thank you in advance.
 
@Allyra Use this.

Find: /“/siU
Replace:

Find: /”/siU
Replace:

Find: /‘/siU
Replace:

Find: /’/siU
Replace:

If you rather to use single and double quotes instead then you can minimize the quires.

Find: /“|”/siU
Replace: "

Find: /‘|’/siU
Replace: '
 
Hi,

I have moved my forum from; domain1.com/ to domain2.com/discussion/

What do I write to fix the URLS in threads that users have written when they have linked to another discussion?
 
it can be done using mysql/phpmyadmin. i have used a command like this multiple times in the past.

SQL:
UPDATE xf_post SET message = REPLACE(message, 'domain1.com', 'domain2.com/discussion');

of course... take a backup and do it on your own risk. maybe someone else could confirm if this command is safe to run.
 
it can be done using mysql/phpmyadmin. i have used a command like this multiple times in the past.

SQL:
UPDATE xf_post SET message = REPLACE(message, 'domain1.com', 'domain2.com/discussion');

of course... take a backup and do it on your own risk. maybe someone else could confirm if this command is safe to run.

That's the way I did it and it was fine.

Also with my Wordpress site.
 
Hello,
After we converted to xenforo
Some fonts have resized and become small in some posts
They can be manually modified and resized to the largest but they are too many
Is there any help to change them all to the larger?

Eg font
arial
How larger the size to the largest ?
 
For anyone having problems matching strings that span multiple lines, you need to use the s switch on your regex to allow this to work.

For example, a reflex to find the following:

Rich (BB code):
[quote]
[B]Originally posted by Someone[/B]

Would look like this:

Code:
/\[quote\]\s*\[b\]originally posted by (.+)\[/b\]/siU
Note that I’m using a case-insentitive (i), multi-line (s) regex that is also ungreedy (U), so it will stop matching at the first [/b] that it comes across.
[/QUOTE]
Evening all. Gosh... okay,
How would that work in actual text example please?
I.E where do you put the post by 'someone' in the text?
I have had to change a username and need to rename all existing posts. Would be grateful if someone could show me how to please.
Thank you
 
I've tried this and it doesn't do anything after clicking save. Anyone else encountered the same issue?
Does anyone know the query to change usernames in quotes etc?
 
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
 
The regex should be something like this
Code:
#(\[url]https:\/\/my-forum\.com\/threads\/)([0-9]+)\&highlight\=keyword\+keyword2(\[\/url])#siu
Replacement:
\1\2\3

Always test first

There're some mistakes e.g. unescaped square brackets, also you didn't have to include the url tag at all.


try this:

Search: #(https://my-forum\.com/threads/)(\d+).*#siU
Replace: \1\2
 
Hello. I think this add-on can work great for replacing broken links on our site.
I am having a first go at it, and struggling to get it to work.

Regular expression:
Code:
\[url=('|")?http[s]?:\/\/uberpeople\.net\/x\-apple\-data\-detectors:\/\/([0-9]+)('|")([-a-zA-Z0-9:%_\+\.~\!\$\^#\?&\/='"]+)\[\/url\]

Error:
Code:
Server Error
preg_match_all(): Unknown modifier '\'

XenForo_Application::handlePhpError()
preg_match_all() in PostReplace/ControllerAdmin/PostReplace.php at line 26
PostReplace_ControllerAdmin_PostReplace->actionReplace() in XenForo/FrontController.php at line 369
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 152
XenForo_FrontController->run() in /home/uberpeop/public_html/admin.php at line 13

postreplace.webp
 
Top Bottom