Video Sidebar Widgets - Version 5.1

Version Description

  • Fixed PHP errors in WordPress debug mode.
Download this release

Release Info

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

Code changes from version 5.0 to 5.1

class-postmetavideowidget.php CHANGED
@@ -246,23 +246,23 @@ VSWShowVideo($vsw_pmvw_video_source,$vsw_pmvw_video_id,$vsw_pmvw_video_autoplay,
246
  $msg = "<p class='description'>Sorry, auto play option not supported by ".$source."</p>";
247
  switch ($source) {
248
 
249
- case WordPress:
250
  echo $msg;
251
  break;
252
 
253
- case Tudou:
254
  echo $msg;
255
  break;
256
 
257
- case Youku:
258
  echo $msg;
259
  break;
260
 
261
- case Blip:
262
  echo "<p class='description'>Sorry, auto play option for BlipTv was removed as it is causing error in Internet Explorer</p>";
263
  break;
264
 
265
- case cn6:
266
  echo "<p class='description'>Sorry, auto play option not supported by 6.cn</p>";
267
  break;
268
  }
246
  $msg = "<p class='description'>Sorry, auto play option not supported by ".$source."</p>";
247
  switch ($source) {
248
 
249
+ case 'WordPress':
250
  echo $msg;
251
  break;
252
 
253
+ case 'Tudou':
254
  echo $msg;
255
  break;
256
 
257
+ case 'Youku':
258
  echo $msg;
259
  break;
260
 
261
+ case 'Blip':
262
  echo "<p class='description'>Sorry, auto play option for BlipTv was removed as it is causing error in Internet Explorer</p>";
263
  break;
264
 
265
+ case 'cn6':
266
  echo "<p class='description'>Sorry, auto play option not supported by 6.cn</p>";
267
  break;
268
  }
class-randomvideosidebarwidget.php CHANGED
@@ -35,7 +35,11 @@ extract( $args );
35
  $RV_id5 = $instance['RV_id5'];
36
  $RV_source5 = $instance['RV_source5'];
37
  $RV_cap5 = $instance['RV_cap5'];
38
-
 
 
 
 
39
  echo $before_widget;
40
 
41
  if ( $RV_title )
@@ -99,28 +103,28 @@ extract( $args );
99
  $rv_cap = null;
100
  break;
101
 
102
- case YouTube:
103
  $rv_value = "http://www.youtube.com/v/$Embed_id&autoplay=$RV_autoplay&loop=0&rel=0";
104
  $rv_flashvar = null;
105
  $rv_flashvar2 = null;
106
  $rv_cap = $Embed_cap;
107
  break;
108
 
109
- case Vimeo:
110
  $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";
111
  $rv_flashvar = null;
112
  $rv_flashvar2 = null;
113
  $rv_cap = $Embed_cap;
114
  break;
115
 
116
- case MySpace:
117
  $rv_value = "http://mediaservices.myspace.com/services/media/embed.aspx/m=$Embed_id,t=1,mt=video,ap=$RV_autoplay";
118
  $rv_flashvar = null;
119
  $rv_flashvar2 = null;
120
  $rv_cap = $Embed_cap;
121
  break;
122
 
123
- case Veoh:
124
  $rv_value = "http://www.veoh.com/static/swf/webplayer/WebPlayer.swf?version=AFrontend.5.4.2.20.1002&permalinkId=$Embed_id";
125
  $rv_value.= "&player=videodetailsembedded&id=anonymous&videoAutoPlay=$RV_autoplay";
126
  $rv_flashvar = null;
@@ -128,21 +132,21 @@ extract( $args );
128
  $rv_cap = $Embed_cap;
129
  break;
130
 
131
- case Blip:
132
  $rv_value = "http://blip.tv/play/$Embed_id";
133
  $rv_flashvar = null;
134
  $rv_flashvar2 = null;
135
  $rv_cap = $Embed_cap;
136
  break;
137
 
138
- case WordPress:
139
  $rv_value = "http://s0.videopress.com/player.swf?v=1.02";
140
  $rv_flashvar = "<param name='flashvars' value='$Embed_id'>";
141
  $rv_flashvar2 = 'flashvars="guid='.$Embed_id.'"';
142
  $rv_cap = $Embed_cap;
143
  break;
144
 
145
- case Viddler:
146
  $rv_value = "http://www.viddler.com/player/$Embed_id";
147
  if($RV_autoplay=='1'){
148
  $rv_flashvar = "<param name=\"flashvars\" value=\"autoplay=t\" />\n";
@@ -151,7 +155,7 @@ extract( $args );
151
  $rv_cap = $Embed_cap;
152
  break;
153
 
154
- case DailyMotion:
155
  $rv_value = "http://www.dailymotion.com/swf/$Embed_id&autoStart=$RV_autoplay&related=0";
156
  $rv_flashvar = null;
157
  $rv_flashvar2 = null;
@@ -159,14 +163,14 @@ extract( $args );
159
  break;
160
 
161
 
162
- case Revver:
163
  $rv_value = "http://flash.revver.com/player/1.0/player.swf?mediaId=$Embed_id&autoStart=$RV_autoplay";
164
  $rv_flashvar = null;
165
  $rv_flashvar2 = null;
166
  $rv_cap = $Embed_cap;
167
  break;
168
 
169
- case Metacafe:
170
  $rid = split('/',$Embed_id);
171
  $rv_value = "http://www.metacafe.com/fplayer/$rid[0]/$rid[1].swf";
172
  if($RV_autoplay=='1'){
@@ -176,28 +180,28 @@ extract( $args );
176
  $rv_cap = $Embed_cap;
177
  break;
178
 
179
- case Tudou:
180
  $rv_value = "$Embed_id";
181
  $rv_flashvar = null;
182
  $rv_flashvar2 = null;
183
  $rv_cap = $Embed_cap;
184
  break;
185
 
186
- case Youku:
187
  $rv_value = "$Embed_id";
188
  $rv_flashvar = null;
189
  $rv_flashvar2 = null;
190
  $rv_cap = $Embed_cap;
191
  break;
192
 
193
- case cn6:
194
  $rv_value = "$Embed_id";
195
  $rv_flashvar = null;
196
  $rv_flashvar2 = null;
197
  $rv_cap = $Embed_cap;
198
  break;
199
 
200
- case Google:
201
  $rv_value = "http://video.google.com/googleplayer.swf?docid=$Embed_id&hl=en&fs=true";
202
  if($RV_autoplay=='1'){
203
  $rv_flashvar = null;
@@ -206,7 +210,7 @@ extract( $args );
206
  $rv_cap = $Embed_cap;
207
  break;
208
 
209
- case Tangle:
210
  $rv_value = "http://www.tangle.com/flash/swf/flvplayer.swf";
211
  if($RV_autoplay=='1'){
212
  $rv_flashvar = null;
35
  $RV_id5 = $instance['RV_id5'];
36
  $RV_source5 = $instance['RV_source5'];
37
  $RV_cap5 = $instance['RV_cap5'];
38
+
39
+ //define empty variable to prevent WordPress debug error
40
+ $rv_flashvar = null;
41
+ $rv_flashvar2 = null;
42
+
43
  echo $before_widget;
44
 
45
  if ( $RV_title )
103
  $rv_cap = null;
104
  break;
105
 
106
+ case 'YouTube':
107
  $rv_value = "http://www.youtube.com/v/$Embed_id&autoplay=$RV_autoplay&loop=0&rel=0";
108
  $rv_flashvar = null;
109
  $rv_flashvar2 = null;
110
  $rv_cap = $Embed_cap;
111
  break;
112
 
113
+ case 'Vimeo':
114
  $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";
115
  $rv_flashvar = null;
116
  $rv_flashvar2 = null;
117
  $rv_cap = $Embed_cap;
118
  break;
119
 
120
+ case 'MySpace':
121
  $rv_value = "http://mediaservices.myspace.com/services/media/embed.aspx/m=$Embed_id,t=1,mt=video,ap=$RV_autoplay";
122
  $rv_flashvar = null;
123
  $rv_flashvar2 = null;
124
  $rv_cap = $Embed_cap;
125
  break;
126
 
127
+ case 'Veoh':
128
  $rv_value = "http://www.veoh.com/static/swf/webplayer/WebPlayer.swf?version=AFrontend.5.4.2.20.1002&permalinkId=$Embed_id";
129
  $rv_value.= "&player=videodetailsembedded&id=anonymous&videoAutoPlay=$RV_autoplay";
130
  $rv_flashvar = null;
132
  $rv_cap = $Embed_cap;
133
  break;
134
 
135
+ case 'Blip':
136
  $rv_value = "http://blip.tv/play/$Embed_id";
137
  $rv_flashvar = null;
138
  $rv_flashvar2 = null;
139
  $rv_cap = $Embed_cap;
140
  break;
141
 
142
+ case 'WordPress':
143
  $rv_value = "http://s0.videopress.com/player.swf?v=1.02";
144
  $rv_flashvar = "<param name='flashvars' value='$Embed_id'>";
145
  $rv_flashvar2 = 'flashvars="guid='.$Embed_id.'"';
146
  $rv_cap = $Embed_cap;
147
  break;
148
 
149
+ case 'Viddler':
150
  $rv_value = "http://www.viddler.com/player/$Embed_id";
151
  if($RV_autoplay=='1'){
152
  $rv_flashvar = "<param name=\"flashvars\" value=\"autoplay=t\" />\n";
155
  $rv_cap = $Embed_cap;
156
  break;
157
 
158
+ case 'DailyMotion':
159
  $rv_value = "http://www.dailymotion.com/swf/$Embed_id&autoStart=$RV_autoplay&related=0";
160
  $rv_flashvar = null;
161
  $rv_flashvar2 = null;
163
  break;
164
 
165
 
166
+ case 'Revver':
167
  $rv_value = "http://flash.revver.com/player/1.0/player.swf?mediaId=$Embed_id&autoStart=$RV_autoplay";
168
  $rv_flashvar = null;
169
  $rv_flashvar2 = null;
170
  $rv_cap = $Embed_cap;
171
  break;
172
 
173
+ case 'Metacafe':
174
  $rid = split('/',$Embed_id);
175
  $rv_value = "http://www.metacafe.com/fplayer/$rid[0]/$rid[1].swf";
176
  if($RV_autoplay=='1'){
180
  $rv_cap = $Embed_cap;
181
  break;
182
 
183
+ case 'Tudou':
184
  $rv_value = "$Embed_id";
185
  $rv_flashvar = null;
186
  $rv_flashvar2 = null;
187
  $rv_cap = $Embed_cap;
188
  break;
189
 
190
+ case 'Youku':
191
  $rv_value = "$Embed_id";
192
  $rv_flashvar = null;
193
  $rv_flashvar2 = null;
194
  $rv_cap = $Embed_cap;
195
  break;
196
 
197
+ case 'cn6':
198
  $rv_value = "$Embed_id";
199
  $rv_flashvar = null;
200
  $rv_flashvar2 = null;
201
  $rv_cap = $Embed_cap;
202
  break;
203
 
204
+ case 'Google':
205
  $rv_value = "http://video.google.com/googleplayer.swf?docid=$Embed_id&hl=en&fs=true";
206
  if($RV_autoplay=='1'){
207
  $rv_flashvar = null;
210
  $rv_cap = $Embed_cap;
211
  break;
212
 
213
+ case 'Tangle':
214
  $rv_value = "http://www.tangle.com/flash/swf/flvplayer.swf";
215
  if($RV_autoplay=='1'){
216
  $rv_flashvar = null;
class-videosidebarwidget.php CHANGED
@@ -157,23 +157,23 @@ class VideoSidebarWidget extends WP_Widget {
157
  $msg = "<p>Sorry, auto play option not supported by ".$source."</p>";
158
  switch ($source) {
159
 
160
- case WordPress:
161
  echo $msg;
162
  break;
163
 
164
- case Tudou:
165
  echo $msg;
166
  break;
167
 
168
- case Youku:
169
  echo $msg;
170
  break;
171
 
172
- case Blip:
173
  echo "<p>Sorry, auto play option removed as it is causing error in Internet Explorer</p>";
174
  break;
175
 
176
- case cn6:
177
  echo "<p>Sorry, auto play option not supported by 6.cn</p>";
178
  break;
179
  }
157
  $msg = "<p>Sorry, auto play option not supported by ".$source."</p>";
158
  switch ($source) {
159
 
160
+ case 'WordPress':
161
  echo $msg;
162
  break;
163
 
164
+ case 'Tudou':
165
  echo $msg;
166
  break;
167
 
168
+ case 'Youku':
169
  echo $msg;
170
  break;
171
 
172
+ case 'Blip':
173
  echo "<p>Sorry, auto play option removed as it is causing error in Internet Explorer</p>";
174
  break;
175
 
176
+ case 'cn6':
177
  echo "<p>Sorry, auto play option not supported by 6.cn</p>";
178
  break;
179
  }
helper-functions.php CHANGED
@@ -15,6 +15,9 @@ function VSWShowVideo($videosource,$videoid,$autoplaysetting,$videowidth,$videoh
15
  $v_source = $videosource;
16
  $v_width2 = $videowidth;
17
  $v_height2 = $videoheight;
 
 
 
18
 
19
  $source = $v_source;
20
 
@@ -27,44 +30,44 @@ function VSWShowVideo($videosource,$videoid,$autoplaysetting,$videowidth,$videoh
27
  $flashvar2 = null;
28
  break;
29
 
30
- case YouTube:
31
  $value = "http://www.youtube.com/v/$v_id2&autoplay=$v_autoplay2&loop=0&rel=0";
32
  $flashvar = null;
33
  $flashvar2 = null;
34
  break;
35
 
36
- case Vimeo:
37
  $value = "http://vimeo.com/moogaloop.swf?clip_id=$v_id2&amp;server=vimeo.com&amp;loop=0&amp;fullscreen=1&amp;autoplay=$v_autoplay2";
38
  $flashvar = null;
39
  $flashvar2 = null;
40
  break;
41
 
42
- case MySpace:
43
  $value = "http://mediaservices.myspace.com/services/media/embed.aspx/m=$v_id2,t=1,mt=video,ap=$v_autoplay2";
44
  $flashvar = null;
45
  $flashvar2 = null;
46
  break;
47
 
48
- case Veoh:
49
  $value = "http://www.veoh.com/static/swf/webplayer/WebPlayer.swf?version=AFrontend.5.4.2.20.1002&";
50
  $value.= "permalinkId=$v_id2&player=videodetailsembedded&id=anonymous&videoAutoPlay=$v_autoplay2";
51
  $flashvar = null;
52
  $flashvar2 = null;
53
  break;
54
 
55
- case Blip:
56
  $value = "http://blip.tv/play/$v_id2";
57
  $flashvar = null;
58
  $flashvar2 = null;
59
  break;
60
 
61
- case WordPress:
62
  $value = "http://s0.videopress.com/player.swf?v=1.02";
63
  $flashvar = "<param name='flashvars' value='$v_id2'>";
64
  $flashvar2 = 'flashvars="guid='.$v_id2.'"';
65
  break;
66
 
67
- case Viddler:
68
  $value = "http://www.viddler.com/player/$v_id2";
69
  if($v_autoplay2=='1'){
70
  $flashvar = "<param name=\"flashvars\" value=\"autoplay=t\" />\n";
@@ -72,20 +75,20 @@ function VSWShowVideo($videosource,$videoid,$autoplaysetting,$videowidth,$videoh
72
  }
73
  break;
74
 
75
- case DailyMotion:
76
  $value = "http://www.dailymotion.com/swf/$v_id2&autoStart=$v_autoplay2&related=0";
77
  $flashvar = null;
78
  $flashvar2 = null;
79
  break;
80
 
81
 
82
- case Revver:
83
  $value = "http://flash.revver.com/player/1.0/player.swf?mediaId=$v_id2&autoStart=$v_autoplay2";
84
  $flashvar = null;
85
  $flashvar2 = null;
86
  break;
87
 
88
- case Metacafe:
89
  $id = split('/',$v_id2);
90
  $value = "http://www.metacafe.com/fplayer/$id[0]/$id[1].swf";
91
  if($v_autoplay2=='1'){
@@ -94,25 +97,25 @@ function VSWShowVideo($videosource,$videoid,$autoplaysetting,$videowidth,$videoh
94
  }
95
  break;
96
 
97
- case Tudou:
98
  $value = "$v_id2";
99
  $flashvar = null;
100
  $flashvar2 = null;
101
  break;
102
 
103
- case Youku:
104
  $value = "$v_id2";
105
  $flashvar = null;
106
  $flashvar2 = null;
107
  break;
108
 
109
- case cn6:
110
  $value = "$v_id2";
111
  $flashvar = null;
112
  $flashvar2 = null;
113
  break;
114
 
115
- case Google:
116
  $value = "http://video.google.com/googleplayer.swf?docid=$v_id2&hl=en&fs=true";
117
  if($v_autoplay2=='1'){
118
  $flashvar = null;
@@ -120,7 +123,7 @@ function VSWShowVideo($videosource,$videoid,$autoplaysetting,$videowidth,$videoh
120
  }
121
  break;
122
 
123
- case Tangle:
124
  $value = "http://www.tangle.com/flash/swf/flvplayer.swf";
125
  if($v_autoplay2=='1'){
126
  $flashvar = null;
@@ -206,83 +209,83 @@ return vsw_show_video_class($id,$source,$width,$height,$autoplay);
206
  add_shortcode("vsw", "vsw_show_video");
207
 
208
  //function to be used in shortcode or directly in theme
209
- //uses the_widget WordPress Function found in widgets.php
210
  function vsw_show_video_class($id,$source,$width,$height,$autoplay){
211
 
212
  $vsw_id = $id;
213
  $vsw_width = $width;
214
  $vsw_height = $height;
215
-
 
216
  //convert string of source to lowercase
217
  $source = strtolower($source);
218
 
219
  //should have used all lowercase in previous functions
220
  //now have to switch it.
221
  switch ($source) {
222
-
223
  case null:
224
  $vsw_source = null;
225
  break;
226
 
227
- case youtube:
228
- $vsw_source = YouTube;
229
  break;
230
 
231
- case vimeo:
232
- $vsw_source = Vimeo;
233
  break;
234
 
235
- case myspace:
236
- $vsw_source = MySpace;
237
  break;
238
 
239
- case veoh:
240
- $vsw_source = Veoh;
241
  break;
242
 
243
- case bliptv:
244
- $vsw_source = Blip;
245
  break;
246
 
247
- case wordpress:
248
- $vsw_source = WordPress;
249
  break;
250
 
251
- case viddler:
252
- $vsw_source = Viddler;
253
  break;
254
 
255
- case dailymotion:
256
- $vsw_source = DailyMotion;
257
  break;
258
 
259
 
260
- case revver:
261
- $vsw_source = Revver;
262
  break;
263
 
264
- case metacafe:
265
- $vsw_source = Metacafe;
266
  break;
267
 
268
- case tudou:
269
- $vsw_source = Tudou;
270
  break;
271
 
272
- case youku:
273
- $vsw_source = Youku;
274
  break;
275
 
276
- case cn6:
277
- $vsw_source = cn6;
278
  break;
279
 
280
- case google:
281
- $vsw_source = Google;
282
  break;
283
 
284
- case tangle:
285
- $vsw_source = Tangle;
286
  break;
287
 
288
  }
@@ -297,11 +300,11 @@ function vsw_show_video_class($id,$source,$width,$height,$autoplay){
297
  $vsw_autoplay = 0;
298
  break;
299
 
300
- case no:
301
  $vsw_autoplay = 0;
302
  break;
303
 
304
- case yes:
305
  $vsw_autoplay = 1;
306
  break;
307
 
15
  $v_source = $videosource;
16
  $v_width2 = $videowidth;
17
  $v_height2 = $videoheight;
18
+ //declare empty variable to prevent WordPress debug error
19
+ $flashvar = null;
20
+ $flashvar2 = null;
21
 
22
  $source = $v_source;
23
 
30
  $flashvar2 = null;
31
  break;
32
 
33
+ case 'YouTube':
34
  $value = "http://www.youtube.com/v/$v_id2&autoplay=$v_autoplay2&loop=0&rel=0";
35
  $flashvar = null;
36
  $flashvar2 = null;
37
  break;
38
 
39
+ case 'Vimeo':
40
  $value = "http://vimeo.com/moogaloop.swf?clip_id=$v_id2&amp;server=vimeo.com&amp;loop=0&amp;fullscreen=1&amp;autoplay=$v_autoplay2";
41
  $flashvar = null;
42
  $flashvar2 = null;
43
  break;
44
 
45
+ case 'MySpace':
46
  $value = "http://mediaservices.myspace.com/services/media/embed.aspx/m=$v_id2,t=1,mt=video,ap=$v_autoplay2";
47
  $flashvar = null;
48
  $flashvar2 = null;
49
  break;
50
 
51
+ case 'Veoh':
52
  $value = "http://www.veoh.com/static/swf/webplayer/WebPlayer.swf?version=AFrontend.5.4.2.20.1002&";
53
  $value.= "permalinkId=$v_id2&player=videodetailsembedded&id=anonymous&videoAutoPlay=$v_autoplay2";
54
  $flashvar = null;
55
  $flashvar2 = null;
56
  break;
57
 
58
+ case 'Blip':
59
  $value = "http://blip.tv/play/$v_id2";
60
  $flashvar = null;
61
  $flashvar2 = null;
62
  break;
63
 
64
+ case 'WordPress':
65
  $value = "http://s0.videopress.com/player.swf?v=1.02";
66
  $flashvar = "<param name='flashvars' value='$v_id2'>";
67
  $flashvar2 = 'flashvars="guid='.$v_id2.'"';
68
  break;
69
 
70
+ case 'Viddler':
71
  $value = "http://www.viddler.com/player/$v_id2";
72
  if($v_autoplay2=='1'){
73
  $flashvar = "<param name=\"flashvars\" value=\"autoplay=t\" />\n";
75
  }
76
  break;
77
 
78
+ case 'DailyMotion':
79
  $value = "http://www.dailymotion.com/swf/$v_id2&autoStart=$v_autoplay2&related=0";
80
  $flashvar = null;
81
  $flashvar2 = null;
82
  break;
83
 
84
 
85
+ case 'Revver':
86
  $value = "http://flash.revver.com/player/1.0/player.swf?mediaId=$v_id2&autoStart=$v_autoplay2";
87
  $flashvar = null;
88
  $flashvar2 = null;
89
  break;
90
 
91
+ case 'Metacafe':
92
  $id = split('/',$v_id2);
93
  $value = "http://www.metacafe.com/fplayer/$id[0]/$id[1].swf";
94
  if($v_autoplay2=='1'){
97
  }
98
  break;
99
 
100
+ case 'Tudou':
101
  $value = "$v_id2";
102
  $flashvar = null;
103
  $flashvar2 = null;
104
  break;
105
 
106
+ case 'Youku':
107
  $value = "$v_id2";
108
  $flashvar = null;
109
  $flashvar2 = null;
110
  break;
111
 
112
+ case 'cn6':
113
  $value = "$v_id2";
114
  $flashvar = null;
115
  $flashvar2 = null;
116
  break;
117
 
118
+ case 'Google':
119
  $value = "http://video.google.com/googleplayer.swf?docid=$v_id2&hl=en&fs=true";
120
  if($v_autoplay2=='1'){
121
  $flashvar = null;
123
  }
124
  break;
125
 
126
+ case 'Tangle':
127
  $value = "http://www.tangle.com/flash/swf/flvplayer.swf";
128
  if($v_autoplay2=='1'){
129
  $flashvar = null;
209
  add_shortcode("vsw", "vsw_show_video");
210
 
211
  //function to be used in shortcode or directly in theme
 
212
  function vsw_show_video_class($id,$source,$width,$height,$autoplay){
213
 
214
  $vsw_id = $id;
215
  $vsw_width = $width;
216
  $vsw_height = $height;
217
+
218
+
219
  //convert string of source to lowercase
220
  $source = strtolower($source);
221
 
222
  //should have used all lowercase in previous functions
223
  //now have to switch it.
224
  switch ($source) {
225
+
226
  case null:
227
  $vsw_source = null;
228
  break;
229
 
230
+ case 'youtube':
231
+ $vsw_source = 'YouTube';
232
  break;
233
 
234
+ case 'vimeo':
235
+ $vsw_source = 'Vimeo';
236
  break;
237
 
238
+ case 'myspace':
239
+ $vsw_source = 'MySpace';
240
  break;
241
 
242
+ case 'veoh':
243
+ $vsw_source = 'Veoh';
244
  break;
245
 
246
+ case 'bliptv':
247
+ $vsw_source = 'Blip';
248
  break;
249
 
250
+ case 'wordpress':
251
+ $vsw_source = 'WordPress';
252
  break;
253
 
254
+ case 'viddler':
255
+ $vsw_source = 'Viddler';
256
  break;
257
 
258
+ case 'dailymotion':
259
+ $vsw_source = 'DailyMotion';
260
  break;
261
 
262
 
263
+ case 'revver':
264
+ $vsw_source = 'Revver';
265
  break;
266
 
267
+ case 'metacafe':
268
+ $vsw_source = 'Metacafe';
269
  break;
270
 
271
+ case 'tudou':
272
+ $vsw_source = 'Tudou';
273
  break;
274
 
275
+ case 'youku':
276
+ $vsw_source = 'Youku';
277
  break;
278
 
279
+ case 'cn6':
280
+ $vsw_source = 'cn6';
281
  break;
282
 
283
+ case 'google':
284
+ $vsw_source = 'Google';
285
  break;
286
 
287
+ case 'tangle':
288
+ $vsw_source = 'Tangle';
289
  break;
290
 
291
  }
300
  $vsw_autoplay = 0;
301
  break;
302
 
303
+ case 'no':
304
  $vsw_autoplay = 0;
305
  break;
306
 
307
+ case 'yes':
308
  $vsw_autoplay = 1;
309
  break;
310
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ 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, google videos, tangle
6
  Requires at least:2.8.1
7
  Tested up to: 3.2
8
- Stable tag:5.0
9
 
10
  == Description ==
11
 
@@ -14,6 +14,10 @@ Stable tag:5.0
14
 
15
  == Changelog ==
16
 
 
 
 
 
17
  = 5.0 =
18
 
19
  * Added Post Meta Video Widget (instructions within Widget)
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, google videos, tangle
6
  Requires at least:2.8.1
7
  Tested up to: 3.2
8
+ Stable tag:5.1
9
 
10
  == Description ==
11
 
14
 
15
  == Changelog ==
16
 
17
+ = 5.1 =
18
+
19
+ * Fixed PHP errors in WordPress debug mode.
20
+
21
  = 5.0 =
22
 
23
  * Added Post Meta Video Widget (instructions within Widget)
video-sidebar-widgets.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Video Sidebar Widgets
4
  Plugin URI: http://denzeldesigns.com/wordpress-plugins/video-sidebar-widgets/
5
- Version: 5.0
6
  Description: Video Sidebar Widgets to display videos such as Vimeo, YouTube, MySpace Videos etc. Now with added shortcode and quicktag to embed video in post and page content.
7
  Author: Denzel Chia
8
  Author URI: http://denzeldesigns.com/
@@ -17,6 +17,8 @@ require_once(dirname(__FILE__) . "/vsw_admin_settings.php");
17
  //Tinymce Editor Button
18
  require_once(dirname(__FILE__) . "/vsw_tinymce/vsw_tinymce.php");
19
 
 
 
20
  // Video Sidebar Widget
21
  require_once(dirname(__FILE__) . "/class-videosidebarwidget.php");
22
 
@@ -26,7 +28,8 @@ require_once(dirname(__FILE__) . "/class-randomvideosidebarwidget.php");
26
  // Post Meta Video Widget
27
  require_once(dirname(__FILE__) . "/class-postmetavideowidget.php");
28
 
29
- //function to register Video Sidebar Widget and Random Video Sidebar Widget
 
30
  function load_video_sidebar_widgets(){
31
  $options = get_option('vsw_plugin_options');
32
  if(empty($options['hide_vsw'])){
2
  /*
3
  Plugin Name: Video Sidebar Widgets
4
  Plugin URI: http://denzeldesigns.com/wordpress-plugins/video-sidebar-widgets/
5
+ Version: 5.1
6
  Description: Video Sidebar Widgets to display videos such as Vimeo, YouTube, MySpace Videos etc. Now with added shortcode and quicktag to embed video in post and page content.
7
  Author: Denzel Chia
8
  Author URI: http://denzeldesigns.com/
17
  //Tinymce Editor Button
18
  require_once(dirname(__FILE__) . "/vsw_tinymce/vsw_tinymce.php");
19
 
20
+ //You can comment out the widget class that you do not want to load, remember to comment out the register_widget() in load_video_sidebar_widgets() below!
21
+
22
  // Video Sidebar Widget
23
  require_once(dirname(__FILE__) . "/class-videosidebarwidget.php");
24
 
28
  // Post Meta Video Widget
29
  require_once(dirname(__FILE__) . "/class-postmetavideowidget.php");
30
 
31
+ //function to register Video Sidebar Widget and Random Video Sidebar Widget and post meta video widget.
32
+ //You comment out the widget that you do not want.
33
  function load_video_sidebar_widgets(){
34
  $options = get_option('vsw_plugin_options');
35
  if(empty($options['hide_vsw'])){
vsw_admin_settings.php CHANGED
@@ -13,6 +13,8 @@ add_options_page('Video Sidebar Widgets Settings', 'Video Sidebar Widgets','mana
13
  }
14
 
15
  function vsw_admin_page(){
 
 
16
  ?>
17
  <div class="wrap">
18
  <div class="icon32" id="icon-options-general"><br></div>
@@ -31,7 +33,7 @@ function vsw_admin_page(){
31
  <br/>
32
  <label>Video Sidebar Widget</label>
33
  <?php
34
- if($options['hide_vsw']) { $checked1 = ' checked="checked" '; }
35
  echo "<input ".$checked1." id='vsw' name='vsw_plugin_options[hide_vsw]' type='checkbox' value='hide'/>";
36
  ?>
37
  </div>
@@ -41,7 +43,7 @@ function vsw_admin_page(){
41
  <br/>
42
  <label>Random Video Widget</label>
43
  <?php
44
- if($options['hide_rvw']) { $checked2 = ' checked="checked" '; }
45
  echo "<input ".$checked2." id='rvw' name='vsw_plugin_options[hide_rvw]' type='checkbox' value='hide'/>";
46
  ?>
47
  </div>
@@ -51,7 +53,7 @@ function vsw_admin_page(){
51
  <br/>
52
  <label>TinyMCE Editor Button</label>
53
  <?php
54
- if($options['hide_tmb']) { $checked3 = ' checked="checked" '; }
55
  echo "<input ".$checked3." id='tmb' name='vsw_plugin_options[hide_tmb]' type='checkbox' value='hide'/>";
56
  ?>
57
  </div>
@@ -62,7 +64,7 @@ function vsw_admin_page(){
62
  <br/>
63
  <label>Post Meta Video Widget</label>
64
  <?php
65
- if($options['hide_pmvw']) { $checked4 = ' checked="checked" '; }
66
  echo "<input ".$checked4." id='tmb' name='vsw_plugin_options[hide_pmvw]' type='checkbox' value='hide'/>";
67
  ?>
68
  </div>
13
  }
14
 
15
  function vsw_admin_page(){
16
+ //define and initiate variables to prevent error in WordPress Debug Mode
17
+ $checked1 = $checked2 = $checked3 = $checked4 = '';
18
  ?>
19
  <div class="wrap">
20
  <div class="icon32" id="icon-options-general"><br></div>
33
  <br/>
34
  <label>Video Sidebar Widget</label>
35
  <?php
36
+ if(isset($options['hide_vsw'])) { $checked1 = ' checked="checked" '; }
37
  echo "<input ".$checked1." id='vsw' name='vsw_plugin_options[hide_vsw]' type='checkbox' value='hide'/>";
38
  ?>
39
  </div>
43
  <br/>
44
  <label>Random Video Widget</label>
45
  <?php
46
+ if(isset($options['hide_rvw'])) { $checked2 = ' checked="checked" '; }
47
  echo "<input ".$checked2." id='rvw' name='vsw_plugin_options[hide_rvw]' type='checkbox' value='hide'/>";
48
  ?>
49
  </div>
53
  <br/>
54
  <label>TinyMCE Editor Button</label>
55
  <?php
56
+ if(isset($options['hide_tmb'])) { $checked3 = ' checked="checked" '; }
57
  echo "<input ".$checked3." id='tmb' name='vsw_plugin_options[hide_tmb]' type='checkbox' value='hide'/>";
58
  ?>
59
  </div>
64
  <br/>
65
  <label>Post Meta Video Widget</label>
66
  <?php
67
+ if(isset($options['hide_pmvw'])) { $checked4 = ' checked="checked" '; }
68
  echo "<input ".$checked4." id='tmb' name='vsw_plugin_options[hide_pmvw]' type='checkbox' value='hide'/>";
69
  ?>
70
  </div>