Vladimir’s WordPress Forum


 
Current User: Guest
Search Forums:


 






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

Support for WordPress.com migration…

Add a New Topic Reply to Post
UserPost

0:36
25 August, 2008


XSportSeeker

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

Admin

posts 707

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

Cheers

16:47
9 April, 2009


Daniel

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

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

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']
Reply to Post

Reply to Topic:
Support for WordPress.com migration…

Guest Name (Required):

Guest Email (Required):

HTML Editor
Smileys
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

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