Resource icon

Post Content Find / Replace 1.0.0

No permission to download
The fact that you can't do an undo with replacements and could bork your whole db with this addon is probably a reason that it is not included and would not be included in the forum software itself. I mean you can put warnings and such on the replacement page but ultimately it is easier and safer to do this as an addon where only people that know what it is and have a reason to install it do so.

That makes perfect sense, thanks for taking time to explain it.
 
I did this in my phpadmin using this code:

Code:
UPDATE xf_post
SET message = REPLACE(message, 'https://8thos.com', 'http://8th.us');

I looked at an old thread and I saw that it still said the 8thos link. When I click the link, its still 8thos.

BUT

when I went to edit the post I saw that it was changed to 8th.us

wtf

So I looked up this addon. Can this be done with his addon?

Whats a code for changing:

https://8thos.com

to

http://8th.us

Yes it can be done, is everything exactly the same except the change from 8thos.com to 8th.us? Kinda need more info.

Do you want any reference anywhere in posts to 8thos.com to be replaced by 8th.us ...be it in links, plain tags, code blocks, quotes etc?

Also does it need to match http://8thos and https://8thos, or are you only trying to catch https and convert it to http for the .us domain?





That makes perfect sense, thanks for taking time to explain it.
no problem man
 
Yes it can be done, is everything exactly the same except the change from 8thos.com to 8th.us? Kinda need more info.

Do you want any reference anywhere in posts to 8thos.com to be replaced by 8th.us ...be it in links, plain tags, code blocks, quotes etc?

Also does it need to match http://8thos and https://8thos, or are you only trying to catch https and convert it to http for the .us domain?
Basically, anything that has https://8thos.com and http://8thos.com and http://www.8thos.com needs to be changed to http://8th.us

Didn't work for me in phpmyadmin using that query apparently.
 
If you want to replace every instance everywhere try this.

Quick Find:
Code:
8thos


Regular expression:
Code:
#((http(?:s)?://)(?:www\.)?)(8thos\.com)([^\[\s']+)?#siu


Replacement String:
Code:
http://8th.us\4
 
This addon broke my post.php page. After installing it I get this error when trying to view posts:

ErrorException: Fatal Error: Class 'XenForo_Model_Post' not found - library/XenForo/Model/Post.php:4
Stack Trace
Code:
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}
Request State
Code:
array(3) {
["url"] => string(73) "http://aoahosting.webfactional.com/threads/extra-life-2013-join-us.26390/"
["_GET"] => array(1) {
["/threads/extra-life-2013-join-us_26390/"] => string(0) ""
}
["_POST"] => array(0) {
}
}
 
Code:
[URL]https://www.facebook.com/photo.php?v=164624740391963&set=vb.539110052800217&type=2&theater[/URL]

Need to convert these into facebook video.

Code:
[video=dailymotion;x14tmd0]http://www.dailymotion.com/video/x14tmd0_kaltak17sep2013_news#from=embediframe[/video]

Need this to convert in daily motion video.
 
This addon broke my post.php page. After installing it I get this error when trying to view posts:

ErrorException: Fatal Error: Class 'XenForo_Model_Post' not found - library/XenForo/Model/Post.php:4
Stack Trace
Code:
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}
Request State
Code:
array(3) {
["url"] => string(73) "http://aoahosting.webfactional.com/threads/extra-life-2013-join-us.26390/"
["_GET"] => array(1) {
["/threads/extra-life-2013-join-us_26390/"] => string(0) ""
}
["_POST"] => array(0) {
}
}
It looks like you uploaded the files to the wrong directory and written over a stock file needed by and included with xenforo.


Try this...

Find the .zip with your copy of xenforo.
-
extract it and go to the following directory...
-
/library/XenForo/Model ,then find Post.php
-
Copy that file and upload it to your server inside the following directory - /library/XenForo/Model/


After re-uploading that file and overwriting the existing one in that folder...check that page that threw you the error before.

If you don't have that error anymore you only need to upload the addon to the proper directory...

extract the zip containing the addon from this thread and upload the entire PostReplace folder to the library folder on your server.

Let me know if that solves the issue.





Code:
[URL]https://www.facebook.com/photo.php?v=164624740391963&set=vb.539110052800217&type=2&theater[/URL]

Need to convert these into facebook video.

Code:
[video=dailymotion;x14tmd0]http://www.dailymotion.com/video/x14tmd0_kaltak17sep2013_news#from=embediframe[/video]

Need this to convert in daily motion video.


Quick Find:
Code:
[url


Regular expression:
Code:
#\[url]https://www\.facebook\.com/photo\.php\?v=([0-9]+)(?:[^\[]+)?\[/url]#siu


Replacement String:
Code:
[media=facebook]\1[/media]



Quick Find:
Code:
[video


Regular expression:
Code:
#\[video=dailymotion;([^]]+)][^\[]+\[/video]#siu


Replacement String:
Code:
[media=dailymotion]\1[/media]
 
It looks like you uploaded the files to the wrong directory and written over a stock file needed by and included with xenforo.


Try this...

Find the .zip with your copy of xenforo.
-
extract it and go to the following directory...
-
/library/XenForo/Model ,then find Post.php
-
Copy that file and upload it to your server inside the following directory - /library/XenForo/Model/


After re-uploading that file and overwriting the existing one in that folder...check that page that threw you the error before.

If you don't have that error anymore you only need to upload the addon to the proper directory...

extract the zip containing the addon from this thread and upload the entire PostReplace folder to the library folder on your server.

Let me know if that solves the issue.








Quick Find:
Code:
[url


Regular expression:
Code:
#\[url]https://www\.facebook\.com/photo\.php\?v=([0-9]+)(?:[^\[]+)?\[/url]#siu


Replacement String:
Code:
[media=facebook]\1[/media]



Quick Find:
Code:
[video


Regular expression:
Code:
#\[video=dailymotion;([^]]+)][^\[]+\[/video]#siu


Replacement String:
Code:
[media=dailymotion]\1[/media]

You're correct. I had already fixed the error by replacing the stock files but because the directory structure isn't in this addon my rsync script didn't work to install it.
 
Quick Find:
Code:
[url


Regular expression: EDITED
Code:
#(\[url]http://)(forums)(\.DOMAIN\.com(?:[^\[]+)?)(\[/url])#siu


Replacement String:
Code:
\1www\3\4

Damn, finally got to run this and got out of memory errors. :) When I searched for how many instances I had in mysql directly, it had about 20k entries (spread over about 10 tables). I guess I can try to temporarily set the memory limit higher one night when I'm burning the midnight oil. ;)
 
Damn, finally got to run this and got out of memory errors. :) When I searched for how many instances I had in mysql directly, it had about 20k entries (spread over about 10 tables). I guess I can try to temporarily set the memory limit higher one night when I'm burning the midnight oil. ;)
nice...gotta love burning at midnight...might just swap out the oils though ;-)


have you tried this for the memory issues?
http://xenforo.com/community/threads/import-from-ipb-3-2-posts-not-parsed-at-all.39577/#post-435226
 
Hi! After crossing on to quote IPB not display correctly.
Can I convert quotes like this:

Code:
Quote(Kulikov @ 04 September 2013, 14:42)
Seregas1979, How are you ?

to quote this kind of ..

Code:
[QUOTE]
(Kulikov @ 04 September 2013, 14:42)
Seregas1979, How are you ?
[/QUOTE]
 
I have never been a member at a forum running IP board so I don't know the syntax for their various bbcodes.


Is this...
Code:
[QUOTE]
(Kulikov @ 04 September 2013, 14:42)
Seregas1979, How are you ?
[/QUOTE]
...what you see when you click edit on a post in xenforo?

That is what I need to see to write the regex.
 
Please forgive me for my bad English!
The first example of this is now,
The second example - the way I want to do!

By the way this addon works on 1.2.2?
 
Please forgive me for my bad English!
The first example of this is now,
The second example - the way I want to do!

By the way this addon works on 1.2.2?
Don't worry about it.

I need you to go to your forum, on one of the posts that has a quote, and while logged in as admin click 'edit' on that post and copy the quote in the editor. That is what I need you to paste in a code block here.
 
We kind of left mine in the middle, can you have a quick look ? :)

Yes but I be forced to expect you to take a quick look at this DocEvil.gif

Quick Find:
Code:
[url


Regular expression:
Code:
#\[url='http://www.travelstories.gr/glossary(?:.|/)[^]]+]([^]\[]+)(\[/url])#siu


Replacement String:
Code:
\1

Let me know how that works.
 
Top Bottom