Resource icon

Post Content Find / Replace 1.0.0

No permission to download
One more that I just found out: In many threads, there is a MAJOR problem with some random img code having thousands of lines of code , which I don't know how it got there (it's usually among other img codes which work just fine). So I'm looking for a regular expression to remove all instances that are like this:

Code:
[img]http://www.mydomain.com/data:image/ThousandsOfCharactersHereIncludingNumbersLettersSymbols[/img]
 
Try this


Quick Find:
Code:
[img


Regular expression:
Code:
#\[img]http://(www)?\.[^\.]+\.[a-z]+/data:image/[^\[]+\[/img]#siu


Replacement String:
Code:
 
Here are four settings to convert vb3 [thread] and [post] bbcodes after importing.
Code:
[thread]
#\[thread\](\d+)\[/thread\]#i
[URL='http://yoursite.com/threads/$1']http://yoursite.com/threads/$1[/URL]

[thread=
#\[thread=(\d+)\](.*?)\[/thread\]#i
[URL='http://yoursite.com/threads/$1']$2[/URL]

[post]
#\[post\](\d+)\[/post\]#i
[URL='http://yoursite.com/posts/$1']http://yoursite.com/posts/$1[/URL]

[post=
#\[post=(\d+)\](.*?)\[/post\]#i
[URL='http://yoursite.com/posts/$1']$2[/URL]
 
Try this


Quick Find:
Code:
[img


Regular expression:
Code:
#\[img]http://(www)?\.[^\.]+\.[a-z]+/data:image/[^\[]+\[/img]#siu


Replacement String:
Code:

Thanks that seems to find the posts, but when I actually go and click save changes, it brings back an error:

ERROR

Please enter a valid message.

Edit: nevermind, it's only 114 posts, so I will edit them one by one, it's good enough this tool found them for me, thanks :)
 
Last edited:
I'm sorry, I was just about asleep when you responded.

TBH I don't know why it is throwing an error, maybe it needed a space or some kind of placeholder for the replacement. If you can pass me a couple of those bbcode tags I would like to test them myself and see if it also throw me an error. If you have none left to convert at this point don't worry about it.
 
Thanks very much for your help - I've found that it was running up to a specific post that was throwing an error, I went in deleted that post and moved on. It did this a few times, so I managed to get through all of them doing some small amount of manual work. :)
 
guys, excuse my nooby question but where do i exactly upload the folders inside the zip file?library or where :(
 
upload them to:

/YOURDOMAIN/library/

If possible always try this on a backup or testbed. If you are unsure with regex, filter through the pages to find the expressions you need, if they don't exist than make a request here.
 
upload them to:

/YOURDOMAIN/library/

If possible always try this on a backup or testbed. If you are unsure with regex, filter through the pages to find the expressions you need, if they don't exist than make a request here.
thanks for replying but i did uploaded em in library and then installed the xml but still saying
The requested page could not be found. when i go and click on tools then replace in posts
http://localhost/admin.php?post-replace/
 
Ahh sorry I should have made my words clearer,

you only need to upload the PostReplace directory and it's contents into the library folder,

so you have /library/PostReplace/

with four directories and two files inside.
 
Ahh sorry I should have made my words clearer,

you only need to upload the PostReplace directory and it's contents into the library folder,

so you have /library/PostReplace/

with four directories and two files inside.
you're a life saver , thanks alot
 
Can anybody help me please?

I have this code from vB
Code:
[video=youtube;8DnKOc6FISU]http://www.youtube.com/watch?v=8DnKOc6FISU[/video]

And I need this code for Xen Media Gallery
Code:
[media=youtube]8DnKOc6FISU[/media]

thx!
 
I got one more, it seems many links from my vb installation that were being generated live using the old vbgeek GAL addon, have been copied in my xenforo installation , and I need to remove them asap, as they point to nowhere.

All of these are links, and have the form of: http://www.mydomain.com/glossary.phpANYTHINGHEREOINCLUDINGSYMBOLS

or http://www.mydomain.com/glossary/againanythinghere

So I guess I need to remove the whole link tag for these entries.

So these links you want completely removed and they all start with this signature?...

http://www.mydomain.com/glossary/
or
http://www.mydomain.com/glossary.php

If you click edit on a post containing one of those links, what is the text shows up in bbcode editor?
 
Last edited:
I got the link codes:

Code:
[URL]http://www.mydomain.com/glossary/18231-%F3%EF%F5%E7%E4%DF%E1.html[/URL]

Code:
[URL='http://www.mydomain.com/glossary.php?do=item&id=85']Τόκιο[/URL].

The problem now that I think of it is that many many posts will point to nothing now if we completely remove these. These were a sort of index of my content back in vbulletin :(

Edit: could i maybe change these links to search links and make them search for the underlined part above? it's the only thing i can think of to salvage this :S
 
Last edited:
Just a couple random questions so I can get a grasp on what is going on, I'm not familiar with that particular addon having never used it myself...

Do you have the old vB DB for the data associated with this addon?

What was the content these links pointed to? Was it forum posts or custom pages or something else and more importantly, has it been imported or re-created on your XF conversion?

I am assuming the links go to some content having to do with an index of locations but even assuming that is even true I can't really guess what the importance is of these links without really knowing the importance of the content they link to on your old vb version of your site.

I don't really like the search data idea (not because it isn't a valid solution but because I don't know your plans and don't want to make more work for you down the road) and only because once it is changed to a generic link it will be a pain in the rear to change them later to something else if you get a solid idea for what to do about these.
 
Thanks for trying to help me out. I have the old database, these links pointed to custom pages back in my vb. These pages don't exist anymore, or should I say they don't exist in my xenforo anymore (I've moved that content to wordpress so they exist there as categories).

I understand what you're saying about the generic link, but at the end of the day I don't know what else to do, when I changed from vb I knew I would take some damage like this.
 
Top Bottom