Plugin Directory

Changeset 1024999


Ignore:
Timestamp:
11/13/2014 10:55:56 AM (11 years ago)
Author:
davidmerinas
Message:

Added optional intro text to the widget

Location:
auto-last-youtube-video/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • auto-last-youtube-video/trunk/autolastyoutubevideo.php

    r1003087 r1024999  
    44Plugin URI: http://wordpress.org/plugins/auto-last-youtube-video/
    55Description: This plugin providesboth Widget and Shortcode to show latest videos from any public Youtube channel. Using [auto_last_youtube_video user='channel_name' width='450' height='320'][/auto_last_youtube_video] in a page or post will show last video uploaded to that channel and will change if another video is uploaded. The widget let you show as many videos as you want from any Youtube channel.
    6 Version: 1.0.2
     6Version: 1.0.3
    77Author: davidmerinas
    88Author URI: http://www.davidmerinas.com
     
    1111$_SESSION['AUTO_LAST_YOUTUBE_VIDEO_PATH']=plugin_dir_path( __FILE__ );
    1212 
    13 function AUTO_LAST_YOUTUBE_VIDEO_showvideo($canal='davidmerinas',$number=1,$title="",$visittext="Visit Youtube Channel"){
     13function AUTO_LAST_YOUTUBE_VIDEO_showvideo($canal='davidmerinas',$number=1,$title="",$visittext="Visit Youtube Channel",$introtext=""){
    1414    global $wp_embed;
    1515    $videos=youtube($canal,$number);
    1616    echo('<h2 class="widget-title">'.($title!=""?$title:__("Latest from Youtube","autolastyoutubevideo")).'</h2>');
     17    if($introtext!="")
     18    {
     19        echo("<p>".$introtext."</p>");
     20    }
    1721    foreach($videos as $video)
    1822    {
     
    7579    if ($widget_data['submit']) {
    7680        $options['AUTO_LAST_YOUTUBE_VIDEO_title'] = $widget_data['AUTO_LAST_YOUTUBE_VIDEO_title'];
     81        $options['AUTO_LAST_YOUTUBE_VIDEO_introtext'] = $widget_data['AUTO_LAST_YOUTUBE_VIDEO_introtext'];
    7782        $options['AUTO_LAST_YOUTUBE_VIDEO_channelurl'] = $widget_data['AUTO_LAST_YOUTUBE_VIDEO_channelurl'];
    7883        $options['AUTO_LAST_YOUTUBE_VIDEO_number'] = $widget_data['AUTO_LAST_YOUTUBE_VIDEO_number'];
     
    8287    // Datos para el formulario
    8388    $AUTO_LAST_YOUTUBE_VIDEO_title = $options['AUTO_LAST_YOUTUBE_VIDEO_title'];
     89    $AUTO_LAST_YOUTUBE_VIDEO_introtext = $options['AUTO_LAST_YOUTUBE_VIDEO_introtext'];
    8490    $AUTO_LAST_YOUTUBE_VIDEO_channelurl = $options['AUTO_LAST_YOUTUBE_VIDEO_channelurl'];
    8591    $AUTO_LAST_YOUTUBE_VIDEO_number = $options['AUTO_LAST_YOUTUBE_VIDEO_number'];
     
    97103        id="<?php echo AUTO_LAST_YOUTUBE_VIDEO_WIDGET_ID; ?>-title"
    98104        value="<?php echo $AUTO_LAST_YOUTUBE_VIDEO_title; ?>"/>
     105    </p>
     106    <p>
     107      <label for="<?php echo AUTO_LAST_YOUTUBE_VIDEO_WIDGET_ID;?>-introtext">
     108        <?php _e('Intro Text','autolastyoutubevideo');?>
     109      </label>
     110      <input class="widefat"
     111        type="text"
     112        name="<?php echo AUTO_LAST_YOUTUBE_VIDEO_WIDGET_ID; ?>[AUTO_LAST_YOUTUBE_VIDEO_introtext]"
     113        id="<?php echo AUTO_LAST_YOUTUBE_VIDEO_WIDGET_ID; ?>-introtext"
     114        value="<?php echo $AUTO_LAST_YOUTUBE_VIDEO_introtext; ?>"/>
    99115    </p>
    100116    <p>
     
    140156    // Query the next scheduled post
    141157    $AUTO_LAST_YOUTUBE_VIDEO_title = $options["AUTO_LAST_YOUTUBE_VIDEO_title"];
     158    $AUTO_LAST_YOUTUBE_VIDEO_introtext = $options["AUTO_LAST_YOUTUBE_VIDEO_introtext"];
    142159    $AUTO_LAST_YOUTUBE_VIDEO_channelurl = $options["AUTO_LAST_YOUTUBE_VIDEO_channelurl"];
    143160    $AUTO_LAST_YOUTUBE_VIDEO_number = $options["AUTO_LAST_YOUTUBE_VIDEO_number"];
     
    145162
    146163    echo $before_widget;
    147     AUTO_LAST_YOUTUBE_VIDEO_showvideo($AUTO_LAST_YOUTUBE_VIDEO_channelurl,$AUTO_LAST_YOUTUBE_VIDEO_number,$AUTO_LAST_YOUTUBE_VIDEO_title,$AUTO_LAST_YOUTUBE_VIDEO_visittext);
     164    AUTO_LAST_YOUTUBE_VIDEO_showvideo($AUTO_LAST_YOUTUBE_VIDEO_channelurl,$AUTO_LAST_YOUTUBE_VIDEO_number,$AUTO_LAST_YOUTUBE_VIDEO_title,$AUTO_LAST_YOUTUBE_VIDEO_visittext,$AUTO_LAST_YOUTUBE_VIDEO_introtext);
    148165    echo $after_widget;
    149166}
  • auto-last-youtube-video/trunk/readme.txt

    r1003087 r1024999  
    3838
    3939== Changelog ==
     40= 1.0.3 =
     41*Added optional intro text to the widget
     42
    4043= 1.0.2 =
    4144*Trying to fix some library path errors
Note: See TracChangeset for help on using the changeset viewer.