XF 1.1 Converting Media Tags from vb3

TeflonDon

Well-known member
For a replacement like that you can use this addon:

http://xenforo.com/community/threads/post-content-find-replace.6548/

Here are settings for your replacement. I tested this using the example in your post:

Quick Find: [ame

Regular expression: #\[ame="http:.+youtube.+v=(\w+)(&.+)?"\].+\[/ame\]#siU

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

View attachment 22866
@Jake Bunce

This got the majority of my old AME tags but still left quite a few :(

[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]
[ame=[media=youtube]RwaJk-Xsjd8[/media] Rick,Primo & Cougnut "Tribute to Mr Cee" - YouTube[/ame]
[ame=[media=youtube]leB1b1vO6hQ[/media] - Bring It On - YouTube[/ame]

...etc
 

Jake Bunce

XenForo moderator
Staff member
@Jake Bunce

This got the majority of my old AME tags but still left quite a few :(

[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]
[ame=[media=youtube]RwaJk-Xsjd8[/media] Rick,Primo & Cougnut "Tribute to Mr Cee" - YouTube[/ame]
[ame=[media=youtube]leB1b1vO6hQ[/media] - Bring It On - YouTube[/ame]

...etc
Those posts have apparently been edited and subject to auto-media parsing. Those will be exceptions. It is easy to deal with those manually. Or you can run a custom replacement to fix them.
 

imthebest

Well-known member
@JulianD

Quick Find: [ame

Regular expression: #\[ame(=".+")?\]http://www\.youtube\.com/watch\?v=([a-zA-Z0-9_\-]+?).*\[/ame\]#siU

Replacement String: [media=youtube]\2[/media]
Hi Jake, this one converted almost all my AME tags however these appear to be tricky:

Code:
[ame="http://m.youtube.com/watch?v=Gt50ua_9y3I"]http://m.youtube.com/watch?v=Gt50ua_9y3I[/ame]
[ame]http://m.youtube.com/watch?v=kv5dCXiXFaw[/ame]
[ame="http://www.youtube.com/watch?v=U1daYDlgAB8"][COLOR=#0066cc]http://www.youtube.com/watch?v=U1daYDlgAB8[/COLOR][/ame]
[ame="https://www.youtube.com/watch?v=YfkK51dYUbI"]Planetside 2[/ame]
Hope you can give me a hand with this!
 

imthebest

Well-known member
Already took a look however the regex from @Jake Bunce is the more complete I found.
I just want to know if he could include the missing URLs in his regex.
 

Jake Bunce

XenForo moderator
Staff member
@Super120

Quick Find: [ame

Regular expression: #\[ame(=".+")?\]http://m\.youtube\.com/watch\?v=([a-zA-Z0-9_\-]+?).*\[/ame\]#siU

Replacement String: [media=youtube]\2[/media]



Quick Find: [ame

Regular expression: #\[ame(=".+")?\]\[color=[^\]]+\]http://www\.youtube\.com/watch\?v=([a-zA-Z0-9_\-]+?).*\[/color\]\[/ame\]#siU

Replacement String: [media=youtube]\2[/media]



Quick Find: [ame

Regular expression: #\[ame="https://www\.youtube\.com/watch\?v=([a-zA-Z0-9_\-]+?)[^"]*"\][^\[]*\[/ame\]#siU

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

CMGDevel

Active member
So I am running:
PHP:
[ame
#\[ame="http://www\.youtube\.com/watch\?v=([a-zA-Z0-9_\-] ?)[^"]*"\][^\[]*\[/ame\]#siU
[media=youtube]\1[/media]

but it doesn't convert:
PHP:
[ame]http://www.youtube.com/watch?v=Q7f2CPpFLGw[/ame]
why would this be?
 

Mike

XenForo developer
Staff member
The particular configuration you used isn't designed for that format. See the first format @Jake Bunce gave, though you'll need to adjust the URL in the regex to fit exactly.
 
Top