it works but.. (General)

by Bubba @, Wednesday, January 01, 2014, 15:26 (3739 days ago) @ bakunin
edited by Bubba, Wednesday, January 01, 2014, 15:46

You're welcome, I'm glad you found it useful. I had only intended for it to work with the share links, which is why I said paste a video share link in the post, I guess I should have made it clear that it would not work with the normal urls. My intent was to get the job done with the smallest amount of code possible, so the code only handled the share links and nothing else. Just add the following directly above or below the other code and it will handle the regular urls ;-)

    if (strpos($content,"http://www.youtube.com/watch?v=") !== false) {
     $content = str_replace("http://www.youtube.com/watch?v=", "http://www.youtube.com/v/", $content);
    }

Complete thread:

 RSS Feed of thread