Plugin Directory

Changeset 472341


Ignore:
Timestamp:
12/08/2011 07:45:04 AM (14 years ago)
Author:
gerhard
Message:
 
Location:
ninja-embed-plugin/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ninja-embed-plugin/trunk/ninja_embed_plugin.php

    r468227 r472341  
    44Plugin URI: http://blog.ninjasforhire.co.za/65/ninja-embed-wordpress-plugin/
    55Description: This plugin allows you to filter media links from YouTube, Vimeo and Soundcloud and also allows for shortcodes in posts e.g. [media width="400" height="225" link="http://www.vimeo.com/12345"]. In the code it can be called like this: media_embed($mediaurl, $width, $height). For both methods Width and height is to change player dimentions and is optional.
    6 Version: 1.0
     6Version: 1.1
    77Author: Ninjas for Hire
    88Author URI: http://www.ninjasforhire.co.za
     
    4949            // youtube
    5050           
    51             $youtube_key = explode('/', $mediaurl);
    52             $youtube_key = explode('v=', $youtube_key[3]);
    53            
    54             if ( isset($youtube_key[1]) ) {
     51            if(strpos($mediaurl, "&v") || strpos($mediaurl, "?v")) {
     52               
     53                $youtube_key = explode('/', $mediaurl);
     54                $youtube_key = explode('v=', $youtube_key[3]);
     55               
    5556                $youtube_key = explode('&', $youtube_key[1]);
     57               
    5658            } else {
    57                 $youtube_key = explode('&', $youtube_key[0]);
     59               
     60                $youtube_key = explode('?', $mediaurl);
     61               
     62                $youtube_key[0] = substr($youtube_key[0], -11);
     63               
    5864            }
    5965           
     
    6167           
    6268        } else {
     69           
    6370            echo '<p>Sorry, this media provider is not currently supported.</p>';
     71           
    6472        }
    6573       
  • ninja-embed-plugin/trunk/readme.txt

    r468259 r472341  
    3636* First Version of the plugin
    3737
     38= 1.1 =
     39* Added support for YouTube videos on profile pages
     40
    3841== Usage ==
    3942
Note: See TracChangeset for help on using the changeset viewer.