WordPress.org

Plugin Directory

Changeset 632002


Ignore:
Timestamp:
11/29/12 21:51:04 (17 months ago)
Author:
Jayjdk
Message:

Version 3.0

  • The videos are now embedded using oEmbed which means that WordPress can cache them
  • Many bug fixes - mostly bugs where parameters didn't work as indended
  • Code improvements
  • Youtube API version 2.0
  • Tested with WordPress 3.5
Location:
youtube-profile-field/trunk
Files:
3 added
2 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • youtube-profile-field/trunk/admin.php

    r507914 r632002  
    1 <?php  
     1<?php 
    22 
    33add_action( 'admin_menu', 'ypf_add_options_page' ); 
    44 
     5/** 
     6 * Add the options page 
     7 * 
     8 * @since 2.0.0 
     9 */ 
    510function ypf_add_options_page() { 
    6     add_options_page( __( 'Youtube Profile Field Options', 'youtubeprofile' ), __( 'Youtube Profile Field', 'youtubeprofile' ), 'manage_options', 'youtube-profile-field', 'ypf_plugin_options' ); 
    7 } 
    8  
    9 // Option page 
     11    add_options_page( 
     12        __( 'Youtube Profile Field Options', 'youtube-profile-field' ), 
     13        __( 'Youtube Profile Field', 'youtube-profile-field' ), 
     14        'manage_options', 
     15        'youtube-profile-field', 
     16        'ypf_plugin_options' 
     17    ); 
     18} 
     19 
     20/** 
     21 * Display the options page. 
     22 * 
     23 * @since 2.0.0 
     24 */ 
    1025function ypf_plugin_options() { ?> 
    1126 
    1227    <div class="wrap"> 
     28 
    1329        <?php screen_icon(); ?> 
    14         <h2><?php _e( 'Youtube Profile Field Options', 'youtubeprofile' ); ?></h2> 
     30        <h2><?php _e( 'Youtube Profile Field Options', 'youtube-profile-field' ); ?></h2> 
    1531 
    1632        <form action="options.php" method="post"> 
     
    2137 
    2238    </div> 
    23      
     39 
    2440    <?php 
    2541} 
    2642 
    27 // Register and define the settings 
    28 add_action( 'admin_init', 'ypf_admin_init' ); 
    29  
     43/** 
     44 * Register the settings for the options page. 
     45 * 
     46 * @since 2.0.0 
     47 */ 
    3048function ypf_admin_init() { 
    3149 
     
    3452    add_settings_section( 
    3553        'ypf_options_main', 
    36         __( 'Settings', 'youtubeprofile' ), 
     54        __( 'Settings', 'youtube-profile-field' ), 
    3755        'ypf_section_text', 
    3856        'ypf_options' 
     
    4159    add_settings_field( 
    4260        'ypf_count', 
    43         __( 'Videos to show', 'youtubeprofile' ), 
     61        __( 'Videos to show', 'youtube-profile-field' ), 
    4462        'ypf_setting_input_number', 
    4563        'ypf_options', 
     
    4967    add_settings_field( 
    5068        'ypf_heading_start', 
    51         __( 'Heading to titles', 'youtubeprofile' ), 
     69        __( 'Heading to titles', 'youtube-profile-field' ), 
    5270        'ypf_setting_input_heading_start', 
    5371        'ypf_options', 
     
    5775    add_settings_field( 
    5876        'ypf_heading_end', 
    59         __( 'End heading', 'youtubeprofile' ), 
     77        __( 'End heading', 'youtube-profile-field' ), 
    6078        'ypf_setting_input_heading_end', 
    6179        'ypf_options', 
     
    6583    add_settings_field( 
    6684        'ypf_width', 
    67         __( 'Width', 'youtubeprofile' ), 
     85        __( 'Width', 'youtube-profile-field' ), 
    6886        'ypf_setting_input_width', 
    6987        'ypf_options', 
     
    7391    add_settings_field( 
    7492        'ypf_height', 
    75         __( 'Height', 'youtubeprofile' ), 
     93        __( 'Height', 'youtube-profile-field' ), 
    7694        'ypf_setting_input_height', 
    7795        'ypf_options', 
     
    8199    add_settings_section( 
    82100        'ypf_options_help', 
    83         __( 'Help', 'youtubeprofile' ), 
     101        __( 'Help', 'youtube-profile-field' ), 
    84102        'ypf_section_help', 
    85103        'ypf_options' 
     
    87105} 
    88106 
    89 // Settings section 
     107add_action( 'admin_init', 'ypf_admin_init' ); 
     108 
     109/** 
     110 * Settings section 
     111 * 
     112 * @since 2.0.0 
     113 */ 
    90114function ypf_section_text() { 
    91115    return; 
    92116} 
    93117 
    94 // "Number of videos" text field 
     118/** 
     119 * "Videos to show" text field 
     120 * 
     121 * @since 2.0.0 
     122 */ 
    95123function ypf_setting_input_number() { 
    96     $options = get_option( 'ypf_options' ); 
     124    $options     = get_option( 'ypf_options' ); 
    97125    $text_string = $options['count']; 
    98126 
    99     echo "<input id='ypf_count' name='ypf_options[count]' type='text' value='$text_string' /> "; 
    100     _e( 'Number of videos you want to show (Can be overriden with a template tag or shortcode)', 'youtubeprofile' ); 
    101 } 
    102  
    103 // Heading start field 
     127    echo "<input type='number' id='ypf_count' name='ypf_options[count]' class='small-text' min='1' value='$text_string' /> "; 
     128    _e( 'Number of videos you want to show (Can be overriden with a template tag or shortcode)', 'youtube-profile-field' ); 
     129} 
     130 
     131/** 
     132 * "Heading start" field 
     133 * 
     134 * @since 2.0.0 
     135 */ 
    104136function ypf_setting_input_heading_start() { 
    105     $options = get_option( 'ypf_options' ); 
     137    $options     = get_option( 'ypf_options' ); 
    106138    $text_string = $options['headingStart']; 
    107139 
    108     echo "<input id='ypf_setting_input_heading_start' name='ypf_options[headingStart]' type='text' value='$text_string' /> "; 
    109     _e( '&lt;h3&gt;, &lt;p&gt; or something else. Leave empty to hide titles', 'youtubeprofile' ); 
    110 } 
    111  
    112 // Heading end field 
     140    echo "<input type='text' id='ypf_setting_input_heading_start' name='ypf_options[headingStart]' value='$text_string' /> "; 
     141    echo esc_html_e( '<h3>, <p> or something else. Leave empty to hide titles', 'youtube-profile-field' ); 
     142} 
     143 
     144/** 
     145 * "Heading end" field 
     146 * 
     147 * @since 2.0.0 
     148 */ 
    113149function ypf_setting_input_heading_end() { 
    114     $options = get_option( 'ypf_options' ); 
     150    $options     = get_option( 'ypf_options' ); 
    115151    $text_string = $options['headingEnd']; 
    116152 
    117     echo "<input id='ypf_setting_input_heading_end' name='ypf_options[headingEnd]' type='text' value='$text_string' /> "; 
    118     echo '&lt;/h3&gt;, &lt;/p&gt;'; 
    119 } 
    120  
    121 // Width field 
     153    echo "<input type='text' id='ypf_setting_input_heading_end' name='ypf_options[headingEnd]' value='$text_string' /> "; 
     154    echo esc_html_e( '</h3>, </p>' ); 
     155} 
     156 
     157/** 
     158 * "Width" field 
     159 * 
     160 * @since 2.0.0 
     161 */ 
    122162function ypf_setting_input_width() { 
    123     $options = get_option( 'ypf_options' ); 
    124     $text_string = (isset( $options['width'] ) ) ? $options['width'] : '0'; 
    125  
    126     echo "<input id='ypf_width' name='ypf_options[width]' type='text' value='$text_string' /> "; 
    127     _e( 'If left blank, the width of the videos will default to your media settings.', 'youtubeprofile' ); 
    128 } 
    129  
    130 // Height field 
     163    $options     = get_option( 'ypf_options' ); 
     164    $text_string = ( isset( $options['width'] ) ) ? $options['width'] : 0; 
     165 
     166    echo "<input type='number' id='ypf_width' name='ypf_options[width]' class='small-text' value='$text_string' /> "; 
     167    _e( 'If left blank, or 0, the width of the videos will default to your media settings.', 'youtube-profile-field' ); 
     168} 
     169 
     170/** 
     171 * "Height" field 
     172 * 
     173 * @since 2.0.0 
     174 */ 
    131175function ypf_setting_input_height() { 
    132     $options = get_option( 'ypf_options' ); 
    133     $text_string = (isset( $options['height'] ) ) ? $options['height'] : '0'; 
    134  
    135     echo "<input id='ypf_height' name='ypf_options[height]' type='text' value='$text_string' /> "; 
    136     _e( 'If left blank, the height of the videos will default to your media settings.', 'youtubeprofile' ); 
    137 } 
    138  
    139 // Validate user input  
     176    $options     = get_option( 'ypf_options' ); 
     177    $text_string = ( isset( $options['height'] ) ) ? $options['height'] : 0; 
     178 
     179    echo "<input type='number' id='ypf_height' name='ypf_options[height]' class='small-text' value='$text_string' /> "; 
     180    _e( 'If left blank, or 0, the height of the videos will be calculated using the width', 'youtube-profile-field' ); 
     181} 
     182 
     183/** 
     184 * Validate user input 
     185 * 
     186 * @since 2.0.0 
     187 * @param array $input The raw, untrusted input 
     188 * @return array The validated input 
     189 */ 
    140190function ypf_validate_options( $input ) { 
    141     $input['count'] = intval( $input['count'] ); 
    142     $input['width'] = intval( $input['width'] ); 
     191    $input['count']  = intval( $input['count'] ); 
     192    $input['width']  = intval( $input['width'] ); 
    143193    $input['height'] = intval( $input['height'] ); 
    144194 
     
    149199} 
    150200 
    151 // Help section 
     201/** 
     202 * Help section 
     203 * 
     204 * @since 2.0.0 
     205 */ 
    152206function ypf_section_help() { 
    153207 
    154     echo '<h4>' . __( 'Recommended video sizes:', 'youtubeprofile' ) . '</h4>'; 
     208    echo '<h4>' . __( 'Helpful video sizes:', 'youtube-profile-field' ) . '</h4>'; 
    155209 
    156210    echo '<ul style="list-style: inside square;"> 
    157211            <li>480x385</li> 
    158             <li>560x340</li> 
    159             <li>640x385</li> 
    160             <li>853x505</li> 
     212            <li>560x315</li> 
     213            <li>640x360</li> 
     214            <li>853x480</li> 
    161215        </ul>'; 
    162  
    163216} 
    164217 
  • youtube-profile-field/trunk/index.php

    r583061 r632002  
    66 * Author: Jayjdk 
    77 * Author URI: http://jayj.dk 
    8  * Version: 2.2.5 
     8 * Version: 3.0.0 
    99 * License: GPLv2 or later 
    1010 */ 
    11   
    12 /* 
    13     This program is free software; you can redistribute it and/or 
    14     modify it under the terms of the GNU General Public License 
    15     as published by the Free Software Foundation; either version 2 
    16     of the License, or (at your option) any later version. 
    1711 
    18     This program is distributed in the hope that it will be useful, 
    19     but WITHOUT ANY WARRANTY; without even the implied warranty of 
    20     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    21     GNU General Public License for more details. 
     12class Youtube_Profile_Field { 
    2213 
    23     You should have received a copy of the GNU General Public License 
    24     along with this program; if not, write to the Free Software 
    25     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. 
    26 */ 
     14    /** 
     15     * PHP5 constructor method. 
     16     * 
     17     * @since 3.0.0 
     18     */ 
     19    public function __construct() { 
    2720 
    28 register_activation_hook( __FILE__, 'ypf_install' ); 
    29 register_uninstall_hook( __FILE__, 'ypf_uninstall' ); 
     21        /* Set the constants needed by the plugin. */ 
     22        add_action( 'plugins_loaded', array( &$this, 'constants' ), 1 ); 
    3023 
    31 /* Load the textdomain for translation */ 
    32 load_plugin_textdomain( 'youtubeprofile', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); 
     24        /* Internationalize the text strings used. */ 
     25        add_action( 'plugins_loaded', array( &$this, 'i18n' ), 2 ); 
    3326 
    34 /** 
    35  * Install function 
    36  * 
    37  * Set up default options on install 
    38  * 
    39  * @since 2.2 
    40  */ 
    41 function ypf_install() { 
    42     $default_options = array( 
    43         'count'        => '1', 
    44         'headingStart' => '&lt;h4&gt;', 
    45         'headingEnd'   => '&lt;/h4&gt;', 
    46         'width'        => 0, 
    47         'height'       => 0 
    48     ); 
     27        /* Load the functions files. */ 
     28        add_action( 'plugins_loaded', array( &$this, 'includes' ), 3 ); 
    4929 
    50     update_option( 'ypf_options', $default_options ); 
     30        /* Load the admin files. */ 
     31        add_action( 'plugins_loaded', array( &$this, 'admin' ), 4 ); 
     32 
     33        /* Register activation hook. */ 
     34        register_activation_hook( __FILE__, array( &$this, 'activation' ) ); 
     35 
     36        /* Register activation hook. */ 
     37        register_uninstall_hook( __FILE__, array( &$this, 'uninstall' ) ); 
     38    } 
     39 
     40    /** 
     41     * Defines constants used by the plugin. 
     42     * 
     43     * @since 3.0.0 
     44     */ 
     45    public function constants() { 
     46 
     47        /* Set constant path to the Youtube Profile Field plugin directory. */ 
     48        define( 'YPF_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) ); 
     49    } 
     50 
     51    /** 
     52     * Loads the initial files needed by the plugin. 
     53     * 
     54     * @since 3.0.0 
     55     */ 
     56    public function includes() { 
     57 
     58        require_once( YPF_DIR . 'functions.php' ); 
     59    } 
     60 
     61    /** 
     62     * Loads the translation files. 
     63     * 
     64     * @since 3.0.0 
     65     */ 
     66    public function i18n() { 
     67 
     68        /* Load the translation of the plugin. */ 
     69        load_plugin_textdomain( 'youtube-profile-field', false, YPF_DIR . 'languages' ); 
     70    } 
     71 
     72    /** 
     73     * Loads the admin functions and files. 
     74     * 
     75     * @since 3.0.0 
     76     */ 
     77    public function admin() { 
     78 
     79        /* Only load files if in the WordPress admin. */ 
     80        if ( is_admin() ) { 
     81            require_once( YPF_DIR . 'admin.php' ); 
     82        } 
     83    } 
     84 
     85    /** 
     86     * Method that runs only when the plugin is activated. 
     87     * 
     88     * @since 3.0.0 
     89     */ 
     90    function activation() { 
     91        $default_options = array( 
     92            'count'        => 1, 
     93            'headingStart' => esc_attr( '<h4>' ), 
     94            'headingEnd'   => esc_attr( '</h4>' ), 
     95            'width'        => 0, 
     96            'height'       => 0 
     97        ); 
     98 
     99        update_option( 'ypf_options', $default_options ); 
     100    } 
     101 
     102    /** 
     103     * Method that runs only when the plugin is uninstall. 
     104     * 
     105     * @since 3.0.0 
     106     */ 
     107    function uninstall() { 
     108        delete_option( 'ypf_options' ); 
     109    } 
    51110} 
    52111 
    53 /** 
    54  * Uninstall function 
    55  * 
    56  * Remove the options from the database 
    57  * 
    58  * @since 1.0.0 
    59  */ 
    60 function ypf_uninstall() { 
    61     if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) 
    62         exit(); 
    63  
    64     delete_option( 'ypf_options' ); 
    65  
    66 } 
    67  
    68 /** 
    69  * Load plugin settings page 
    70  */ 
    71 if ( is_admin() ) 
    72     include_once dirname( __FILE__ ) . '/admin.php'; 
    73  
    74 /* 
    75  * Get the video 
    76  * 
    77  * @param   array   $options    Array with arguments. Can contain count, user_id, width, height, headingStart, headingEnd 
    78  * @since 2.1 
    79  */ 
    80 function ypf_get_video( $options ) { 
    81  
    82     /** 
    83      * Get width and height 
    84      */ 
    85  
    86     // Get default width from the media options or the theme $content_width 
    87     $default_width = ( get_option( 'embed_size_w' ) ) ? get_option( 'embed_size_w' ) : (int) $GLOBALS['content_width']; 
    88  
    89     // If the width isn't set in the options or arguments, return the default width 
    90     if ( $options['width'] == 0 ) 
    91         $options['width'] = $default_width; 
    92  
    93     // Set height if empty 
    94     if ( $options['height'] == 0 ) 
    95         $options['height'] = round($options['width'] / (16/9)); // 16:9 aspect ratio 
    96  
    97     // Get the username 
    98     $username = get_the_author_meta( 'youtube', $options['user_id'] );  
    99  
    100     // Get the videos 
    101     include_once( ABSPATH . WPINC . '/feed.php' ); 
    102  
    103     $rss = fetch_feed( "http://gdata.youtube.com/feeds/base/users/{$username}/uploads" ); 
    104  
    105     // Is count set to 0? (why would some one do that??) 
    106     if ( $options['count'] === 0 ) 
    107         return; 
    108  
    109     // Is count set to all? 
    110     if ( $options['count'] == 'all' ) 
    111         $options['count'] = '0'; // 0 will return all items in the RSS feed 
    112  
    113     // Checks that the object is created correctly  
    114     if ( ! is_wp_error( $rss ) ) : 
    115         $maxitems  = $rss->get_item_quantity( intval( $options['count'] ) ); 
    116         $rss_items = $rss->get_items( 0, $maxitems ); 
    117     endif; 
    118  
    119     if ( $maxitems != 0 ) : 
    120  
    121         ob_start(); 
    122  
    123         foreach ( $rss_items as $item ) :  
    124  
    125             // Get video link 
    126             $url = $item->get_permalink(); 
    127  
    128             // Get title 
    129             $title = $item->get_title(); 
    130  
    131             // Get video ID 
    132             if ( preg_match('![?&]{1}v=([^&]+)!', $url . '&', $m ) ) 
    133                 $id = $m[1]; 
    134             else 
    135                 return __( 'Error: No video ID found.', 'youtubeprofile' ); 
    136  
    137     ?> 
    138             <div class="youtube-video"> 
    139                 <?php 
    140                     // Get the headingStart option 
    141                     if ( ! empty( $options['headingStart'] ) ) 
    142                         echo html_entity_decode( $options['headingStart'] ); 
    143                 ?> 
    144  
    145                     <a href="<?php echo esc_url( $url ); ?>"><?php echo $title; ?></a> 
    146  
    147                 <?php 
    148                     // Get the headingEnd option 
    149                     if ( ! empty( $options['headingEnd'] ) ) 
    150                         echo html_entity_decode( $options['headingEnd'] ); 
    151                 ?> 
    152  
    153                 <iframe title="<?php echo esc_attr( $title ); ?>" width="<?php echo intval( $options['width'] ); ?>" height="<?php echo intval( $options['height'] ); ?>" src="http://www.youtube.com/embed/<?php echo esc_attr( $id ); ?>?rel=0&amp;hd=1&amp;wmode=transparent" frameborder="0" allowfullscreen></iframe> 
    154  
    155             </div><?php 
    156      
    157         endforeach; 
    158  
    159         return ob_get_clean(); 
    160  
    161     endif; // $maxitems 
    162  
    163     return; 
    164 } 
    165  
    166 /** 
    167  * Show the video 
    168  * 
    169  * @param   array   $args   Array with arguments. Can contain count, user_id, width, height, headingStart, headingEnd  
    170  * @since   2.0.2 
    171  */ 
    172 function ypf_show_video( $args = array() ) { 
    173  
    174     // Backward compatibility for earlier plugin versions than 2.2 
    175     if ( ! is_array( $args ) ) { 
    176         $args = array(); 
    177         $numargs = func_num_args(); 
    178  
    179         $args['count'] = func_get_arg(0); 
    180  
    181         if ( $numargs >= 2 ) 
    182             $args['user_id'] = func_get_arg(1); 
    183     } 
    184  
    185     // Get default options 
    186     $defaults = get_option( 'ypf_options' ); 
    187     $defaults['user_id'] = get_the_author_meta( 'ID' ); 
    188  
    189     // Merge the parameters and default options 
    190     $options = wp_parse_args( $args, $defaults ); 
    191  
    192     return ypf_get_video( $options ); 
    193 } 
    194  
    195 /** 
    196  * The [youtube-user] shortcode 
    197  * 
    198  * Parameter you can use: count/display, user/user_id, ID, width, height, headingStart, headingEnd  
    199  * 
    200  * @since 1.0 
    201  */ 
    202 function ypf_youtube_user_shortcode( $args ) { 
    203  
    204     // Get default options 
    205     $defaults = get_option( 'ypf_options' ); 
    206  
    207     $args = shortcode_atts(array( 
    208         'display' => $defaults['count'], // count can be used instead 
    209         'id'      => '', // If you just want to display a video, just paste the link in the post content instead of using this shortcode 
    210         'user'    => get_the_author_meta( 'ID' ), 
    211     ), $args ); 
    212  
    213     // Rename display to count 
    214     $args['count'] = $args['display']; 
    215  
    216     // Rename user to user_id 
    217     $args['user_id'] = $args['user']; 
    218  
    219     unset($args['display'], $args['user']); 
    220  
    221     // Merge the parameters and default options 
    222     $options = wp_parse_args( $args, $defaults ); 
    223  
    224     // There's an ID! Get the video 
    225     if ( ! empty( $args['id'] ) ) : 
    226  
    227         // Get default width from the media options or the theme $content_width 
    228         $default_width = ( get_option( 'embed_size_w' ) ) ? get_option( 'embed_size_w' ) : (int) $GLOBALS['content_width']; 
    229  
    230         // If the width isn't set in the options or arguments, return the default width 
    231         if ( $options['width'] == 0 ) 
    232             $options['width'] = $default_width; 
    233  
    234         // Set height if empty. The aspect ratio is 16:9 
    235         if ( $options['height'] == 0 ) 
    236             $options['height'] = round($options['width'] / (16/9)); // 16:9 aspect ratio 
    237  
    238         ob_start(); ?> 
    239  
    240         <div class="youtube-video"> 
    241             <iframe width="<?php echo intval( $options['width'] ); ?>" height="<?php echo intval( $options['height'] ); ?>" src="http://www.youtube.com/embed/<?php echo esc_attr( $args['id']  ); ?>?rel=0&amp;hd=1&amp;wmode=transparent" frameborder="0" allowfullscreen></iframe> 
    242  
    243         </div> 
    244  
    245     <?php 
    246         return ob_get_clean(); 
    247     endif; 
    248  
    249     return ypf_get_video( $options ); 
    250 } 
    251  
    252 add_shortcode( 'youtube-user', 'ypf_youtube_user_shortcode' ); 
    253  
    254 /* 
    255  * Create the Youtube profile field 
    256  */ 
    257 function yfp_youtube_field( $contactmethods ) { 
    258         $contactmethods['youtube'] = 'Youtube username'; 
    259         return $contactmethods; 
    260 } 
    261  
    262 add_filter( 'user_contactmethods', 'yfp_youtube_field' ); 
    263  
    264 /** 
    265  * Add a link to the settings 
    266  */ 
    267 function ypf_plugin_action_links( $links, $file ) { 
    268     static $this_plugin; 
    269  
    270     if ( ! $this_plugin ) 
    271         $this_plugin = plugin_basename( __FILE__ ); 
    272          
    273     if ( $file == $this_plugin ) { 
    274         $settings_link = '<a href="' . admin_url( 'options-general.php?page=youtube-profile-field' ) . '">' . __( 'Settings', 'youtubeprofile' ) . '</a>'; 
    275         array_unshift( $links, $settings_link ); 
    276     } 
    277  
    278     return $links; 
    279 } 
    280  
    281 add_filter( 'plugin_action_links', 'ypf_plugin_action_links', 10, 2 ); 
     112new Youtube_Profile_Field(); 
    282113 
    283114?> 
  • youtube-profile-field/trunk/languages/youtubeprofile-da_DK.po

    r583061 r632002  
    33"Project-Id-Version: Youtube Profile Field\n" 
    44"Report-Msgid-Bugs-To: \n" 
    5 "POT-Creation-Date: 2012-08-08 12:07+0100\n" 
     5"POT-Creation-Date: 2012-11-29 22:41+0100\n" 
    66"PO-Revision-Date: \n" 
    7 "Last-Translator: Jesper <kontakt@jayj.dk>\n" 
     7"Last-Translator: Jesper J <kontakt@jayj.dk>\n" 
    88"Language-Team: Jayjdk\n" 
    99"MIME-Version: 1.0\n" 
     
    1212"X-Poedit-KeywordsList: _e;__\n" 
    1313"X-Poedit-Basepath: .\n" 
     14"X-Generator: Poedit 1.5.4\n" 
    1415"X-Poedit-SearchPath-0: ..\n" 
    1516 
    16 #: ../admin.php:6 
    17 #: ../admin.php:14 
     17#: admin.php:12 admin.php:30 
    1818msgid "Youtube Profile Field Options" 
    1919msgstr "Youtube Profile Field indstillinger" 
    2020 
    21 #: ../admin.php:6 
     21#: admin.php:13 
    2222msgid "Youtube Profile Field" 
    2323msgstr "Youtube Profile Field" 
    2424 
    25 #: ../admin.php:36 
    26 #: ../index.php:274 
     25#: admin.php:54 functions.php:257 
    2726msgid "Settings" 
    2827msgstr "Indstillinger" 
    2928 
    30 #: ../admin.php:43 
     29#: admin.php:61 
    3130msgid "Videos to show" 
    3231msgstr "Antal videoer der skal vises" 
    3332 
    34 #: ../admin.php:51 
     33#: admin.php:69 
    3534msgid "Heading to titles" 
    3635msgstr "Overskrift til videoer" 
    3736 
    38 #: ../admin.php:59 
     37#: admin.php:77 
    3938msgid "End heading" 
    4039msgstr "Slut overskrift" 
    4140 
    42 #: ../admin.php:67 
     41#: admin.php:85 
    4342msgid "Width" 
    4443msgstr "Bredde" 
    4544 
    46 #: ../admin.php:75 
     45#: admin.php:93 
    4746msgid "Height" 
    4847msgstr "Højde" 
    4948 
    50 #: ../admin.php:83 
     49#: admin.php:101 
    5150msgid "Help" 
    5251msgstr "Hjælp" 
    5352 
    54 #: ../admin.php:100 
    55 msgid "Number of videos you want to show (Can be overriden with a template tag or shortcode)" 
    56 msgstr "Antal af videoer du vil vise (kan blive overskrevet med et template tag eller en shortcode)" 
    57  
    58 #: ../admin.php:109 
    59 msgid "&lt;h3&gt;, &lt;p&gt; or something else. Leave empty to hide titles" 
    60 msgstr "&lt;h3&gt;, &lt;p&gt; eller noget lignende. Efterlad den tom for at fjerne titlerne." 
    61  
    62 #: ../admin.php:127 
    63 msgid "If left blank, the width of the videos will default to your media settings." 
    64 msgstr "Hvis tom, vil bredden blive den i dine Medie indstllinger." 
    65  
    66 #: ../admin.php:136 
    67 msgid "If left blank, the height of the videos will default to your media settings." 
    68 msgstr "Hvis tom, vil højden  blive den i dine Medie indstllinger." 
    69  
    70 #: ../admin.php:154 
    71 msgid "Recommended video sizes:" 
    72 msgstr "Anbefalet video størrelser:" 
    73  
    74 #: ../index.php:135 
     53#: admin.php:128 
     54msgid "" 
     55"Number of videos you want to show (Can be overriden with a template tag or " 
     56"shortcode)" 
     57msgstr "" 
     58"Antal af videoer du vil vise (kan blive overskrevet med et template tag " 
     59"eller en shortcode)" 
     60 
     61#: admin.php:141 
     62msgid "<h3>, <p> or something else. Leave empty to hide titles" 
     63msgstr "" 
     64"<h3>, <p>, eller noget lignende. Efterlad den tom for at fjerne titlerne." 
     65 
     66#: admin.php:154 
     67msgid "</h3>, </p>" 
     68msgstr "</h3>, </p>" 
     69 
     70#: admin.php:167 
     71msgid "" 
     72"If left blank, or 0, the width of the videos will default to your media " 
     73"settings." 
     74msgstr "" 
     75"Hvis tom, eller 0, vil bredden fra dine medie indstllinger blive brugt." 
     76 
     77#: admin.php:180 
     78msgid "" 
     79"If left blank, or 0, the height of the videos will be calculated using the " 
     80"width" 
     81msgstr "Hvis tom, 0, vil højden blive udregnet ved hjælp af bredden" 
     82 
     83#: admin.php:208 
     84msgid "Helpful video sizes:" 
     85msgstr "Hjælpsomme video størrelser:" 
     86 
     87#: functions.php:88 
    7588msgid "Error: No video ID found." 
    7689msgstr "Fejl: Ingen video ID fundet." 
     90 
     91#: functions.php:239 
     92msgid "Youtube username" 
     93msgstr "Youtube brugernavn" 
    7794 
    7895#~ msgid "Use old embed code" 
     
    92109#~ msgstr "<p>Ingen videoer blev fundet.</p>" 
    93110 
    94 #~ msgid "Youtube username" 
    95 #~ msgstr "Youtube brugernavn" 
    96  
    97111#~ msgid "The video could not be found" 
    98112#~ msgstr "Videoen kunne ikke blive fundet." 
  • youtube-profile-field/trunk/languages/youtubeprofile-default.pot

    r583061 r632002  
    22msgstr "" 
    33"Project-Id-Version: Youtube Profile Field\n" 
    4 "Report-Msgid-Bugs-To: \n" 
    5 "POT-Creation-Date: 2012-08-08 12:07+0100\n" 
     4"POT-Creation-Date: 2012-11-29 22:41+0100\n" 
    65"PO-Revision-Date: \n" 
    7 "Last-Translator: Jesper <kontakt@jayj.dk>\n" 
    8 "Language-Team: Jayjdk\n" 
     6"Last-Translator: Jesper J <kontakt@jayj.dk>\n" 
     7"Language-Team: \n" 
    98"MIME-Version: 1.0\n" 
    109"Content-Type: text/plain; charset=UTF-8\n" 
    1110"Content-Transfer-Encoding: 8bit\n" 
    12 "X-Poedit-KeywordsList: _e;__;esc_attr_e;esc_attr__\n" 
    13 "X-Poedit-Basepath: .\n" 
    14 "X-Poedit-SearchPath-0: ..\n" 
     11"X-Generator: Poedit 1.5.4\n" 
     12"X-Poedit-SourceCharset: UTF-8\n" 
     13"X-Poedit-KeywordsList: __;_e;_n;_x;esc_html_e;esc_html__;esc_attr_e;" 
     14"esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_x:1,2c;_n:1,2\n" 
     15"X-Poedit-Basepath: ../\n" 
     16"Plural-Forms: nplurals=2; plural=n != 1;\n" 
     17"X-Poedit-SearchPath-0: .\n" 
    1518 
    16 #: ../admin.php:6 
    17 #: ../admin.php:14 
     19#: admin.php:12 admin.php:30 
    1820msgid "Youtube Profile Field Options" 
    1921msgstr "" 
    2022 
    21 #: ../admin.php:6 
     23#: admin.php:13 
    2224msgid "Youtube Profile Field" 
    2325msgstr "" 
    2426 
    25 #: ../admin.php:36 
    26 #: ../index.php:274 
     27#: admin.php:54 functions.php:257 
    2728msgid "Settings" 
    2829msgstr "" 
    2930 
    30 #: ../admin.php:43 
     31#: admin.php:61 
    3132msgid "Videos to show" 
    3233msgstr "" 
    3334 
    34 #: ../admin.php:51 
     35#: admin.php:69 
    3536msgid "Heading to titles" 
    3637msgstr "" 
    3738 
    38 #: ../admin.php:59 
     39#: admin.php:77 
    3940msgid "End heading" 
    4041msgstr "" 
    4142 
    42 #: ../admin.php:67 
     43#: admin.php:85 
    4344msgid "Width" 
    4445msgstr "" 
    4546 
    46 #: ../admin.php:75 
     47#: admin.php:93 
    4748msgid "Height" 
    4849msgstr "" 
    4950 
    50 #: ../admin.php:83 
     51#: admin.php:101 
    5152msgid "Help" 
    5253msgstr "" 
    5354 
    54 #: ../admin.php:100 
    55 msgid "Number of videos you want to show (Can be overriden with a template tag or shortcode)" 
     55#: admin.php:128 
     56msgid "" 
     57"Number of videos you want to show (Can be overriden with a template tag or " 
     58"shortcode)" 
    5659msgstr "" 
    5760 
    58 #: ../admin.php:109 
    59 msgid "&lt;h3&gt;, &lt;p&gt; or something else. Leave empty to hide titles" 
     61#: admin.php:141 
     62msgid "<h3>, <p> or something else. Leave empty to hide titles" 
    6063msgstr "" 
    6164 
    62 #: ../admin.php:127 
    63 msgid "If left blank, the width of the videos will default to your media settings." 
     65#: admin.php:154 
     66msgid "</h3>, </p>" 
    6467msgstr "" 
    6568 
    66 #: ../admin.php:136 
    67 msgid "If left blank, the height of the videos will default to your media settings." 
     69#: admin.php:167 
     70msgid "" 
     71"If left blank, or 0, the width of the videos will default to your media " 
     72"settings." 
    6873msgstr "" 
    6974 
    70 #: ../admin.php:154 
    71 msgid "Recommended video sizes:" 
     75#: admin.php:180 
     76msgid "" 
     77"If left blank, or 0, the height of the videos will be calculated using the " 
     78"width" 
    7279msgstr "" 
    7380 
    74 #: ../index.php:135 
     81#: admin.php:208 
     82msgid "Helpful video sizes:" 
     83msgstr "" 
     84 
     85#: functions.php:88 
    7586msgid "Error: No video ID found." 
    7687msgstr "" 
    7788 
     89#: functions.php:239 
     90msgid "Youtube username" 
     91msgstr "" 
  • youtube-profile-field/trunk/readme.txt

    r583061 r632002  
    22Contributors: Jayjdk 
    33Donate link: none 
    4 Tags: youtube, video, rss, profile, field, username, user, shortcode 
     4Tags: youtube, video, rss, feed, profile, field, username, user, shortcode, oembed 
    55Requires at least: 3.1 
    6 Tested up to: 3.4 
     6Tested up to: 3.5 
    77Stable tag: trunk 
    88 
    9 Adds an additional field to the user profile page and allow you to show your videos on your website. 
     9Adds an additional field to the user profile page and allows you to show your videos on your website. 
    1010 
    1111== Description == 
     
    3131You can use these parameters: 
    3232 
    33 * count/display - The number of videos you want to show. Ex: `[youtube-user count="2"]` 
    34 * user/user_id  - The ID of the user you want to show videos from. Default is the post author. Ex:  `[youtube-user user="3"]` 
    35 * width         - If you want a different width than the default 
    36 * height        - If you want a different height than the default. If you leave it empty, the plugin will calculate a height using the width 
    37 * headingStart  - If you want to overwrite the default. 
    38 * headingEnd    - If you want to overwrite the default. 
    39 * ID            - If you want to show a specific video you can use this. You **shouldn't** use this since WordPress now supports oEmbed. 
     33* count     - The number of videos you want to show. Ex: `[youtube-user count="2"]` 
     34* user_id   - The ID of the user you want to show videos from. Default is the post author. Ex:  `[youtube-user user="3"]` 
     35* width     - If you want a different width than the default 
     36* height    - If you want a different height than the default. If you leave it empty, the plugin will calculate a height using the width 
     37* ID        - If you want to show a specific video you can use this. You **shouldn't** really use this since WordPress now supports oEmbed. 
    4038 
    4139= How do I use the template tag? = 
     
    5755* width         - If you want a different width than the default 
    5856* height        - If you want a different height than the default. If you leave it empty, the plugin will calculate a height using the width 
    59 * headingStart  - If you want to overwrite the default. 
    60 * headingEnd    - If you want to overwrite the default. 
     57* headingStart      - If you want to overwrite the default. 
     58* headingEnd        - If you want to overwrite the default. 
    6159 
    6260Example: 
     
    9593== Changelog == 
    9694 
     95= 3.0 = 
     96* The videos are now embedded using oEmbed which means that WordPress can cache them 
     97* Many bug fixes - mostly bugs where parameters didn't work as indended 
     98* Code improvements 
     99* Youtube API version 2.0 
     100* Tested with WordPress 3.5 
     101 
    97102= 2.2.5 = 
    98103* Add `?wmode=transparent` to the iframe 
     
    115120= 2.0.3 = 
    116121* Shortcode bug fix 
     122 
    117123= 2.0.2 = 
    118124* <code>show_video()</code> has been renamed to <code>ypf_show_video()</code> - You'll have to update your template files if you use the template tag 
     
    121127* Code clean up and other bug fixes 
    122128* No more 2.8 support 
     129 
    123130= 2.0.1 = 
    124131* Support for full screen 
     132 
    125133= 2.0 = 
    126134* 2.9 support 
     
    128136* Plugin options panel 
    129137* Can now be translated 
     138 
    130139= 1.0.5 = 
    131140* Shortcode: Added the ID parameter to the shortcode 
     141 
    132142= 1.0 = 
    133143* Initial Release 
     
    159169= 2.2.5 = 
    160170Added `?wmode=transparent` to the iframe 
     171 
     172= 3.0 = 
     173A lot of bug fixes. The videos as embedded and cached using Oembed. Youtube API version 2.0. 
Note: See TracChangeset for help on using the changeset viewer.