Resource icon

Post Content Find / Replace 1.0.0

No permission to download
Thanks jake.

Another quick question...if I do a replacement for old @tagging, will that send everyone a new alert for all the old user tags?
I do not think it will, I tested it on my end and it did not but it is not a real environment and I am every user there. Assuming that what I saw in my tests repeats I would say no it won't resend all the alerts.

I have a feeling that is done at post time but you will have to wait for another answer to know for sure what's really good with that.

I'm not very good with regex and I looked all over this thread for an exact example of how to remove some old AME tags but didn't see anything. Here's what I currently have and want to get rid of

[ame=[media=youtube]QrDTmOECeMw[/media] - Inner City - YouTube[/ame]


to turn:
[ame=[media=youtube]QrDTmOECeMw[/media] - Inner City - YouTube[/ame]
into:
[media=youtube]QrDTmOECeMw[/media]
you should be able to use the following:


Code:
Quick Find:           [ame=[
Regular expression:   #\[ame=(\[media\=youtube\][^\[]+\[\/media\])[^\[]+\[\/ame\]#siu
Replacement String:   \1
 
I do not think it will, I tested it on my end and it did not but it is not a real environment and I am every user there. Assuming that what I saw in my tests repeats I would say no it won't resend all the alerts.

I have a feeling that is done at post time but you will have to wait for another answer to know for sure what's really good with that.




to turn:
[ame=[media=youtube]QrDTmOECeMw[/media] - Inner City - YouTube[/ame]
into:
[media=youtube]QrDTmOECeMw[/media]
you should be able to use the following:


Code:
Quick Find:           [ame=[
Regular expression:   #\[ame=(\[media\=youtube\][^\[]+\[\/media\])[^\[]+\[\/ame\]#siu
Replacement String:   \1

Do you know if this addon uses the search index? I'm seeing a bunch of old codes its not converting. My search index is incomplete at the moment so I was wondering if that's the reason.
 
Do you know if this addon uses the search index? I'm seeing a bunch of old codes its not converting. My search index is incomplete at the moment so I was wondering if that's the reason.
I don't think it does...I believe it just runs across the posts table.

Give me an example of a bbcode it didn't convert
 
I don't think it does...I believe it just runs across the posts table.

Give me an example of a bbcode it didn't convert

Here's a couple

[ame=[media=youtube]o2_bwpCWO1g[/media] X - Another Pig Bites the Dust - YouTube[/ame]
[ame=[media=youtube]pPvlpc-AhTc[/media] X - Down So Long - YouTube[/ame]

edit: its copying the links incorrectly

Code:
[ame=http://www.youtube.com/watch?v=o2_bwpCWO1g]Askari X - Another Pig Bites the Dust - YouTube[/ame]
[ame=http://www.youtube.com/watch?v=pPvlpc-AhTc]Askari X - Down So Long - YouTube[/ame]
 
Last edited:
So are these not converted in the actual posts or are these being returned as search results..

I just tested those links with the same expression and they worked fine.

Did you by chance do this as Jake suggested?
http://xenforo.com/community/threads/import-from-ipb-3-2-posts-not-parsed-at-all.39577/#post-435226

If so you must keep running the same expression until it has caught all of them since as I understand it if you follow those instructions, when you replace in posts it will do it in batches of 5000, so if you set that number to 5000 and you have 20000 expected matches you will need to run the expression 4 times to catch them all.
 
So are these not converted in the actual posts or are these being returned as search results..

I just tested those links with the same expression and they worked fine.

Did you by chance do this as Jake suggested?
http://xenforo.com/community/threads/import-from-ipb-3-2-posts-not-parsed-at-all.39577/#post-435226

If so you must keep running the same expression until it has caught all of them since as I understand it if you follow those instructions, when you replace in posts it will do it in batches of 5000, so if you set that number to 5000 and you have 20000 expected matches you will need to run the expression 4 times to catch them all.

I edited my post, guessing you didn't see the update. These are the codes that aren't being updated. I've tried all the different AME replacements in this thread :(

Code:
[ame=http://www.youtube.com/watch?v=o2_bwpCWO1g]Askari X - Another Pig Bites the Dust - YouTube[/ame]
[ame=http://www.youtube.com/watch?v=pPvlpc-AhTc]Askari X - Down So Long - YouTube[/ame]

And yes, I did what Jake suggested but I run the same process over and over until it doesn't find any matches.
 
do all ame links for youtube go like this...
youtube.com/watch?v=o2_bwpCWO1g
youtube.com/watch?v=pPvlpc-AhTc

or do some have this kind of stuff in them &feature=related

do a quick search in post replace to find out...



quick search: [ame=http://www.youtube.com

regex: #\[ame\=http\:\/\/(www\.)?youtube\.com#siu

 
Last edited:
Hi, can anyone help me?

I need to change my vBulletin BB Code [YOUTUBE]o2_bwpCWO1g[/YOUTUBE] to xenforo.

What should I use on quick search, regex and replacement strings fields?
 
do all ame links for youtube go like this...
youtube.com/watch?v=o2_bwpCWO1g
youtube.com/watch?v=pPvlpc-AhTc

or do some have this kind of stuff in them &feature=related

do a quick search in post replace to find out...



quick search: [ame=http://www.youtube.com

regex: #\[ame\=http\:\/\/(www\/)?youtube\.com#siu


It didn't find anything.

Maybe it is using the search index. :confused:
 
Hi, can anyone help me?

I need to change my vBulletin BB Code [YOUTUBE]o2_bwpCWO1g[/YOUTUBE] to xenforo.

What should I use on quick search, regex and replacement strings fields?



Code:
Quick Find:           [youtube
Regular expression:   #\[youtube\]([^\]]+)\[\/youtube\]#siu
Replacement String:   [media=youtube]\1[/media]
 
Found 5k posts of just:


[ame=http://www.youtube.com


Try this....(I really need complete imports to test all of these expressions...) let me know how it goes because I am flying blind here.

Code:
Quick Find:           [ame=http://www.youtube.com
Regular expression:   #\[ame\=http\:\/\/(www\.)?youtube.com\/watch\?([a-z]+\=[^\=\&\]]+\&)*v\=([^\]\&]+)(\&[a-z]+\=[^\=\&\]]+)*\][^\[]+\[\/ame\]#siu
Replacement String:   [media=youtube]\3[/media]
 
Last edited:
Try this....(I really need complete imports to test all of these expressions...) let me know how it goes because I am flying blind here.

Code:
Quick Find:           [ame=http://www.youtube.com
Regular expression:  #\[ame\=http\:\/\/(www\.)?youtube.com\/watch\?([a-z]+\=[^\=\&\]]+\&)*v\=([^\]\&]+)(\&[a-z]+\=[^\=\&\]]+)*\][^\[]+\[\/ame\]#siu
Replacement String:   [media=youtube]\3[/media]

I had to really limit the amount it was replacing but it seems to be working. Thanks
 
Hi!

How can I replace this:
<a class="postlink-local" href="http://test.com" onclick="window.open(this.href);return false;">Test</a>

... with this:
http://test.com

.... or to this:
Test


This will do what you said last. Please try it on a test bed first.

Code:
Quick Find:          <a class="postlink-local"
Regular expression:  #<a\sclass\=\"postlink\-local\"\shref\=\"([^<\"]+)\"\sonclick\=\"window\.open\(this\.href\)\;return\sfalse\;\"\>([^<\<]+)<\/a>#siu
Replacement String:  [URL="\1"]\2[/URL]
 
Last edited:
Top Bottom