Resource icon

Post Content Find / Replace 1.0.0

No permission to download
Run this query and make a backup first just incase something goes wrong
Code:
UPDATE xf_post
SET message = REPLACE(message, 'ibf.rocks', 'j.mp')
 
hehe. did just that. funny thing happening now. if i load a post with the ibf link, the post itself shows the ibf link. but if i edit the post, it shows the j.mp link. i am guessing i need to clear some cache or something?
 
We currently have these tags:

Code:
[youtube]https://www.youtube.com/watch?v=s3lzEfr1L78[/youtube]

Would this work to fix them?

Code:
Quick Find:
[youtube

Regular Expression:
#\[youtube;([^\]]+)\]([^\[]+)\[/youtube\]#siU

Replacement String:
[media=youtube]\1[/media]
 
I was wondering if someone can help me.
I just mirgated from IPB 4 to Xenforo & there are a lot of messed up things. I was wondering if I could gather them, & just simply remove them, not replace them.

Examples:
I have emoticons all over the place that are broken, code -
Code:
[IMG]http://<fileStore.core_Emoticons>/default_biggrin.png[/IMG]

I was wondering if I could take out all emoticons that use code like this.


Also all attachment images weren't brought over & there is code like this -
Code:
<a class="ipsAttachLink ipsAttachLink_image" href="<fileStore.core_Attachment>/monthly_2015_08/2015-08-20_14.58.15.png.87e9fcdea39c41a67cbbd956c114dcaa.png">[IMG]http://<fileStore.core_Attachment>/monthly_2015_08/2015-08-20_14.58.15.thumb.png.b47d2f0c4bf6fa299eabc2a13459fb23.png[/IMG]</a>


I would really appreciate me if someone could help me. I have installed this plugin, i just wanna remove all this ugly broken code so I can make my forums live again.

Thank you
 
I had a similar issue when I did a DNN conversion. Except it was way, way worse. Hard to explain.

But if your old forum referenced a specific directory, or at least a main directory with various sub-directories, there is definitely a way to bring all those pics back. For instance, the term <fileStore.core_Attachment> is likely a field in the old software that specifies what directory the pics are stored in. So find that folder on your old server and move all the pics to a directory in your XF root and call it oldphotos or something, then use the find/replace to replace that whole messy string with a URL that points to that photo is a way the resolves it (displays it) as a photo. It's possible, as long as you can find a definitive pattern that references the files the same way, every time.

In my conversion...everything was buried in 3 tables that cross-referenced each other in a "secure" way so that there was no way to actually figure out what the URL location of a file was based on the link. Took me forever to figure out the pattern and files were buried in directory trees, it was a mess.

As far as the emoticons, if you can find the same pattern, that's an easy one to fix. All you care about is 'biggrin.png' and so you can find the code that looks like that everywhere and replace each instance with the default XF smiley. I have to do this as well yet.
 
TBH, I would be happy just replacing it with nothing. Just to get rid of the messy code. There weren't many attachments anyway. Is there a way to find those pieces of code & replace it with nothing?
 
Hey @Kier, I'd like to run this on quite a sizeable forum. Any chance you'd consider adding the batch processing? :[

Edit: It actually didn't time out while pulling up 20,000+ posts that matched in test mode, well alright then

Edit2: Okay, actually trying to save and apply the change does not work out as well :P
 
Last edited:
In playing around with this add-on, I managed to end up with some entries like this:
Code:
[[SIZE=1]]

It's only in my first test import so no damage done, but to better understand how this works could anyone give me a Regular Expression and a Replacement String to change these entries back to just
Code:
[SIZE=1]

UPDATE: Thanxx ChrisD, that worked just perfectly! Now, on to study more about Regex at http://www.regextester.com
 
Last edited:
It would be really great if some one can help me out on this, as i'm not at all good at regular expression and strings.

I need to convert Image urls from imgur from http to https

So for example need to convert all imagur links in post -
Code:
 [IMG]http://i.imgur.com/hydfg.jpg[/IMG] to [IMG]https://i.imgur.com/hydfg.jpg[/IMG]

I have found the Regualr expression to use from Stackoverflow as ((\[IMG\].*?\[/IMG\])|(\[IMG=.*\](.*?)\[/IMG\]))

That correctly brings up all the bbcode with the imgur link, but how to replace only the http string with https?
 
How about a Tapatalk signature removal regex?

Something that can take this

Code:
Sent from my iPhone using Tapatalk

And replace it with a blank (delete it)

Since every default signature is different (Samsung, iPad, etc) it would be good to search for all instances that start with "Sent from my" and end with "using Tapatalk" and remove those along with whatever is inbetween.

Is this possible, and if so, what's the QF/R/R?

Thanks ahead of time!
 
How about a Tapatalk signature removal regex?

Something that can take this

Code:
Sent from my iPhone using Tapatalk

And replace it with a blank (delete it)

Since every default signature is different (Samsung, iPad, etc) it would be good to search for all instances that start with "Sent from my" and end with "using Tapatalk" and remove those along with whatever is inbetween.

Is this possible, and if so, what's the QF/R/R?

Thanks ahead of time!

Take a look at this

Removal of TapaTalk
 
Yes but why not just post it here, because here is where I asked for it.

Quick Find:

Code:
tapatalk

Regular expression:

Code:
/Sent from my (.+) using Tapatalk/i

Replacement String: nothing

And, yes it works. Unless you have a post that contains only the "Sent from my" text (resulting in a blank post)- this will give you an error, but then just run it again (as a test) and click the first one. That will be the post, manually edit it or just delete it, and run again.

You lose Tapatalk.
 
Last edited:
Top Bottom