WordPress.org

Plugin Directory

Changeset 613777


Ignore:
Timestamp:
10/17/12 20:42:44 (5 years ago)
Author:
Joe Anzalone
Message:

Added YouTube uploader whitelist option

Location:
on-the-fly-youtube-embeds
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • on-the-fly-youtube-embeds/trunk/main.php

    r613652 r613777  
    44Plugin URI: http://JoeAnzalone.com/plugins/on-the-fly-youtube-embeds 
    55Description: Creates a page on your site that will play any YouTube video based on the requested URL without having to create a new page for each individual video. 
    6 Version: 1.0 
     6Version: 1.1 
    77Author: Joe Anzalone 
    88Author URI: http://JoeAnzalone.com 
     
    287287            $wp_query->is_attachment = false; 
    288288        } 
     289 
     290 
     291        $options = get_option('otfye_options'); 
     292        $youtube_uploader_whitelist_arr = array_filter( explode(',', $options['youtube_uploader_whitelist']) ); 
     293 
     294        foreach ($youtube_uploader_whitelist_arr as $k => $user) { 
     295            $youtube_uploader_whitelist_arr[$k] = trim($user); 
     296        } 
     297 
     298        if(!in_array($this->vid_info->data->uploader, $youtube_uploader_whitelist_arr) && !empty($youtube_uploader_whitelist_arr)){ 
     299            return array(); 
     300        } 
     301 
    289302        return $posts; 
    290303    } 
     
    430443                    </td> 
    431444                </tr> 
     445                <!-- Textbox Control --> 
     446                <tr> 
     447                    <th scope="row">YouTube uploader whitelist</th> 
     448                    <td> 
     449                        <input type="text" size="57" name="otfye_options[youtube_uploader_whitelist]" value="<?php echo $options['youtube_uploader_whitelist']; ?>" /> 
     450                        <br /><span style="color:#666666;margin-left:2px;">Only allow embedding of videos from these YouTube users<br><i>Separate multiple user names with commas or leave blank to allow videos from any user</i></span> 
     451                    </td> 
     452                </tr>                
    432453 
    433454                <tr><td colspan="2"><div style="margin-top:10px;"></div></td></tr> 
     
    504525                        "slug" => "video", 
    505526                        "page_template" => "default", 
     527                        "youtube_uploader_whitelist" => "", 
    506528                        "chk_default_options_db" => "1", 
    507529        ); 
  • on-the-fly-youtube-embeds/trunk/readme.txt

    r613652 r613777  
    3535== Changelog == 
    3636 
     37= 1.1 = 
     38* Added YouTube uploader whitelist option 
     39 
    3740= 1.0 = 
    3841* First public release 
     42 
     43== Upgrade Notice == 
     44 
     45= 1.1 = 
     46* Added YouTube uploader whitelist option 
Note: See TracChangeset for help on using the changeset viewer.