WordPress.org

Plugin Directory

Changeset 575493


Ignore:
Timestamp:
07/21/12 15:06:03 (5 years ago)
Author:
birgire
Message:

added new attributes: id, listtype, autohide, autoplay, disablekb. Added the possibility to display user favorites playlist

Location:
youlist/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • youlist/trunk/readme.txt

    r572896 r575493  
    11=== youList - Youtube playlist shortcode  === 
    22Contributors: birgire 
     3Donate link: https://www.paypal.com/is/cgi-bin/webscr?cmd=_flow&SESSION=oKt0477jvHqLRssQCQmB_Oas5csxlh316mkBM4p9soLqQ3o-wfIuZPzqdQy&dispatch=5885d80a13c0db1f8e263663d3faee8d7283e7f0184a5674430f290db9e9c846 
    34Tags: youtube, shortcode, embed, playlist, youtube playlist 
    45Requires at least: 3.0 
    56Tested up to: 3.4.1 
    6 Stable tag: 1.0.0 
     7Stable tag: 1.0.1 
    78License: GPLv2 or later 
    89License URI: http://www.gnu.org/licenses/gpl-2.0.html 
    910 
    10 A simple shortcode to embed YouTube™ playlists or many YouTube™ videos in a single YouTube™ player  
     11A simple shortcode to embed playlists or handpicked videos in a single YouTube™ player.  
    1112 
    1213== Description == 
    13 This plugin adds the shortcode `[youlist]` so you can easily embed YouTube™ playlist or many videos in a single YouTube™ player into your posts and pages. 
    1414 
    15 The plugin can also display YouTube™ playlist from a search string or all uploaded videos by a user. 
     15This plugin adds the shortcode [youlist] so you can easily embed  YouTube™ playlist defined by 
     16 
     17* playlist id (PL in front of the playlist id) 
     18* many videos (comma seperated video ids list) 
     19* user favorites  
     20* user uploads 
     21* search query 
     22 
     23in a single YouTube™ player. 
     24 
     25[Live demo](http://xlino.com/projects/youlist-youtube-playlist-shortcode-plugin/) 
    1626 
    1727= Usage Examples = 
    18 To embed a playlist with thumbnails: 
     28 
     29To embed a playlist with thumbnails  
    1930`[youlist pid="PL3FF15AA7ED356D9F"]` 
    2031 
    21 To embed three videos with thumbnails: 
     32To embed three videos with thumbnails (comma seperated video id list): 
    2233`[youlist vid="ZF_K8D414-Y,sFHXWoawnt0,E2uOGOqIyC4"]` 
    2334 
     
    2637 
    2738To embed a playlist from the search string "higgs boson" 
    28 `[youlist search="higgs boson"]` 
     39`[youlist search="higgs boson" width="600" height="400"]` 
    2940 
    3041To embed a playlist for all uploaded videos for the user "mismag822" 
    31 `[youlist uid="mismag822"]` 
     42`[youlist uid="mismag822" listtype="user_uploads"]` 
    3243 
    33 To embed three videos with all the supported attributes: 
     44To embed a playlist for all favorite videos for the user "mismag822" 
     45`[youlist uid="mismag822" listtype="user_favorites"]` 
     46 
     47To embed a user playlist with all the supported attributes (default values shown): 
    3448`[youlist  
    35     vid="ZF_K8D414-Y,sFHXWoawnt0,E2uOGOqIyC4"  
     49    uid="mismag822"  
    3650    showinfo="1"  
    3751    width="680"  
    3852    height="480"  
    3953    class="youlist" 
     54    autohide="2" 
     55    autoplay="0" 
     56    disablekb="0" 
     57    listtype="user_uploads" 
    4058    theme="dark"  
    4159    modestbranding="1"  
     
    5472 
    5573 1. You can use it to display ad-video before or after the main video 
    56  2. You can have your own short trailer before the main video 
    57  3. You can collect video lessons/tutorials 
    58  4. You can use it for your YouTube™ playlist 
    59  5. ... etc ... 
     74 1. You can have your own short trailer before the main video 
     75 1. You can collect lessons/tutorials/music videos 
     76 1. You can use it for your YouTube™ playlist 
     77 1. You can watch your friends favourites videos 
     78 1. You can collect videos for your kid and watch it on your site 
     79 1. ... etc ... 
    6080 
    6181= Shortcode Parameters =  
     82 
    6283The youList-shortcode is a wrapper for most of the YouTube™ iframe parameters described here: 
    6384 
     
    6990 * height (pixels) 
    7091 * class (css classname) 
     92 * id (css id) 
    7193 
    7294**youtube parameters:** 
     
    7597* pid (YouTube playlist ID) 
    7698* uid (YouTube user ID) 
     99* listtype (YouTube listtype) 
    77100* search (YouTube search string) 
    78101* theme (dark or light) 
    79102* modestbranding (0 or 1) 
    80103* showinfo (0 or 1) 
    81 * controls (0 or 1) 
     104* autohide (0,1 or 2) 
     105* autoplay (0 or 1) 
     106* disablekb (0 or 1) 
     107* controls (0,1 or 2) 
    82108* color (red or white) 
    83109* fs (0 or 1) 
     
    89115 
    90116== Installation == 
     117 
    91118= Installation = 
     119 
    92120 1. Upload the plugin directory to the `/wp-content/plugins/` directory or use the installer via backend of WordPress 
    93  2. Activate the plugin through the 'Plugins' menu in WordPress 
     121 1. Activate the plugin through the 'Plugins' menu in WordPress 
    94122 
    95123== Screenshots == 
     124 
    96125 1. YouTube playlist with thumbnails: 
    97  2. Three YouTube videos with thumbnails 
    98  3. Three YouTube videos without thumbnails 
     126 1. Three YouTube videos with thumbnails 
     127 1. Three YouTube videos without thumbnails 
    99128 
    100129== Changelog == 
     130 
     131= 1.0.1 = 
     132 
     133* added new attributes: listtype, autohide, autoplay, disablekb 
     134* added the possibility to display user's favorites playlist 
     135* changed the readme.txt file -  new usage examples 
     136 
     137 
    101138= 1.0.0 = 
    102  * Initial Release 
    103139  
     140* Initial Release 
     141  
  • youlist/trunk/youlist.php

    r572896 r575493  
    44Plugin URI:  http://wordpress.org/extend/plugins/youlist/ 
    55Description: Shortcode for embedding a Youtube playlist or multiple Youtube videos with a single Youtube player 
    6 Version:     1.0.0 
     6Version:     1.0.1 
    77Author:      Birgir Erlendsson 
    88Author URI:  http://profiles.wordpress.org/birgire 
     
    1818        'width' => '640',       // in pixels 
    1919        'height' => '480',      // in pixels 
    20         'class' => 'youlist',       // css classname 
     20        'class' => 'youlist',       // css class name 
    2121        'theme' => 'dark',      // [dark|light] 
     22        'listtype' => 'user_uploads',   // [user_uploads|user_favorites|playlist|search] 
    2223        'modestbranding' => '1',    // [0|1] 
    2324        'showinfo' => '1',      // [0|1] 
    24         'controls' => '1',      // [0|1] 
     25        'controls' => '1',      // [0|1|2] 
     26        'autoplay' => '0',      // [0|1] 
     27        'autohide' => '2',      // [0|1|2] 
     28        'disablekb' => '0',     // [0|1] 
    2529        'color' => '1',         // [red|...] 
    2630        'fs' => '1',            // [0|1]  
     
    4246    $start=(int)$start; 
    4347    $loop=(int)$loop; 
     48    $autohide=(int)$autohide; 
     49    $autoplay=(int)$autoplay; 
     50    $disablekb=(int)$disablekb; 
    4451    $iv_load_policy=(int)$iv_load_policy; 
    4552    $version=(int)$version; 
     
    5158    $uid=esc_attr($uid); 
    5259    $search=esc_attr($search); 
     60    $listtype=esc_attr($listtype); 
    5361         
    5462    // format attributes 
    5563    $vid = str_replace(" ","",$vid); 
     64    $pid = str_replace(" ","",$pid); 
     65    $uid = str_replace(" ","",$uid); 
    5666 
    57     //construct the get-query 
    58     $query="&version={$version}&modestbranding={$modestbranding}&showinfo={$showinfo}&theme={$theme}&controls={$controls}&color={$color}&start={$start}&loop={$loop}&iv_load_policy={$iv_load_policy}&fs={$fs}"; 
     67    //construct the common get-query 
     68    $query="&version={$version}&modestbranding={$modestbranding}&showinfo={$showinfo}&theme={$theme}&controls={$controls}&color={$color}&start={$start}&loop={$loop}&iv_load_policy={$iv_load_policy}&fs={$fs}&disablekb={$disablekb}"; 
    5969 
    6070    //iframe style 
     
    6777    // user uploads list: 
    6878    }elseif(strlen($uid)>0){ 
    69         $s="<iframe class=\"{$class}\" style=\"{$style}\" src=\"http://www.youtube.com/embed/?listType=user_uploads&list={$uid}{$query}\"></iframe>"; 
     79        $s="<iframe class=\"{$class}\" style=\"{$style}\" src=\"http://www.youtube.com/embed/?listType={$listtype}&list={$uid}{$query}\"></iframe>"; 
    7080    // search list: 
    7181    }elseif(strlen($search)>0){ 
     
    8898 
    8999add_shortcode( 'youlist', 'youlist_ooo_func' ); 
     100 
Note: See TracChangeset for help on using the changeset viewer.