Video Sidebar Widgets - Version 2.0

Version Description

Download this release

Release Info

Developer denzel_chia
Plugin Icon 128x128 Video Sidebar Widgets
Version 2.0
Comparing to
See all releases

Code changes from version 1.0 to 2.0

Files changed (2) hide show
  1. readme.txt +18 -6
  2. video-sidebar-widgets.php +405 -6
readme.txt CHANGED
@@ -4,18 +4,19 @@ Donate link: http://denzeldesigns.com/wordpress-plugins/video-sidebar-widgets/
4
  Author link: http://denzeldesigns.com
5
  Tags:video, widget, widgets, sidebar, videos, video sidebar widget, video widget, embed video, video embed, video in sidebar, youtube, vimeo, veoh, myspace video, revver, blip tv, tudou, youku, 6.cn
6
  Requires at least:2.8.1
7
- Tested up to: 2.8.1
8
- Stable tag:1.0
9
 
10
  == Description ==
11
 
12
- A Video Widget written in latest Widgets API. It enables the user to embed FlashVideo from various video sharing networks into the widgetised sidebar of a WordPress powered blog. Currently supporting video embed from 13 video sharing networks. Including, Youtube, Vimeo, Veoh, Blip.tv etc..
13
-
14
 
15
  == Changelog ==
16
 
17
- =1.0=
18
 
 
19
 
20
  == Installation ==
21
 
@@ -28,7 +29,12 @@ A Video Widget written in latest Widgets API. It enables the user to embed Flash
28
  4. Go to Widgets under Appearance in the WordPress Admin, and you will find the Video Sidebar Widget.
29
 
30
 
31
- == How to use Video Sidebar Widgets ? ==
 
 
 
 
 
32
 
33
  Please visit plugin site for details.
34
 
@@ -40,6 +46,12 @@ Please visit plugin site for details.
40
  It is not compatible because a bug was found to cause settings of multiple instance of a widget to disappear or mixed up.
41
  The bug was fixed in WordPress 2.8.1
42
 
 
 
 
 
 
 
43
 
44
  == Screenshots ==
45
 
4
  Author link: http://denzeldesigns.com
5
  Tags:video, widget, widgets, sidebar, videos, video sidebar widget, video widget, embed video, video embed, video in sidebar, youtube, vimeo, veoh, myspace video, revver, blip tv, tudou, youku, 6.cn
6
  Requires at least:2.8.1
7
+ Tested up to: 2.8.2
8
+ Stable tag:2.0
9
 
10
  == Description ==
11
 
12
+ A Video Widget written in latest Widgets API. It enables the user to embed FlashVideo from various video sharing networks into the widgetised sidebar of a WordPress powered blog. Currently supporting video embed from 14 video sharing networks. Including, Youtube, Vimeo, Veoh, Blip.tv etc..
13
+ Now including Random Video Sidebar Widget to randomly display 1 out of 5 preset video.
14
 
15
  == Changelog ==
16
 
17
+ =2.0=
18
 
19
+ *Included Random Video Sidebar Widget to randomly display 1 out of 5 preset video.
20
 
21
  == Installation ==
22
 
29
  4. Go to Widgets under Appearance in the WordPress Admin, and you will find the Video Sidebar Widget.
30
 
31
 
32
+ == How to use Video Sidebar Widget ? ==
33
+
34
+ Please visit plugin site for details.
35
+
36
+
37
+ == How to use Random Video Sidebar Widget ? ==
38
 
39
  Please visit plugin site for details.
40
 
46
  It is not compatible because a bug was found to cause settings of multiple instance of a widget to disappear or mixed up.
47
  The bug was fixed in WordPress 2.8.1
48
 
49
+ 2. Why is my Random Video sidebar Widget not working?
50
+
51
+ Reload the webpage where you use the widget, each time you reload, the widget will randomly pick 1 of the 5 video you set for display. there are chances that it displays the same video after you reload. Just try reloading again.
52
+
53
+ Random Video Sidebar Widget will not work on blogs that uses cache plugins. It is because the cache plugin will deliver the generated static page instead of regenerating blog page or post through server script. However, it may work if your theme has a page template with a different sidebar. You can then set your cache plugin not to cache that particular page or post, if there is such option available in that cache plugin.
54
+
55
 
56
  == Screenshots ==
57
 
video-sidebar-widgets.php CHANGED
@@ -2,9 +2,8 @@
2
  /*
3
  Plugin Name: Video Sidebar Widgets
4
  Plugin URI: http://denzeldesigns.com/wordpress-plugins/video-sidebar-widgets/
5
- Version: 1.0
6
- Description: A video sidebar widget using WordPress 2.8 Widgets API to display videos such as Vimeo, YouTube, MySpace Videos etc.
7
- requires at least WordPress 2.8.1
8
  Author: Denzel Chia
9
  Author URI: http://denzeldesigns.com/
10
  */
@@ -14,14 +13,15 @@ add_action('widgets_init', 'load_video_sidebar_widgets');
14
 
15
  function load_video_sidebar_widgets() {
16
  register_widget('VideoSidebarWidget');
 
17
  }
18
 
19
 
20
- // vimeo video widget
21
  class VideoSidebarWidget extends WP_Widget {
22
 
23
  function VideoSidebarWidget() {
24
- $widget_ops = array( 'classname' => 'videosidebar', 'description' => __('A Video Widget to display multiple videos in sidebar from sources such as YouTube, Vimeo, MySpace etc. Please visit Plugin Site for details', 'videosidebar') );
25
  $control_ops = array( 'width' => 200, 'height' => 350, 'id_base' => 'videosidebar' );
26
  $this->WP_Widget( 'videosidebar', __('Video Sidebar Widget', 'videosidebar'), $widget_ops, $control_ops );
27
  }
@@ -192,7 +192,7 @@ $instance = wp_parse_args( (array) $instance, array( 'title2' => '', 'v_width2'
192
 
193
  <p>
194
  <label for="<?php echo $this->get_field_id( 'v_source' ); ?>">Select Video Source:</label>
195
- <select id="<?php echo $this->get_field_id( 'v_source' );?>" name="<?php echo $this->get_field_name( 'v_source' );?>" class="widefat" style="width:100%;">';
196
  <option value='YouTube' <?php if($instance['v_source'] == 'YouTube'){echo 'selected="selected"';}?> >YouTube Video</option>
197
  <option value='Vimeo' <?php if($instance['v_source'] == 'Vimeo'){echo 'selected="selected"';}?> >Vimeo Video</option>
198
  <option value='MySpace' <?php if($instance['v_source'] == 'MySpace'){echo 'selected="selected"';}?> >MySpace Video</option>
@@ -261,4 +261,403 @@ switch ($source) {
261
 
262
  }
263
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
264
  ?>
2
  /*
3
  Plugin Name: Video Sidebar Widgets
4
  Plugin URI: http://denzeldesigns.com/wordpress-plugins/video-sidebar-widgets/
5
+ Version: 2.0
6
+ Description: A video sidebar widget using WordPress 2.8 Widgets API to display videos such as Vimeo, YouTube, MySpace Videos etc. Requires at least WordPress 2.8.1. Now including Random Video Sidebar Widget to randomly display 1 out of 5 preset video.
 
7
  Author: Denzel Chia
8
  Author URI: http://denzeldesigns.com/
9
  */
13
 
14
  function load_video_sidebar_widgets() {
15
  register_widget('VideoSidebarWidget');
16
+ register_widget('RandomVideoSidebarWidget');
17
  }
18
 
19
 
20
+
21
  class VideoSidebarWidget extends WP_Widget {
22
 
23
  function VideoSidebarWidget() {
24
+ $widget_ops = array( 'classname' => 'videosidebar', 'description' => __('A Video Widget to display video in sidebar from various video sharing networks', 'videosidebar') );
25
  $control_ops = array( 'width' => 200, 'height' => 350, 'id_base' => 'videosidebar' );
26
  $this->WP_Widget( 'videosidebar', __('Video Sidebar Widget', 'videosidebar'), $widget_ops, $control_ops );
27
  }
192
 
193
  <p>
194
  <label for="<?php echo $this->get_field_id( 'v_source' ); ?>">Select Video Source:</label>
195
+ <select id="<?php echo $this->get_field_id( 'v_source' );?>" name="<?php echo $this->get_field_name( 'v_source' );?>" class="widefat" style="width:100%;">
196
  <option value='YouTube' <?php if($instance['v_source'] == 'YouTube'){echo 'selected="selected"';}?> >YouTube Video</option>
197
  <option value='Vimeo' <?php if($instance['v_source'] == 'Vimeo'){echo 'selected="selected"';}?> >Vimeo Video</option>
198
  <option value='MySpace' <?php if($instance['v_source'] == 'MySpace'){echo 'selected="selected"';}?> >MySpace Video</option>
261
 
262
  }
263
 
264
+
265
+
266
+
267
+ //Random video widget starts here
268
+
269
+
270
+ class RandomVideoSidebarWidget extends WP_Widget {
271
+
272
+ function RandomVideoSidebarWidget() {
273
+ $widget_ops = array( 'classname' => 'randomvideosidebar', 'description' => __('A Random Video Widget. Randomly selects 1 of the 5 preset videos for display', 'randomvideosidebar') );
274
+ $control_ops = array( 'width' => 200, 'height' => 600, 'id_base' => 'randomvideosidebar' );
275
+ $this->WP_Widget( 'randomvideosidebar', __('Random Video Sidebar Widget', 'randomvideosidebar'), $widget_ops, $control_ops );
276
+ }
277
+
278
+
279
+ function widget( $args, $instance ) {
280
+ extract( $args );
281
+
282
+ $RV_title = apply_filters('widget_title', $instance['RV_title'] );
283
+ $RV_width = $instance['RV_width'];
284
+ $RV_height = $instance['RV_height'];
285
+ $RV_autoplay = $instance['RV_autoplay'];
286
+ $RV_id1 = $instance['RV_id1'];
287
+ $RV_source1 = $instance['RV_source1'];
288
+ $RV_id2 = $instance['RV_id2'];
289
+ $RV_source2 = $instance['RV_source2'];
290
+ $RV_id3 = $instance['RV_id3'];
291
+ $RV_source3 = $instance['RV_source3'];
292
+ $RV_id4 = $instance['RV_id4'];
293
+ $RV_source4 = $instance['RV_source4'];
294
+ $RV_id5 = $instance['RV_id5'];
295
+ $RV_source5 = $instance['RV_source5'];
296
+
297
+ echo $before_widget;
298
+
299
+ if ( $RV_title )
300
+ echo $before_title . $RV_title . $after_title;
301
+
302
+ //using rand() to select which video to show
303
+
304
+ $selection = rand(1,5);
305
+
306
+ switch($selection){
307
+
308
+ case 1:
309
+ $Embed_id = $RV_id1;
310
+ $Embed_source = $RV_source1;
311
+ break;
312
+
313
+ case 2:
314
+ $Embed_id = $RV_id2;
315
+ $Embed_source = $RV_source2;
316
+ break;
317
+
318
+ case 3:
319
+ $Embed_id = $RV_id3;
320
+ $Embed_source = $RV_source3;
321
+ break;
322
+
323
+ case 4:
324
+ $Embed_id = $RV_id4;
325
+ $Embed_source = $RV_source4;
326
+ break;
327
+
328
+ case 5:
329
+ $Embed_id = $RV_id5;
330
+ $Embed_source = $RV_source5;
331
+ break;
332
+
333
+ }
334
+
335
+ //test for empty $Embed_id and empty $Embed_source. if empty,
336
+ //assign to same as first video id and source
337
+
338
+ If(empty($Embed_id)){
339
+ $Embed_id = $RV_id1;
340
+ $Embed_source = $RV_source1;
341
+ }
342
+
343
+ $select_source = $Embed_source;
344
+
345
+ switch ($select_source) {
346
+
347
+ case null:
348
+ $rv_value = null;
349
+ $rv_flashvar = null;
350
+ $rv_flashvar2 = null;
351
+ break;
352
+
353
+ case YouTube:
354
+ $rv_value = "http://www.youtube.com/v/$Embed_id&autoplay=$RV_autoplay&loop=0&rel=0";
355
+ $rv_flashvar = null;
356
+ $rv_flashvar2 = null;
357
+ break;
358
+
359
+ case Vimeo:
360
+ $rv_value = "http://vimeo.com/moogaloop.swf?clip_id=$Embed_id&amp;server=vimeo.com&amp;loop=0&amp;fullscreen=1&amp;autoplay=$RV_autoplay";
361
+ $rv_flashvar = null;
362
+ $rv_flashvar2 = null;
363
+ break;
364
+
365
+ case MySpace:
366
+ $rv_value = "http://mediaservices.myspace.com/services/media/embed.aspx/m=$Embed_id,t=1,mt=video,ap=$RV_autoplay";
367
+ $rv_flashvar = null;
368
+ $rv_flashvar2 = null;
369
+ break;
370
+
371
+ case Veoh:
372
+ $rv_value = "http://www.veoh.com/static/swf/webplayer/WebPlayer.swf?version=AFrontend.5.4.2.20.1002&permalinkId=$Embed_id";
373
+ $rv_value.= "&player=videodetailsembedded&id=anonymous&videoAutoPlay=$RV_autoplay";
374
+ $rv_flashvar = null;
375
+ $rv_flashvar2 = null;
376
+ break;
377
+
378
+ case Blip:
379
+ if($RV_autoplay=='1'){
380
+ $R_autoplay2 = "true";
381
+ }else{$R_autoplay2 = "false";}
382
+ $rv_value = "http://blip.tv/play/$Embed_id?autostart=$R_autoplay2";
383
+ $rv_flashvar = null;
384
+ $rv_flashvar2 = null;
385
+ break;
386
+
387
+ case WordPress:
388
+ $rv_value = "http://v.wordpress.com/$Embed_id";
389
+ $rv_flashvar = null;
390
+ $rv_flashvar2 = null;
391
+ break;
392
+
393
+ case Viddler:
394
+ $rv_value = "http://www.viddler.com/player/$Embed_id";
395
+ if($RV_autoplay=='1'){
396
+ $rv_flashvar = "<param name=\"flashvars\" value=\"autoplay=t\" />\n";
397
+ $rv_flashvar2 = 'flashvars="autoplay=t" ';
398
+ }
399
+ break;
400
+
401
+ case DailyMotion:
402
+ $rv_value = "http://www.dailymotion.com/swf/$Embed_id&autoStart=$RV_autoplay&related=0";
403
+ $rv_flashvar = null;
404
+ $rv_flashvar2 = null;
405
+ break;
406
+
407
+
408
+ case Revver:
409
+ $rv_value = "http://flash.revver.com/player/1.0/player.swf?mediaId=$Embed_id&autoStart=$RV_autoplay";
410
+ $rv_flashvar = null;
411
+ $rv_flashvar2 = null;
412
+ break;
413
+
414
+ case Metacafe:
415
+ $rid = split('/',$Embed_id);
416
+ $rv_value = "http://www.metacafe.com/fplayer/$rid[0]/$rid[1].swf";
417
+ if($RV_autoplay=='1'){
418
+ $rv_flashvar = null;
419
+ $rv_flashvar2 = 'flashVars="playerVars=showStats=no|autoPlay=yes|"';
420
+ }
421
+ break;
422
+
423
+ case Tudou:
424
+ $rv_value = "$Embed_id";
425
+ $rv_flashvar = null;
426
+ $rv_flashvar2 = null;
427
+ break;
428
+
429
+ case Youku:
430
+ $rv_value = "$Embed_id";
431
+ $rv_flashvar = null;
432
+ $rv_flashvar2 = null;
433
+ break;
434
+
435
+ case cn6:
436
+ $rv_value = "$Embed_id";
437
+ $rv_flashvar = null;
438
+ $rv_flashvar2 = null;
439
+ break;
440
+
441
+ }
442
+
443
+
444
+
445
+ echo "\n<object width=\"$RV_width\" height=\"$RV_height\">\n";
446
+ echo $rv_flashvar;
447
+ echo "<param name=\"allowfullscreen\" value=\"true\" />\n";
448
+ echo "<param name=\"allowscriptaccess\" value=\"always\" />\n";
449
+ echo "<param name=\"movie\" value=\"$rv_value\" />\n";
450
+ echo "<param name=\"wmode\" value=\"transparent\">\n";
451
+ echo "<embed src=\"$rv_value\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" allowfullscreen=\"true\" allowscriptaccess=\"always\" ";
452
+ echo $rv_flashvar2;
453
+ echo "width=\"$RV_width\" height=\"$RV_height\">\n";
454
+ echo "</embed>\n";
455
+ echo "</object>\n\n";
456
+ echo $after_widget;
457
+ }
458
+
459
+
460
+ function update( $new_instance, $old_instance ) {
461
+ $instance = $old_instance;
462
+ $instance['RV_title'] = strip_tags( $new_instance['RV_title'] );
463
+ $instance['RV_width'] = strip_tags( $new_instance['RV_width'] );
464
+ $instance['RV_height'] = strip_tags( $new_instance['RV_height'] );
465
+ $instance['RV_autoplay'] = strip_tags( $new_instance['RV_autoplay'] );
466
+ $instance['RV_id1'] = strip_tags( $new_instance['RV_id1'] );
467
+ $instance['RV_source1'] = strip_tags( $new_instance['RV_source1'] );
468
+ $instance['RV_id2'] = strip_tags( $new_instance['RV_id2'] );
469
+ $instance['RV_source2'] = strip_tags( $new_instance['RV_source2'] );
470
+ $instance['RV_id3'] = strip_tags( $new_instance['RV_id3'] );
471
+ $instance['RV_source3'] = strip_tags( $new_instance['RV_source3'] );
472
+ $instance['RV_id4'] = strip_tags( $new_instance['RV_id4'] );
473
+ $instance['RV_source4'] = strip_tags( $new_instance['RV_source4'] );
474
+ $instance['RV_id5'] = strip_tags( $new_instance['RV_id5'] );
475
+ $instance['RV_source5'] = strip_tags( $new_instance['RV_source5'] );
476
+ return $instance;
477
+ }
478
+
479
+
480
+ function form($instance) {
481
+ $instance = wp_parse_args( (array) $instance, array( 'RV_title' => '', 'RV_width' => '', 'RV_height' => '', 'RV_autoplay' => '','RV_id1' => '','RV_source1' => '', 'RV_id2' => '','RV_source2' => '', 'RV_id3' => '','RV_source3' => '', 'RV_id4' => '','RV_source4' => '', 'RV_id5' => '','RV_source5' => '') );
482
+ $instance['RV_title'] = strip_tags( $instance['RV_title'] );
483
+ $instance['RV_width'] = strip_tags( $instance['RV_width'] );
484
+ $instance['RV_height'] = strip_tags( $instance['RV_height'] );
485
+ $instance['RV_autoplay'] = strip_tags( $instance['RV_autoplay'] );
486
+ $instance['RV_id1'] = strip_tags( $instance['RV_id1'] );
487
+ $instance['RV_source1'] = strip_tags( $instance['RV_source1'] );
488
+ $instance['RV_id2'] = strip_tags( $instance['RV_id2'] );
489
+ $instance['RV_source2'] = strip_tags( $instance['RV_source2'] );
490
+ $instance['RV_id3'] = strip_tags( $instance['RV_id3'] );
491
+ $instance['RV_source3'] = strip_tags( $instance['RV_source3'] );
492
+ $instance['RV_id4'] = strip_tags( $instance['RV_id4'] );
493
+ $instance['RV_source4'] = strip_tags( $instance['RV_source4'] );
494
+ $instance['RV_id5'] = strip_tags( $instance['RV_id5'] );
495
+ $instance['RV_source5'] = strip_tags( $instance['RV_source5'] );
496
+
497
+
498
+ ?>
499
+
500
+ <!--Title -->
501
+ <p>
502
+ <label for="<?php echo $this->get_field_id('RV_title'); ?>">Title:</label>
503
+ <input class="widefat" id="<?php echo $this->get_field_id('RV_title'); ?>" name="<?php echo $this->get_field_name('RV_title'); ?>" type="text" value="<?php echo $instance['RV_title']; ?>" />
504
+ </p>
505
+
506
+ <!--Width -->
507
+ <p>
508
+ <label for="<?php echo $this->get_field_id('RV_width'); ?>">Width: </label>
509
+ <input class="widefat" id="<?php echo $this->get_field_id('RV_width'); ?>" name="<?php echo $this->get_field_name('RV_width'); ?>" type="text" value="<?php echo $instance['RV_width']; ?>" />
510
+ </p>
511
+
512
+ <!--Height -->
513
+ <p>
514
+ <label for="<?php echo $this->get_field_id('RV_height'); ?>">Height: </label>
515
+ <input class="widefat" id="<?php echo $this->get_field_id('RV_height'); ?>" name="<?php echo $this->get_field_name('RV_height'); ?>" type="text" value="<?php echo $instance['RV_height']; ?>" />
516
+ </p>
517
+
518
+ <!--first video setting -->
519
+ <p>
520
+ <label for="<?php echo $this->get_field_id( 'RV_source1' ); ?>">Select Video 1 Source:</label>
521
+ <select id="<?php echo $this->get_field_id( 'RV_source1' );?>" name="<?php echo $this->get_field_name( 'RV_source1' );?>" class="widefat" style="width:100%;">
522
+ <option value='YouTube' <?php if($instance['RV_source1'] == 'YouTube'){echo 'selected="selected"';}?> >YouTube Video</option>
523
+ <option value='Vimeo' <?php if($instance['RV_source1'] == 'Vimeo'){echo 'selected="selected"';}?> >Vimeo Video</option>
524
+ <option value='MySpace' <?php if($instance['RV_source1'] == 'MySpace'){echo 'selected="selected"';}?> >MySpace Video</option>
525
+ <option value='Veoh' <?php if($instance['RV_source1'] == 'Veoh'){echo 'selected="selected"';}?> >Veoh Video</option>
526
+ <option value='Blip' <?php if($instance['RV_source1'] == 'Blip'){echo 'selected="selected"';}?> >blip.tv Video</option>
527
+ <option value='WordPress' <?php if($instance['RV_source1'] == 'WordPress'){echo 'selected="selected"';}?> >WordPress Video</option>
528
+ <option value='Viddler' <?php if($instance['RV_source1'] == 'Viddler'){echo 'selected="selected"';}?> >Viddler Video</option>
529
+ <option value='DailyMotion' <?php if($instance['RV_source1'] == 'DailyMotion'){echo 'selected="selected"';}?> >DailyMotion Video</option>
530
+ <option value='Revver' <?php if($instance['RV_source1'] == 'Revver'){echo 'selected="selected"';}?> >Revver Video</option>
531
+ <option value='Metacafe' <?php if($instance['RV_source1'] == 'Metacafe'){echo 'selected="selected"';}?> >Metacafe Video</option>
532
+ <option value='Tudou' <?php if($instance['RV_source1'] == 'Tudou'){echo 'selected="selected"';}?> >Tudou Video</option>
533
+ <option value='Youku' <?php if($instance['RV_source1'] == 'Youku'){echo 'selected="selected"';}?> >Youku Video</option>
534
+ <option value='cn6' <?php if($instance['RV_source1'] == 'cn6'){echo 'selected="selected"';}?> >6.cn Video</option>
535
+ </select>
536
+ </p>
537
+
538
+ <p>
539
+ <label for="<?php echo $this->get_field_id('RV_id1'); ?>">Video 1 ID: </label>
540
+ <input class="widefat" id="<?php echo $this->get_field_id('RV_id1'); ?>" name="<?php echo $this->get_field_name('RV_id1'); ?>" type="text" value="<?php echo $instance['RV_id1']; ?>" /></p>
541
+
542
+
543
+ <!--second video setting -->
544
+ <p>
545
+ <label for="<?php echo $this->get_field_id( 'RV_source2' ); ?>">Select Video 2 Source:</label>
546
+ <select id="<?php echo $this->get_field_id( 'RV_source2' );?>" name="<?php echo $this->get_field_name( 'RV_source2' );?>" class="widefat" style="width:100%;">
547
+ <option value='YouTube' <?php if($instance['RV_source2'] == 'YouTube'){echo 'selected="selected"';}?> >YouTube Video</option>
548
+ <option value='Vimeo' <?php if($instance['RV_source2'] == 'Vimeo'){echo 'selected="selected"';}?> >Vimeo Video</option>
549
+ <option value='MySpace' <?php if($instance['RV_source2'] == 'MySpace'){echo 'selected="selected"';}?> >MySpace Video</option>
550
+ <option value='Veoh' <?php if($instance['RV_source2'] == 'Veoh'){echo 'selected="selected"';}?> >Veoh Video</option>
551
+ <option value='Blip' <?php if($instance['RV_source2'] == 'Blip'){echo 'selected="selected"';}?> >blip.tv Video</option>
552
+ <option value='WordPress' <?php if($instance['RV_source2'] == 'WordPress'){echo 'selected="selected"';}?> >WordPress Video</option>
553
+ <option value='Viddler' <?php if($instance['RV_source2'] == 'Viddler'){echo 'selected="selected"';}?> >Viddler Video</option>
554
+ <option value='DailyMotion' <?php if($instance['RV_source2'] == 'DailyMotion'){echo 'selected="selected"';}?> >DailyMotion Video</option>
555
+ <option value='Revver' <?php if($instance['RV_source2'] == 'Revver'){echo 'selected="selected"';}?> >Revver Video</option>
556
+ <option value='Metacafe' <?php if($instance['RV_source2'] == 'Metacafe'){echo 'selected="selected"';}?> >Metacafe Video</option>
557
+ <option value='Tudou' <?php if($instance['RV_source2'] == 'Tudou'){echo 'selected="selected"';}?> >Tudou Video</option>
558
+ <option value='Youku' <?php if($instance['RV_source2'] == 'Youku'){echo 'selected="selected"';}?> >Youku Video</option>
559
+ <option value='cn6' <?php if($instance['RV_source2'] == 'cn6'){echo 'selected="selected"';}?> >6.cn Video</option>
560
+ </select>
561
+ </p>
562
+
563
+ <p>
564
+ <label for="<?php echo $this->get_field_id('RV_id2'); ?>">Video 2 ID: </label>
565
+ <input class="widefat" id="<?php echo $this->get_field_id('RV_id2'); ?>" name="<?php echo $this->get_field_name('RV_id2'); ?>" type="text" value="<?php echo $instance['RV_id2']; ?>" /></p>
566
+
567
+
568
+ <!--third video setting -->
569
+ <p>
570
+ <label for="<?php echo $this->get_field_id( 'RV_source3' ); ?>">Select Video 3 Source:</label>
571
+ <select id="<?php echo $this->get_field_id( 'RV_source3' );?>" name="<?php echo $this->get_field_name( 'RV_source3' );?>" class="widefat" style="width:100%;">
572
+ <option value='YouTube' <?php if($instance['RV_source3'] == 'YouTube'){echo 'selected="selected"';}?> >YouTube Video</option>
573
+ <option value='Vimeo' <?php if($instance['RV_source3'] == 'Vimeo'){echo 'selected="selected"';}?> >Vimeo Video</option>
574
+ <option value='MySpace' <?php if($instance['RV_source3'] == 'MySpace'){echo 'selected="selected"';}?> >MySpace Video</option>
575
+ <option value='Veoh' <?php if($instance['RV_source3'] == 'Veoh'){echo 'selected="selected"';}?> >Veoh Video</option>
576
+ <option value='Blip' <?php if($instance['RV_source3'] == 'Blip'){echo 'selected="selected"';}?> >blip.tv Video</option>
577
+ <option value='WordPress' <?php if($instance['RV_source3'] == 'WordPress'){echo 'selected="selected"';}?> >WordPress Video</option>
578
+ <option value='Viddler' <?php if($instance['RV_source3'] == 'Viddler'){echo 'selected="selected"';}?> >Viddler Video</option>
579
+ <option value='DailyMotion' <?php if($instance['RV_source3'] == 'DailyMotion'){echo 'selected="selected"';}?> >DailyMotion Video</option>
580
+ <option value='Revver' <?php if($instance['RV_source3'] == 'Revver'){echo 'selected="selected"';}?> >Revver Video</option>
581
+ <option value='Metacafe' <?php if($instance['RV_source3'] == 'Metacafe'){echo 'selected="selected"';}?> >Metacafe Video</option>
582
+ <option value='Tudou' <?php if($instance['RV_source3'] == 'Tudou'){echo 'selected="selected"';}?> >Tudou Video</option>
583
+ <option value='Youku' <?php if($instance['RV_source3'] == 'Youku'){echo 'selected="selected"';}?> >Youku Video</option>
584
+ <option value='cn6' <?php if($instance['RV_source3'] == 'cn6'){echo 'selected="selected"';}?> >6.cn Video</option>
585
+ </select>
586
+ </p>
587
+
588
+ <p>
589
+ <label for="<?php echo $this->get_field_id('RV_id3'); ?>">Video 3 ID: </label>
590
+ <input class="widefat" id="<?php echo $this->get_field_id('RV_id3'); ?>" name="<?php echo $this->get_field_name('RV_id3'); ?>" type="text" value="<?php echo $instance['RV_id3']; ?>" /></p>
591
+
592
+
593
+ <!--fourth video setting -->
594
+ <p>
595
+ <label for="<?php echo $this->get_field_id( 'RV_source4' ); ?>">Select Video 4 Source:</label>
596
+ <select id="<?php echo $this->get_field_id( 'RV_source4' );?>" name="<?php echo $this->get_field_name( 'RV_source4' );?>" class="widefat" style="width:100%;">
597
+ <option value='YouTube' <?php if($instance['RV_source4'] == 'YouTube'){echo 'selected="selected"';}?> >YouTube Video</option>
598
+ <option value='Vimeo' <?php if($instance['RV_source4'] == 'Vimeo'){echo 'selected="selected"';}?> >Vimeo Video</option>
599
+ <option value='MySpace' <?php if($instance['RV_source4'] == 'MySpace'){echo 'selected="selected"';}?> >MySpace Video</option>
600
+ <option value='Veoh' <?php if($instance['RV_source4'] == 'Veoh'){echo 'selected="selected"';}?> >Veoh Video</option>
601
+ <option value='Blip' <?php if($instance['RV_source4'] == 'Blip'){echo 'selected="selected"';}?> >blip.tv Video</option>
602
+ <option value='WordPress' <?php if($instance['RV_source4'] == 'WordPress'){echo 'selected="selected"';}?> >WordPress Video</option>
603
+ <option value='Viddler' <?php if($instance['RV_source4'] == 'Viddler'){echo 'selected="selected"';}?> >Viddler Video</option>
604
+ <option value='DailyMotion' <?php if($instance['RV_source4'] == 'DailyMotion'){echo 'selected="selected"';}?> >DailyMotion Video</option>
605
+ <option value='Revver' <?php if($instance['RV_source4'] == 'Revver'){echo 'selected="selected"';}?> >Revver Video</option>
606
+ <option value='Metacafe' <?php if($instance['RV_source4'] == 'Metacafe'){echo 'selected="selected"';}?> >Metacafe Video</option>
607
+ <option value='Tudou' <?php if($instance['RV_source4'] == 'Tudou'){echo 'selected="selected"';}?> >Tudou Video</option>
608
+ <option value='Youku' <?php if($instance['RV_source4'] == 'Youku'){echo 'selected="selected"';}?> >Youku Video</option>
609
+ <option value='cn6' <?php if($instance['RV_source4'] == 'cn6'){echo 'selected="selected"';}?> >6.cn Video</option>
610
+ </select>
611
+ </p>
612
+
613
+ <p>
614
+ <label for="<?php echo $this->get_field_id('RV_id4'); ?>">Video 4 ID: </label>
615
+ <input class="widefat" id="<?php echo $this->get_field_id('RV_id4'); ?>" name="<?php echo $this->get_field_name('RV_id4'); ?>" type="text" value="<?php echo $instance['RV_id4']; ?>" /></p>
616
+
617
+
618
+ <!--fifth video setting -->
619
+ <p>
620
+ <label for="<?php echo $this->get_field_id( 'RV_source5' ); ?>">Select Video 5 Source:</label>
621
+ <select id="<?php echo $this->get_field_id( 'RV_source5' );?>" name="<?php echo $this->get_field_name( 'RV_source5' );?>" class="widefat" style="width:100%;">
622
+ <option value='YouTube' <?php if($instance['RV_source5'] == 'YouTube'){echo 'selected="selected"';}?> >YouTube Video</option>
623
+ <option value='Vimeo' <?php if($instance['RV_source5'] == 'Vimeo'){echo 'selected="selected"';}?> >Vimeo Video</option>
624
+ <option value='MySpace' <?php if($instance['RV_source5'] == 'MySpace'){echo 'selected="selected"';}?> >MySpace Video</option>
625
+ <option value='Veoh' <?php if($instance['RV_source5'] == 'Veoh'){echo 'selected="selected"';}?> >Veoh Video</option>
626
+ <option value='Blip' <?php if($instance['RV_source5'] == 'Blip'){echo 'selected="selected"';}?> >blip.tv Video</option>
627
+ <option value='WordPress' <?php if($instance['RV_source5'] == 'WordPress'){echo 'selected="selected"';}?> >WordPress Video</option>
628
+ <option value='Viddler' <?php if($instance['RV_source5'] == 'Viddler'){echo 'selected="selected"';}?> >Viddler Video</option>
629
+ <option value='DailyMotion' <?php if($instance['RV_source5'] == 'DailyMotion'){echo 'selected="selected"';}?> >DailyMotion Video</option>
630
+ <option value='Revver' <?php if($instance['RV_source5'] == 'Revver'){echo 'selected="selected"';}?> >Revver Video</option>
631
+ <option value='Metacafe' <?php if($instance['RV_source5'] == 'Metacafe'){echo 'selected="selected"';}?> >Metacafe Video</option>
632
+ <option value='Tudou' <?php if($instance['RV_source5'] == 'Tudou'){echo 'selected="selected"';}?> >Tudou Video</option>
633
+ <option value='Youku' <?php if($instance['RV_source5'] == 'Youku'){echo 'selected="selected"';}?> >Youku Video</option>
634
+ <option value='cn6' <?php if($instance['RV_source5'] == 'cn6'){echo 'selected="selected"';}?> >6.cn Video</option>
635
+ </select>
636
+ </p>
637
+
638
+ <p>
639
+ <label for="<?php echo $this->get_field_id('RV_id5'); ?>">Video 5 ID: </label>
640
+ <input class="widefat" id="<?php echo $this->get_field_id('RV_id5'); ?>" name="<?php echo $this->get_field_name('RV_id5'); ?>" type="text" value="<?php echo $instance['RV_id5']; ?>" /></p>
641
+
642
+
643
+ <!--auto play -->
644
+ <p>
645
+ <label for="<?php echo $this->get_field_id( 'RV_autoplay' ); ?>">Auto Play:</label>
646
+ <select id="<?php echo $this->get_field_id( 'RV_autoplay' );?>" name="<?php echo $this->get_field_name( 'RV_autoplay' );?>" class="widefat" style="width:100%;">';
647
+ <option value='1' <?php if($instance['RV_autoplay'] == '1'){echo 'selected="selected"';}?>>Yes</option>
648
+ <option value='0' <?php if($instance['RV_autoplay'] == '0'){echo 'selected="selected"';}?>>No</option>
649
+ </select>
650
+ </p>
651
+
652
+ <?php
653
+
654
+ }
655
+
656
+ }
657
+
658
+
659
+
660
+
661
+
662
+
663
  ?>