XF 1.1 Converting Media Tags from vb3

Kintaro

Well-known member
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?
 
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.
 
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?
 
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?
 
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]
 
This should do it:

Quick Find: [ame

Regular expression: #\[ame\]http:.+youtube\.com/(\w+)\[/ame\]#siU

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

hmm, it didn't find anything when i searched but im in a thread its on right now lol

31734e0b2b4aae68fa3ecc20ac1e0d95.png
 
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 =)
 
Top Bottom