Resource icon

Post Content Find / Replace 1.0.0

No permission to download
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:
A note: please don't use [quote] tags, please use code tags so they preserve whatever you post, otherwise using quotes can cause problems in communication when passing code back and forth.



Also I need a better description of what it is you are showing me in replacement text. What you have shown there is the second subpattern


the replacement (Which I put single quotes instead of double accidentally) should include at least this much

[URL="\1"]\2[/URL]



...says to put the first captured subpattern after the = sign inside the first set of brackets, and put the second captured subpattern in between the two sets of brackets




<a class="postlink-local" href="http://test.com/viewtopic.php?f=25&t=265" onclick="window.open(this.href);return false;">viewtopic.php?f=25&t=265</a>

should become

[url="http://test.com/viewtopic.php?f=25&t=265"]viewtopic.php?f=25&t=265[url]
 
A note: please don't use [quote] tags, please use code tags so they preserve whatever you post, otherwise using quotes can cause problems in communication when passing code back and forth.

Ok, sorry. New here and thank you for that!


Also I need a better description of what it is you are showing me in replacement text. What you have shown there is the second subpattern


the replacement (Which I put single quotes instead of double accidentally) should include at least this much

[URL="\1"]\2[/URL]



...says to put the first captured subpattern after the = sign inside the first set of brackets, and put the second captured subpattern in between the two sets of brackets




<a class="postlink-local" href="http://test.com/viewtopic.php?f=25&t=265" onclick="window.open(this.href);return false;">viewtopic.php?f=25&t=265</a>

should become

[url="http://test.com/viewtopic.php?f=25&t=265"]viewtopic.php?f=25&t=265[url]
Ooh, sorry, really don't understand much of these now. Is it ok? Can I save this?

I've just put your instructions inside and click Proceed. Then I've pasted you what I get.

Or maybe I'll send you some examples again so you can write me instructions again.

Here you are.

<a class="postlink-local" href="http://forum.test.com/viewtopic.php?f=25&t=265" onclick="window.open(this.href);return false;">Something</a>

<a class="postlink-local" href="http://forum.test.com/viewforum.php?f=24" onclick="window.open(this.href);return false;">Something1</a>

Oh, and all those links are redirected now to my new board (if it has something to do with it).
 
Ok, sorry. New here and thank you for that!



Ooh, sorry, really don't understand much of these now. Is it ok? Can I save this?

I've just put your instructions inside and click Proceed. Then I've pasted you what I get.

Or maybe I'll send you some examples again so you can write me instructions again.

Here you are.

<a class="postlink-local" href="http://forum.test.com/viewtopic.php?f=25&t=265" onclick="window.open(this.href);return false;">Something</a>

<a class="postlink-local" href="http://forum.test.com/viewforum.php?f=24" onclick="window.open(this.href);return false;">Something1</a>

Oh, and all those links are redirected now to my new board (if it has something to do with it).

If you have links redirected it makes it easier, when you want to manually rewrite a link you need to do a lot of extra expressions and replacement, in your case if they are redirected the old links are directed to the new links when clicked so changing them should not be needed at all and again in your case you should just need to add the url tags.



I just tested the original expression against the following links.


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

<a class="postlink-local" href="http://test.com/viewtopic.php?f=25&t=265" onclick="window.open(this.href);return false;">viewtopic.php?f=25&t=265</a>

<a class="postlink-local" href="http://forum.test.com/viewtopic.php?f=25&t=265" onclick="window.open(this.href);return false;">viewtopic.php?f=25&t=265</a>

<a class="postlink-local" href="http://forum.test.com/viewforum.php?f=24" onclick="window.open(this.href);return false;">viewforum.php?f=24</a>



The expression seems to catch everything on my end.
PCRT.webp


So from my testing this will work if you copy and paste everything correctly


Quick Find:
Code:
<a class="postlink

Regular expression:
Code:
#<a\sclass\=\"postlink\-local\"\shref\=\"([^<\"]+)\"\sonclick\=\"window\.open\(this\.href\)\;return\sfalse\;\"\>([^<\<]+)<\/a>#siu

Replacement String:
Code:
[URL="\1"]\2[/URL]


If you do this and the replacements shown look good you can save...but IMPORTANT!!! If you don't know what you are doing when it comes to stuff using regex, please do this on a testbed first because regex is very powerful and you could muck up your posts really good with it if you do the wrong thing.
 
Back
Top Bottom