Resource icon

Post Content Find / Replace 1.0.0

No permission to download
Do me a favor and hit edit on one of the posts with your link in it and paste that in a code block here so I can see what is actually in the post.

Code:
dear members kindly share your knowledge at the thread

http://www.defence.pk/forums/wmd-missiles/20716-surface-air-missile-7.html

Here...
 
yeah that finds lots, but only up to the glossary.php point or the /glossary/ point.
Ok thats what it was supposed to do...there is something I am not seeing on your board which I can't account for by a guess...I had you run that expression to verify that there is a lot of those links, make note of the number...this is how we can check that we catch them all later.

Now try this expression (so I can get more information about what possible things may be in the match)

#.....travelstories\.gr/glossary(?:\.php|/).....#siu
 
Last edited:
Code:
dear members kindly share your knowledge at the thread

http://www.defence.pk/forums/wmd-missiles/20716-surface-air-missile-7.html

Here...

When you hit edit on the post , also switch to the bbcode editor. I need the output including the bbcode tags if any like this..

[URL]http://blah.com[/URL]
or
[URL='http://blah.com']Click here to read about blah[/URL]
 
Yep that seems to work too. What next? :D
I need you to look over that list and find see if their are any drastic differences in the first and last 5 characters of the entries. Without having access to your board I would guess that the problem should reveal itself within those 5 characters


(updated that expression above...went HAM on the dots)
 
Yeah, so first 5 characters of that string seem identical in all finds.

The last 5 characters, we have various types:

- a few entries end up like so: travelstories.gr/glossary/18233 (so basically they only have 5 numbers after the /glossary/ part)

- most entries have these last characters:

glossary.php?do=i
 
When you hit edit on the post , also switch to the bbcode editor. I need the output including the bbcode tags if any like this..

[URL]http://blah.com[/URL]
or
[URL='http://blah.com']Click here to read about blah[/URL]

Code:
Post all the news and updates of Gwadar here. :bounce:

Old thread can be found here: [URL]http://www.defence.pk/forums/economy-development/1232-gwadar-jewel-crown-13.html[/URL]

Thanks
 
~req cont.


Quick Find:
Code:
[url


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


Replacement String:
Code:
\1\2\4\5\6\8


~req cont.

Quick Find:
Code:
[url


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


Replacement String:
Code:
\6

Test those first before applying anything, I am tired and going to sleep soon.
 
Do we still need this for 1.2?

There is nothing saying anyone needs this, it is a tool primary used for editing posts after an import, rewriting bbcodes whose syntax/embed method has changed and fixing other post oddities that come from moving from one system to another.

If you didn't start using a different bbcode recently (for one you already had that works differently) or if you did not import a db you probably wont need this, but yes if you need to do post replacements, this will need to be installed as an addon.
 
There is nothing saying anyone needs this, it is a tool primary used for editing posts after an import, rewriting bbcodes whose syntax/embed method has changed and fixing other post oddities that come from moving from one system to another.

If you didn't start using a different bbcode recently (for one you already had that works differently) or if you did not import a db you probably wont need this, but yes if you need to do post replacements, this will need to be installed as an addon.

Thanks, I was wondering whether it's built into 1.2 or not.
 
Does the search has to be rebuild to run this? After migration?
I haven't rebuilt the search and running this, and getting time out errors even though i have decreased the limit to 500 via modification.
 
Thanks, I was wondering whether it's built into 1.2 or not.
No problem, but yeah it's not included because this is not a tool most people are going to use all of the time.

I don't think the post replacement is ever going to be included in the core software (maybe one day as a debug mode only function) for the simple fact that an unsuspecting person who sees it in the acp might copy and paste something they see, like in this thread for example, and that person might have wanted to match a string and replace a segment of it and when they came here they may copy/paste something that was posted in response to someone asking how to completely remove a string that is matched leaving them with missing parts of posts that are not recoverable without restoring a backup.

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.

Does the search has to be rebuild to run this? After migration?
I haven't rebuilt the search and running this, and getting time out errors even though i have decreased the limit to 500 via modification.
I would say no I wouldn't think the search has anything to do with this.
 
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
 
Top Bottom