Vladimir’s WordPress Forum


 
guestdefault Vladimirs WordPress Forum
Current User: Guest user permissions Vladimirs WordPress Forum
Search Forums:


searchicon Vladimirs WordPress Forum 






Wildcard Usage:
*    matches any number of characters
%    matches exactly one character

topic Vladimirs WordPress Forum

Support for WordPress.com migration…

addtopic Vladimirs WordPress Forum Add a New Topic addpost Vladimirs WordPress Forum Reply to Post
UserPost

0:36
25 August, 2008


XSportSeeker

 Vladimirs WordPress Forum
Guest

Great plugin Vladimir!

This is not and issue, it's actually an add for the plugin.

For those migrating from WordPress.com blogs:

You probably have used the YouTube tags… they go like this:

(example)

I just migrated to self-hosted, imported all my posts, and ended up with tons of tags like that in the middle of my posts, because I couldn't find any YouTube plugins that used the same tags as WordPress.com

So I decided to pick a plugin and modify it so it works with that.

Here's what I done:

Using a code editor (Notepad++), opened "smartyoutube.php", and on line 445, added this:

        preg_match_all("/\\[youtube\\=http:\\/\\/([a-zA-Z0-9\\-\\_]+\\.|)youtube\\.com\\/watch(\\?v\\=|\\/v\\/)([a-zA-Z0-9\\-\\_]{11})([^<\\s]*)\\]/", $the_content, $matches, PREG_SET_ORDER);
        foreach($matches as $match) {
            $the_content = preg_replace("/\\[youtube\\=http:\\/\\/([a-zA-Z0-9\\-\\_]+\\.|)youtube\\.com\\/watch(\\?v\\=|\\/v\\/)([a-zA-Z0-9\\-\\_]{11})([^\\s<]*)/", yte_tag($match[3], 0), $the_content, 1);   
        }

Just in case someone is also looking for this, or even if you want to add it to your plugin Vladimir.

[]'s

0:42
25 August, 2008


Vladimir

 Vladimirs WordPress Forum
Admin

posts 685

Great addon, surely will be useful for users migrating from WordPress.com.

Cheers

16:47
9 April, 2009


Daniel

 Vladimirs WordPress Forum
Guest

This is exactly what I'm looking for, but it doesn't work in the lastest version of the plugin. I know the line number changed to 555, but putting it in there doesn't work. Any ideas?

21:24
12 April, 2009


Daniel

 Vladimirs WordPress Forum
Guest

Okay I figured it out. On the current version, this is how you do it.

Change line #538 to:

if (( strpos($the_content, "httpv")!==FALSE ) OR
( strpos($the_content, "[youtube")!==FALSE )) {

Then on #555 add:

// This is for [youtube=url] support
preg_match_all("/\\[youtube\\=http:\\/\\/([a-zA-Z0-9\\-\\_]+\\.|)youtube\\.com\\/watch(\\?v\\=|\\/v\\/)([a-zA-Z0-9\\-\\_]{11})([^<\\s]*)\\]/", $the_content, $matches, PREG_SET_ORDER);
foreach($matches as $match) {
$the_content = preg_replace("/\\[youtube\\=http:\\/\\/([a-zA-Z0-9\\-\\_]+\\.|)youtube\\.com\\/watch(\\?v\\=|\\/v\\/)([a-zA-Z0-9\\-\\_]{11})([^\\s<]*)/", yte_tag($match[3], 0), $the_content, 1);
}

Then it works!

22:43
6 February, 2012


jazzylee

 Vladimirs WordPress Forum
Guest

Would it be possible to migrate from the "IFRAME Embed For YouTube" plugin?

It uses code like this

[youtube_video id='http://youtu.be/CHekNnySAfM']
addpost Vladimirs WordPress Forum Reply to Post

Reply to Topic:
Support for WordPress.com migration…

Guest Name (Required):

Guest Email (Required):

htmlEditor Vladimirs WordPress Forum
Smileys
sf confused Vladimirs WordPress Forum sf cool Vladimirs WordPress Forum sf cry Vladimirs WordPress Forum sf embarassed Vladimirs WordPress Forum sf frown Vladimirs WordPress Forum sf kiss Vladimirs WordPress Forum sf laugh Vladimirs WordPress Forum sf smile Vladimirs WordPress Forum sf surprised Vladimirs WordPress Forum sf wink Vladimirs WordPress Forum sf yell Vladimirs WordPress Forum
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
10 + 11