source: trunk/www.guidonia.net/wp/wp-content/plugins/wordpress-video-plugin/videos.php@ 44

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 76.7 KB
Line 
1<?php
2/*
3Plugin Name: Wordpress Video Plugin
4Plugin URI: http://www.daburna.de/blog/2006/12/13/wordpress-video-plugin/
5Description: A filter for WordPress that displays videos from myvideo.de, youtube, google video, Brightcove, Aniboom, 123video.nl, MyspaceTV, Yahoo! Video, Veoh, Wandeo, Glumbert, Gametrailers, Gamevideos, LiveLeak, sevenload.de, clipfish.de, break.com, Metacafe, dailymotion.com, Vimeo, videotube, blip.tv, revver, IFILM, Tu.tv, grouper, Cellfish.com, Sumo.tv, Last.fm, Vsocial, teachertube, SlideShare, Jumpcut, MSN, GoalVideoz, Guba, wat.tv, Facebook, Flickr Video, Kewego, Smotri.Com...and many more.
6Version: 0.71
7Author: Oliver Wunder
8Author URI: http://www.daburna.de/
9
10
11*/
12
13// Kewego Code
14
15define("KEWEGO_WIDTH", 400); // default width
16define("KEWEGO_HEIGHT", 300); // default height
17define("KEWEGO_PLAYERKEY", "9c37f60da51b"); //player key
18define("KEWEGO_SKINKEY", "71703ed5cea1"); //skin key
19define("KEWEGO_LCODE", "fr"); //language code
20define("KEWEGO_REGEXP", "/\[kewego ([[:print:]]+)\]/");
21
22define("KEWEGO_TARGET", "<object name=\"iLyROoafJCWA\" id=\"iLyROoafJCWA\" type=\"application/x-shockwave-flash\" data=\"http://sa.kewego.com/swf/p3/epix.swf\" width=\"###WIDTH###\" height=\"###HEIGHT###\"> <param name=\"flashVars\" value=\"language_code=###LCODE###&playerKey=###PKEY###&skinKey=###SKEY###&sig=###URL###&autostart=false\" /> <param name=\"movie\" value=\"http://sa.kewego.com/swf/p3/epix.swf\" /> <param name=\"allowFullScreen\" value=\"true\" /> <param name=\"allowscriptaccess\" value=\"always\" /></object>");
23
24function kewego_plugin_callback($match)
25{
26 $tag_parts = explode(" ", rtrim($match[0], "]"));
27 $output = KEWEGO_TARGET;
28 $output = str_replace("###URL###", $tag_parts[1], $output);
29 $output = str_replace("###LCODE###", KEWEGO_LCODE, $output);
30 $output = str_replace("###PKEY###", KEWEGO_PLAYERKEY, $output);
31 $output = str_replace("###SKEY###", KEWEGO_SKINKEY, $output);
32 if (count($tag_parts) > 2) {
33 if ($tag_parts[2] == 0) {
34 $output = str_replace("###WIDTH###", KEWEGO_WIDTH, $output);
35 } else {
36 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
37 }
38 if ($tag_parts[3] == 0) {
39 $output = str_replace("###HEIGHT###", KEWEGO_HEIGHT, $output);
40 } else {
41 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
42 }
43 } else {
44 $output = str_replace("###WIDTH###", KEWEGO_WIDTH, $output);
45 $output = str_replace("###HEIGHT###", KEWEGO_HEIGHT, $output);
46 }
47 return ($output);
48}
49function kewego_plugin($content)
50{
51 return (preg_replace_callback(KEWEGO_REGEXP, 'kewego_plugin_callback', $content));
52}
53
54add_filter('the_content', 'kewego_plugin', 1);
55add_filter('the_content_rss', 'kewego_plugin');
56add_filter('comment_text', 'kewego_plugin');
57
58// FLICKR CODE by an anonymous user
59
60define("FLICKR_WIDTH", 308); // default width
61define("FLICKR_HEIGHT", 250); // default height
62define("FLICKR_REGEXP", "/\[flickr ([[:print:]]+)\]/");
63define("FLICKR_TARGET", "<object type=\"application/x-shockwave-flash\" width=\"###WIDTH###\" height=\"###HEIGHT###\" data=\"http://www.flickr.com/apps/video/stewart.swf?v=71377\"><param name=\"flashvars\" value=\"intl_lang=en-us&photo_secret=1669be43ac&photo_id=###URL###&hd_default=false\"></param><param name=\"movie\" value=\"http://www.flickr.com/apps/video/stewart.swf?v=71377\" /><param name=\"bgcolor\" value=\"#000000\"></param><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"http://www.flickr.com/apps/video/stewart.swf?v=71377\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" bgcolor=\"#0000000\" flashvars=\"intl_lang=en-us&photo_secret=1669be43ac&photo_id=###URL###&hd_default=false\" width=\"###WIDTH###\" height=\"###HEIGHT###\"></embed></object>");
64
65function flickr_plugin_callback($match)
66{
67 $tag_parts = explode(" ", rtrim($match[0], "]"));
68 $output = FLICKR_TARGET;
69 $output = str_replace("###URL###", $tag_parts[1], $output);
70 if (count($tag_parts) > 2) {
71 if ($tag_parts[2] == 0) {
72 $output = str_replace("###WIDTH###", FLICKR_WIDTH, $output);
73 } else {
74 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
75 }
76 if ($tag_parts[3] == 0) {
77 $output = str_replace("###HEIGHT###", FLICKR_HEIGHT, $output);
78 } else {
79 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
80 }
81 } else {
82 $output = str_replace("###WIDTH###", FLICKR_WIDTH, $output);
83 $output = str_replace("###HEIGHT###", FLICKR_HEIGHT, $output);
84 }
85 return ($output);
86}
87function flickr_plugin($content)
88{
89 return (preg_replace_callback(FLICKR_REGEXP, 'flickr_plugin_callback', $content));
90}
91
92add_filter('the_content', 'flickr_plugin',1);
93add_filter('the_content_rss', 'flickr_plugin');
94add_filter('comment_text', 'flickr_plugin');
95
96// FB Code
97// Code for FaceBook video
98// credits: roberto scano http://robertoscano.info
99
100define("FB_WIDTH", 470);
101define("FB_HEIGHT", 306);
102define("FB_REGEXP", "/\[FB ([[:print:]]+)\]/");
103define("FB_TARGET", "<object type=\"application/x-shockwave-flash\"
104data=\"http://www.facebook.com/v/###URL###\" width=\"".FB_WIDTH."\"
105height=\"".FB_HEIGHT."\"><param name=\"autostart\" value=\"false\" /><param
106name=\"movie\" value=\"http://www.facebook.com/v/###URL###\" /></object>");
107
108function FB_plugin_callback($match) {
109 $output = FB_TARGET;
110 $output = str_replace("###URL###", $match[1], $output);
111 return ($output);
112}
113
114function FB_plugin($content) {
115 return preg_replace_callback(FB_REGEXP, 'FB_plugin_callback',
116$content);
117}
118
119add_filter('the_content', 'FB_plugin');
120add_filter('comment_text', 'FB_plugin');
121
122// current code
123
124define("CURRENT_WIDTH", 400); // default width
125define("CURRENT_HEIGHT", 342); // default height
126define("CURRENT_REGEXP", "/\[current ([[:print:]]+)\]/");
127define("CURRENT_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT###\"><param name=\"movie\" value=\"http://current.com/e/###URL###/en_US\"></param><param name=\"wmode\" value=\"transparent\"></param><param name=\"allowfullscreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://current.com/e/###URL###/en_US\" type=\"application/x-shockwave-flash\" width=\"###WIDTH###\" height=\"###HEIGHT###\" wmode=\"transparent\" allowfullscreen=\"true\" allowscriptaccess=\"always\"></embed></object>");
128
129function current_plugin_callback($match)
130{
131 $tag_parts = explode(" ", rtrim($match[0], "]"));
132 $output = CURRENT_TARGET;
133 $output = str_replace("###URL###", $tag_parts[1], $output);
134 if (count($tag_parts) > 2) {
135 if ($tag_parts[2] == 0) {
136 $output = str_replace("###WIDTH###", CURRENT_WIDTH, $output);
137 } else {
138 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
139 }
140 if ($tag_parts[3] == 0) {
141 $output = str_replace("###HEIGHT###", CURRENT_HEIGHT, $output);
142 } else {
143 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
144 }
145 } else {
146 $output = str_replace("###WIDTH###", CURRENT_WIDTH, $output);
147 $output = str_replace("###HEIGHT###", CURRENT_HEIGHT, $output);
148 }
149 return ($output);
150}
151function current_plugin($content)
152{
153 return (preg_replace_callback(CURRENT_REGEXP, 'current_plugin_callback', $content));
154}
155
156add_filter('the_content', 'current_plugin');
157add_filter('the_content_rss', 'current_plugin');
158add_filter('comment_text', 'current_plugin');
159
160
161// screencast-o-matic code
162
163define("SCREENCAST_WIDTH", 504); // default width
164define("SCREENCAST_HEIGHT", 424); // default height
165define("SCREENCAST_REGEXP", "/\[screencast ([[:print:]]+)\]/");
166define("SCREENCAST_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT###\" data=\"http://www.screencast-o-matic.com/embed?sc=###URL###&w=500&np=0&v=2\" type=\"text/html\"></object>");
167
168function screencast_plugin_callback($match)
169{
170 $tag_parts = explode(" ", rtrim($match[0], "]"));
171 $output = SCREENCAST_TARGET;
172 $output = str_replace("###URL###", $tag_parts[1], $output);
173 if (count($tag_parts) > 2) {
174 if ($tag_parts[2] == 0) {
175 $output = str_replace("###WIDTH###", SCREENCAST_WIDTH, $output);
176 } else {
177 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
178 }
179 if ($tag_parts[3] == 0) {
180 $output = str_replace("###HEIGHT###", SCREENCAST_HEIGHT, $output);
181 } else {
182 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
183 }
184 } else {
185 $output = str_replace("###WIDTH###", SCREENCAST_WIDTH, $output);
186 $output = str_replace("###HEIGHT###", SCREENCAST_HEIGHT, $output);
187 }
188 return ($output);
189}
190function screencast_plugin($content)
191{
192 return (preg_replace_callback(SCREENCAST_REGEXP, 'screencast_plugin_callback', $content));
193}
194
195add_filter('the_content', 'screencast_plugin');
196add_filter('the_content_rss', 'screencast_plugin');
197add_filter('comment_text', 'screencast_plugin');
198
199// dotSUB code
200
201define("DOTSUB_WIDTH", 420); // default width
202define("DOTSUB_HEIGHT", 347); // default height
203define("DOTSUB_REGEXP", "/\[dotsub ([[:print:]]+)\]/");
204define("DOTSUB_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT###\" data=\"http://dotsub.com/media/###URL###/e/m\" type=\"text/html\"></object>");
205
206function dotsub_plugin_callback($match)
207{
208 $tag_parts = explode(" ", rtrim($match[0], "]"));
209 $output = DOTSUB_TARGET;
210 $output = str_replace("###URL###", $tag_parts[1], $output);
211 if (count($tag_parts) > 2) {
212 if ($tag_parts[2] == 0) {
213 $output = str_replace("###WIDTH###", DOTSUB_WIDTH, $output);
214 } else {
215 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
216 }
217 if ($tag_parts[3] == 0) {
218 $output = str_replace("###HEIGHT###", DOTSUB_HEIGHT, $output);
219 } else {
220 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
221 }
222 } else {
223 $output = str_replace("###WIDTH###", DOTSUB_WIDTH, $output);
224 $output = str_replace("###HEIGHT###", DOTSUB_HEIGHT, $output);
225 }
226 return ($output);
227}
228function dotsub_plugin($content)
229{
230 return (preg_replace_callback(DOTSUB_REGEXP, 'dotsub_plugin_callback', $content));
231}
232
233add_filter('the_content', 'dotsub_plugin');
234add_filter('the_content_rss', 'dotsub_plugin');
235add_filter('comment_text', 'dotsub_plugin');
236
237
238// OnSMASH code
239
240define("ONSMASH_WIDTH", 448); // default width
241define("ONSMASH_HEIGHT", 374); // default height
242define("ONSMASH_REGEXP", "/\[onsmash ([[:print:]]+)\]/");
243define("ONSMASH_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT###\"><param name=\"movie\" value=\"http://videos.onsmash.com/e/###URL###\"></param><param name=\"allowFullscreen\" value=\"true\"><param name=\"allowScriptAccess\" value=\"always\"></param><param name=\"allowNetworking\" value=\"all\"></param><embed src=\"http://videos.onsmash.com/e/###URL###\" type=\"application/x-shockwave-flash\" allowFullScreen=\"true\" allowNetworking=\"all\" allowScriptAccess=\"always\" width=\"###WIDTH###\" height=\"###HEIGHT###\"></embed></object>");
244
245function onsmash_plugin_callback($match)
246{
247 $tag_parts = explode(" ", rtrim($match[0], "]"));
248 $output = ONSMASH_TARGET;
249 $output = str_replace("###URL###", $tag_parts[1], $output);
250 if (count($tag_parts) > 2) {
251 if ($tag_parts[2] == 0) {
252 $output = str_replace("###WIDTH###", ONSMASH_WIDTH, $output);
253 } else {
254 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
255 }
256 if ($tag_parts[3] == 0) {
257 $output = str_replace("###HEIGHT###", ONSMASH_HEIGHT, $output);
258 } else {
259 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
260 }
261 } else {
262 $output = str_replace("###WIDTH###", ONSMASH_WIDTH, $output);
263 $output = str_replace("###HEIGHT###", ONSMASH_HEIGHT, $output);
264 }
265 return ($output);
266}
267function onsmash_plugin($content)
268{
269 return (preg_replace_callback(ONSMASH_REGEXP, 'onsmash_plugin_callback', $content));
270}
271
272add_filter('the_content', 'onsmash_plugin');
273add_filter('the_content_rss', 'onsmash_plugin');
274add_filter('comment_text', 'onsmash_plugin');
275
276
277// Smotri.Com code
278
279define("SMOTRI_WIDTH", 400); // default width
280define("SMOTRI_HEIGHT", 330); // default height
281define("SMOTRI_REGEXP", "/\[smotri ([[:print:]]+)\]/");
282define("SMOTRI_TARGET", "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"###WIDTH###\" height=\"###HEIGHT###\"><param name=\"movie\" value=\"http://pics.smotri.com/scrubber_custom8.swf?file=###URL###&bufferTime=3&autoStart=false&str_lang=eng&xmlsource=http%3A%2F%2Fpics.smotri.com%2Fcskins%2Fblue%2Fskin_color_lightaqua.xml&xmldatasource=http%3A%2F%2Fpics.smotri.com%2Fskin_ng.xml\" /><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"allowFullScreen\" value=\"true\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed src=\"http://pics.smotri.com/scrubber_custom8.swf?file=###URL###&bufferTime=3&autoStart=false&str_lang=eng&xmlsource=http%3A%2F%2Fpics.smotri.com%2Fcskins%2Fblue%2Fskin_color_lightaqua.xml&xmldatasource=http%3A%2F%2Fpics.smotri.com%2Fskin_ng.xml\" quality=\"high\" allowscriptaccess=\"always\" allowfullscreen=\"true\" wmode=\"window\" width=\"###WIDTH###\" height=\"###HEIGHT###\" type=\"application/x-shockwave-flash\"></embed></object>");
283
284function smotri_plugin_callback($match)
285{
286 $tag_parts = explode(" ", rtrim($match[0], "]"));
287 $output = SMOTRI_TARGET;
288 $output = str_replace("###URL###", $tag_parts[1], $output);
289 if (count($tag_parts) > 2) {
290 if ($tag_parts[2] == 0) {
291 $output = str_replace("###WIDTH###", SMOTRI_WIDTH, $output);
292 } else {
293 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
294 }
295 if ($tag_parts[3] == 0) {
296 $output = str_replace("###HEIGHT###", SMOTRI_HEIGHT, $output);
297 } else {
298 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
299 }
300 } else {
301 $output = str_replace("###WIDTH###", SMOTRI_WIDTH, $output);
302 $output = str_replace("###HEIGHT###", SMOTRI_HEIGHT, $output);
303 }
304 return ($output);
305}
306function smotri_plugin($content)
307{
308 return (preg_replace_callback(SMOTRI_REGEXP, 'smotri_plugin_callback', $content));
309}
310
311add_filter('the_content', 'smotri_plugin');
312add_filter('the_content_rss', 'smotri_plugin');
313add_filter('comment_text', 'smotri_plugin');
314
315// wat.tv code by Bertimus (http://www.born2buzz.com/)
316
317define("WAT_WIDTH", 430); // default width
318define("WAT_HEIGHT", 385); // default height
319define("WAT_REGEXP", "/\[wat ([[:print:]]+)\]/");
320define("WAT_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT###\"><param name=\"movie\" value=\"http://www.wat.tv/swf2/###URL###\" /><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"http://www.wat.tv/swf2/###URL###\" type=\"application/x-shockwave-flash\" width=\"###WIDTH###\" height=\"###HEIGHT###\" allowScriptAccess=\"always\" allowFullScreen=\"true\"></embed></object>");
321
322function wat_plugin_callback($match)
323{
324 $tag_parts = explode(" ", rtrim($match[0], "]"));
325 $output = WAT_TARGET;
326 $output = str_replace("###URL###", $tag_parts[1], $output);
327 if (count($tag_parts) > 2) {
328 if ($tag_parts[2] == 0) {
329 $output = str_replace("###WIDTH###", WAT_WIDTH, $output);
330 } else {
331 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
332 }
333 if ($tag_parts[3] == 0) {
334 $output = str_replace("###HEIGHT###", WAT_HEIGHT, $output);
335 } else {
336 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
337 }
338 } else {
339 $output = str_replace("###WIDTH###", WAT_WIDTH, $output);
340 $output = str_replace("###HEIGHT###", WAT_HEIGHT, $output);
341 }
342 return ($output);
343}
344function wat_plugin($content)
345{
346 return (preg_replace_callback(WAT_REGEXP, 'wat_plugin_callback', $content));
347}
348
349add_filter('the_content', 'wat_plugin');
350add_filter('the_content_rss', 'wat_plugin');
351add_filter('comment_text', 'wat_plugin');
352
353// Guba code
354
355define("GUBA_WIDTH", 375); // default width
356define("GUBA_HEIGHT", 360); // default height
357define("GUBA_REGEXP", "/\[guba ([[:print:]]+)\]/");
358define("GUBA_TARGET", "<embed src=\"http://www.guba.com/f/root.swf?video_url=http://free.guba.com/uploaditem/###URL###/flash.flv&isEmbeddedPlayer=true\" quality=\"best\" bgcolor=\"#FFFFFF\" menu=\"true\" width=\"###WIDTH###\" height=\"###HEIGHT###\" name=\"root\" id=\"root\" align=\"middle\" scaleMode=\"noScale\" allowScriptAccess=\"always\" allowFullScreen=\"true\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>");
359
360function guba_plugin_callback($match)
361{
362 $tag_parts = explode(" ", rtrim($match[0], "]"));
363 $output = GUBA_TARGET;
364 $output = str_replace("###URL###", $tag_parts[1], $output);
365 if (count($tag_parts) > 2) {
366 if ($tag_parts[2] == 0) {
367 $output = str_replace("###WIDTH###", GUBA_WIDTH, $output);
368 } else {
369 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
370 }
371 if ($tag_parts[3] == 0) {
372 $output = str_replace("###HEIGHT###", GUBA_HEIGHT, $output);
373 } else {
374 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
375 }
376 } else {
377 $output = str_replace("###WIDTH###", GUBA_WIDTH, $output);
378 $output = str_replace("###HEIGHT###", GUBA_HEIGHT, $output);
379 }
380 return ($output);
381}
382function guba_plugin($content)
383{
384 return (preg_replace_callback(GUBA_REGEXP, 'guba_plugin_callback', $content));
385}
386
387add_filter('the_content', 'guba_plugin');
388add_filter('the_content_rss', 'guba_plugin');
389add_filter('comment_text', 'guba_plugin');
390
391
392// GoalVideoz code
393
394define("GOALVIDEOZ_WIDTH", 425); // default width
395define("GOALVIDEOZ_HEIGHT", 350); // default height
396define("GOALVIDEOZ_REGEXP", "/\[goalvideoz ([[:print:]]+)\]/");
397define("GOALVIDEOZ_TARGET", "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"###WIDTH###\" height=\"###HEIGHT###\" id=\"vpod2\ align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"wmode\" value=\"transparent\"><param name=\"movie\" value=\"http://www.goalvideoz.com/vpod2.swf?id=###URL###\" /><param name=\"quality\" value=\"high\" /><embed src=\"http://www.goalvideoz.com/vpod2.swf?id=###URL###\" quality=\"high\" width=\"###WIDTH###\" height=\"###HEIGHT###\" name=\"vpod\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>");
398
399function goalvideoz_plugin_callback($match)
400{
401 $tag_parts = explode(" ", rtrim($match[0], "]"));
402 $output = GOALVIDEOZ_TARGET;
403 $output = str_replace("###URL###", $tag_parts[1], $output);
404 if (count($tag_parts) > 2) {
405 if ($tag_parts[2] == 0) {
406 $output = str_replace("###WIDTH###", GOALVIDEOZ_WIDTH, $output);
407 } else {
408 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
409 }
410 if ($tag_parts[3] == 0) {
411 $output = str_replace("###HEIGHT###", GOALVIDEOZ_HEIGHT, $output);
412 } else {
413 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
414 }
415 } else {
416 $output = str_replace("###WIDTH###", GOALVIDEOZ_WIDTH, $output);
417 $output = str_replace("###HEIGHT###", GOALVIDEOZ_HEIGHT, $output);
418 }
419 return ($output);
420}
421function goalvideoz_plugin($content)
422{
423 return (preg_replace_callback(GOALVIDEOZ_REGEXP, 'goalvideoz_plugin_callback', $content));
424}
425
426add_filter('the_content', 'goalvideoz_plugin');
427add_filter('the_content_rss', 'goalvideoz_plugin');
428add_filter('comment_text', 'goalvideoz_plugin');
429
430// mojvideo.com Slovenska Video Skupnost code
431
432define("MOJVIDEO_WIDTH", 400); // default width
433define("MOJVIDEO_HEIGHT", 320); // default height
434define("MOJVIDEO_REGEXP", "/\[mojvideo ([[:print:]]+)\]/");
435define("MOJVIDEO_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT###\"><param name=\"movie\" value=\"http://www.mojvideo.com/v/###URL###\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.mojvideo.com/v/###URL###\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"###WIDTH###\" height=\"###HEIGHT###\"></embed></object>");
436
437function mojvideo_plugin_callback($match)
438{
439 $tag_parts = explode(" ", rtrim($match[0], "]"));
440 $output = MOJVIDEO_TARGET;
441 $output = str_replace("###URL###", $tag_parts[1], $output);
442 if (count($tag_parts) > 2) {
443 if ($tag_parts[2] == 0) {
444 $output = str_replace("###WIDTH###", MOJVIDEO_WIDTH, $output);
445 } else {
446 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
447 }
448 if ($tag_parts[3] == 0) {
449 $output = str_replace("###HEIGHT###", MOJVIDEO_HEIGHT, $output);
450 } else {
451 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
452 }
453 } else {
454 $output = str_replace("###WIDTH###", MOJVIDEO_WIDTH, $output);
455 $output = str_replace("###HEIGHT###", MOJVIDEO_HEIGHT, $output);
456 }
457 return ($output);
458}
459function mojvideo_plugin($content)
460{
461 return (preg_replace_callback(MOJVIDEO_REGEXP, 'mojvideo_plugin_callback', $content));
462}
463
464add_filter('the_content', 'mojvideo_plugin');
465add_filter('the_content_rss', 'mojvideo_plugin');
466add_filter('comment_text', 'mojvideo_plugin');
467
468
469// ClipSyndicate Code by Antonio SJ Musumeci
470
471define("CLIPSYN_WIDTH", 300); // default width
472define("CLIPSYN_HEIGHT", 265); // default height
473define("CLIPSYN_REGEXP", "/\[clipsyndicate ([[:print:]]+)\]/");
474define("CLIPSYN_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT###\"><param name=\"movie\" value=\"http://eplayer.clipsyndicate.com/cs_api/get_swf\"></param><param name=\"flashvars\" value=\"swfHome=eplayer.clipsyndicate.com&va_id=###URL###\"></param><embed src=\"http://eplayer.clipsyndicate.com/cs_api/get_swf\" flashvars=\"swfHome=eplayer.clipsyndicate.com&va_id=###URL###\" type=\"application/x-shockwave-flash\" width=\"###WIDTH###\" height=\"###HEIGHT###\"></embed></object>");
475
476function clipsyn_plugin_callback($match)
477{
478 $tag_parts = explode(" ", rtrim($match[0], "]"));
479 $output = CLIPSYN_TARGET;
480 $output = str_replace("###URL###", $tag_parts[1], $output);
481 if (count($tag_parts) > 2) {
482 if ($tag_parts[2] == 0) {
483 $output = str_replace("###WIDTH###", CLIPSYN_WIDTH, $output);
484 } else {
485 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
486 }
487 if ($tag_parts[3] == 0) {
488 $output = str_replace("###HEIGHT###", CLIPSYN_HEIGHT, $output);
489 } else {
490 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
491 }
492 } else {
493 $output = str_replace("###WIDTH###", CLIPSYN_WIDTH, $output);
494 $output = str_replace("###HEIGHT###", CLIPSYN_HEIGHT, $output);
495 }
496 return ($output);
497}
498function clipsyn_plugin($content)
499{
500 return (preg_replace_callback(CLIPSYN_REGEXP, 'clipsyn_plugin_callback', $content));
501}
502
503add_filter('the_content', 'clipsyn_plugin');
504add_filter('the_content_rss', 'clipsyn_plugin');
505add_filter('comment_text', 'clipsyn_plugin');
506
507
508// Youreporter Code by Giacomo
509
510define("YOUREPORTER_WIDTH", 450);
511define("YOUREPORTER_HEIGHT", 340);
512define("YOUREPORTER_REGEXP", "/\[youreporter ([[:print:]]+)\]/");
513define("YOUREPORTER_TARGET", "<embed src=\"http://www.youreporter.it/player/flv.swf\" width=\"".YOUREPORTER_WIDTH."\" height=\"".YOUREPORTER_HEIGHT."\"allowscriptaccess=\"always\" allowfullscreen=\"true\" flashvars=\"config=http://www.youreporter.it/player/ext/config.xml.php?vkey=###URL###%26colors=youreporter%26size=normale\" menu=\"false\" />");
514
515function youreporter_plugin_callback($match) {
516 $output = YOUREPORTER_TARGET;
517 $output = str_replace("###URL###", $match[1], $output);
518 return ($output);
519}
520
521function youreporter_plugin($content) {
522 return preg_replace_callback(YOUREPORTER_REGEXP,
523'youreporter_plugin_callback', $content);
524}
525
526add_filter('the_content', 'youreporter_plugin');
527add_filter('the_content_rss', 'youreporter_plugin');
528add_filter('comment_text', 'youreporter_plugin');
529
530// Generic Flash Code by Francisco Monteagudo
531
532define("GENERIC_FLASH_WIDTH", 425);
533define("GENERIC_FLASH_HEIGHT", 350);
534define("GENERIC_FLASH_REGEXP", "/\[flash ([[:print:]]+)\]/");
535define("GENERIC_FLASH_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"###URL###\" width=\"".GENERIC_FLASH_WIDTH."\" height=\"".GENERIC_FLASH_HEIGHT."\" wmode=\"transparent\"/></object>");
536
537function generic_flash_plugin_callback($match) {
538 $output = GENERIC_FLASH_TARGET;
539 $output = str_replace("###URL###", $match[1], $output);
540 return ($output);
541}
542
543function generic_flash_plugin($content) {
544 return preg_replace_callback(GENERIC_FLASH_REGEXP, 'generic_flash_plugin_callback', $content);
545}
546
547add_filter('the_content', 'generic_flash_plugin');
548add_filter('the_content_rss', 'generic_flash_plugin');
549add_filter('comment_text', 'generic_flash_plugin');
550
551
552// Funny or Die
553
554define("FUNNYORDIE_WIDTH", 464); // default width
555define("FUNNYORDIE_HEIGHT", 388); // default height
556define("FUNNYORDIE_REGEXP", "/\[funnyordie ([[:print:]]+)\]/");
557define("FUNNYORDIE_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT####\" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"><param name=\"movie\" value=\"http://www2.funnyordie.com/public/flash/fodplayer.swf?6045\" /><param name=\"flashvars\" value=\"key=###URL###\" /><param name=\"allowfullscreen\" value=\"true\" /><embed width=\"###WIDTH###\" height=\"###HEIGHT###\" flashvars=\"key=###URL###\" allowfullscreen=\"true\" quality=\"high\" src=\"http://www2.funnyordie.com/public/flash/fodplayer.swf?6045\" type=\"application/x-shockwave-flash\"></embed></object>");
558
559function funnyordie_plugin_callback($match)
560{
561 $tag_parts = explode(" ", rtrim($match[0], "]"));
562 $output = FUNNYORDIE_TARGET;
563 $output = str_replace("###URL###", $tag_parts[1], $output);
564 if (count($tag_parts) > 2) {
565 if ($tag_parts[2] == 0) {
566 $output = str_replace("###WIDTH###", FUNNYORDIE_WIDTH, $output);
567 } else {
568 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
569 }
570 if ($tag_parts[3] == 0) {
571 $output = str_replace("###HEIGHT###", FUNNYORDIE_HEIGHT, $output);
572 } else {
573 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
574 }
575 } else {
576 $output = str_replace("###WIDTH###", FUNNYORDIE_WIDTH, $output);
577 $output = str_replace("###HEIGHT###", FUNNYORDIE_HEIGHT, $output);
578 }
579 return ($output);
580}
581function funnyordie_plugin($content)
582{
583 return (preg_replace_callback(FUNNYORDIE_REGEXP, 'funnyordie_plugin_callback', $content));
584}
585
586add_filter('the_content', 'funnyordie_plugin');
587add_filter('the_content_rss', 'funnyordie_plugin');
588add_filter('comment_text', 'funnyordie_plugin');
589
590
591// Trilulilu
592
593define("TRILULILU_WIDTH", 448); // default width
594define("TRILULILU_HEIGHT", 386); // default height
595define("TRILULILU_REGEXP", "/\[trilulilu ([[:print:]]+)\]/");
596define("TRILULILU_TARGET", "<script type=\"text/javascript\" language=\"javascript\" src=\"http://www.trilulilu.ro/embed-video/keskifa/###URL###\"></script><script type=\"text/javascript\" language=\"javascript\">show_###URL###(###WIDTH###, ###HEIGHT###);</script>");
597
598function trilulilu_plugin_callback($match)
599{
600 $tag_parts = explode(" ", rtrim($match[0], "]"));
601 $output = TRILULILU_TARGET;
602 $output = str_replace("###URL###", $tag_parts[1], $output);
603 if (count($tag_parts) > 2) {
604 if ($tag_parts[2] == 0) {
605 $output = str_replace("###WIDTH###", TRILULILU_WIDTH, $output);
606 } else {
607 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
608 }
609 if ($tag_parts[3] == 0) {
610 $output = str_replace("###HEIGHT###", TRILULILU_HEIGHT, $output);
611 } else {
612 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
613 }
614 } else {
615 $output = str_replace("###WIDTH###", TRILULILU_WIDTH, $output);
616 $output = str_replace("###HEIGHT###", TRILULILU_HEIGHT, $output);
617 }
618 return ($output);
619}
620function trilulilu_plugin($content)
621{
622 return (preg_replace_callback(TRILULILU_REGEXP, 'trilulilu_plugin_callback', $content));
623}
624
625add_filter('the_content', 'trilulilu_plugin');
626add_filter('the_content_rss', 'trilulilu_plugin');
627add_filter('comment_text', 'trilulilu_plugin');
628
629
630// d1g.com
631
632define("D1G_WIDTH", 400); // default width
633define("D1G_HEIGHT", 300); // default height
634define("D1G_REGEXP", "/\[d1g ([[:print:]]+)\]/");
635define("D1G_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT###\"><param value=\"#000000\" name=\"bgcolor\"><param name=\"movie\" value=\"http://www.d1g.com/swf/embedded_video_player.swf?id=2378&usefullscreen=false&file=http://www.d1g.com/video/play_video/###URL###&autostart=false&overstretch=false&repeat=false&shuffle=false\"></param><embed src=\"http://www.d1g.com/swf/embedded_video_player.swf?id=2378&file=http://www.d1g.com/video/play_video/###URL###&usefullscreen=false&autostart=false&overstretch=false&repeat=false&shuffle=false\" type=\"application/x-shockwave-flash\" width=\"###WIDTH###\" height=\"###HEIGHT###\" bgcolor=\"#000000\"></embed></object>");
636
637function d1g_plugin_callback($match)
638{
639 $tag_parts = explode(" ", rtrim($match[0], "]"));
640 $output = D1G_TARGET;
641 $output = str_replace("###URL###", $tag_parts[1], $output);
642 if (count($tag_parts) > 2) {
643 if ($tag_parts[2] == 0) {
644 $output = str_replace("###WIDTH###", D1G_WIDTH, $output);
645 } else {
646 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
647 }
648 if ($tag_parts[3] == 0) {
649 $output = str_replace("###HEIGHT###", D1G_HEIGHT, $output);
650 } else {
651 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
652 }
653 } else {
654 $output = str_replace("###WIDTH###", D1G_WIDTH, $output);
655 $output = str_replace("###HEIGHT###", D1G_HEIGHT, $output);
656 }
657 return ($output);
658}
659function d1g_plugin($content)
660{
661 return (preg_replace_callback(D1G_REGEXP, 'd1g_plugin_callback', $content));
662}
663
664add_filter('the_content', 'd1g_plugin');
665add_filter('the_content_rss', 'd1g_plugin');
666add_filter('comment_text', 'd1g_plugin');
667
668
669// ReelzChannel
670
671define("REELZCHANNEL_WIDTH", 480); // default width
672define("REELZCHANNEL_HEIGHT", 300); // default height
673define("REELZCHANNEL_REGEXP", "/\[reelzchannel ([[:print:]]+)\]/");
674define("REELZCHANNEL_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT###\"><param name=\"movie\" value=\"http://cache.reelzchannel.com/assets/flash/syndicatedPlayer.swf\" /><param name=\"wmode\" value=\"transparent\" /><param name=\"allowScriptAccess\" value=\"always\"/><param name=\"flashvars\" value=\"clipid=###URL###\"><embed src=\"http://cache.reelzchannel.com/assets/flash/syndicatedPlayer.swf\" AllowScriptAccess=\"always\" width=\"###WIDTH###\" height=\"###HEIGHT###\" type=\"application/x-shockwave-flash\" mode=\"transparent\" flashvars=\"clipid=###URL###\"/></object>");
675
676function reelzchannel_plugin_callback($match)
677{
678 $tag_parts = explode(" ", rtrim($match[0], "]"));
679 $output = REELZCHANNEL_TARGET;
680 $output = str_replace("###URL###", $tag_parts[1], $output);
681 if (count($tag_parts) > 2) {
682 if ($tag_parts[2] == 0) {
683 $output = str_replace("###WIDTH###", REELZCHANNEL_WIDTH, $output);
684 } else {
685 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
686 }
687 if ($tag_parts[3] == 0) {
688 $output = str_replace("###HEIGHT###", REELZCHANNEL_HEIGHT, $output);
689 } else {
690 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
691 }
692 } else {
693 $output = str_replace("###WIDTH###", REELZCHANNEL_WIDTH, $output);
694 $output = str_replace("###HEIGHT###", REELZCHANNEL_HEIGHT, $output);
695 }
696 return ($output);
697}
698function reelzchannel_plugin($content)
699{
700 return (preg_replace_callback(REELZCHANNEL_REGEXP, 'reelzchannel_plugin_callback', $content));
701}
702
703add_filter('the_content', 'reelzchannel_plugin');
704add_filter('the_content_rss', 'reelzchannel_plugin');
705add_filter('comment_text', 'reelzchannel_plugin');
706
707
708// MEGAVIDEO
709
710define("MEGAVIDEO_WIDTH", 432); // default width
711define("MEGAVIDEO_HEIGHT", 351); // default height
712define("MEGAVIDEO_REGEXP", "/\[megavideo ([[:print:]]+)\]/");
713define("MEGAVIDEO_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT###\"><param name=\"movie\" value=\"http://www.megavideo.com/v/###URL###.3920544471.0\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.megavideo.com/v/###URL###.3920544471.0\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"###WIDTH###\" height=\"###HEIGHT###\"></embed></object>");
714
715function megavideo_plugin_callback($match)
716{
717 $tag_parts = explode(" ", rtrim($match[0], "]"));
718 $output = MEGAVIDEO_TARGET;
719 $output = str_replace("###URL###", $tag_parts[1], $output);
720 if (count($tag_parts) > 2) {
721 if ($tag_parts[2] == 0) {
722 $output = str_replace("###WIDTH###", MEGAVIDEO_WIDTH, $output);
723 } else {
724 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
725 }
726 if ($tag_parts[3] == 0) {
727 $output = str_replace("###HEIGHT###", MEGAVIDEO_HEIGHT, $output);
728 } else {
729 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
730 }
731 } else {
732 $output = str_replace("###WIDTH###", MEGAVIDEO_WIDTH, $output);
733 $output = str_replace("###HEIGHT###", MEGAVIDEO_HEIGHT, $output);
734 }
735 return ($output);
736}
737function megavideo_plugin($content)
738{
739 return (preg_replace_callback(MEGAVIDEO_REGEXP, 'megavideo_plugin_callback', $content));
740}
741
742add_filter('the_content', 'megavideo_plugin');
743add_filter('the_content_rss', 'megavideo_plugin');
744add_filter('comment_text', 'megavideo_plugin');
745
746// MSN Video (soapbox)
747
748define("MSN_WIDTH", 432); // default width
749define("MSN_HEIGHT", 364); // default height
750define("MSN_REGEXP", "/\[msn ([[:print:]]+)\]/");
751define("MSN_TARGET", "<embed src=\"http://images.video.msn.com/flash/soapbox1_1.swf\" quality=\"high\" width=\"###WIDTH###\" height=\"###HEIGHT###\" base=\"http://images.video.msn.com\" type=\"application/x-shockwave-flash\" allowFullScreen=\"true\" allowScriptAccess=\"always\" pluginspage=\"http://macromedia.com/go/getflashplayer\" flashvars=\"c=v&v=###URL###\"></embed>");
752
753function msn_plugin_callback($match)
754{
755 $tag_parts = explode(" ", rtrim($match[0], "]"));
756 $output = MSN_TARGET;
757 $output = str_replace("###URL###", $tag_parts[1], $output);
758 if (count($tag_parts) > 2) {
759 if ($tag_parts[2] == 0) {
760 $output = str_replace("###WIDTH###", MSN_WIDTH, $output);
761 } else {
762 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
763 }
764 if ($tag_parts[3] == 0) {
765 $output = str_replace("###HEIGHT###", MSN_HEIGHT, $output);
766 } else {
767 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
768 }
769 } else {
770 $output = str_replace("###WIDTH###", MSN_WIDTH, $output);
771 $output = str_replace("###HEIGHT###", MSN_HEIGHT, $output);
772 }
773 return ($output);
774}
775function msn_plugin($content)
776{
777 return (preg_replace_callback(MSN_REGEXP, 'msn_plugin_callback', $content));
778}
779
780add_filter('the_content', 'msn_plugin');
781add_filter('the_content_rss', 'msn_plugin');
782add_filter('comment_text', 'msn_plugin');
783
784
785// Youtube Playlist Code
786
787define("YTPLAYLIST_WIDTH", 470); // default width
788define("YTPLAYLIST_HEIGHT", 406); // default height
789define("YTPLAYLIST_REGEXP", "/\[youtubeplaylist ([[:print:]]+)\]/");
790define("YTPLAYLIST_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT###\"><param name=\"movie\" value=\"http://de.youtube.com/p/###URL###\" /><param name=\"wmode\" value=\"transparent\" /><embed src=\"http://de.youtube.com/p/###URL###\" type=\"application/x-shockwave-flash\" width=\"###WIDTH###\" height=\"###HEIGHT###\" wmode=\"transparent\"></embed></object>
791");
792
793function ytplaylist_plugin_callback($match)
794{
795 $tag_parts = explode(" ", rtrim($match[0], "]"));
796 $output = YTPLAYLIST_TARGET;
797 $output = str_replace("###URL###", $tag_parts[1], $output);
798 if (count($tag_parts) > 2) {
799 if ($tag_parts[2] == 0) {
800 $output = str_replace("###WIDTH###", YTPLAYLIST_WIDTH, $output);
801 } else {
802 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
803 }
804 if ($tag_parts[3] == 0) {
805 $output = str_replace("###HEIGHT###", YTPLAYLIST_HEIGHT, $output);
806 } else {
807 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
808 }
809 } else {
810 $output = str_replace("###WIDTH###", YTPLAYLIST_WIDTH, $output);
811 $output = str_replace("###HEIGHT###", YTPLAYLIST_HEIGHT, $output);
812 }
813 return ($output);
814}
815function ytplaylist_plugin($content)
816{
817 return (preg_replace_callback(YTPLAYLIST_REGEXP, 'ytplaylist_plugin_callback', $content));
818}
819
820add_filter('the_content', 'ytplaylist_plugin',1);
821add_filter('the_content_rss', 'ytplaylist_plugin',1);
822add_filter('comment_text', 'ytplaylist_plugin');
823
824// mncast.com
825
826define("MNCAST_WIDTH", 520); // default width
827define("MNCAST_HEIGHT", 449); // default height
828define("MNCAST_REGEXP", "/\[mncast ([[:print:]]+)\]/");
829define("MNCAST_TARGET", "<embed pluginspage=\"http://www.macromedia.com/go/getflashplayer\" src=\"http://dory.mncast.com/mncHMovie.swf?movieID=###URL###&skinNum=1\" width=\"###WIDTH###\" height=\"###HEIGHT###\" type=\"application/x-shockwave-flash\"></embed>");
830
831function mncast_plugin_callback($match)
832{
833 $tag_parts = explode(" ", rtrim($match[0], "]"));
834 $output = MNCAST_TARGET;
835 $output = str_replace("###URL###", $tag_parts[1], $output);
836 if (count($tag_parts) > 2) {
837 if ($tag_parts[2] == 0) {
838 $output = str_replace("###WIDTH###", MNCAST_WIDTH, $output);
839 } else {
840 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
841 }
842 if ($tag_parts[3] == 0) {
843 $output = str_replace("###HEIGHT###", MNCAST_HEIGHT, $output);
844 } else {
845 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
846 }
847 } else {
848 $output = str_replace("###WIDTH###", MNCAST_WIDTH, $output);
849 $output = str_replace("###HEIGHT###", MNCAST_HEIGHT, $output);
850 }
851 return ($output);
852}
853function mncast_plugin($content)
854{
855 return (preg_replace_callback(MNCAST_REGEXP, 'mncast_plugin_callback', $content));
856}
857
858add_filter('the_content', 'mncast_plugin');
859add_filter('the_content_rss', 'mncast_plugin');
860add_filter('comment_text', 'mncast_plugin');
861
862// Hamburg1
863
864define("HH_WIDTH", 400); // default width
865define("HH_HEIGHT", 368); // default height
866define("HH_REGEXP", "/\[hamburg1 ([[:print:]]+)\]/");
867define("HH_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.hamburg1video.de/p/de/###URL###.html\" width=\"###WIDTH###\" height=\"###HEIGHT###\"><param name=\"movie\" value=\"http://www.hamburg1video.de/p/de/###URL###.html\" /><param name=\"wmode\" value=\"transparent\" /><embed src=\"http://www.hamburg1video.de/p/de/###URL###.html\" width=\"###WIDTH###\" height=\"###HEIGHT###\" wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\"></embed></object>");
868
869function hh_plugin_callback($match)
870{
871 $tag_parts = explode(" ", rtrim($match[0], "]"));
872 $output = HH_TARGET;
873 $output = str_replace("###URL###", $tag_parts[1], $output);
874 if (count($tag_parts) > 2) {
875 if ($tag_parts[2] == 0) {
876 $output = str_replace("###WIDTH###", HH_WIDTH, $output);
877 } else {
878 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
879 }
880 if ($tag_parts[3] == 0) {
881 $output = str_replace("###HEIGHT###", HH_HEIGHT, $output);
882 } else {
883 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
884 }
885 } else {
886 $output = str_replace("###WIDTH###", HH_WIDTH, $output);
887 $output = str_replace("###HEIGHT###", HH_HEIGHT, $output);
888 }
889 return ($output);
890}
891function hh_plugin($content)
892{
893 return (preg_replace_callback(HH_REGEXP, 'hh_plugin_callback', $content));
894}
895
896add_filter('the_content', 'hh_plugin');
897add_filter('the_content_rss', 'hh_plugin');
898add_filter('comment_text', 'hh_plugin');
899
900
901
902// Collegehumor Code
903
904define("COLLEGEHUMOR_WIDTH", 480); // default width
905define("COLLEGEHUMOR_HEIGHT", 360); // default height
906define("COLLEGEHUMOR_REGEXP", "/\[collegehumor ([[:print:]]+)\]/");
907define("COLLEGEHUMOR_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=###URL###&fullscreen=1\" width=\"###WIDTH###\" height=\"###HEIGHT###\"><param name=\"allowfullscreen\" value=\"true\" /><param name=\"movie\" quality=\"best\" value=\"http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=###URL###&fullscreen=1\" /></object>");
908
909function collegehumor_plugin_callback($match)
910{
911 $tag_parts = explode(" ", rtrim($match[0], "]"));
912 $output = COLLEGEHUMOR_TARGET;
913 $output = str_replace("###URL###", $tag_parts[1], $output);
914 if (count($tag_parts) > 2) {
915 if ($tag_parts[2] == 0) {
916 $output = str_replace("###WIDTH###", COLLEGEHUMOR_WIDTH, $output);
917 } else {
918 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
919 }
920 if ($tag_parts[3] == 0) {
921 $output = str_replace("###HEIGHT###", COLLEGEHUMOR_HEIGHT, $output);
922 } else {
923 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
924 }
925 } else {
926 $output = str_replace("###WIDTH###", COLLEGEHUMOR_WIDTH, $output);
927 $output = str_replace("###HEIGHT###", COLLEGEHUMOR_HEIGHT, $output);
928 }
929 return ($output);
930}
931function collegehumor_plugin($content)
932{
933 return (preg_replace_callback(COLLEGEHUMOR_REGEXP, 'collegehumor_plugin_callback', $content));
934}
935
936add_filter('the_content', 'collegehumor_plugin');
937add_filter('the_content_rss', 'collegehumor_plugin');
938add_filter('comment_text', 'collegehumor_plugin');
939
940
941// Jumpcut Code
942
943define("JUMPCUT_WIDTH", 408); // default width
944define("JUMPCUT_HEIGHT", 324); // default height
945define("JUMPCUT_REGEXP", "/\[jumpcut ([[:print:]]+)\]/");
946define("JUMPCUT_TARGET", "<embed type=\"application/x-shockwave-flash\" src=\"http://jumpcut.com/media/flash/jump.swf?id=###URL###&asset_type=movie&asset_id=###URL###&eb=1\" width=\"###WIDTH###\" height=\"###HEIGHT###\"></embed>");
947
948function jumpcut_plugin_callback($match)
949{
950 $tag_parts = explode(" ", rtrim($match[0], "]"));
951 $output = JUMPCUT_TARGET;
952 $output = str_replace("###URL###", $tag_parts[1], $output);
953 if (count($tag_parts) > 2) {
954 if ($tag_parts[2] == 0) {
955 $output = str_replace("###WIDTH###", JUMPCUT_WIDTH, $output);
956 } else {
957 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
958 }
959 if ($tag_parts[3] == 0) {
960 $output = str_replace("###HEIGHT###", JUMPCUT_HEIGHT, $output);
961 } else {
962 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
963 }
964 } else {
965 $output = str_replace("###WIDTH###", JUMPCUT_WIDTH, $output);
966 $output = str_replace("###HEIGHT###", JUMPCUT_HEIGHT, $output);
967 }
968 return ($output);
969}
970function jumpcut_plugin($content)
971{
972 return (preg_replace_callback(JUMPCUT_REGEXP, 'jumpcut_plugin_callback', $content));
973}
974
975add_filter('the_content', 'jumpcut_plugin');
976add_filter('the_content_rss', 'jumpcut_plugin');
977add_filter('comment_text', 'jumpcut_plugin');
978
979
980// ComedyCentral
981
982define("CC_WIDTH", 332);
983define("CC_HEIGHT", 316);
984define("CC_REGEXP", "/\[comedycentral ([[:print:]]+)\]/");
985define("CC_TARGET", "<embed src=\"http://www.comedycentral.com/sitewide/video_player/view/default/swf.jhtml\" flashvars=\"videoId=###URL###\" quality=\"high\" name=\"comedy_central_player\" allowscriptaccess=\"always\" allownetworking=\"external\" type=\"application/x-shockwave-flash\" height=\"".CC_HEIGHT."\" width=\"".CC_WIDTH."\"></embed>");
986
987function cc_plugin_callback($match) {
988 $output = CC_TARGET;
989 $output = str_replace("###URL###", $match[1], $output);
990 return ($output);
991}
992
993function cc_plugin($content) {
994 return preg_replace_callback(CC_REGEXP, 'cc_plugin_callback', $content);
995}
996
997add_filter('the_content', 'cc_plugin');
998add_filter('the_content_rss', 'cc_plugin');
999add_filter('comment_text', 'cc_plugin');
1000
1001// Reason.tv
1002
1003define("REASON_REGEXP", "/\[reason ([[:print:]]+)\]/");
1004define("REASON_TARGET", "<script type=\"text/javascript\" src=\"http://www.reason.tv/embed/video.php?id=###ID###\"></script>");
1005
1006function reason_plugin_callback($match) {
1007 $output = REASON_TARGET;
1008 $output = str_replace("###ID###", $match[1], $output);
1009 return ($output);
1010}
1011
1012function reason_plugin($content) {
1013 return preg_replace_callback(REASON_REGEXP, 'reason_plugin_callback', $content);
1014}
1015
1016add_filter('the_content', 'reason_plugin');
1017add_filter('the_content_rss', 'reason_plugin');
1018add_filter('comment_text', 'reason_plugin');
1019
1020// SlideShare Slides
1021
1022define("SS_WIDTH", 425);
1023define("SS_HEIGHT", 348);
1024define("SS_REGEXP", "/\[slideshare ([[:print:]]+)\]/");
1025
1026define("SS_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://static.slideshare.net/swf/ssplayer2.swf?doc=###ID###\" width=\"".SS_WIDTH."\" height=\"".SS_HEIGHT."\"><param name=\"movie\" value=\"http://static.slideshare.net/swf/ssplayer2.swf?doc=###ID###\" ></object>");
1027
1028function ss_plugin_callback($match){
1029 $output = SS_TARGET;
1030 $output = str_replace("###ID###", $match[1], $output);
1031 return ($output);
1032}
1033
1034function ss_plugin($content){
1035 return (preg_replace_callback(SS_REGEXP, 'ss_plugin_callback', $content));
1036}
1037
1038add_filter('the_content', 'ss_plugin');
1039add_filter('the_content_rss', 'ss_plugin');
1040add_filter('comment_text', 'ss_plugin');
1041
1042
1043// Teachertube.com code
1044
1045define("TT_WIDTH", 425);
1046define("TT_HEIGHT", 350);
1047define("TT_REGEXP", "/\[teachertube ([[:print:]]+)\]/");
1048define("TT_TARGET", "<embed src=\"http://www.teachertube.com/skin-p/flvplayer.swf\" allowfullscreen=\"true\" flashvars=\"&file=http://www.teachertube.com/flvideo/###tt_mu###.flv&image=http://www.teachertube.com/thumb/###tt_mu###.jpg&location=http://www.teachertube.com/skin-p/flvplayer.swf&logo=http://www.teachertube.com/images/greylogo.swf&frontcolor=0xffffff&backcolor=0x000000&lightcolor=0xFF0000&autostart=false&volume=80&overstretch=fit\" quality=\"high\" bgcolor=\"#000000\" wmode=\"transparent\" width=\"".TT_WIDTH."\" height=\"".TT_HEIGHT."\" loop=\"false\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"> </embed>");
1049
1050function tt_plugin_callback_mu($match)
1051{
1052// $match[1] = str_replace("&w=425", "", $match[1]);
1053 $output = TT_TARGET;
1054 $output = str_replace("###tt_mu###", $match[1], $output);
1055 $output = str_replace('"','',$output);
1056 return ($output);
1057}
1058
1059function tt_plugin_mu($content)
1060{
1061 return (preg_replace_callback(TT_REGEXP, 'tt_plugin_callback_mu', $content));
1062}
1063
1064add_filter('the_content', 'tt_plugin_mu');
1065add_filter('the_content_rss', 'tt_plugin_mu');
1066add_filter('comment_text', 'tt_plugin_mu');
1067
1068
1069// vsocial Code
1070
1071define("VSOCIAL_WIDTH", 400);
1072define("VSOCIAL_HEIGHT", 410);
1073define("VSOCIAL_REGEXP", "/\[vsocial ([[:print:]]+)\]/");
1074define("VSOCIAL_TARGET", "<object width=\"".VSOCIAL_WIDTH."\" height=\"".VSOCIAL_HEIGHT."\"><embed src=\"http://static.vsocial.com/flash/ups.swf?d=###URL###&a=0\" type=\"application/x-shockwave-flash\" width=\"".VSOCIAL_WIDTH."\" height=\"".VSOCIAL_HEIGHT."\"></embed></object>");
1075
1076function vsocial_plugin_callback($match) {
1077 $output = VSOCIAL_TARGET;
1078 $output = str_replace("###URL###", $match[1], $output);
1079 return ($output);
1080}
1081
1082function vsocial_plugin($content) {
1083 return preg_replace_callback(VSOCIAL_REGEXP, 'vsocial_plugin_callback', $content);
1084}
1085
1086add_filter('the_content', 'vsocial_plugin');
1087add_filter('the_content_rss', 'vsocial_plugin');
1088add_filter('comment_text', 'vsocial_plugin');
1089
1090
1091// last.fm Code
1092
1093define("LASTFM_WIDTH", 340);
1094define("LASTFM_HEIGHT", 289);
1095define("LASTFM_REGEXP", "/\[lastfm ([[:print:]]+)\]/");
1096define("LASTFM_TARGET", "<object width=\"".LASTFM_WIDTH."\" height=\"".LASTFM_HEIGHT."\"><embed src=\"http://cdn.last.fm/videoplayer/33/VideoPlayer.swf?=###URL###\" type=\"application/x-shockwave-flash\" width=\"".LASTFM_WIDTH."\" height=\"".LASTFM_HEIGHT."\" wmode=\"transparent\"></embed></object>");
1097
1098function lastfm_plugin_callback($match) {
1099 $output = LASTFM_TARGET;
1100 $output = str_replace("###URL###", $match[1], $output);
1101 return ($output);
1102}
1103
1104function lastfm_plugin($content) {
1105 return preg_replace_callback(LASTFM_REGEXP, 'lastfm_plugin_callback', $content);
1106}
1107
1108add_filter('the_content', 'lastfm_plugin');
1109add_filter('the_content_rss', 'lastfm_plugin');
1110add_filter('comment_text', 'lastfm_plugin');
1111
1112// Sumo.tv Code
1113
1114
1115define("SUMOTV_WIDTH", 400);
1116define("SUMOTV_HEIGHT", 329);
1117define("SUMOTV_REGEXP", "/\[sumotv ([[:print:]]+)\]/");
1118define("SUMOTV_TARGET", "<object width=\"".SUMOTV_WIDTH."\" height=\"".SUMTOV_HEIGHT."\"><embed src=\"http://www.sumo.tv/embed.swf?file=###URL###.flv&autostart=false\" type=\"application/x-shockwave-flash\" width=\"".SUMOTV_WIDTH."\" height=\"".SUMOTV_HEIGHT."\" wmode=\"transparent\"></embed></object>");
1119
1120function sumotv_plugin_callback($match) {
1121 $output = SUMOTV_TARGET;
1122 $output = str_replace("###URL###", $match[1], $output);
1123 return ($output);
1124}
1125
1126function sumotv_plugin($content) {
1127 return preg_replace_callback(SUMOTV_REGEXP, 'sumotv_plugin_callback', $content);
1128}
1129
1130add_filter('the_content', 'sumotv_plugin');
1131add_filter('the_content_rss', 'sumotv_plugin');
1132add_filter('comment_text', 'sumotv_plugin');
1133
1134
1135
1136// 123video.nl code
1137
1138define("VIDEONL_WIDTH", 420);
1139define("VIDEONL_HEIGHT", 339);
1140define("VIDEONL_REGEXP", "/\[123videonl ([[:print:]]+)\]/");
1141define("VIDEONL_TARGET", "<object width=\"".VIDEONL_WIDTH."\" height=\"".VIDEONL_HEIGHT."\"><embed src=\"http://www.123video.nl/123video_share.swf?mediaSrc=###URL###\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"".VIDEONL_WIDTH."\" height=\"".VIDEONL_HEIGHT."\"></embed></object>");
1142
1143function videonl_plugin_callback($match)
1144{
1145 $output = VIDEONL_TARGET;
1146 $output = str_replace("###URL###", $match[1], $output);
1147 return ($output);
1148}
1149
1150function videonl_plugin($content)
1151{
1152 return (preg_replace_callback(VIDEONL_REGEXP, 'videonl_plugin_callback', $content));
1153}
1154
1155add_filter('the_content', 'videonl_plugin');
1156add_filter('the_content_rss', 'videonl_plugin');
1157add_filter('comment_text', 'videonl_plugin');
1158
1159// Brightcove code
1160
1161define("BRIGHTCOVE_WIDTH", 510);
1162define("BRIGHTCOVE_HEIGHT", 550);
1163define("BRIGHTCOVE_REGEXP", "/\[brightcove ([[:print:]]+)\]/");
1164define("BRIGHTCOVE_TARGET", "<embed src=\"http://c.brightcove.com/services/viewer/federated_f8/416542555\" bgcolor=\"#FFFFFF\" flashVars=\"videoId=###URL###&playerId=416542555&viewerSecureGatewayURL=https://console.brightcove.com/services/amfgateway&servicesURL=http://services.brightcove.com/services&cdnURL=http://admin.brightcove.com&domain=embed&autoStart=false&\" base=\"http://admin.brightcove.com\" name=\"flashObj\" width=\"".BRIGHTCOVE_WIDTH."\" height=\"".BRIGHTCOVE_HEIGHT."\" seamlesstabbing=\"false\" type=\"application/x-shockwave-flash\" swLiveConnect=\"true\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\"></embed>");
1165
1166
1167function brightcove_plugin_callback($match)
1168{
1169 $output = BRIGHTCOVE_TARGET;
1170 $output = str_replace("###URL###", $match[1], $output);
1171 return ($output);
1172}
1173
1174function brightcove_plugin($content)
1175{
1176 return (preg_replace_callback(BRIGHTCOVE_REGEXP, 'brightcove_plugin_callback', $content));
1177}
1178
1179add_filter('the_content', 'brightcove_plugin');
1180add_filter('the_content_rss', 'brightcove_plugin');
1181add_filter('comment_text', 'brightcove_plugin');
1182
1183
1184// Aniboom code
1185
1186define("ANIBOOM_WIDTH", 448);
1187define("ANIBOOM_HEIGHT", 372);
1188define("ANIBOOM_REGEXP", "/\[aniboom ([[:print:]]+)\]/");
1189define("ANIBOOM_TARGET", "<object width=\"".ANIBOOM_WIDTH."\" height=\"".ANIBOOM_HEIGHT."\"><param name=\"movie\" value=\"window\"></param><embed src=\"http://api.aniboom.com/embedded.swf?videoar=###URL###\" type=\"application/x-shockwave-flash\" quality=\"high\" width=\"".ANIBOOM_WIDTH."\" height=\"".ANIBOOM_HEIGHT."\"></embed></object>");
1190
1191function aniboom_plugin_callback($match)
1192{
1193 $output = ANIBOOM_TARGET;
1194 $output = str_replace("###URL###", $match[1], $output);
1195 return ($output);
1196}
1197
1198function aniboom_plugin($content)
1199{
1200 return (preg_replace_callback(ANIBOOM_REGEXP, 'aniboom_plugin_callback', $content));
1201}
1202
1203add_filter('the_content', 'aniboom_plugin');
1204add_filter('the_rss', 'aniboom_plugin');
1205add_filter('comment_text', 'aniboom_plugin');
1206
1207
1208// Cellfish.com code
1209
1210define("CELLFISH_WIDTH", 420);
1211define("CELLFISH_HEIGHT", 315);
1212define("CELLFISH_REGEXP", "/\[cellfish ([[:print:]]+)\]/");
1213define("CELLFISH_TARGET", "<object width=\"".CELLFISH_WIDTH."\" height=\"".CELLFISH_HEIGHT."\"><param name=\"vmode\" value=\"window\"></param><embed src=\"http://cellfish.com/static/swf/player8.swf?Id=###URL###\" type=\"application/x-shockwave-flash\" wmode=\"window\" width=\"".CELLFISH_WIDTH."\" height=\"".CELLFISH_HEIGHT."\"></embed></object>");
1214
1215function cellfish_plugin_callback($match)
1216{
1217 $output = CELLFISH_TARGET;
1218 $output = str_replace("###URL###", $match[1], $output);
1219 return ($output);
1220}
1221
1222function cellfish_plugin($content)
1223{
1224 return (preg_replace_callback(CELLFISH_REGEXP, 'cellfish_plugin_callback', $content));
1225}
1226
1227add_filter('the_content', 'cellfish_plugin');
1228add_filter('the_content_rss', 'cellfish_plugin');
1229add_filter('comment_text', 'cellfish_plugin');
1230
1231
1232// Tu.tv code
1233
1234define("TUTV_WIDTH", 425);
1235define("TUTV_HEIGHT", 350);
1236define("TUTV_REGEXP", "/\[tutv ([[:print:]]+)\]/");
1237define("TUTV_TARGET", "<object width=\"".TUTV_WIDTH."\" height=\"".TUTV_HEIGHT."\"><param name=\"vmode\" value=\"transparent\"></param><embed src=\"http://www.tu.tv/tutvweb.swf?kpt=###URL###\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"".TUTV_WIDTH."\" height=\"".TUTV_HEIGHT."\"></embed></object>");
1238
1239function tutv_plugin_callback($match)
1240{
1241 $output = TUTV_TARGET;
1242 $output = str_replace("###URL###", $match[1], $output);
1243 return ($output);
1244}
1245
1246function tutv_plugin($content)
1247{
1248 return (preg_replace_callback(TUTV_REGEXP, 'tutv_plugin_callback', $content));
1249}
1250
1251add_filter('the_content', 'tutv_plugin');
1252add_filter('the_content_rss', 'tutv_plugin');
1253add_filter('comment_text', 'tutv_plugin');
1254
1255
1256// Yahoo! Video code
1257
1258define("YAHOO_WIDTH", 512);
1259define("YAHOO_HEIGHT", 322);
1260define("YAHOO_REGEXP", "/\[yahoo ([[:print:]]+)\]/");
1261define("YAHOO_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT###\"><param name=\"movie\" value=\"http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.30\" /><param name=\"allowFullScreen\" value=\"true\" /><param name=\"AllowScriptAccess\" VALUE=\"always\" /><param name=\"bgcolor\" value=\"#000000\" /><param name=\"flashVars\" value=\"id=###URL###&embed=1\" /><embed src=\"http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.30\" type=\"application/x-shockwave-flash\" width=\"###WIDTH###\" height=\"###HEIGHT###\" allowFullScreen=\"true\" AllowScriptAccess=\"always\" bgcolor=\"#000000\" flashVars=\"id=###URL###&embed=1\" ></embed></object>");
1262
1263function yahoo_plugin_callback($match)
1264{
1265 $tag_parts = explode(" ", rtrim($match[0], "]"));
1266 $output = YAHOO_TARGET;
1267 $output = str_replace("###URL###", $tag_parts[1], $output);
1268 if (count($tag_parts) > 2) {
1269 if ($tag_parts[2] == 0) {
1270 $output = str_replace("###WIDTH###", YAHOO_WIDTH, $output);
1271 } else {
1272 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
1273 }
1274 if ($tag_parts[3] == 0) {
1275 $output = str_replace("###HEIGHT###", YAHOO_HEIGHT, $output);
1276 } else {
1277 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
1278 }
1279 } else {
1280 $output = str_replace("###WIDTH###", YAHOO_WIDTH, $output);
1281 $output = str_replace("###HEIGHT###", YAHOO_HEIGHT, $output);
1282 }
1283 return ($output);
1284}
1285
1286function yahoo_plugin($content)
1287{
1288 return (preg_replace_callback(YAHOO_REGEXP, 'yahoo_plugin_callback', $content));
1289}
1290
1291add_filter('the_content', 'yahoo_plugin');
1292add_filter('the_content_rss', 'yahoo_plugin');
1293add_filter('comment_text', 'yahoo_plugin');
1294
1295
1296// MyspaceTV code
1297
1298define("MYSPACETV_WIDTH", 385);
1299define("MYSPACETV_HEIGHT", 346);
1300define("MYSPACETV_REGEXP", "/\[myspacetv ([[:print:]]+)\]/");
1301define("MYSPACETV_TARGET", "<object width=\"".MYSPACETV_WIDTH."\" height=\"".MYSPACETV_HEIGHT."\"><param name=\"vmode\" value=\"transparent\"></param><embed src=\"http://lads.myspace.com/videos/vplayer.swf?m=###URL###&type=video\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"".MYSPACETV_WIDTH."\" height=\"".MYSPACETV_HEIGHT."\"></embed></object>");
1302
1303function myspacetv_plugin_callback($match)
1304{
1305 $output = MYSPACETV_TARGET;
1306 $output = str_replace("###URL###", $match[1], $output);
1307 return ($output);
1308}
1309
1310function myspacetv_plugin($content)
1311{
1312 return (preg_replace_callback(MYSPACETV_REGEXP, 'myspacetv_plugin_callback', $content));
1313}
1314
1315add_filter('the_content', 'myspacetv_plugin');
1316add_filter('the_content_rss', 'myspacetv_plugin');
1317add_filter('comment_text', 'myspacetv_plugin');
1318
1319
1320// Veoh code
1321
1322define("VEOH_WIDTH", 410);
1323define("VEOH_HEIGHT", 341);
1324define("VEOH_REGEXP", "/\[veoh ([[:print:]]+)\]/");
1325define("VEOH_TARGET", "<embed src=\"http://www.veoh.com/veohplayer.swf?permalinkId=###URL###&id=anonymous&player=videodetailsembedded&videoAutoPlay=0\" allowFullScreen=\"true\" width=\"".VEOH_WIDTH."\" height=\"".VEOH_HEIGHT."\" bgcolor=\"#FFFFFF\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>");
1326
1327function veoh_plugin_callback($match)
1328{
1329 $output = VEOH_TARGET;
1330 $output = str_replace("###URL###", $match[1], $output);
1331 return ($output);
1332}
1333
1334function veoh_plugin($content)
1335{
1336 return (preg_replace_callback(VEOH_REGEXP, 'veoh_plugin_callback', $content));
1337}
1338
1339add_filter('the_content', 'veoh_plugin');
1340add_filter('the_content_rss', 'veoh_plugin');
1341add_filter('comment_text', 'veoh_plugin');
1342
1343// Wandeo Video Code
1344
1345define("WANDEO_WIDTH", 352);
1346define("WANDEO_HEIGHT", 308);
1347define("WANDEO_REGEXP", "/\[wandeo ([[:print:]]+)\]/");
1348define("WANDEO_TARGET", "<object width=\"".WANDEO_WIDTH."\" height=\"".WANDEO_HEIGHT."\"><param name=\"vmode\" value=\"transparent\"></param><embed src=\"http://www.wandeo.com/v/###URL###\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"".WANDEO_WIDTH."\" height=\"".WANDEO_HEIGHT."\"></embed></object>");
1349
1350function wandeo_plugin_callback($match) {
1351 $output = WANDEO_TARGET;
1352 $output = str_replace("###URL###", $match[1], $output);
1353 return ($output);
1354}
1355
1356function wandeo_plugin($content) {
1357 return preg_replace_callback(WANDEO_REGEXP, 'wandeo_plugin_callback', $content);
1358}
1359
1360add_filter('the_content', 'wandeo_plugin');
1361add_filter('the_content_rss', 'wandeo_plugin');
1362add_filter('comment_text', 'wandeo_plugin');
1363
1364
1365// glumbert code
1366
1367define("GLUMBERT_WIDTH", 448);
1368define("GLUMBERT_HEIGHT", 336);
1369define("GLUMBERT_REGEXP", "/\[glumbert ([[:print:]]+)\]/");
1370define("GLUMBERT_TARGET", "<object width=\"".GLUMBERT_WIDTH."\" height=\"".GLUMBERT_HEIGHT."\"><param name=\"vmode\" value=\"transparent\"></param><embed src=\"http://www.glumbert.com/embed/###URL###\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"".GLUMBERT_WIDTH."\" height=\"".GLUMBERT_HEIGHT."\"></embed></object>");
1371
1372function glumbert_plugin_callback($match)
1373{
1374 $output = GLUMBERT_TARGET;
1375 $output = str_replace("###URL###", $match[1], $output);
1376 return ($output);
1377}
1378
1379function glumbert_plugin($content)
1380{
1381 return (preg_replace_callback(GLUMBERT_REGEXP,
1382'glumbert_plugin_callback', $content));
1383}
1384
1385add_filter('the_content', 'glumbert_plugin');
1386add_filter('the_content_rss', 'glumbert_plugin');
1387add_filter('comment_text', 'glumbert_plugin');
1388
1389// GameVideos Code
1390
1391define("GameVideos_WIDTH", 425);
1392define("GameVideos_HEIGHT", 350);
1393define("GameVideos_REGEXP", "/\[gamevideos ([[:print:]]+)\]/");
1394define("GameVideos_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.gamevideos.com:80/swf/gamevideos11.swf?embedded=1&fullscreen=1&autoplay=0&src=http://www.gamevideos.com:80/video/videoListXML%3Fid%3D###URL###%26ordinal%3D1184588561564%26adPlay%3Dfalse\" quality=\"high\" play=\"true\" loop=\"true\" scale=\"showall\" wmode=\"window\" devicefont=\"false\" id=\"gamevideos6\" bgcolor=\"#FFFFFF\" name=\"gamevideos6\" menu=\"true\" allowscriptaccess=\"sameDomain\" allowFullScreen=\"true\" align=\"middle\" height=\"".GameVideos_HEIGHT."\" width=\"".GameVideos_WIDTH."\"/></object>");
1395
1396function gamevideos_plugin_callback($match) {
1397 $output = GameVideos_TARGET;
1398 $output = str_replace("###URL###", $match[1], $output);
1399 return ($output);
1400}
1401
1402function gamevideos_plugin($content) {
1403 return preg_replace_callback(GameVideos_REGEXP, 'gamevideos_plugin_callback', $content);
1404}
1405
1406add_filter('the_content', 'gamevideos_plugin');
1407add_filter('the_content_rss', 'gamevideos_plugin');
1408add_filter('comment_text', 'gamevideos_plugin');
1409
1410
1411// GameTrailers Code
1412
1413define("GameTrailers_WIDTH", 480);
1414define("GameTrailers_HEIGHT", 409);
1415define("GameTrailers_REGEXP", "/\[gametrailers ([[:print:]]+)\]/");
1416define("GameTrailers_TARGET", "<object id=\"gtembed\" width=\"".GameTrailers_WIDTH."\" height=\"".GameTrailers_HEIGHT."\">
1417<param name=\"movie\" value=\"http://www.gametrailers.com/remote_wrap.php?mid=###URL###\"/>
1418<param name=\"quality\" value=\"high\" />
1419<embed src=\"http://www.gametrailers.com/remote_wrap.php?mid=###URL###\" name=\"gtembed\" align=\"middle\" allowScriptAccess=\"sameDomain\" quality=\"high\" type=\"application/x-shockwave-flash\" width=\"".GameTrailers_WIDTH."\" height=\"".GameTrailers_HEIGHT."\"></embed> </object>");
1420
1421
1422function gametrailers_plugin_callback($match) {
1423 $output = GameTrailers_TARGET;
1424 $output = str_replace("###URL###", $match[1], $output);
1425 return ($output);
1426}
1427
1428function gametrailers_plugin($content) {
1429 return preg_replace_callback(GameTrailers_REGEXP, 'gametrailers_plugin_callback', $content);
1430}
1431
1432add_filter('the_content', 'gametrailers_plugin');
1433add_filter('the_content_rss', 'gametrailers_plugin');
1434add_filter('comment_text', 'gametrailers_plugin');
1435
1436// IFILM Code
1437
1438define("IFILM_WIDTH", 448);
1439define("IFILM_HEIGHT", 365);
1440define("IFILM_REGEXP", "/\[ifilm ([[:print:]]+)\]/");
1441define("IFILM_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.ifilm.com/efp?flvbaseclip=###URL###\" width=\"".IFILM_WIDTH."\" height=\"".IFILM_HEIGHT."\" wmode=\"transparent\"><param name=\"movie\" value=\"http://www.ifilm.com/efp?flvbaseclip=###URL###\" /></object>");
1442
1443function ifilm_plugin_callback($match) {
1444 $output = IFILM_TARGET;
1445 $output = str_replace("###URL###", $match[1], $output);
1446 return ($output);
1447}
1448
1449function ifilm_plugin($content) {
1450 return preg_replace_callback(IFILM_REGEXP, 'ifilm_plugin_callback', $content);
1451}
1452
1453add_filter('the_content', 'ifilm_plugin');
1454add_filter('the_content_rss', 'ifilm_plugin');
1455add_filter('comment_text', 'ifilm_plugin');
1456
1457//LiveLeak Code
1458
1459define("LIVELEAK_WIDTH", 450);
1460define("LIVELEAK_HEIGHT", 370);
1461define("LIVELEAK_REGEXP", "/\[liveleak ([[:print:]]+)\]/");
1462define("LIVELEAK_TARGET", "<object width=\"".LIVELEAK_WIDTH."\" height=\"".LIVELEAK_HEIGHT."\"><param name=\"movie\" value=\"http://www.liveleak.com/e/###URL###\"></param><param name=\"wmode\" value=\"transparent\"></param><embed src=\"http://www.liveleak.com/e/###URL###\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" width=\"".LIVELEAK_WIDTH."\" height=\"".LIVELEAK_HEIGHT."\"></embed></object>");
1463
1464
1465function liveleak_plugin_callback($match)
1466{
1467 $output = LIVELEAK_TARGET;
1468 $output = str_replace("###URL###", $match[1], $output);
1469 return ($output);
1470}
1471
1472function liveleak_plugin($content)
1473{
1474 return (preg_replace_callback(LIVELEAK_REGEXP, 'liveleak_plugin_callback', $content));
1475}
1476
1477add_filter('the_content', 'liveleak_plugin');
1478add_filter('the_content_rss', 'liveleak_plugin');
1479add_filter('comment_text', 'liveleak_plugin');
1480
1481// Grouper Code
1482
1483define("GROUPER_WIDTH", 400);
1484define("GROUPER_HEIGHT", 325);
1485define("GROUPER_REGEXP", "/\[grouper ([[:print:]]+)\]/");
1486define("GROUPER_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://grouper.com/mtg/mtgPlayer.swf?v=1.7ap=0&rf=-1&vfver=8&extid=-1&extsite=-1&id=###URL###\" width=\"".GROUPER_WIDTH."\" height=\"".GROUPER_HEIGHT."\" wmode=\"transparent\"><param name=\"movie\" value=\"http://grouper.com/mtg/mtgPlayer.swf?v=1.7ap=0&rf=-1&vfver=8&extid=-1&extsite=-1&id=###URL###\" /></object>");
1487
1488function grouper_plugin_callback($match)
1489{
1490 $output = GROUPER_TARGET;
1491 $output = str_replace("###URL###", $match[1], $output);
1492 return ($output);
1493}
1494
1495function grouper_plugin($content)
1496{
1497 return (preg_replace_callback(GROUPER_REGEXP, 'grouper_plugin_callback', $content));
1498}
1499
1500add_filter('the_content', 'grouper_plugin');
1501add_filter('the_content_rss', 'grouper_plugin');
1502add_filter('comment_text', 'grouper_plugin');
1503
1504
1505// UnCut Code
1506
1507define("UNCUT_WIDTH", 425);
1508define("UNCUT_HEIGHT", 350);
1509define("UNCUT_REGEXP", "/\[uncut ([[:print:]]+)\]/");
1510define("UNCUT_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://uncutvideo.aol.com/en-US/uc_videoplayer.swf?aID=1###URL###\" width=\"".UNCUT_WIDTH."\" height=\"".UNCUT_HEIGHT."\" wmode=\"transparent\"><param name=\"movie\" value=\"http://uncutvideo.aol.com/en-US/uc_videoplayer.swf?aID=1###URL###\" /></object>");
1511
1512function uncut_plugin_callback($match)
1513{
1514 $output = UNCUT_TARGET;
1515 $output = str_replace("###URL###", $match[1], $output);
1516 return ($output);
1517}
1518
1519function uncut_plugin($content)
1520{
1521 return (preg_replace_callback(UNCUT_REGEXP, 'uncut_plugin_callback', $content));
1522}
1523
1524add_filter('the_content', 'uncut_plugin');
1525add_filter('the_content_rss', 'uncut_plugin');
1526add_filter('comment_text', 'uncut_plugin');
1527
1528
1529// Revver Code
1530
1531define("REVVER_WIDTH", 480);
1532define("REVVER_HEIGHT", 392);
1533define("REVVER_REGEXP", "/\[revver ([[:print:]]+)\]/");
1534define("REVVER_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://flash.revver.com/player/1.0/player.swf?mediaId=###URL###\" width=\"".REVVER_WIDTH."\" height=\"".REVVER_HEIGHT."\" wmode=\"transparent\"><param name=\"movie\" value=\"http://flash.revver.com/player/1.0/player.swf?mediaId=###URL###\" /></object>");
1535
1536function revver_plugin_callback($match)
1537{
1538 $output = REVVER_TARGET;
1539 $output = str_replace("###URL###", $match[1], $output);
1540 return ($output);
1541}
1542
1543function revver_plugin($content)
1544{
1545 return (preg_replace_callback(REVVER_REGEXP, 'revver_plugin_callback', $content));
1546}
1547
1548add_filter('the_content', 'revver_plugin');
1549add_filter('the_content_rss', 'revver_plugin');
1550add_filter('comment_text', 'revver_plugin');
1551
1552// blip.tv Code
1553define("BLIPTV_WIDTH", 400);
1554define("BLIPTV_HEIGHT", 294);
1555define("BLIPTV_REGEXP", "/\[bliptv ([[:print:]]+)\]/");
1556define("BLIPTV_TARGET", "<embed src=\"http://blip.tv/play/###URL###\" type=\"application/x-shockwave-flash\" width=\"".BLIPTV_WIDTH."\" height=\"".BLIPTV_HEIGHT."\" allowscriptaccess=\"always\" allowfullscreen=\"true\"></embed>");
1557
1558function bliptv_plugin_callback($match) {
1559 $output = BLIPTV_TARGET;
1560 $output = str_replace("###URL###", $match[1], $output);
1561 return ($output);
1562}
1563
1564function bliptv_plugin($content) {
1565 return preg_replace_callback(BLIPTV_REGEXP, 'bliptv_plugin_callback', $content);
1566}
1567
1568add_filter('the_content', 'bliptv_plugin');
1569add_filter('the_content_rss', 'bliptv_plugin');
1570add_filter('comment_text', 'bliptv_plugin');
1571
1572
1573// Videotube Code
1574
1575define("VIDEOTUBE_WIDTH", 480);
1576define("VIDEOTUBE_HEIGHT", 400);
1577define("VIDEOTUBE_REGEXP", "/\[videotube ([[:print:]]+)\]/");
1578define("VIDEOTUBE_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.videotube.de/ci/flash/videotube_player_4.swf?videoId=###URL###&svsf=0&lang=german&host=www.videotube.de\" width=\"".VIDEOTUBE_WIDTH."\" height=\"".VIDEOTUBE_HEIGHT."\" wmode=\"transparent\"><param name=\"movie\" value=\"http://www.videotube.de/ci/flash/videotube_player_4.swf?videoId=###URL###&svsf=0&lang=german&host=www.videotube.de\" /></object>");
1579
1580function videotube_plugin_callback($match) {
1581 $output = VIDEOTUBE_TARGET;
1582 $output = str_replace("###URL###", $match[1], $output);
1583 return ($output);
1584}
1585
1586function videotube_plugin($content) {
1587 return preg_replace_callback(VIDEOTUBE_REGEXP, 'videotube_plugin_callback', $content);
1588}
1589
1590add_filter('the_content', 'videotube_plugin');
1591add_filter('the_content_rss', 'videotube_plugin');
1592add_filter('comment_text', 'videotube_plugin');
1593
1594
1595// Vimeo Code
1596
1597define("VIMEO_WIDTH", 400); // default width
1598define("VIMEO_HEIGHT", 300); // default height
1599define("VIMEO_REGEXP", "/\[vimeo ([[:print:]]+)\]/");
1600define("VIMEO_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT###\"><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"movie\" value=\"http://vimeo.com/moogaloop.swf?clip_id=###URL###&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1\" /><embed src=\"http://vimeo.com/moogaloop.swf?clip_id=###URL###&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"###WIDTH###\" height=\"###HEIGHT###\"></embed></object><br />");
1601
1602function vimeo_plugin_callback($match)
1603{
1604 $tag_parts = explode(" ", rtrim($match[0], "]"));
1605 $output = VIMEO_TARGET;
1606 $output = str_replace("###URL###", $tag_parts[1], $output);
1607 if (count($tag_parts) > 2) {
1608 if ($tag_parts[2] == 0) {
1609 $output = str_replace("###WIDTH###", VIMEO_WIDTH, $output);
1610 } else {
1611 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
1612 }
1613 if ($tag_parts[3] == 0) {
1614 $output = str_replace("###HEIGHT###", VIMEO_HEIGHT, $output);
1615 } else {
1616 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
1617 }
1618 } else {
1619 $output = str_replace("###WIDTH###", VIMEO_WIDTH, $output);
1620 $output = str_replace("###HEIGHT###", VIMEO_HEIGHT, $output);
1621 }
1622 return ($output);
1623}
1624function vimeo_plugin($content)
1625{
1626 return (preg_replace_callback(VIMEO_REGEXP, 'vimeo_plugin_callback', $content));
1627}
1628
1629add_filter('the_content', 'vimeo_plugin');
1630add_filter('the_content_rss', 'vimeo_plugin');
1631add_filter('comment_text', 'vimeo_plugin');
1632
1633
1634// Metacafe Code
1635define("METACAFE_WIDTH", 400);
1636define("METACAFE_HEIGHT", 345);
1637define("METACAFE_REGEXP", "/\[metacafe ([[:print:]]+)\]/");
1638define("METACAFE_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://www.metacafe.com/fplayer/###URL###/.swf\" width=\"".METACAFE_WIDTH."\" height=\"".METACAFE_HEIGHT."\" wmode=\"transparent\"><param name=\"movie\" value=\"http://www.metacafe.com/fplayer/###URL###/.swf\" /></object>");
1639
1640function metacafe_plugin_callback($match) {
1641 $output = METACAFE_TARGET;
1642 $output = str_replace("###URL###", $match[1], $output);
1643 return ($output);
1644}
1645
1646function metacafe_plugin($content) {
1647 return preg_replace_callback(METACAFE_REGEXP, 'metacafe_plugin_callback', $content);
1648}
1649
1650add_filter('the_content', 'metacafe_plugin');
1651add_filter('the_content_rss', 'metacafe_plugin');
1652add_filter('comment_text', 'metacafe_plugin');
1653
1654
1655// Break.com Codes
1656
1657define("BREAK_WIDTH", 425);
1658define("BREAK_HEIGHT", 350);
1659define("BREAK_REGEXP", "/\[break ([[:print:]]+)\]/");
1660define("BREAK_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://embed.break.com/###URL###\" width=\"".BREAK_WIDTH."\" height=\"".BREAK_HEIGHT."\" wmode=\"transparent\"><param name=\"movie\" value=\"http://embed.break.com/###URL###\" /></object>");
1661
1662function break_plugin_callback($match) {
1663 $output = BREAK_TARGET;
1664 $output = str_replace("###URL###", $match[1], $output);
1665 return ($output);
1666}
1667
1668function break_plugin($content) {
1669 return preg_replace_callback(BREAK_REGEXP, 'break_plugin_callback', $content);
1670}
1671
1672add_filter('the_content', 'break_plugin');
1673add_filter('the_content_rss', 'break_plugin');
1674add_filter('comment_text', 'break_plugin');
1675
1676
1677// MyVideo Code
1678
1679define("MYVIDEO_WIDTH", 470);
1680define("MYVIDEO_HEIGHT", 406);
1681define("MYVIDEO_REGEXP", "/\[myvideo ([[:print:]]+)\]/");
1682define("MYVIDEO_TARGET", "<object style=\"width:###WIDTH###px;height:###HEIGHT###px;\" type=\"application/x-shockwave-flash\" data=\"http://www.myvideo.de/movie/###URL###\"> <param name=\"movie\" value=\"http://www.myvideo.de/movie/###URL###\" /> <param name=\"AllowFullscreen\" value=\"true\" /> </object>");
1683
1684function myvideo_plugin_callback($match)
1685{
1686 $tag_parts = explode(" ", rtrim($match[0], "]"));
1687 $output = MYVIDEO_TARGET;
1688 $output = str_replace("###URL###", $tag_parts[1], $output);
1689 if (count($tag_parts) > 2) {
1690 if ($tag_parts[2] == 0) {
1691 $output = str_replace("###WIDTH###", MYVIDEO_WIDTH, $output);
1692 } else {
1693 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
1694 }
1695 if ($tag_parts[3] == 0) {
1696 $output = str_replace("###HEIGHT###", MYVIDEO_HEIGHT, $output);
1697 } else {
1698 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
1699 }
1700 } else {
1701 $output = str_replace("###WIDTH###", MYVIDEO_WIDTH, $output);
1702 $output = str_replace("###HEIGHT###", MYVIDEO_HEIGHT, $output);
1703 }
1704 return ($output);
1705}
1706function myvideo_plugin($content)
1707{
1708 return (preg_replace_callback(MYVIDEO_REGEXP, 'myvideo_plugin_callback', $content));
1709}
1710
1711add_filter('the_content', 'myvideo_plugin');
1712add_filter('the_content_rss', 'myvideo_plugin');
1713add_filter('comment_text', 'myvideo_plugin');
1714
1715// Dailymotion Code
1716
1717define("DAILYMOTION_WIDTH", 420);
1718define("DAILYMOTION_HEIGHT", 336);
1719define("DAILYMOTION_REGEXP", "/\[dailymotion[:\s]([[:print:]]+)\]/");
1720define("DAILYMOTION_TARGET", "<object width=\"".DAILYMOTION_WIDTH."\" height=\"".DAILYMOTION_HEIGHT."\"><param name=\"movie\" value=\"http://www.dailymotion.com/swf/###URL###\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowScriptAccess\" value=\"always\"></param><embed src=\"http://www.dailymotion.com/swf/###URL###\" type=\"application/x-shockwave-flash\" width=\"".DAILYMOTION_WIDTH."\" height=\"".DAILYMOTION_HEIGHT."\" allowFullScreen=\"true\" allowScriptAccess=\"always\"></embed></object>");
1721
1722
1723
1724function dailymotion_plugin_callback($match) {
1725 $output = DAILYMOTION_TARGET;
1726 $output = str_replace("###URL###", $match[1], $output);
1727 return ($output);
1728}
1729
1730function dailymotion_plugin($content) {
1731 return preg_replace_callback(DAILYMOTION_REGEXP, 'dailymotion_plugin_callback', $content);
1732}
1733
1734add_filter('the_content', 'dailymotion_plugin');
1735add_filter('the_content_rss', 'dailymotion_plugin');
1736add_filter('comment_text', 'dailymotion_plugin');
1737
1738
1739// Sevenload Code
1740
1741define("SEVENLOAD_WIDTH", 380);
1742define("SEVENLOAD_HEIGHT", 313);
1743define("SEVENLOAD_REGEXP", "/\[sevenload ([[:print:]]+)\]/");
1744define("SEVENLOAD_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://sevenload.de/pl/###URL###/380x313/swf\" width=\"".SEVENLOAD_WIDTH."\" height=\"".SEVENLOAD_HEIGHT."\" wmode=\"transparent\"><param name=\"movie\" value=\"http://sevenload.de/pl/###URL###/380x313/swf\" /></object>");
1745
1746function sevenload_plugin_callback($match) {
1747 $output = SEVENLOAD_TARGET;
1748 $output = str_replace("###URL###", $match[1], $output);
1749 return ($output);
1750}
1751
1752function sevenload_plugin($content) {
1753 return preg_replace_callback(SEVENLOAD_REGEXP, 'sevenload_plugin_callback', $content);
1754}
1755
1756add_filter('the_content', 'sevenload_plugin');
1757add_filter('the_content_rss', 'sevenload_plugin');
1758add_filter('comment_text', 'sevenload_plugin');
1759
1760// Clipfish Code
1761
1762define("CLIPFISH_WIDTH", 464);
1763define("CLIPFISH_HEIGHT", 380);
1764define("CLIPFISH_REGEXP", "/\[clipfish ([[:print:]]+)\]/");
1765define("CLIPFISH_TARGET", "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"###WIDTH###\" height=\"###HEIGHT###\" id=\"player\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"always\" /><param name=\"movie\" value=\"http://www.clipfish.de/videoplayer.swf?as=0&vid=###URL####&r=0\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#FF0000\" /><param name=\"allowFullScreen\" value=\"true\" /><embed src=\"http://www.clipfish.de/videoplayer.swf?as=0&vid=###URL####&r=0\" quality=\"high\" bgcolor=\"#FF0000\" width=\"###WIDTH###\" height=\"###HEIGHT###\" name=\"player\" align=\"middle\" allowFullScreen=\"true\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed></object>");
1766
1767function clipfish_plugin_callback($match)
1768{
1769 $tag_parts = explode(" ", rtrim($match[0], "]"));
1770 $output = CLIPFISH_TARGET;
1771 $output = str_replace("###URL###", $tag_parts[1], $output);
1772 if (count($tag_parts) > 2) {
1773 if ($tag_parts[2] == 0) {
1774 $output = str_replace("###WIDTH###", CLIPFISH_WIDTH, $output);
1775 } else {
1776 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
1777 }
1778 if ($tag_parts[3] == 0) {
1779 $output = str_replace("###HEIGHT###", CLIPFISH_HEIGHT, $output);
1780 } else {
1781 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
1782 }
1783 } else {
1784 $output = str_replace("###WIDTH###", CLIPFISH_WIDTH, $output);
1785 $output = str_replace("###HEIGHT###", CLIPFISH_HEIGHT, $output);
1786 }
1787 return ($output);
1788}
1789function clipfish_plugin($content)
1790{
1791 return (preg_replace_callback(CLIPFISH_REGEXP, 'clipfish_plugin_callback', $content));
1792}
1793
1794add_filter('the_content', 'clipfish_plugin');
1795add_filter('the_content_rss', 'clipfish_plugin');
1796add_filter('comment_text', 'clipfish_plugin');
1797
1798
1799// GoogleVideo Code
1800
1801define("GOOGLE_WIDTH", 425);
1802define("GOOGLE_HEIGHT", 350);
1803define("GOOGLE_REGEXP", "/\[google ([[:print:]]+)\]/");
1804define("GOOGLE_TARGET", "<object type=\"application/x-shockwave-flash\" data=\"http://video.google.com/googleplayer.swf?docId=###URL###\" width=\"".GOOGLE_WIDTH."\" height=\"".GOOGLE_HEIGHT."\" wmode=\"transparent\"><param name=\"movie\" value=\"http://video.google.com/googleplayer.swf?docId=###URL###\" /></object>");
1805
1806function google_plugin_callback($match) {
1807 $output = GOOGLE_TARGET;
1808 $output = str_replace("###URL###", $match[1], $output);
1809 return ($output);
1810}
1811
1812function google_plugin($content) {
1813 return preg_replace_callback(GOOGLE_REGEXP, 'google_plugin_callback', $content);
1814}
1815
1816add_filter('the_content', 'google_plugin');
1817add_filter('the_content_rss', 'google_plugin');
1818add_filter('comment_text', 'google_plugin');
1819
1820
1821
1822// Youtube Code
1823
1824define("YOUTUBE_WIDTH", 425); // default width
1825define("YOUTUBE_HEIGHT", 344); // default height
1826define("YOUTUBE_REGEXP", "/\[youtube ([[:print:]]+)\]/");
1827define("YOUTUBE_TARGET", "<object width=\"###WIDTH###\" height=\"###HEIGHT###\"><param name=\"movie\" value=\"http://www.youtube.com/v/###URL###&fs=1\" /><param name=\"allowFullScreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><embed src=\"http://www.youtube.com/v/###URL###&fs=1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"###WIDTH###\" height=\"###HEIGHT###\"></embed></object>");
1828
1829function youtube_plugin_callback($match)
1830{
1831 $tag_parts = explode(" ", rtrim($match[0], "]"));
1832 $output = YOUTUBE_TARGET;
1833 $output = str_replace("###URL###", $tag_parts[1], $output);
1834 if (count($tag_parts) > 2) {
1835 if ($tag_parts[2] == 0) {
1836 $output = str_replace("###WIDTH###", YOUTUBE_WIDTH, $output);
1837 } else {
1838 $output = str_replace("###WIDTH###", $tag_parts[2], $output);
1839 }
1840 if ($tag_parts[3] == 0) {
1841 $output = str_replace("###HEIGHT###", YOUTUBE_HEIGHT, $output);
1842 } else {
1843 $output = str_replace("###HEIGHT###", $tag_parts[3], $output);
1844 }
1845 } else {
1846 $output = str_replace("###WIDTH###", YOUTUBE_WIDTH, $output);
1847 $output = str_replace("###HEIGHT###", YOUTUBE_HEIGHT, $output);
1848 }
1849 return ($output);
1850}
1851function youtube_plugin($content)
1852{
1853 return (preg_replace_callback(YOUTUBE_REGEXP, 'youtube_plugin_callback', $content));
1854}
1855
1856add_filter('the_content', 'youtube_plugin',1);
1857add_filter('the_content_rss', 'youtube_plugin');
1858add_filter('comment_text', 'youtube_plugin');
1859
1860
1861?>
Note: See TracBrowser for help on using the repository browser.