• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.1 Converting Media Tags from vb3

Kintaro

Well-known member
#1
In vb3 I use AME Automatic Media Embeding.

The problem is that AME have the possibility to restore link removing [AME] tags but it will restore it with [url] tags... plus some tags are like [AME=youtube]9MkB6NkQscI[/AME] and it will restore it like

[url]9MkB6NkQscI[/url]


do you suggest to maintain AME tags and replace them in a second moment?
 

Brogan

XenForo moderator
Staff member
#2
You can try doing a simple SQL query to replace identical strings in the post table.

Code:
UPDATE xf_post SET message = REPLACE(message,'current_content','new_content');
So in your case it would be:
Code:
UPDATE xf_post SET message = REPLACE(message,'[AME=youtube]','[media=youtube]');
UPDATE xf_post SET message = REPLACE(message,'[/AME]','[/media]');
Take a backup of the post table first though before you try that.
 

Kintaro

Well-known member
#4
Here I am again :D

I was wrong with the tags, they are not simple like [ame=youtube] :(

I played a little with regex into mysql replace query for extract and replace from vb3_post.pagetext something like this:

Code:
[ame="http://www.youtube.com/watch?v=rH9w5M1afc&feature=g-all-u&context=G240730aFAAAAAAAADAA"]title      - YouTube[/ame]
into this:

Code:
http://www.youtube.com/watch?v=rH9w5M1afc
But I fail! :D
I need to study more regex!!
Can you help me with this?

p.s. In this way when I'll import in xenforo it will embed right?
 

Kintaro

Well-known member
#6
Wow I totally missed it! ...and is a Kier addon!
I need to work on my search skill. :D

p.s. Thank you for the regex Jake.
 

Rob

Well-known member
#7
how would i match these:-
[ url = "http://www.youtube.com/blah"]link text [/ url] and turn them into regular media tags?

Either that, or I need to re-enable AME and convert those tags instead. I need to do this also for amazon links and god knows what else.

I'm thinking it should be easier to work with regular [u rl] tags do you think?
 

Jake Bunce

XenForo moderator
Staff member
#8
how would i match these:-
[ url = "http://www.youtube.com/blah"]link text [/ url] and turn them into regular media tags?

Either that, or I need to re-enable AME and convert those tags instead. I need to do this also for amazon links and god knows what else.

I'm thinking it should be easier to work with regular [u rl] tags do you think?
Try this:

Quick Find: [url

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

Replacement String: [media=youtube]\1[/media]
 
#15
I tried the regex to replace the ame ones, and it found a bunch, but afterwards I'm still seeing the [ame tags and no videos in the posts.
 

JulianD

Well-known member
#18
I'm sorry to bring this thread up after so many months but I have recently imported my 5M forum and I'm having some trouble converting all these AME links.

I can't get to match this one with the expressions above.

Code:
[ame]http://www.youtube.com/watch?v=mJb_I0y-Da8[/ame]
[ame="http://www.youtube.com/watch?v=KbWgUO-Rqcw"]http://www.youtube.com/watch?v=KbWgUO-Rqcw[/ame]
[ame="http://www.youtube.com/watch?v=-3X00EPzphA"]http://www.youtube.com/watch?v=-3X00EPzphA[/ame]
[ame]http://www.youtube.com/watch?v=QfOmCmc-syc[/ame]

[ame]http://www.youtube.com/watch?v=WUE7nGPfaa4#[/ame]
[ame]http://www.youtube.com/watch?v=gPjkUXXH5V4#[/ame]
Any help would be appreciated @hathway @Jake Bunce =)