Resource icon

Post Content Find / Replace 1.0.0

No permission to download
Thanks @EQnoble :)

I tried it without saving and what it showed me seemed to be OK, but then when I wanted to save I received this error.

Code:
Please enter a message with no more than 5 pieces of media.

All that means is that you have a post that has more than 5 embeds (which is the default max embeds per message in xf) in it...you can go into your admin control panel and within 'options' find 'messages' and then while you are doing your replacements change 'Maximum Media Embeds per Message' from 5 to 0, when you are done you can change this back to five.
 
Thanks, that worked, we're getting closer, but now I have to fix this ones.

Just in case, this is what I see in the BB Code Editor when I edit the posts.

Code:
[URL='http://[media=youtube'][media=youtube']OtkOofSswP4[/media][/URL]

And...

Code:
[URL='http://[media=youtube'][media=youtube']KQwmcGI33q0[/media]

[media=youtube']Ph-nR09RiYE[/media]

[media=youtube']kKMO5_iTyTg[/media]

[media=youtube']k7c7-QzcTxo[/media]

[media=youtube']6BT6jBjulZ8[/media]

[media=youtube']0FJVi52NUn4[/media]

[media=youtube']nihHG4YH2SQ[/media]

[media=youtube']nUHN3iUfAtg[/media]

[media=youtube']GjvFBZbP2Gg[/media]

[media=youtube']wGrHLnOaQyM[/media]

[media=youtube']QSqlKDDEYqs[/media][/URL]


upload_2014-1-25_16-44-37.webp
 
Yeah i just noticed that there is an error in your bbcode from before we started. Run this to fix that...

Quick Find:
Code:
youtube

Regular expression:
Code:
#\[media=youtube']#siu

Replacement String:
Code:
[media=youtube]


Then run the following to clean up that url then double media tag as well as the closing media followed by the url

Quick Find:
Code:
youtube

Regular expression:
Code:
#(?:\[url='http://)\[media=youtube]|(\[/media])\[/url]#siu

Replacement String:
Code:
\1
 
What do you mean it doesn't work? Like what does it show you in the addon....I just replicated that post in my db and tested the replacements and they work just fine and also tested the expression independently...

efgdfsf.webp
 
I tried to, but regex doesn't seem to be something I can learn in just a couple of minutes (I'm not a programmer), so I'll ask for your help once again.


Code:
[URL]http://youtu.be/2yFMjjk4tis[/URL]

Code:
[URL]http://vimeo.com/83947019[/URL]
 
Code:
[URL]http://youtu.be/2yFMjjk4tis[/URL]

Quick Find:
Code:
youtube

Regular expression: updated 10.23.13-11:31amEST
Code:
#(?:\[url])http(?:s)?://(?:www\.)?(?:[a-z0-9-]+\.)?youtu(?:be\.com/(?:[a-z]+(?:/api/videos/)?)|\.be)(?:\?v=|/)?([a-z0-9_-]{11})(?:[^\s]+)?(?:\[/url])#siu

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



Code:
[URL]http://vimeo.com/83947019[/URL]

Quick Find:
Code:
vimeo

Regular expression:
Code:
#(?:\[url])http(?:s)?://(?:www\.)?vimeo.com/(?:(?:groups/|album/)(?:[^/]+/)video(?:s)?/)?([^/\[]+)(?:\[/url])#siu

Replacement String:
Code:
[media=vimeo]\1[/media]
 
Those don't seem to work, I've left Save Changes unchecked to check what was going to be changed and nothing showed up. :unsure:
 
This is how it looks in the post:

Code:
[URL]http://forum.emobucket.com/groupcp.php?g=53924[/URL]

I need to replace

Code:
http://forum.emobucket.com

Within that with

Code:
http://www.yabucket.com
 
That happens because some of your posts have only that image in there...if you remove it and it is the only thing you have a blank post which you shouldn't be able to save anyways... if you place something in the replacement field like 'img-removed' it will save.

Running into the same issue. How do I do this without also adding it to every post that is valid?

Edit: Never mind, found your other expression and it worked fine.
 
Last edited:
Running into the same issue. How do I do this without also adding it to every post that is valid?

Edit: Never mind, found your other expression and it worked fine.

If you want to use one expression for all and need something to hold the place of the post for posts with only an image and at the same time not add anything visible to the post, you can just use [plain][/plain] for the replacement value, it wont display anything extra in the visible post...but the post content itself wont be empty, and in the case that the image is not the only thing in the post...this will also add nothing nor shift character spaces other than the removal of the image.
 
This is how it looks in the post:
Code:
[URL]http://forum.emobucket.com/groupcp.php?g=53924[/URL]

replace:
Code:
http://forum.emobucket.com

with:
Code:
http://www.yabucket.com

Are you looking to change (one of the following):
Any link starting with forum.emobucket.com/groupcp.php?= ?
Any link with
forum.emobucket.com in it ?
Any link with
emobucket.com in it at all ?
 
This one:

Any link with forum.emobucket.com in it ?
I used a query courtesy of Jake to do simple replacements like this one. You could run this query to change the links.

Code:
UPDATE xf_post SET message = REPLACE(message, 'forum.emobucket.com','www.yabucket.com');
 
How can I find all posts that start with the quote tag and end with closing quote tag?

Some of my members continually click the Reply button below a message and then they go to the quick editor and click Post Reply before writing their reply.

So I'd like to find all posts with the following content... So I guess a RegExp for [quote and the ending /quote] and what's important: only find posts that have nothing after the closing /quote] tag...

Code:
[quote="MemberName, post: 20734, member: 2014"]Content...[/quote]

thanks so much!
 
Last edited:
Hi,

i have moved from vB4 to XF and problems with links with german umlauts / percents:

old: http://de.wikipedia.org/wiki/Brevet_(Fahrrad)
new: http://de.wikipedia.org/wiki/Brevet_%28Fahrrad%29

old: http://www.pedelecforum.de/forum/showthread.php?1560-Chat-auch-für-Pedelec
new: http://www.pedelecforum.de/forum/showthread.php?1560-Chat-auch-f%FCr-Pedelec

old: http://www.novosport.de/?Produkte:Sitze_und_Polster:-_für_Kurzliegeräder
new: http://www.novosport.de/?Produkte:Sitze_%26amp%3B_Polster:Sitze_f%FCr_Kurzlieger%E4der

Can i correct this with that tool?

Thanks.
 
Back
Top Bottom