Resource icon

Post Content Find / Replace 1.0.0

No permission to download
Would someone be kind enough to help me replace all the links on my forum to the new url? I'm changing from "cogumelosmagicos.org" to "teonanacatl.org"

What would be a correct regex? Of course these links would have /forums/ and all shorts of other xenforo hierarchy after the domain.

Thanks!
 
You can do something like that with a simple query in phpMyAdmin.

Code:
UPDATE xf_post SET message = REPLACE(message,'current_content','new_content');

How can I do the same for the signature column in xf_user_profile?

EDITED:

Figure it out:

Code:
UPDATE xf_user_profile SET signature = REPLACE(signature,'current_content','new_content');

Thanks!
 
Last edited:
Hi...Really need to be able to use this to convert all our [YT (YouTube) links that came over from a conversion from Vb. The issue is, it just kind of dies and does not complete. I have to guess this is based on the size of the database. 7.5 million posts.

So, it says it uses the search to find all the [YT, and we are using Elasticsearch....Yet it still does not work without stopping. Can't even do a test run.

Anyway to fix this? Short of that...I could not find a BB Code tag I could add in for a [TY] to make it work as a normal code. Even tried using the one I had in VB and it does not pull the right video ID.

Any help would be great.

Thanks
 
Thank you kindly. I was able to get a new [YT] BB code in place that also solved it. But surely would like the posts to be correct and will try it. ;)

(Maybe the script should be updated as it surely is an issue without the limits in place. Well, it is for any larger sites. :))

THANK YOU!
 
Hey there try this, as always on a test site if you can first...I don't have full imports to test this against.

Quick Find:
Code:
[mention


Regular expression:
Code:
#\[mention=([0-9]+)]([^\[]+)\[/mention]#siu


Replacement String:
Code:
@[USER=\1]\2[/USER]
I know this is old, but thank you very much for this. This helped me out tremendously.
 
There is an log where i can check errors, because i click Proceed and nothing returns after 5 seconds.

I have the last xenforo, import from vb4.

Code:
Quick Find: [media]

Regular Expression: #\[media\]http://youtu\.be/([A-Za-z0-9_\-]+)\[/media\]#siU

Replacement String: [media=youtube]\1[/media]
 
Last edited:
Thank you for helping me Jake Bunce now its working ok.

Code:
Quick Find: video=youtube

Regular expression: #\[video=youtube;([a-zA-Z0-9_\-]+)\]http[^\[]+\[/video\]#siU

Replacement String: [media=youtube]\1[/media]
 
Need a regular expression to convert this:
Code:
[video][URL='http://www.youtube.com/watch?v=xEtkFAPHHRg']www.youtube.com/watch?v=xEtkFAPHHRg[/URL][/video]
 
How can I remove all username tags using this addon? Is this possible? I want to remove all instances of @ before user names so it is not a link but just a name.

Edit: After trying a code mentioned here, my entire posts have become links.
I think [/user] part alone got removed.
 
Last edited:
How can I remove all username tags using this addon? Is this possible? I want to remove all instances of @ before user names so it is not a link but just a name.

Edit: After trying a code mentioned here, my entire posts have become links.
I think [/user] part alone got removed.

My last little bit of assistance for this year.

You need to remove the bbcode which was auto generated when someone did the @mention and then also remove the @ from the name.

Quick Find:
Code:
user


Regular expression:
Code:
#(?:@)?\[(user)=([0-9]+)](?:@)?([^\[]+)\[/\1]#siu


Replacement String:
Code:
\3


EDIT: Without seeing the exact text your entries were changed to I can't write an expression for it....however assuming you took a backup before you started editing the database this is the expression you would need.
 
Last edited:
however assuming you took a backup

Yes I did take a back up and restored it. So everything is back to normal and tagged usernames are appearing as a link as shown below. Can I use the code you have given above so the circled name is not a link anymore?

user tagging.webp
My last little bit of assistance for this year.

Thank you very much. Have a happy and blessed new year. (y)
 
To answer you knowing for sure that I am giving you good advice I would need you to click edit on that post and then click the use bbcode editor button.
gbbvc.webp
Once you have that view copy the entire contents surrounding the piece in question and paste it here within a set of [code] tags [/code] so that it is not changed on post.
 
  • Like
Reactions: IPF
Top Bottom