Resource icon

Post Content Find / Replace 1.0.0

No permission to download
can i change the quick find to this †? i get a lot of them this way.
The problem with that is while it would catch †, it would also match strings that start with that and mess them up.


‘
â€
â€
“

â€

The only easy way to replace †is to replace all other strings containing †first or you will end up with all sorts of weirdness.

Example:

“ -should be- “ but running the replacement for †anything but last would leave you with this ”œ making many steps needed to fix this.

to be honest in this case I am not comfortable just giving you instructions because you can really mess up your post table if you do anything out of order or incorrectly,it wont completely ruin your posts but it will make it 50 times harder to replace everything and at the very least take a lot of time.

If this addon supported using a callback processor I could write a script to handle this with one shot but with regex alone it is very involved and probably not suitable for someone who doesn't already understand it and I don't want to be responsible if your posts get fubar'd and I don't have the time at the moment to do anything that will take a lot time researching.
 
@EQnoble what about this from

" You can run SQL queries to update the text.

UPDATE xf_post SET message = REPLACE(message,'current_content','new_content');"

Take a backup first.
 
It doesn't matter either way...replacements are replacements.

– ’ ‘ “ etc... all need to be replaced before †and that means finding all improperly encoded instances starting with â€(ANYTHING) and replacing those first.
 
Well that sucks! Thanks for your help @EQnoble so I guess i am stuck with 1000's of threads with goobley gobbley- how does this effect search engines? Or anything else for that matter?
 
The problem with that is while it would catch †, it would also match strings that start with that and mess them up.


‘
â€
â€
“

â€

The only easy way to replace †is to replace all other strings containing †first or you will end up with all sorts of weirdness.

Example:

“ -should be- “ but running the replacement for †anything but last would leave you with this ”œ making many steps needed to fix this.

to be honest in this case I am not comfortable just giving you instructions because you can really mess up your post table if you do anything out of order or incorrectly,it wont completely ruin your posts but it will make it 50 times harder to replace everything and at the very least take a lot of time.

If this addon supported using a callback processor I could write a script to handle this with one shot but with regex alone it is very involved and probably not suitable for someone who doesn't already understand it and I don't want to be responsible if your posts get fubar'd and I don't have the time at the moment to do anything that will take a lot time researching.
So to be clear - I should NOT run this â€
 
So to be clear - I should NOT run this â€
No you should not run this until all other instances of things that start with †are converted first...(like – ’ ‘ “) because it will change those and different replacements will be needed and it will be an even bigger mess.

You need to find each instance of strings starting with †first(like these – ’ ‘ “), then once they are replaced you can safely replace (â€).

The problem is you need to know every single improperly encoded string before you start replacing...you can't just find one and replace it and that is not something I can help you with just by asking you to look because if you miss one it could effect everything after that if you replace the last one before catching one you missed.
 
No you should not run this until all other instances of things that start with †are converted first...(like – ’ ‘ “) because it will change those and different replacements will be needed and it will be an even bigger mess.

You need to find each instance of strings starting with †first(like these – ’ ‘ “), then once they are replaced you can safely replace (â€).

The problem is you need to know every single improperly encoded string before you start replacing...you can't just find one and replace it and that is not something I can help you with just by asking you to look because if you miss one it could effect everything after that if you replace the last one before catching one you missed.
So can I run these then safely – ’ ‘ “ without issue? I'll take as much repairing as I can get.
 
Yes those strings can be replaced...

keep this in mind though (I am noting it because it appears you misunderstand how this works), the quick find is not what you are matching, it is limiting the scope of what posts the match is run against

I think of the sequence like this and it may help you to understand what the fields are for:

Quick Find:
In any post that contains this

Regular expression:
Match this regular expression

Replacement String:
and for each instance of a match replace with this




I am replacing what is supposed to be the “ with " because your average person is not going to be entering “ they will be entering this " and I really don't see the point in using those. I updated that post with the expressions that are safe for now.
 
Hi, I have moved one big forum to xenforo but, there are larger amount of HTML content tags, like iframe, embedded etc. that can not work OK.

Now my plan is to use this addon: Post Message Regex Replacer and this ParseHTML to wrap for example all iframe tags into tag of ParseHTML, and at end this should allow for iframe to work.

My question is what I need to use in Regular expression to wrap <iframe> code </iframe> to end up like this [parsehtml] <iframe> code </iframe> [parsehtml]

Thank you for any help
 
Try this

Quick Find:
Code:
youtube


Regular expression:
Code:
#http://(?:www\.)?youtube\.com\/watch\?v=([a-zA-Z0-9_-]{11})(?:[^\s]+)?#siu


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

This worked, but youtube player doesn't show, instead messages look like this:

Code:
[media=youtube]lKudwSJWocs[/media]

If I go and edit the message and save it without changing anything, the player shows up.
 
That should not happen...I can check and see why if allowed access to your board but otherwise when I test replacements on page refresh here on my end the embed works.
 
Hi, I have moved one big forum to xenforo but, there are larger amount of HTML content tags, like iframe, embedded etc. that can not work OK.

Now my plan is to use this addon: Post Message Regex Replacer and this ParseHTML to wrap for example all iframe tags into tag of ParseHTML, and at end this should allow for iframe to work.

My question is what I need to use in Regular expression to wrap <iframe> code </iframe> to end up like this [parsehtml] <iframe> code </iframe> [parsehtml]

Thank you for any help
Can you hit 'edit' on a post containing one of those tags and then click 'use bbcode editor' then copy the contents of the editor window and paste that in between [code][/code] tags here.
 
Hi, greetings from germany.

The next stupid question because i don´t understand the regular expression :)

My source code look likes -->

Code:
[BBvideo 425,350]http://www.youtube.com/watch?v=7addhPljRiM[/BBvideo]

What can i do to change it in
Code:
[media=youtube]xxxxxxxxxxxx[/media]

Thanks for any idea ;)
 
My source code look likes -->

Code:
[BBvideo 425,350]http://www.youtube.com/watch?v=7addhPljRiM[/BBvideo]

What can I do to change it to
Code:
[media=youtube]xxxxxxxxxxxx[/media]

Hi there, try giving this a whirl.

Quick Find:
Code:
[BB


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

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

If it misses any please let me know.
 
Last edited:
Thank you for your answer @EQnoble :)

But, it will not run. Nothing happens after a klick on "Run"

Sorry, yesterday i made a mistake. The link -->
Code:
[BBvideo 425,350]http://www.youtube.com/watch?v=7addhPljRiM[/BBvideo]
is from my phpbb3 installation.

After an import to XF it look likes
Code:
[BBvideo 425,350:st5fv12m]http://www.youtube.com/watch?v=7addhPljRiM[/BBvideo]

Every link has other (always nine) characters behind 425,350 like
Code:
[BBvideo 425,350:bcdefhgh]http://www.youtube.com/watch?v=7addhPljRiM[/BBvideo]

[BBvideo 425,350:utukhjsl]http://www.youtube.com/watch?v=7addhPljRiM[/BBvideo]
 
After an import to XF it look likes
Code:
[BBvideo 425,350:st5fv12m]http://www.youtube.com/watch?v=7addhPljRiM[/BBvideo]

In that case try this...

Code:
[BB

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

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