Changeset 1024999
- Timestamp:
- 11/13/2014 10:55:56 AM (11 years ago)
- Location:
- auto-last-youtube-video/trunk
- Files:
-
- 2 edited
-
autolastyoutubevideo.php (modified) (7 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
auto-last-youtube-video/trunk/autolastyoutubevideo.php
r1003087 r1024999 4 4 Plugin URI: http://wordpress.org/plugins/auto-last-youtube-video/ 5 5 Description: 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. 26 Version: 1.0.3 7 7 Author: davidmerinas 8 8 Author URI: http://www.davidmerinas.com … … 11 11 $_SESSION['AUTO_LAST_YOUTUBE_VIDEO_PATH']=plugin_dir_path( __FILE__ ); 12 12 13 function AUTO_LAST_YOUTUBE_VIDEO_showvideo($canal='davidmerinas',$number=1,$title="",$visittext="Visit Youtube Channel" ){13 function AUTO_LAST_YOUTUBE_VIDEO_showvideo($canal='davidmerinas',$number=1,$title="",$visittext="Visit Youtube Channel",$introtext=""){ 14 14 global $wp_embed; 15 15 $videos=youtube($canal,$number); 16 16 echo('<h2 class="widget-title">'.($title!=""?$title:__("Latest from Youtube","autolastyoutubevideo")).'</h2>'); 17 if($introtext!="") 18 { 19 echo("<p>".$introtext."</p>"); 20 } 17 21 foreach($videos as $video) 18 22 { … … 75 79 if ($widget_data['submit']) { 76 80 $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']; 77 82 $options['AUTO_LAST_YOUTUBE_VIDEO_channelurl'] = $widget_data['AUTO_LAST_YOUTUBE_VIDEO_channelurl']; 78 83 $options['AUTO_LAST_YOUTUBE_VIDEO_number'] = $widget_data['AUTO_LAST_YOUTUBE_VIDEO_number']; … … 82 87 // Datos para el formulario 83 88 $AUTO_LAST_YOUTUBE_VIDEO_title = $options['AUTO_LAST_YOUTUBE_VIDEO_title']; 89 $AUTO_LAST_YOUTUBE_VIDEO_introtext = $options['AUTO_LAST_YOUTUBE_VIDEO_introtext']; 84 90 $AUTO_LAST_YOUTUBE_VIDEO_channelurl = $options['AUTO_LAST_YOUTUBE_VIDEO_channelurl']; 85 91 $AUTO_LAST_YOUTUBE_VIDEO_number = $options['AUTO_LAST_YOUTUBE_VIDEO_number']; … … 97 103 id="<?php echo AUTO_LAST_YOUTUBE_VIDEO_WIDGET_ID; ?>-title" 98 104 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; ?>"/> 99 115 </p> 100 116 <p> … … 140 156 // Query the next scheduled post 141 157 $AUTO_LAST_YOUTUBE_VIDEO_title = $options["AUTO_LAST_YOUTUBE_VIDEO_title"]; 158 $AUTO_LAST_YOUTUBE_VIDEO_introtext = $options["AUTO_LAST_YOUTUBE_VIDEO_introtext"]; 142 159 $AUTO_LAST_YOUTUBE_VIDEO_channelurl = $options["AUTO_LAST_YOUTUBE_VIDEO_channelurl"]; 143 160 $AUTO_LAST_YOUTUBE_VIDEO_number = $options["AUTO_LAST_YOUTUBE_VIDEO_number"]; … … 145 162 146 163 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); 148 165 echo $after_widget; 149 166 } -
auto-last-youtube-video/trunk/readme.txt
r1003087 r1024999 38 38 39 39 == Changelog == 40 = 1.0.3 = 41 *Added optional intro text to the widget 42 40 43 = 1.0.2 = 41 44 *Trying to fix some library path errors
Note: See TracChangeset
for help on using the changeset viewer.