Index: trunk/extensions/FramedVideo/FramedVideo.class.php |
— | — | @@ -0,0 +1,685 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/****************************************************************************************
|
| 5 | +* *
|
| 6 | +* FramedVideo extention by Robert Pilawski, based on VideoFlash extension *
|
| 7 | +* by Alberto Sarullo, based on YouTube extension by Iubito, with a minor *
|
| 8 | +* fixes by Austin Wheeler. *
|
| 9 | +* *
|
| 10 | +* This library is free software; you can redistribute it and/or *
|
| 11 | +* modify it under the terms of the GNU General Public *
|
| 12 | +* License as published by the Free Software Foundation; either *
|
| 13 | +* version 2.1 of the License, or (at your option) any later version. *
|
| 14 | +* *
|
| 15 | +* This library is distributed in the hope that it will be useful, *
|
| 16 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
| 17 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
| 18 | +* General Public License for more details. *
|
| 19 | +* *
|
| 20 | +* You should have received a copy of the GNU General Public *
|
| 21 | +* License along with this library; if not, write to the Free Software *
|
| 22 | +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
|
| 23 | +* *
|
| 24 | +*****************************************************************************************/
|
| 25 | +
|
| 26 | +class RenderVideo {
|
| 27 | +
|
| 28 | + function renderFramedVideo( $input, $args, $parser ) {
|
| 29 | + global $wgLanguageCode, $wgFramedVideoLightMode, $wgFramedVideoConfigLoaded;
|
| 30 | + global $wgFramedVideoDefaultWidth, $wgFramedVideoForceDefaultSize, $wgFramedVideoMaxWidth, $wgFramedVideoMaxHeight;
|
| 31 | + global $wgFramedVideoAllowFullScreen, $wgFramedVideoForceAllowFullScreen, $wgFramedVideoFrames, $wgFramedVideoForceFrames;
|
| 32 | + global $wgFramedVideoPosition, $wgFramedVideoForcePosition;
|
| 33 | + if ( !isset( $wgFramedVideoConfigLoaded ) ) {
|
| 34 | + if ( !isset( $wgFramedVideoLightMode ) || $wgFramedVideoLightMode == false ) {
|
| 35 | + wfLoadExtensionMessages( 'FramedVideo' );
|
| 36 | + $wgFramedVideoDefaultWidth = intval( wfMsg( 'framedvideo_default_width' ) );
|
| 37 | + $wgFramedVideoForceDefaultSize = false;
|
| 38 | + if ( ( wfMsg( 'framedvideo-forcesize' ) == "true" ) ) {
|
| 39 | + $wgFramedVideoForceDefaultSize = true;
|
| 40 | + }
|
| 41 | + $wgFramedVideoMaxWidth = intval( wfMsg( 'framedvideo_max_width' ) );
|
| 42 | + $wgFramedVideoMaxHeight = intval( wfMsg( 'framedvideo_max_height' ) );
|
| 43 | + $wgFramedVideoAllowFullScreen = trueOrFalse( wfMsg( 'framedvideo_allow_full_screen' ) );
|
| 44 | + $wgFramedVideoForceAllowFullScreen = trueOrFalse( wfMsg( 'framedvideo_force_allow_full_screen' ) );
|
| 45 | + $wgFramedVideoFrames = trueOrFalse( wfMsg( 'framedvideo_frames' ) );
|
| 46 | + $wgFramedVideoForceFrames = trueOrFalse( wfMsg( 'framedvideo_force_frames' ) );
|
| 47 | + $wgFramedVideoPosition = wfMsg( 'framedvideo_position' );
|
| 48 | + $wgFramedVideoForcePosition = trueOrFalse( wfMsg( 'framedvideo_force_position' ) );
|
| 49 | + $wgFramedVideoConfigLoaded = true;
|
| 50 | + } else {
|
| 51 | + wfLoadExtensionMessages( 'FramedVideo' );
|
| 52 | + if ( !isset( $wgFramedVideoDefaultWidth ) || !isset( $wgFramedVideoForceDefaultSize ) || !isset( $wgFramedVideoMaxWidth )
|
| 53 | + || !isset( $wgFramedVideoMaxHeight ) || !isset( $wgFramedVideoAllowFullScreen ) || !isset( $wgFramedVideoForceAllowFullScreen )
|
| 54 | + || !isset( $wgFramedVideoFrames ) || !isset( $wgFramedVideoForceFrames ) || !isset ( $wgFramedVideoPosition )
|
| 55 | + || !isset( $wgFramedVideoForcePosition ) ) {
|
| 56 | + wfLoadExtensionMessages( 'FramedVideo' );
|
| 57 | + }
|
| 58 | + if ( !isset( $wgFramedVideoDefaultWidth ) ) { $wgFramedVideoDefaultWidth = intval( wfMsg( 'framedvideo_default_width' ) ); }
|
| 59 | + if ( !isset( $wgFramedVideoForceDefaultSize ) ) {
|
| 60 | + $wgFramedVideoForceDefaultSize = false;
|
| 61 | + if ( ( wfMsg( 'framedvideo-forcesize' ) == "true" ) ) {
|
| 62 | + $wgFramedVideoForceDefaultSize = true;
|
| 63 | + }
|
| 64 | + }
|
| 65 | + if ( !isset( $wgFramedVideoMaxWidth ) ) { $wgFramedVideoMaxWidth = intval( wfMsg( 'framedvideo_max_width' ) ); }
|
| 66 | + if ( !isset( $wgFramedVideoMaxHeight ) ) { $wgFramedVideoMaxHeight = intval( wfMsg( 'framedvideo_max_height' ) ); }
|
| 67 | + if ( !isset( $wgFramedVideoAllowFullScreen ) ) {
|
| 68 | + $wgFramedVideoAllowFullScreen = trueOrFalse( wfMsg( 'framedvideo_allow_full_screen' ) );
|
| 69 | + }
|
| 70 | + if ( !isset( $wgFramedVideoForceAllowFullScreen ) ) {
|
| 71 | + $wgFramedVideoForceAllowFullScreen = trueOrFalse( wfMsg( 'framedvideo_force_allow_full_screen' ) );
|
| 72 | + }
|
| 73 | + if ( !isset( $wgFramedVideoFrames ) ) {
|
| 74 | + $wgFramedVideoFrames = trueOrFalse( wfMsg( 'framedvideo_frames' ) );
|
| 75 | + }
|
| 76 | + if ( !isset( $wgFramedVideoForceFrames ) ) {
|
| 77 | + $wgFramedVideoForceFrames = trueOrFalse( wfMsg( 'framedvideo_force_frames' ) );
|
| 78 | + }
|
| 79 | + if ( !isset( $wgFramedVideoPosition ) ) {
|
| 80 | + $wgFramedVideoPosition = wfMsg( 'framedvideo_position' );
|
| 81 | + }
|
| 82 | + if ( !isset( $wgFramedVideoForcePosition ) ) {
|
| 83 | + $wgFramedVideoForcePosition = trueOrFalse( wfMsg( 'framedvideo_force_position' ) );
|
| 84 | + }
|
| 85 | + }
|
| 86 | + $wgFramedVideoConfigLoaded = true;
|
| 87 | + }
|
| 88 | +
|
| 89 | + $defaultwidth = $wgFramedVideoDefaultWidth;
|
| 90 | + $forcesize = $wgFramedVideoForceDefaultSize;
|
| 91 | + $maxwidth = $wgFramedVideoMaxWidth;
|
| 92 | + $maxheight = $wgFramedVideoMaxHeight;
|
| 93 | + $allowfullscreen = $wgFramedVideoAllowFullScreen;
|
| 94 | + $forceallowfullscreen = $wgFramedVideoForceAllowFullScreen;
|
| 95 | + $frame = $wgFramedVideoFrames;
|
| 96 | + $forceframes = $wgFramedVideoForceFrames;
|
| 97 | + $position2 = $wgFramedVideoPosition;
|
| 98 | + $forceposition = $wgFramedVideoForcePosition;
|
| 99 | + $rendervideo = true;
|
| 100 | +
|
| 101 | + if ( array_key_exists( 'type', $args ) ) { $type = htmlspecialchars( $args['type'] ); }
|
| 102 | + else { $type = "youtube"; }
|
| 103 | + if ( array_key_exists( 'id', $args ) ) { $id = htmlspecialchars( $args['id'] ); }
|
| 104 | + else {
|
| 105 | + $id = "0";
|
| 106 | + $rendervideo = false;
|
| 107 | + $errorid[4] = 1;
|
| 108 | + $width = 1;
|
| 109 | + $height = 1;
|
| 110 | + }
|
| 111 | +
|
| 112 | + $twidth['bbsports'] = 425; $theight['bbsports'] = 350;
|
| 113 | + $twidth['bliptv'] = 640; $theight['bliptv'] = 510;
|
| 114 | + $twidth['break'] = 464; $theight['break'] = 392;
|
| 115 | + $twidth['broadcaster'] = 425; $theight['broadcaster'] = 340;
|
| 116 | + $twidth['clipfish'] = 464; $theight['clipfish'] = 380;
|
| 117 | + $twidth['clipshack'] = 430; $theight['clipshack'] = 370;
|
| 118 | + $twidth['comedycentral'] = 464; $theight['comedycentral'] = 392;
|
| 119 | + $twidth['dailymotion'] = 420; $theight['dailymotion'] = 336;
|
| 120 | + $twidth['error'] = $defaultwidth; $theight['error'] = 1;
|
| 121 | + $twidth['eyespot'] = 432; $theight['eyespot'] = 407;
|
| 122 | + $twidth['funnyordie'] = 464; $theight['funnyordie'] = 388;
|
| 123 | + $twidth['gazeta'] = 480; $theight['gazeta'] = 393;
|
| 124 | + $twidth['glumbert'] = 448; $theight['glumbert'] = 336;
|
| 125 | + $twidth['godtube'] = 330; $theight['godtube'] = 270;
|
| 126 | + $twidth['googlevideo'] = 400; $theight['googlevideo'] = 326;
|
| 127 | + $twidth['interia'] = 425; $theight['interia'] = 350;
|
| 128 | + $twidth['znajomi'] = 425; $theight['znajomi'] = 350;
|
| 129 | + $twidth['jumpcut'] = 408; $theight['jumpcut'] = 324;
|
| 130 | + $twidth['kewego'] = 400; $theight['kewego'] = 368;
|
| 131 | + $twidth['liveleak'] = 450; $theight['liveleak'] = 370;
|
| 132 | + $twidth['livevideo'] = 445; $theight['livevideo'] = 369;
|
| 133 | + $twidth['metacafe'] = 400; $theight['metacafe'] = 345;
|
| 134 | + $twidth['myspace'] = 425; $theight['myspace'] = 360;
|
| 135 | + $twidth['myspacetv'] = 425; $theight['myspacetv'] = 360;
|
| 136 | + $twidth['myvideo'] = 470; $theight['myvideo'] = 406;
|
| 137 | + $twidth['patrz'] = 425; $theight['patrz'] = 331;
|
| 138 | + $twidth['photobucket'] = 448; $theight['photobucket'] = 361;
|
| 139 | + $twidth['plejada'] = 640; $theight['plejada'] = 396;
|
| 140 | + $twidth['putfile'] = 420; $theight['putfile'] = 349;
|
| 141 | + $twidth['revver'] = 480; $theight['revver'] = 392;
|
| 142 | + $twidth['rutube'] = 400; $theight['rutube'] = 353;
|
| 143 | + $twidth['selfcasttv'] = 340; $theight['selfcasttv'] = 283;
|
| 144 | + $twidth['selfcast'] = 340; $theight['selfcast'] = 283;
|
| 145 | + $twidth['sevenload'] = 455; $theight['sevenload'] = 364;
|
| 146 | + $twidth['sharkle'] = 340; $theight['sharkle'] = 310;
|
| 147 | + $twidth['shoutfile'] = 400; $theight['shoutfile'] = 300;
|
| 148 | + $twidth['spike'] = 448; $theight['spike'] = 365;
|
| 149 | + $twidth['stickam'] = 400; $theight['stickam'] = 300;
|
| 150 | + $twidth['superdeluxe'] = 400; $theight['superdeluxe'] = 300;
|
| 151 | + $twidth['uncutvideo'] = 415; $theight['uncutvideo'] = 347;
|
| 152 | + $twidth['veoh'] = 540; $theight['veoh'] = 458;
|
| 153 | + $twidth['videojug'] = 400; $theight['videojug'] = 345;
|
| 154 | + $twidth['viddler'] = 437; $theight['viddler'] = 370;
|
| 155 | + $twidth['vimeo'] = 400; $theight['vimeo'] = 300;
|
| 156 | + $twidth['wrzuta'] = 450; $theight['wrzuta'] = 416;
|
| 157 | + $twidth['yahoovideo'] = 512; $theight['yahoovideo'] = 323;
|
| 158 | + $twidth['youaretv'] = 350; $theight['youaretv'] = 300;
|
| 159 | + $twidth['youare'] = 350; $theight['youare'] = 300;
|
| 160 | + $twidth['youtube'] = 425; $theight['youtube'] = 344;
|
| 161 | + $twidth['youtube2'] = 480; $theight['youtube2'] = 295;
|
| 162 | +
|
| 163 | + if ( !( array_key_exists( $type, $twidth ) ) ) {
|
| 164 | + $rendervideo = false;
|
| 165 | + $errorid[3] = 1;
|
| 166 | + $width = 1;
|
| 167 | + $height = 1;
|
| 168 | + $type2 = $type;
|
| 169 | + $type = 'error';
|
| 170 | + }
|
| 171 | +
|
| 172 | + $playerheight1 = 0;
|
| 173 | + $playerheight2 = 0;
|
| 174 | +
|
| 175 | + if ( $type == "bbsports" ) { $playerheight1 = 24; $playerheight2 = 20; }
|
| 176 | + if ( $type == "bliptv" ) { $playerheight1 = 30; $playerheight2 = 30; }
|
| 177 | + if ( $type == "clipfish" ) { $playerheight1 = 30; $playerheight2 = 30; }
|
| 178 | + if ( $type == "dailymotion" ) { $playerheight1 = 21; $playerheight2 = 21; }
|
| 179 | + if ( $type == "funnyordie" ) { $playerheight1 = 40; $playerheight2 = 40; }
|
| 180 | + if ( $type == "gazeta" ) { $playerheight1 = 34; $playerheight2 = 34; }
|
| 181 | + if ( $type == "googlevideo" ) { $playerheight1 = 27; $playerheight2 = 27; }
|
| 182 | + if ( $type == "interia" ) { $playerheight1 = 49; $playerheight2 = 49; }
|
| 183 | + if ( $type == "znajomi" ) { $playerheight1 = 49; $playerheight2 = 49; }
|
| 184 | + if ( $type == "jumpcut" ) { $playerheight1 = 21; $playerheight2 = 21; }
|
| 185 | + if ( $type == "kewego" ) { $playerheight1 = 0; $playerheight2 = 26; }
|
| 186 | + if ( $type == "liveleak" ) { $playerheight1 = 20; $playerheight2 = 20; }
|
| 187 | + if ( $type == "livevideo" ) { $playerheight1 = 0; $playerheight2 = 22; }
|
| 188 | + if ( $type == "metacafe" ) { $playerheight1 = 31; $playerheight2 = 40; }
|
| 189 | + if ( $type == "myspace" ) { $playerheight1 = 40; $playerheight2 = 40; }
|
| 190 | + if ( $type == "myspacetv" ) { $playerheight1 = 40; $playerheight2 = 40; }
|
| 191 | + if ( $type == "myvideo" ) { $playerheight1 = 46; $playerheight2 = 46; }
|
| 192 | + if ( $type == "photobucket" ) { $playerheight1 = 25; $playerheight2 = 25; }
|
| 193 | + if ( $type == "plejada" ) { $playerheight1 = 36; $playerheight2 = 36; }
|
| 194 | + if ( $type == "putfile" ) { $playerheight1 = 27; $playerheight2 = 50; }
|
| 195 | + if ( $type == "revver" ) { $playerheight1 = 32; $playerheight2 = 32; }
|
| 196 | + if ( $type == "rutube" ) { $playerheight1 = 36; $playerheight2 = 36; }
|
| 197 | + if ( $type == "selfcasttv" ) { $playerheight1 = 20; $playerheight2 = 20; }
|
| 198 | + if ( $type == "selfcast" ) { $playerheight1 = 20; $playerheight2 = 20; }
|
| 199 | + if ( $type == "sevenload" ) { $playerheight1 = 33; $playerheight2 = 33; }
|
| 200 | + if ( $type == "shoutfile" ) { $playerheight1 = 29; $playerheight2 = 29; }
|
| 201 | + if ( $type == "spike" ) { $playerheight1 = 31; $playerheight2 = 31; }
|
| 202 | + if ( $type == "superdeluxe" ) { $playerheight1 = 50; $playerheight2 = 50; }
|
| 203 | + if ( $type == "uncutvideo" ) { $playerheight1 = 47; $playerheight2 = 47; }
|
| 204 | + if ( $type == "veoh" ) { $playerheight1 = 34; $playerheight2 = 34; }
|
| 205 | + if ( $type == "viddler" ) { $playerheight1 = 42; $playerheight2 = 42; }
|
| 206 | + if ( $type == "videojug" ) { $playerheight1 = 30; $playerheight2 = 30; }
|
| 207 | + if ( $type == "yahoovideo" ) { $playerheight1 = 34; $playerheight2 = 34; }
|
| 208 | + if ( $type == "youtube" ) { $playerheight1 = 25; $playerheight2 = 25; }
|
| 209 | + if ( $type == "youtube2" ) { $playerheight1 = 25; $playerheight2 = 25; }
|
| 210 | +
|
| 211 | + if ( array_key_exists( 'width', $args ) && $type != 'vimeo' && $type != 'dailymotion' && $type != 'bliptv' ) { $width = htmlspecialchars( $args['width'] ); }
|
| 212 | + else { $width = $twidth[$type]; }
|
| 213 | + if ( array_key_exists( 'height', $args ) && $type != 'vimeo' && $type != 'dailymotion' && $type != 'bliptv' ) { $height = htmlspecialchars( $args['height'] ); }
|
| 214 | + else { $height = $theight[$type]; }
|
| 215 | +
|
| 216 | + if ( $type == 'dailymotion' || $type == 'vimeo' ) {
|
| 217 | + if ( ( array_key_exists( 'height', $args ) ) && !( array_key_exists( 'width', $args ) ) ) {
|
| 218 | + $height = htmlspecialchars( $args['height'] );
|
| 219 | + $width = $defaultwidth;
|
| 220 | + $height = ( htmlspecialchars( $args['height'] ) - $playerheight1 ) / $twidth[$type] * $defaultwidth + $playerheight2;
|
| 221 | + $height = round( $height );
|
| 222 | + }
|
| 223 | +
|
| 224 | + if ( !( array_key_exists( 'height', $args ) ) && !( array_key_exists( 'width', $args ) ) ) {
|
| 225 | + $width = $defaultwidth;
|
| 226 | + $rendervideo = false;
|
| 227 | + $errorid[1] = 1;
|
| 228 | + }
|
| 229 | + if ( !( array_key_exists( 'height', $args ) ) && ( array_key_exists( 'width', $args ) ) ) {
|
| 230 | + $width = htmlspecialchars( $args['width'] );
|
| 231 | + $rendervideo = false;
|
| 232 | + $errorid[2] = 1;
|
| 233 | + }
|
| 234 | + if ( ( array_key_exists( 'height', $args ) ) && ( array_key_exists( 'width', $args ) ) ) {
|
| 235 | + $height = htmlspecialchars( $args['height'] );
|
| 236 | + $width = htmlspecialchars( $args['width'] );
|
| 237 | + $height = ( htmlspecialchars( $args['height'] ) - $playerheight1 ) / $twidth[$type] * $defaultwidth + $playerheight2;
|
| 238 | + $height = round( $height );
|
| 239 | + }
|
| 240 | +
|
| 241 | + }
|
| 242 | +
|
| 243 | + if ( $type == 'bliptv' ) {
|
| 244 | + if ( ( array_key_exists( 'height', $args ) ) && ( array_key_exists( 'width2', $args ) ) && !( array_key_exists( 'width', $args ) ) ) {
|
| 245 | + $width = htmlspecialchars( $args['width2'] );
|
| 246 | + $height = htmlspecialchars( $args['height'] );
|
| 247 | + if ( $width < 1 ) {
|
| 248 | + $width = $defaultwidth;
|
| 249 | + $rendervideo = false;
|
| 250 | + $errorid[11] = 1;
|
| 251 | + } else {
|
| 252 | + $height = ( $height - $playerheight1 ) * $defaultwidth / $width + $playerheight2;
|
| 253 | + $width = $defaultwidth;
|
| 254 | + }
|
| 255 | + } elseif ( ( array_key_exists( 'height', $args ) ) && ( array_key_exists( 'width', $args ) ) ) {
|
| 256 | + $width = htmlspecialchars( $args['width'] );
|
| 257 | + $height = htmlspecialchars( $args['height'] );
|
| 258 | + } else {
|
| 259 | + $rendervideo = false;
|
| 260 | + $width = $defaultwidth;
|
| 261 | + $errorid[10] = 1;
|
| 262 | + }
|
| 263 | + }
|
| 264 | +
|
| 265 | + $url['bbsports'] = 'http://broadbandsports.com/flv/bbs-xplayer.swf?n=' . $id;
|
| 266 | + $url['bliptv'] = 'http://blip.tv/play/' . $id;
|
| 267 | + $url['break'] = 'http://embed.break.com/' . $id;
|
| 268 | + $url['brightcove'] = 'http://';
|
| 269 | + $url['broadcaster'] = 'http://www.broadcaster.com/video/external/player.swf?clip=' . $id . '.flv';
|
| 270 | + $url['clipshack'] = 'http://clipshack.com/player.swf?key=' . $id;
|
| 271 | + $url['comedycentral'] = 'http://www.comedycentral.com/sitewide/video_player/view/default/swf.jhtml';
|
| 272 | + $url['dailymotion'] = 'http://www.dailymotion.com/swf/' . $id;
|
| 273 | + $url['error'] = '';
|
| 274 | + $url['eyespot'] = 'http://eyespot.com/flash/medialoader.swf?vurl=http://downloads.eyespot.com/direct/play?r=' . $id . '&_autoPlay=false';
|
| 275 | + $url['funnyordie'] = 'http://www2.funnyordie.com/public/flash/fodplayer.swf?7228';
|
| 276 | + $url['gazeta'] = 'http://bi.gazeta.pl/im/loader.swf';
|
| 277 | + $url['glumbert'] = 'http://www.glumbert.com/embed/' . $id;
|
| 278 | + $url['godtube'] = '';
|
| 279 | + $url['googlevideo'] = 'http://video.google.com/googleplayer.swf?docId=' . $id . '&hl=' . $wgLanguageCode . '&fs=true';
|
| 280 | + $url['interia'] = 'http://video.interia.pl/player.js';
|
| 281 | + $url['jumpcut'] = 'http://jumpcut.com/media/flash/jump.swf?id=' . $id . '&asset_type=movie&asset_id=' . $id . '&eb=1';
|
| 282 | + $url['kewego'] = 'http://www.kewego.com/p/en/' . $id . '.html';
|
| 283 | + $url['liveleak'] = 'http://www.liveleak.com/e/' . $id;
|
| 284 | + $url['livevideo'] = '';
|
| 285 | + $url['metacafe'] = 'http://www.metacafe.com/fplayer/' . $id . '.swf';
|
| 286 | + $url['patrz'] = 'http://patrz.pl/patrz.pl.swf?id=' . $id . '&r=5&o=';
|
| 287 | + $url['photobucket'] = 'http://';
|
| 288 | + $url['plejada'] = 'http://www.plejada.pl/_d/flash/' . $id . ',player_loader.swf';
|
| 289 | + $url['putfile'] = 'http://feat.putfile.com/flow/putfile.swf?videoFile=' . $id;
|
| 290 | + $url['revver'] = 'http://flash.revver.com/player/1.0/player.swf?mediaId=' . $id;
|
| 291 | + $url['rutube'] = 'http://video.rutube.ru/' . $id;
|
| 292 | + $url['selfcast'] = 'http://www.selfcasttv.com/Selfcast/selfcast.swf?video_1=/s/' . $id;
|
| 293 | + $url['selfcasttv'] = 'http://www.selfcasttv.com/Selfcast/selfcast.swf?video_1=/s/' . $id;
|
| 294 | + $url['sevenload'] = 'http://en.sevenload.com/pl/' . $id . '/' . $width . 'x' . $height . '/swf';
|
| 295 | + $url['sharkle'] = 'http://www.sharkle.com/externalPlayer/' . $id;
|
| 296 | + $url['shoutfile'] = 'http://www.shoutfile.com/emb/' . $id;
|
| 297 | + $url['spike'] = 'http://www.spike.com/efp';
|
| 298 | + $url['stickam'] = 'http://player.stickam.com/flashVarMediaPlayer/' . $id;
|
| 299 | + $url['superdeluxe'] = 'http://i.cdn.turner.com/sdx/static/swf/share_vidplayer.swf';
|
| 300 | + $url['uncutvideo'] = 'http://';
|
| 301 | + $url['veoh'] = 'http://www.veoh.com/videodetails2.swf?permalinkId=' . $id . '&id=anonymous&player=videodetailsembedded&videoAutoPlay=0';
|
| 302 | + $url['videojug'] = 'http://www.videojug.com/film/player?id=' . $id;
|
| 303 | + $url['viddler'] = 'http://www.viddler.com/player/' . $id . '/';
|
| 304 | + $url['vimeo'] = 'http://www.vimeo.com/moogaloop.swf?clip_id=' . $id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1';
|
| 305 | + $url['wrzuta'] = 'http://www.wrzuta.pl/wrzuta_embed.js';
|
| 306 | + $url['yahoovideo'] = 'http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.4';
|
| 307 | + $url['youare'] = 'http://www.youare.tv/player/yatvplayer.swf?videoID=' . $id;
|
| 308 | + $url['youaretv'] = 'http://www.youare.tv/player/yatvplayer.swf?videoID=' . $id;
|
| 309 | + $url['youtube'] = 'http://www.youtube.com/v/' . $id;
|
| 310 | + $url['youtube2'] = 'http://www.youtube.com/v/' . $id;
|
| 311 | + $url['znajomi'] = 'http://video.interia.pl/player.js';
|
| 312 | +
|
| 313 | + if ( array_key_exists( 'desc', $args ) ) { $desc = $args['desc']; }
|
| 314 | + else { $desc = ''; }
|
| 315 | + if ( array_key_exists( 'size', $args ) ) { $size = htmlspecialchars( $args['size'] ); }
|
| 316 | + else { $size = ''; }
|
| 317 | +
|
| 318 | + if ( $allowfullscreen == true && $forceallowfullscreen == false ) {
|
| 319 | + if ( array_key_exists( 'allowfullscreen', $args ) ) {
|
| 320 | + $allowfullscreen = htmlspecialchars( $args['allowfullscreen'] );
|
| 321 | + if ( $allowfullscreen != 'true' ) {
|
| 322 | + $allowfullscreen = false;
|
| 323 | + } else {
|
| 324 | + $allowfullscreen = true;
|
| 325 | + }
|
| 326 | + }
|
| 327 | + } elseif ( $allowfullscreen == false && $forceallowfullscreen == true ) {
|
| 328 | + $allowfullscreen = false;
|
| 329 | + } elseif ( $allowfullscreen == false && $forceallowfullscreen == false && !( array_key_exists( 'allowfullscreen', $args ) ) ) {
|
| 330 | + $allowfullscreen = false;
|
| 331 | + } else {
|
| 332 | + $allowfullscreen = true;
|
| 333 | + }
|
| 334 | +
|
| 335 | + if ( $allowfullscreen == false ) {
|
| 336 | + $allowfullscreen = "false";
|
| 337 | + } else {
|
| 338 | + $allowfullscreen = "true";
|
| 339 | + }
|
| 340 | +
|
| 341 | + if ( $frame == true && $forceframes == false ) {
|
| 342 | + if ( array_key_exists( 'frame', $args ) ) {
|
| 343 | + $frame = htmlspecialchars( $args['frame'] );
|
| 344 | + if ( $frame != "true" ) {
|
| 345 | + $frame = false;
|
| 346 | + } else {
|
| 347 | + $frame = true;
|
| 348 | + }
|
| 349 | + }
|
| 350 | + } elseif ( $frame == false && $forceframes == true ) {
|
| 351 | + $frame = false;
|
| 352 | + } elseif ( $frame == false && $forceframes == false && !( array_key_exists( 'frame', $args ) ) ) {
|
| 353 | + $frame = false;
|
| 354 | + } else {
|
| 355 | + $frame = true;
|
| 356 | + }
|
| 357 | + if ( $forceposition == false ) {
|
| 358 | + if ( array_key_exists( 'position', $args ) ) {
|
| 359 | + $position = htmlspecialchars( $args['position'] );
|
| 360 | + } else { $position = $position2; }
|
| 361 | + } else {
|
| 362 | + $position = $position2;
|
| 363 | + }
|
| 364 | +
|
| 365 | + if ( $type != 'vimeo' && $type != 'dailymotion' && $type != 'bliptv' ) {
|
| 366 | + if ( $forcesize == true ) {
|
| 367 | + $width = $defaultwidth;
|
| 368 | + $height = round( ( $theight[$type] - $playerheight1 ) / $twidth[$type] * $defaultwidth ) + $playerheight2;
|
| 369 | + } elseif ( $forcesize == false && !( array_key_exists( 'width', $args ) ) && !( array_key_exists( 'height', $args ) ) ) {
|
| 370 | + $width = $defaultwidth;
|
| 371 | + $height = round( ( $theight[$type] - $playerheight1 ) / $twidth[$type] * $defaultwidth ) + $playerheight2;
|
| 372 | + } elseif ( $forcesize == false && ( array_key_exists( 'width', $args ) ) && !( array_key_exists( 'height', $args ) ) ) {
|
| 373 | + $height = round( ( $theight[$type] - $playerheight1 ) / $twidth[$type] * $width ) + $playerheight2;
|
| 374 | + } elseif ( $forcesize == false && ( array_key_exists( 'width', $args ) ) && ( array_key_exists( 'height', $args ) ) ) {
|
| 375 | + $width = htmlspecialchars( $args['width'] );
|
| 376 | + $height = htmlspecialchars( $args['height'] );
|
| 377 | + }
|
| 378 | + }
|
| 379 | +
|
| 380 | + if ( $size == "full" && $forcesize == false ) {
|
| 381 | + $width = $twidth[$type];
|
| 382 | + $height = $theight[$type];
|
| 383 | + }
|
| 384 | +
|
| 385 | + if ( $size == "full" ) {
|
| 386 | + if ( $type == "dailymotion" || $type == "vimeo" ) {
|
| 387 | + $rendervideo = false;
|
| 388 | + $errorid[9] = 1;
|
| 389 | + $width = $defaultwidth;
|
| 390 | + $height = 1;
|
| 391 | + }
|
| 392 | + }
|
| 393 | +
|
| 394 | + if ( $width > $maxwidth ) {
|
| 395 | + $width = $defaultwidth;
|
| 396 | + $rendervideo = false;
|
| 397 | + $errorid[5] = 1;
|
| 398 | + }
|
| 399 | +
|
| 400 | + if ( $height > $maxheight ) {
|
| 401 | + $rendervideo = false;
|
| 402 | + $errorid[6] = 1;
|
| 403 | + }
|
| 404 | +
|
| 405 | +
|
| 406 | + if ( $width < 1 ) {
|
| 407 | + $width = $defaultwidth;
|
| 408 | + $rendervideo = false;
|
| 409 | + $errorid[7] = 1;
|
| 410 | + }
|
| 411 | +
|
| 412 | + if ( $height < 1 ) {
|
| 413 | + $height = 1;
|
| 414 | + $rendervideo = false;
|
| 415 | + $errorid[8] = 1;
|
| 416 | + }
|
| 417 | +
|
| 418 | + $widthframe = ( $width + 2 );
|
| 419 | +
|
| 420 | + if ( $position == null && $frame == true ) {
|
| 421 | + $output = '<div class="thumb tright"> <div class="thumbinner" style="width: ' . $widthframe . 'px;" border="0">';
|
| 422 | + }
|
| 423 | + if ( $position != null && $frame == true ) {
|
| 424 | + if ( $position == "center" ) {
|
| 425 | + $output = '<div class="center"><div class="thumb tnone"> <div class="thumbinner" style="width: ' . $widthframe . 'px;" border="0">';
|
| 426 | + } elseif ( $position == "left" ) {
|
| 427 | + $output = '<div class="thumb tleft"> <div class="thumbinner" style="width: ' . $widthframe . 'px;" border="0">';
|
| 428 | + } else {
|
| 429 | + $output = '<div class="thumb tright"> <div class="thumbinner" style="width: ' . $widthframe . 'px;" border="0">';
|
| 430 | + }
|
| 431 | + }
|
| 432 | + if ( $frame == false ) {
|
| 433 | + if ( $position == "center" ) {
|
| 434 | + $output = '<div class="center"><div class="floatnone" style="width: ' . $width . 'px;"><span>';
|
| 435 | + } elseif ( $position == "left" ) {
|
| 436 | + $output = '<div class="floatleft" style="width: ' . $width . 'px;"><span>';
|
| 437 | + } else {
|
| 438 | + $output = '<div class="floatright" style="width: ' . $width . 'px;"><span>';
|
| 439 | + }
|
| 440 | + }
|
| 441 | + if ( $rendervideo == true ) {
|
| 442 | + if ( $type == 'superdeluxe' ) {
|
| 443 | + $output .= '<object width="' . $width . '" height="' . $height . '"><param name="allowFullScreen" value="' . $allowfullscreen . '" />'
|
| 444 | + . '<param name="movie" value="http://i.cdn.turner.com/sdx/static/swf/share_vidplayer.swf" />'
|
| 445 | + . '<param name="FlashVars" value="' . $id . '" />'
|
| 446 | + . '<embed src="http://i.cdn.turner.com/sdx/static/swf/share_vidplayer.swf"'
|
| 447 | + . 'FlashVars="id=' . $id . '" type="application/x-shockwave-flash"'
|
| 448 | + . 'width="' . $width . '" height="' . $height . '" allowFullScreen="true"';
|
| 449 | + } elseif ( $type == 'interia' || $type == 'znajomi' ) {
|
| 450 | + $output .= '<script type="text/javascript" src="http://video.interia.pl/player.js#' . $id . ',' . $width . ',' . $height . '"></script>';
|
| 451 | + } elseif ( $type == 'shoutfile' ) {
|
| 452 | + $output .= '<object width="' . $width . '" height="' . $height . '">'
|
| 453 | + . '<embed allowScriptAccess="always" src="http://www.shoutfile.com/emb/' . $id . '"'
|
| 454 | + . ' allowFullScreen="' . $allowfullscreen . '" width="' . $width . '" height="' . $height . '" border="0"'
|
| 455 | + . ' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"';
|
| 456 | + } elseif ( $type == 'videojug' ) {
|
| 457 | + $output .= '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'
|
| 458 | + . ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"'
|
| 459 | + . ' id="vjplayer04062008" width="400" height="345" align="middle" allowFullScreen="true">'
|
| 460 | + . '<param name="movie" value="http://www.videojug.com/film/player?id=' . $id . '" />'
|
| 461 | + . '<PARAM value="' . $allowfullscreen . '" name="allowFullScreen" /><PARAM value="always" name="allowScriptAccess" />'
|
| 462 | + . '<embed src="http://www.videojug.com/film/player?id=' . $id . '"'
|
| 463 | + . ' quality="high" width="' . $width . '" height="' . $height . '" type="application/x-shockwave-flash"'
|
| 464 | + . ' pluginspage="http://www.macromedia.com/go/getflashplayer" allowscriptaccess="always"'
|
| 465 | + . ' allowfullscreen="true"';
|
| 466 | + } elseif ( $type == 'youaretv' || $type == 'youare' ) {
|
| 467 | + $output .= '<embed src=\'http://www.youare.tv/yatvplayer.swf?videoID=' . $id . '\' allowScriptAccess=\'never\''
|
| 468 | + . ' loop=\'false\' quality=\'best\' wmode=\'transparent\' width=\'' . $width . '\' height=\'' . $height . '\''
|
| 469 | + . ' type=\'application\x-shockwave-flash\' ></embed>';
|
| 470 | + } elseif ( $type == 'wrzuta' ) {
|
| 471 | + $id = htmlspecialchars_decode( $id );
|
| 472 | + $id = preg_replace( '/>/', '>', $id );
|
| 473 | + $id = preg_replace( '/</', "<", $id );
|
| 474 | + $output .= '<script type="text/javascript" src="http://www.wrzuta.pl/wrzuta_embed.js?wrzuta_key=' . $id . '&wrzuta_width=' . $width . '&wrzuta_height=' . $height . '"></script>';
|
| 475 | + } elseif ( $type == 'yahoovideo' ) {
|
| 476 | + $output .= '<object width="' . $width . '" height="' . $height . '">'
|
| 477 | + . '<param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.4" />'
|
| 478 | + . '<param name="allowFullScreen" value="' . $allowfullscreen . '" />'
|
| 479 | + . '<param name="flashVars" value="id=' . $id . '&lang=en-us&intl=us&thumbUrl=&embed=1" />'
|
| 480 | + . '<embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.4" '
|
| 481 | + . 'type="application/x-shockwave-flash" width="' . $width . '" height="' . $height . '" '
|
| 482 | + . 'allowFullScreen="true" flashVars="id=' . $id . '&lang=en-us&intl=us&thumbUrl=&embed=1" ';
|
| 483 | + } elseif ( $type == 'photobucket' ) {
|
| 484 | + $output .= '<embed width="' . $width . '" height="' . $height . '" type="application/x-shockwave-flash" '
|
| 485 | + . 'wmode="transparent" src="http://' . $id . '&sr=1">';
|
| 486 | + } elseif ( $type == 'uncutvideo' ) {
|
| 487 | + $output .= '<object width="' . $width . '" height="' . $height . '">'
|
| 488 | + . '<param name="wmode" value="opaque" /><param name="movie" '
|
| 489 | + . 'value="http://uncutvideo.aol.com/v7.306/en-US/uc_videoplayer.swf" /><param name="FlashVars" '
|
| 490 | + . 'value="aID=' . $id . '&site=http://uncutvideo.aol.com/"/>'
|
| 491 | + . '<embed src="http://uncutvideo.aol.com/v7.306/en-US/uc_videoplayer.swf" wmode="opaque" '
|
| 492 | + . 'FlashVars="aID=' . $id . '&site=http://uncutvideo.aol.com/" width="' . $width . '" height="' . $height . '" '
|
| 493 | + . 'type="application/x-shockwave-flash"';
|
| 494 | + } elseif ( $type == 'godtube' ) {
|
| 495 | + $output .= '<embed src="http://godtube.com/flvplayer.swf" FlashVars="viewkey=' . $id . '" wmode="transparent" quality="high" '
|
| 496 | + . 'width="' . $width . '" height="' . $height . '" name="godtube" align="middle" allowScriptAccess="sameDomain" '
|
| 497 | + . 'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>';
|
| 498 | + } elseif ( $type == 'glumbert' ) {
|
| 499 | + $output .= '<object width=\'' . $width . '\' height=\'' . $height . '\'><param name=\'movie\' '
|
| 500 | + . 'value=\'http://www.glumbert.com/embed/' . $id . '\'></param><param name=\'wmode\' value=\'opaque\'>'
|
| 501 | + . '<param name=\'allowFullScreen\' value=\'' . $allowfullscreen . '\' /></param><embed src=\'http://www.glumbert.com/embed/' . $id . '\' '
|
| 502 | + . 'type=\'application/x-shockwave-flash\' wmode=\'transparent\' allowFullScreen=\'' . $allowfullscreen . '\' '
|
| 503 | + . 'width=\'' . $width . '\' height=\'' . $height . '\'></embed></object> ';
|
| 504 | + } elseif ( $type == 'livevideo' ) {
|
| 505 | + $output .= '<embed src="http://www.livevideo.com/flvplayer/embed/' . $id . '" '
|
| 506 | + . 'type="application/x-shockwave-flash" quality="high" WIDTH="' . $width . '" HEIGHT="' . $height . '" wmode="transparent"></embed>';
|
| 507 | + } elseif ( $type == 'youtube' || $type == 'youtube2' ) {
|
| 508 | + $output .= '<object width="' . $width . '" height="' . $height . '"><param name="movie" value="http://www.youtube.com/v/' . $id . '&hl=' . $wgLanguageCode . '&fs=1">'
|
| 509 | + . '</param><param name="allowFullScreen" value="' . $allowfullscreen . '"></param><embed '
|
| 510 | + . 'src="http://www.youtube.com/v/' . $id . '&hl=' . $wgLanguageCode . '&fs=1" type="application/x-shockwave-flash" '
|
| 511 | + . 'allowfullscreen="' . $allowfullscreen . '" width="' . $width . '" height="' . $height . '"></embed></object>';
|
| 512 | + } elseif ( $type == 'googlevideo' ) {
|
| 513 | + $output .= '<embed id="VideoPlayback" src="http://video.google.com/googleplayer.swf?docid=' . $id . '&hl=' . $wgLanguageCode . '&fs=true" '
|
| 514 | + . 'style="width:' . $width . 'px;height:' . $height . 'px" allowFullScreen="' . $allowfullscreen . '" allowScriptAccess="always" '
|
| 515 | + . 'type="application/x-shockwave-flash"> </embed>';
|
| 516 | + } elseif ( $type == 'myspace' || $type == 'myspacetv' ) {
|
| 517 | + $output .= '<object width="' . $width . 'px" height="' . $height . 'px" ><param name="allowFullScreen" value="' . $allowfullscreen . '"/>'
|
| 518 | + . '<param name="wmode" value="transparent"/><param name="movie" '
|
| 519 | + . 'value="http://mediaservices.myspace.com/services/media/embed.aspx/m=' . $id . ',t=1,mt=video,searchID=,'
|
| 520 | + . 'primarycolor=,secondarycolor="/><embed '
|
| 521 | + . 'src="http://mediaservices.myspace.com/services/media/embed.aspx/m=' . $id . ',t=1,mt=video,searchID=,'
|
| 522 | + . 'primarycolor=,secondarycolor=" width="' . $width . '" height="' . $height . '" allowFullScreen="' . $allowfullscreen . '" '
|
| 523 | + . 'type="application/x-shockwave-flash" wmode="transparent"/></object>';
|
| 524 | + } elseif ( $type == 'myvideo' ) {
|
| 525 | + $output .= '<object style=\'width:' . $width . 'px;height:' . $height . 'px;\' type=\'application/x-shockwave-flash\' '
|
| 526 | + . 'data=\'http://www.myvideo.de/movie/' . $id . '\'> <param name=\'movie\' value=\'http://www.myvideo.de/movie/' . $id . '\' />'
|
| 527 | + . '<param name=\'AllowFullscreen\' value=\'' . $allowfullscreen . '\' /> </object>';
|
| 528 | + } elseif ( $type == 'clipfish' ) {
|
| 529 | + $output .= '<object classid=\'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\' '
|
| 530 | + . 'codebase=\'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\' '
|
| 531 | + . 'width=\'' . $width . '\' height=\'' . $height . '\' id=\'player\' align=\'middle\'><param name=\'allowScriptAccess\' '
|
| 532 | + . 'value=\'always\' /><param name=\'movie\' value=\'http://www.clipfish.de/videoplayer.swf?as=0&vid=' . $id . '&r=1\' />'
|
| 533 | + . '<param name=\'quality\' value=\'high\' /><param name=\'bgcolor\' value=\'\#FF0000\' />'
|
| 534 | + . '<param name=\'allowFullScreen\' value=\'' . $allowfullscreen . '\' /><embed '
|
| 535 | + . 'src=\'http://www.clipfish.de/videoplayer.swf?as=0&videoid=' . $id . '&r=1\' quality=\'high\' bgcolor=\'\#FF0000\' '
|
| 536 | + . 'width=\'' . $width . '\' height=\'' . $height . '\' name=\'player\' align=\'middle\' allowFullScreen=\'' . $allowfullscreen . '\' '
|
| 537 | + . 'allowScriptAccess=\'always\' type=\'application/x-shockwave-flash\' '
|
| 538 | + . 'pluginspage=\'http://www.macromedia.com/go/getflashplayer\'></embed></object>';
|
| 539 | + } else {
|
| 540 | + $output .= '<object width="' . $width . '" height="' . $height . '">'
|
| 541 | + . '<param name="movie" value="' . $url[$type] . '"> <param name="allowfullscreen" value="' . $allowfullscreen . '" />'
|
| 542 | + . '<param name="wmode" value="transparent"></param>'
|
| 543 | + . '<embed src="' . $url[$type]
|
| 544 | + . '" type="application/x-shockwave-flash" wmode="transparent"'
|
| 545 | + . ' width="' . $width . '" height="' . $height . '" allowfullscreen="' . $allowfullscreen . '"';
|
| 546 | + if ( $type == 'revver' ) {
|
| 547 | + $output .= 'flashvars="mediaId=' . $id . '&affiliateId=0"';
|
| 548 | + }
|
| 549 | + if ( $type == 'gazeta' ) {
|
| 550 | + $output .= 'FlashVars="m=http://serwisy.gazeta.pl/getDaneWideo?xx=' . $id . '%26xxd=0&e=1&f=http://bi.gazeta.pl/im/"';
|
| 551 | + }
|
| 552 | + if ( $type == 'funnyordie' ) {
|
| 553 | + $output .= 'flashvars="key=' . $id . '"';
|
| 554 | + }
|
| 555 | + if ( $type == 'bbsports' ) {
|
| 556 | + $output .= 'allowscriptaccess="always" flashvars="nid=.' . $id . '"';
|
| 557 | + }
|
| 558 | + if ( $type == 'stickam' ) {
|
| 559 | + $output .= 'scale="scale" allowScriptAccess="always"';
|
| 560 | + }
|
| 561 | + if ( $type == 'comedycentral' ) {
|
| 562 | + $output .= 'FlashVars="videoId=' . $id . '" quality="high" bgcolor="#cccccc" name="comedy_central_player" align="middle" allownetworking="external"';
|
| 563 | + }
|
| 564 | + if ( $type == 'spike' ) {
|
| 565 | + $output .= 'flashvars="flvbaseclip=' . $id . '&"';
|
| 566 | + }
|
| 567 | + if ( $type != "interia" && $type != "znajomi" && $type != "youaretv" && $type != "youare" && $type != "wrzuta" && $type != 'brightcove' ) {
|
| 568 | + $output .= '></embed></object>';
|
| 569 | + }
|
| 570 | + }
|
| 571 | + if ( array_key_exists( 'desc', $args ) ) {
|
| 572 | + $output .= '<div class="thumbcaption" align="left">';
|
| 573 | + $desc2 = $parser->recursiveTagParse( $desc );
|
| 574 | + $output .= $desc2 . '</div>';
|
| 575 | + }
|
| 576 | + } else {
|
| 577 | + global $wgFramedVideoError, $wgFramedVideoErrors, $wgFramedVideoErrorHeightRequired;
|
| 578 | + global $wgFramedVideoErrorHeightRequiredNotOnlyWidth, $wgFramedVideoUnknownType, $wgFramedVideoErrorNoIdGiven;
|
| 579 | + global $wgFramedVideoErrorWidthTooBig, $wgFramedVideoErrorHeightTooBig, $wgFramedVideoErrorLimitMaxWidth;
|
| 580 | + global $wgFramedVideoErrorLimitMaxHeight, $wgFramedVideoErrorNoIntegerWidth, $wgFramedVideoErrorNoIntegerHeight;
|
| 581 | + global $wgFramedVideoErrorFullSizeNotAllowed, $wgFramedVideoHeightAndWidthRequired, $wgFramedVideoErrorNoIntegerWidth;
|
| 582 | + global $wgFramedVideoErrorSeeHelp;
|
| 583 | + $output .= '<div class="thumbcaption" align="left">';
|
| 584 | + wfLoadExtensionMessages( 'FramedVideo' );
|
| 585 | + $errors = array_sum( $errorid );
|
| 586 | + if ( $errors == 1 ) {
|
| 587 | + if ( !isset( $wgFramedVideoError ) ) { $wgFramedVideoError = wfMsg( 'framedvideo_error' ); }
|
| 588 | + } else {
|
| 589 | + if ( !isset( $wgFramedVideoErrors ) ) { $wgFramedVideoErrors = wfMsg( 'framedvideo_errors' ); }
|
| 590 | + }
|
| 591 | + if ( array_key_exists( 4, $errorid ) ) {
|
| 592 | + if ( !isset( $wgFramedVideoErrorNoIdGiven ) ) {
|
| 593 | + $wgFramedVideoErrorNoIdGiven = wfMsg( 'framedvideo_error_no_id_given' );
|
| 594 | + }
|
| 595 | + }
|
| 596 | + if ( array_key_exists( 5, $errorid ) ) {
|
| 597 | + if ( !isset( $wgFramedVideoErrorWidthTooBig ) ) {
|
| 598 | + $wgFramedVideoErrorWidthTooBig = wfMsg( 'framedvideo_error_width_too_big' );
|
| 599 | + }
|
| 600 | + if ( !isset( $wgFramedVideoErrorLimitMaxWidth ) ) {
|
| 601 | + $wgFramedVideoErrorLimitMaxWidth = wfMsg( 'framedvideo_error_limit', $maxwidth );
|
| 602 | + }
|
| 603 | + }
|
| 604 | + if ( array_key_exists( 6, $errorid ) ) {
|
| 605 | + if ( !isset( $wgFramedVideoErrorHeightTooBig ) ) {
|
| 606 | + $wgFramedVideoErrorHeightTooBig = wfMsg( 'framedvideo_error_height_too_big' );
|
| 607 | + }
|
| 608 | + if ( !isset( $wgFramedVideoErrorLimitMaxHeight ) ) {
|
| 609 | + $wgFramedVideoErrorLimitMaxHeight = wfMsg( 'framedvideo_error_limit', $maxheight );
|
| 610 | + }
|
| 611 | + }
|
| 612 | + if ( array_key_exists( 7, $errorid ) ) {
|
| 613 | + if ( !isset( $wgFramedVideoErrorNoIntegerWidth ) ) {
|
| 614 | + $wgFramedVideoErrorNoIntegerWidth = wfMsg( 'framedvideo_error_no_integer', 'width' );
|
| 615 | + }
|
| 616 | + }
|
| 617 | + if ( array_key_exists( 8, $errorid ) ) {
|
| 618 | + if ( !isset( $wgFramedVideoErrorNoIntegerHeight ) ) {
|
| 619 | + $wgFramedVideoErrorNoIntegerHeight = wfMsg( 'framedvideo_error_no_integer', 'height' );
|
| 620 | + }
|
| 621 | + }
|
| 622 | + if ( array_key_exists( 9, $errorid ) ) { $output .= '<br />' . wfMsg( 'framedvideo_error_full_size_not_allowed', $type ); }
|
| 623 | + if ( array_key_exists( 10, $errorid ) ) { $output .= '<br />' . wfMsg( 'framedvideo_error_height_and_width_required', $type ); }
|
| 624 | + if ( array_key_exists( 11, $errorid ) ) {
|
| 625 | + if ( !isset( $wgFramedVideoErrorNoIntegerWidth2 ) ) {
|
| 626 | + $wgFramedVideoErrorNoIntegerWidth2 = wfMsg( 'framedvideo_error_no_integer', 'width2' );
|
| 627 | + }
|
| 628 | + }
|
| 629 | + if ( !isset( $wgFramedVideoErrorSeeHelp ) ) {
|
| 630 | + $wgFramedVideoErrorSeeHelp = wfMsg( 'framedvideo_error_see_help' );
|
| 631 | + }
|
| 632 | + $errors = array_sum( $errorid );
|
| 633 | + if ( $errors == 1 ) {
|
| 634 | + $output .= $wgFramedVideoError;
|
| 635 | + } else {
|
| 636 | + $output .= $wgFramedVideoErrors;
|
| 637 | + }
|
| 638 | + if ( array_key_exists( 1, $errorid ) ) { $output .= '<br />' . wfMsg( 'framedvideo_error_height_required', $type ); }
|
| 639 | + if ( array_key_exists( 2, $errorid ) ) { $output .= '<br />' . wfMsg( 'framedvideo_error_height_required_not_only_width', $type ); }
|
| 640 | + if ( array_key_exists( 3, $errorid ) ) { $output .= '<br />' . wfMsg( 'framedvideo_error_unknown_type', $type2 ); }
|
| 641 | + if ( array_key_exists( 4, $errorid ) ) { $output .= '<br />' . $wgFramedVideoErrorNoIdGiven; }
|
| 642 | + if ( array_key_exists( 5, $errorid ) ) {
|
| 643 | + $output .= '<br />' . $wgFramedVideoErrorWidthTooBig;
|
| 644 | + $output .= ' ' . $wgFramedVideoErrorLimitMaxWidth;
|
| 645 | + }
|
| 646 | + if ( array_key_exists( 6, $errorid ) ) {
|
| 647 | + $output .= '<br />' . $wgFramedVideoErrorHeightTooBig;
|
| 648 | + $output .= ' ' . $wgFramedVideoErrorLimitMaxHeight;
|
| 649 | + }
|
| 650 | + if ( array_key_exists( 7, $errorid ) ) { $output .= '<br />' . $wgFramedVideoErrorNoIntegerWidth; }
|
| 651 | + if ( array_key_exists( 8, $errorid ) ) { $output .= '<br />' . $wgFramedVideoErrorNoIntegerHeight; }
|
| 652 | + if ( array_key_exists( 9, $errorid ) ) { $output .= '<br />' . wfMsg( 'framedvideo_error_full_size_not_allowed', $type ); }
|
| 653 | + if ( array_key_exists( 10, $errorid ) ) { $output .= '<br />' . wfMsg( 'framedvideo_error_height_and_width_required', $type ); }
|
| 654 | + if ( array_key_exists( 11, $errorid ) ) { $output .= '<br />' . $wgFramedVideoErrorNoIntegerWidth2; }
|
| 655 | + $output .= '<br />' . $parser->recursiveTagParse( $wgFramedVideoErrorSeeHelp ) . '</div>';
|
| 656 | + }
|
| 657 | + if ( $position == null ) {
|
| 658 | + $output .= '</div></div>';
|
| 659 | + }
|
| 660 | + if ( $position != null && $frame == true ) {
|
| 661 | + if ( $position == "center" ) {
|
| 662 | + $output .= '</div></div></div>';
|
| 663 | + } elseif ( $position == "left" ) {
|
| 664 | + $output .= '</div></div>';
|
| 665 | + } else {
|
| 666 | + $output .= '</div></div>';
|
| 667 | + }
|
| 668 | + }
|
| 669 | + if ( $position != null && $frame == false ) {
|
| 670 | + if ( $position == "center" ) {
|
| 671 | + $output .= '</span></div></div>';
|
| 672 | + } elseif ( $position == "left" ) {
|
| 673 | + $output .= '</span></div>';
|
| 674 | + } else {
|
| 675 | + $output .= '</span></div>';
|
| 676 | + }
|
| 677 | + }
|
| 678 | + return $output;
|
| 679 | + }
|
| 680 | +
|
| 681 | + function trueOrFalse ( $input ) {
|
| 682 | + if ( $input == "true" ) { $output = true; }
|
| 683 | + if ( $input == "false" ) { $output = false; }
|
| 684 | + return $output;
|
| 685 | + }
|
| 686 | +}
|
Index: trunk/extensions/FramedVideo/FramedVideo.i18n.php |
— | — | @@ -6,17 +6,17 @@ |
7 | 7 | $messages = array();
|
8 | 8 |
|
9 | 9 | $messages['en'] = array(
|
10 | | - 'framedvideo_default_width' => '270',
|
11 | | - 'framedvideo_force_default_size' => 'false',
|
12 | | - 'framedvideo_max_width' => '852',
|
13 | | - 'framedvideo_max_height' => '510',
|
14 | | - 'framedvideo_allow_full_screen' => 'true',
|
15 | | - 'framedvideo_force_allow_full_screen' => 'false',
|
16 | | - 'framedvideo_frames' => 'true',
|
17 | | - 'framedvideo_force_frames' => 'false',
|
18 | | - 'framedvideo_position' => 'right',
|
19 | | - 'framedvideo_force_position' => 'false',
|
20 | | - 'framedvideo_errors' => 'Errors has occurred!',
|
| 10 | + 'framedvideo_default_width' => '270', # do not translate or duplicate this message to other languages
|
| 11 | + 'framedvideo_force_default_size' => 'false', # do not translate or duplicate this message to other languages
|
| 12 | + 'framedvideo_max_width' => '852', # do not translate or duplicate this message to other languages
|
| 13 | + 'framedvideo_max_height' => '510', # do not translate or duplicate this message to other languages
|
| 14 | + 'framedvideo_allow_full_screen' => 'true', # do not translate or duplicate this message to other languages
|
| 15 | + 'framedvideo_force_allow_full_screen' => 'false', # do not translate or duplicate this message to other languages
|
| 16 | + 'framedvideo_frames' => 'true', # do not translate or duplicate this message to other languages
|
| 17 | + 'framedvideo_force_frames' => 'false', # do not translate or duplicate this message to other languages
|
| 18 | + 'framedvideo_force_position' => 'false', # do not translate or duplicate this message to other languages
|
| 19 | + 'framedvideo_position' => 'right', # only translate this message to other languages if you have to change it
|
| 20 | + 'framedvideo_errors' => 'Multiple errors have occurred!',
|
21 | 21 | 'framedvideo_error' => 'An error has occurred!',
|
22 | 22 | 'framedvideo_error_unknown_type' => 'Unknown video service id ("$1"): check "type" parameter.',
|
23 | 23 | 'framedvideo_error_no_id_given' => 'Missing "id" parameter.',
|
— | — | @@ -27,23 +27,14 @@ |
28 | 28 | 'framedvideo_error_no_integer' => 'Given value of "$1" is not a positive number.',
|
29 | 29 | 'framedvideo_error_limit' => 'The highest allowed value is $1.',
|
30 | 30 | 'framedvideo_error_full_size_not_allowed' => 'Value "full" for "size" parameter not allowed for video service id "$1".',
|
31 | | - 'framedvideo_error_see_help' => 'For more about syntax, see [[help:Video|help page]].',
|
| 31 | + 'framedvideo_helppage' => 'Help:Video',
|
| 32 | + 'framedvideo_error_see_help' => '[[{{MediaWiki:Framedvideo_helppage}}|More about syntax]].',
|
32 | 33 | 'framedvideo_error_height_and_width_required' => 'Video type "$1" requires "height" and "width2" or "width" parameters.',
|
33 | | - 'framedvideo_desc' => 'Allows embedding videos from various websites',
|
| 34 | + 'framedvideo-desc' => 'Allows embedding videos from various websites',
|
34 | 35 | );
|
35 | 36 |
|
36 | 37 |
|
37 | 38 | $messages['pl'] = array(
|
38 | | - 'framedvideo_default_width' => '270',
|
39 | | - 'framedvideo_force_default_size' => 'false',
|
40 | | - 'framedvideo_max_width' => '852',
|
41 | | - 'framedvideo_max_height' => '510',
|
42 | | - 'framedvideo_allow_full_screen' => 'true',
|
43 | | - 'framedvideo_force_allow_full_screen' => 'false',
|
44 | | - 'framedvideo_frames' => 'true',
|
45 | | - 'framedvideo_force_frames' => 'false',
|
46 | | - 'framedvideo_position' => 'right',
|
47 | | - 'framedvideo_force_position' => 'false',
|
48 | 39 | 'framedvideo_errors' => 'Wystąpiły błędy!',
|
49 | 40 | 'framedvideo_error' => 'Wystąpił błąd!',
|
50 | 41 | 'framedvideo_error_unknown_type' => 'Nieznany identyfikator „$1” dla serwisu wideo: sprawdź parametr „type”.',
|
— | — | @@ -57,5 +48,5 @@ |
58 | 49 | 'framedvideo_error_full_size_not_allowed' => 'Wartość „full” dla parametru „size” niedopuszczalna dla identyfikatora „$1”.',
|
59 | 50 | 'framedvideo_error_see_help' => 'Aby dowiedzieć się więcej o formatowaniu, zobacz [[pomoc:Wideo|stronę pomocy]].',
|
60 | 51 | 'framedvideo_error_height_and_width_required' => 'Wideo z serwisu o identyfikatorze „$1” wymaga podania parametru „height” i „width2” lub „width”.',
|
61 | | - 'framedvideo_desc' => 'Pozwala na osadzanie wideo z innych serwisów',
|
| 52 | + 'framedvideo-desc' => 'Pozwala na osadzanie wideo z innych serwisów',
|
62 | 53 | );
|
Index: trunk/extensions/FramedVideo/FramedVideo.php |
— | — | @@ -1,5 +1,5 @@ |
2 | 2 | <?php
|
3 | | -
|
| 3 | +
|
4 | 4 | /****************************************************************************************
|
5 | 5 | * *
|
6 | 6 | * FramedVideo extention by Robert Pilawski, based on VideoFlash extension *
|
— | — | @@ -19,680 +19,25 @@ |
20 | 20 | * You should have received a copy of the GNU General Public *
|
21 | 21 | * License along with this library; if not, write to the Free Software *
|
22 | 22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
|
23 | | -* *
|
24 | | -*****************************************************************************************/
|
| 23 | +* *
|
| 24 | +*****************************************************************************************/
|
25 | 25 |
|
26 | | -$wgExtensionMessagesFiles['FramedVideo'] = dirname(__FILE__) . '/FramedVideo.i18n.php';
|
| 26 | +$dir = dirname(__FILE__) . '/';
|
| 27 | +$wgExtensionMessagesFiles['FramedVideo'] = $dir . 'FramedVideo.i18n.php';
|
| 28 | +$wgAutoloadClasses['FramedVideo'] = $dir . 'FramedVideo.class.php';
|
27 | 29 | $wgExtensionFunctions[] = 'wfFramedVideo';
|
| 30 | +
|
28 | 31 | $wgExtensionCredits['parserhook'][] = array(
|
29 | | - 'name' => 'FramedVideo',
|
30 | | - 'description' => 'Allows embedding videos from various websites',
|
31 | | - 'descriptionmsg' => 'framedvideo_desc',
|
32 | | - 'author' => '[http://filop.pl/wiki/U%C5%BCytkownik:Ruiz Ruiz]',
|
33 | | - 'url' => 'http://www.mediawiki.org/wiki/Extension:FramedVideo',
|
34 | | - 'version' => '1.1.1'
|
| 32 | + 'name' => 'FramedVideo',
|
| 33 | + 'description' => 'Allows embedding videos from various websites',
|
| 34 | + 'descriptionmsg' => 'framedvideo-desc',
|
| 35 | + 'author' => '[http://filop.pl/wiki/U%C5%BCytkownik:Ruiz Ruiz]',
|
| 36 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:FramedVideo',
|
| 37 | + 'version' => '1.2.0',
|
35 | 38 | );
|
36 | 39 |
|
37 | 40 | function wfFramedVideo() {
|
38 | | - global $wgParser;
|
39 | | - $wgParser->setHook('video', 'renderFramedVideo');
|
40 | | -}
|
| 41 | + global $wgParser;
|
41 | 42 |
|
42 | | -function renderFramedVideo($input, $args, $parser) {
|
43 | | - global $wgLanguageCode,$wgFramedVideoLightMode,$wgFramedVideoConfigLoaded;
|
44 | | - global $wgFramedVideoDefaultWidth,$wgFramedVideoForceDefaultSize,$wgFramedVideoMaxWidth,$wgFramedVideoMaxHeight;
|
45 | | - global $wgFramedVideoAllowFullScreen,$wgFramedVideoForceAllowFullScreen,$wgFramedVideoFrames,$wgFramedVideoForceFrames;
|
46 | | - global $wgFramedVideoPosition,$wgFramedVideoForcePosition;
|
47 | | - if ( !isset($wgFramedVideoConfigLoaded) ) {
|
48 | | - if ( !isset($wgFramedVideoLightMode) || $wgFramedVideoLightMode == false ) {
|
49 | | - wfLoadExtensionMessages('FramedVideo');
|
50 | | - $wgFramedVideoDefaultWidth = intval(wfMsg('framedvideo_default_width'));
|
51 | | - $wgFramedVideoForceDefaultSize = false;
|
52 | | - if((wfMsg('framedvideo-forcesize') == "true")) {
|
53 | | - $wgFramedVideoForceDefaultSize = true;
|
54 | | - }
|
55 | | - $wgFramedVideoMaxWidth = intval(wfMsg('framedvideo_max_width'));
|
56 | | - $wgFramedVideoMaxHeight = intval(wfMsg('framedvideo_max_height'));
|
57 | | - $wgFramedVideoAllowFullScreen = trueOrFalse(wfMsg('framedvideo_allow_full_screen'));
|
58 | | - $wgFramedVideoForceAllowFullScreen = trueOrFalse(wfMsg('framedvideo_force_allow_full_screen'));
|
59 | | - $wgFramedVideoFrames = trueOrFalse(wfMsg('framedvideo_frames'));
|
60 | | - $wgFramedVideoForceFrames = trueOrFalse(wfMsg('framedvideo_force_frames'));
|
61 | | - $wgFramedVideoPosition = wfMsg('framedvideo_position');
|
62 | | - $wgFramedVideoForcePosition = trueOrFalse(wfMsg('framedvideo_force_position'));
|
63 | | - $wgFramedVideoConfigLoaded = true;
|
64 | | - } else {
|
65 | | - wfLoadExtensionMessages('FramedVideo');
|
66 | | - if ( !isset($wgFramedVideoDefaultWidth) || !isset($wgFramedVideoForceDefaultSize) || !isset($wgFramedVideoMaxWidth)
|
67 | | - || !isset($wgFramedVideoMaxHeight) || !isset($wgFramedVideoAllowFullScreen) || !isset($wgFramedVideoForceAllowFullScreen)
|
68 | | - || !isset($wgFramedVideoFrames) || !isset($wgFramedVideoForceFrames) || !isset ($wgFramedVideoPosition)
|
69 | | - || !isset($wgFramedVideoForcePosition) ) {
|
70 | | - wfLoadExtensionMessages('FramedVideo');
|
71 | | - }
|
72 | | - if ( !isset($wgFramedVideoDefaultWidth)) { $wgFramedVideoDefaultWidth = intval(wfMsg('framedvideo_default_width')); }
|
73 | | - if ( !isset($wgFramedVideoForceDefaultSize)) {
|
74 | | - $wgFramedVideoForceDefaultSize = false;
|
75 | | - if((wfMsg('framedvideo-forcesize') == "true")) {
|
76 | | - $wgFramedVideoForceDefaultSize = true;
|
77 | | - }
|
78 | | - }
|
79 | | - if ( !isset($wgFramedVideoMaxWidth)) { $wgFramedVideoMaxWidth = intval(wfMsg('framedvideo_max_width')); }
|
80 | | - if ( !isset($wgFramedVideoMaxHeight)) { $wgFramedVideoMaxHeight = intval(wfMsg('framedvideo_max_height')); }
|
81 | | - if ( !isset($wgFramedVideoAllowFullScreen)) {
|
82 | | - $wgFramedVideoAllowFullScreen = trueOrFalse(wfMsg('framedvideo_allow_full_screen'));
|
83 | | - }
|
84 | | - if ( !isset($wgFramedVideoForceAllowFullScreen)) {
|
85 | | - $wgFramedVideoForceAllowFullScreen = trueOrFalse(wfMsg('framedvideo_force_allow_full_screen'));
|
86 | | - }
|
87 | | - if ( !isset($wgFramedVideoFrames)) {
|
88 | | - $wgFramedVideoFrames = trueOrFalse(wfMsg('framedvideo_frames'));
|
89 | | - }
|
90 | | - if ( !isset($wgFramedVideoForceFrames)) {
|
91 | | - $wgFramedVideoForceFrames = trueOrFalse(wfMsg('framedvideo_force_frames'));
|
92 | | - }
|
93 | | - if ( !isset($wgFramedVideoPosition)) {
|
94 | | - $wgFramedVideoPosition = wfMsg('framedvideo_position');
|
95 | | - }
|
96 | | - if ( !isset($wgFramedVideoForcePosition)) {
|
97 | | - $wgFramedVideoForcePosition = trueOrFalse(wfMsg('framedvideo_force_position'));
|
98 | | - }
|
99 | | - }
|
100 | | - $wgFramedVideoConfigLoaded = true;
|
101 | | - }
|
102 | | -
|
103 | | - $defaultwidth = $wgFramedVideoDefaultWidth;
|
104 | | - $forcesize = $wgFramedVideoForceDefaultSize;
|
105 | | - $maxwidth = $wgFramedVideoMaxWidth;
|
106 | | - $maxheight = $wgFramedVideoMaxHeight;
|
107 | | - $allowfullscreen = $wgFramedVideoAllowFullScreen;
|
108 | | - $forceallowfullscreen = $wgFramedVideoForceAllowFullScreen;
|
109 | | - $frame = $wgFramedVideoFrames;
|
110 | | - $forceframes = $wgFramedVideoForceFrames;
|
111 | | - $position2 = $wgFramedVideoPosition;
|
112 | | - $forceposition = $wgFramedVideoForcePosition;
|
113 | | - $rendervideo = true;
|
114 | | -
|
115 | | - if (array_key_exists('type', $args)) { $type = htmlspecialchars($args['type']); }
|
116 | | - else { $type = "youtube"; }
|
117 | | - if (array_key_exists('id', $args)) { $id = htmlspecialchars($args['id']); }
|
118 | | - else {
|
119 | | - $id = "0";
|
120 | | - $rendervideo = false;
|
121 | | - $errorid[4] = 1;
|
122 | | - $width = 1;
|
123 | | - $height = 1;
|
124 | | - }
|
125 | | -
|
126 | | - $twidth['bbsports'] = 425; $theight['bbsports'] = 350;
|
127 | | - $twidth['bliptv'] = 640; $theight['bliptv'] = 510;
|
128 | | - $twidth['break'] = 464; $theight['break'] = 392;
|
129 | | - $twidth['broadcaster'] = 425; $theight['broadcaster'] = 340;
|
130 | | - $twidth['clipfish'] = 464; $theight['clipfish'] = 380;
|
131 | | - $twidth['clipshack'] = 430; $theight['clipshack'] = 370;
|
132 | | - $twidth['comedycentral'] = 464; $theight['comedycentral'] = 392;
|
133 | | - $twidth['dailymotion'] = 420; $theight['dailymotion'] = 336;
|
134 | | - $twidth['error'] = $defaultwidth; $theight['error'] = 1;
|
135 | | - $twidth['eyespot'] = 432; $theight['eyespot'] = 407;
|
136 | | - $twidth['funnyordie'] = 464; $theight['funnyordie'] = 388;
|
137 | | - $twidth['gazeta'] = 480; $theight['gazeta'] = 393;
|
138 | | - $twidth['glumbert'] = 448; $theight['glumbert'] = 336;
|
139 | | - $twidth['godtube'] = 330; $theight['godtube'] = 270;
|
140 | | - $twidth['googlevideo'] = 400; $theight['googlevideo'] = 326;
|
141 | | - $twidth['interia'] = 425; $theight['interia'] = 350;
|
142 | | - $twidth['znajomi'] = 425; $theight['znajomi'] = 350;
|
143 | | - $twidth['jumpcut'] = 408; $theight['jumpcut'] = 324;
|
144 | | - $twidth['kewego'] = 400; $theight['kewego'] = 368;
|
145 | | - $twidth['liveleak'] = 450; $theight['liveleak'] = 370;
|
146 | | - $twidth['livevideo'] = 445; $theight['livevideo'] = 369;
|
147 | | - $twidth['metacafe'] = 400; $theight['metacafe'] = 345;
|
148 | | - $twidth['myspace'] = 425; $theight['myspace'] = 360;
|
149 | | - $twidth['myspacetv'] = 425; $theight['myspacetv'] = 360;
|
150 | | - $twidth['myvideo'] = 470; $theight['myvideo'] = 406;
|
151 | | - $twidth['patrz'] = 425; $theight['patrz'] = 331;
|
152 | | - $twidth['photobucket'] = 448; $theight['photobucket'] = 361;
|
153 | | - $twidth['plejada'] = 640; $theight['plejada'] = 396;
|
154 | | - $twidth['putfile'] = 420; $theight['putfile'] = 349;
|
155 | | - $twidth['revver'] = 480; $theight['revver'] = 392;
|
156 | | - $twidth['rutube'] = 400; $theight['rutube'] = 353;
|
157 | | - $twidth['selfcasttv'] = 340; $theight['selfcasttv'] = 283;
|
158 | | - $twidth['selfcast'] = 340; $theight['selfcast'] = 283;
|
159 | | - $twidth['sevenload'] = 455; $theight['sevenload'] = 364;
|
160 | | - $twidth['sharkle'] = 340; $theight['sharkle'] = 310;
|
161 | | - $twidth['shoutfile'] = 400; $theight['shoutfile'] = 300;
|
162 | | - $twidth['spike'] = 448; $theight['spike'] = 365;
|
163 | | - $twidth['stickam'] = 400; $theight['stickam'] = 300;
|
164 | | - $twidth['superdeluxe'] = 400; $theight['superdeluxe'] = 300;
|
165 | | - $twidth['uncutvideo'] = 415; $theight['uncutvideo'] = 347;
|
166 | | - $twidth['veoh'] = 540; $theight['veoh'] = 458;
|
167 | | - $twidth['videojug'] = 400; $theight['videojug'] = 345;
|
168 | | - $twidth['viddler'] = 437; $theight['viddler'] = 370;
|
169 | | - $twidth['vimeo'] = 400; $theight['vimeo'] = 300;
|
170 | | - $twidth['wrzuta'] = 450; $theight['wrzuta'] = 416;
|
171 | | - $twidth['yahoovideo'] = 512; $theight['yahoovideo'] = 323;
|
172 | | - $twidth['youaretv'] = 350; $theight['youaretv'] = 300;
|
173 | | - $twidth['youare'] = 350; $theight['youare'] = 300;
|
174 | | - $twidth['youtube'] = 425; $theight['youtube'] = 344;
|
175 | | - $twidth['youtube2'] = 480; $theight['youtube2'] = 295;
|
176 | | -
|
177 | | - if (!(array_key_exists($type, $twidth))) {
|
178 | | - $rendervideo = false;
|
179 | | - $errorid[3] = 1;
|
180 | | - $width = 1;
|
181 | | - $height = 1;
|
182 | | - $type2 = $type;
|
183 | | - $type = 'error';
|
184 | | - }
|
185 | | -
|
186 | | - $playerheight1 = 0;
|
187 | | - $playerheight2 = 0;
|
188 | | -
|
189 | | - if ($type=="bbsports") { $playerheight1 = 24; $playerheight2 = 20; }
|
190 | | - if ($type=="bliptv") { $playerheight1 = 30; $playerheight2 = 30; }
|
191 | | - if ($type=="clipfish") { $playerheight1 = 30; $playerheight2 = 30; }
|
192 | | - if ($type=="dailymotion") { $playerheight1 = 21; $playerheight2 = 21; }
|
193 | | - if ($type=="funnyordie") { $playerheight1 = 40; $playerheight2 = 40; }
|
194 | | - if ($type=="gazeta") { $playerheight1 = 34; $playerheight2 = 34; }
|
195 | | - if ($type=="googlevideo") { $playerheight1 = 27; $playerheight2 = 27; }
|
196 | | - if ($type=="interia") { $playerheight1 = 49; $playerheight2 = 49; }
|
197 | | - if ($type=="znajomi") { $playerheight1 = 49; $playerheight2 = 49; }
|
198 | | - if ($type=="jumpcut") { $playerheight1 = 21; $playerheight2 = 21; }
|
199 | | - if ($type=="kewego") { $playerheight1 = 0; $playerheight2 = 26; }
|
200 | | - if ($type=="liveleak") { $playerheight1 = 20; $playerheight2 = 20; }
|
201 | | - if ($type=="livevideo") { $playerheight1 = 0; $playerheight2 = 22; }
|
202 | | - if ($type=="metacafe") { $playerheight1 =31; $playerheight2 = 40; }
|
203 | | - if ($type=="myspace") { $playerheight1 =40; $playerheight2 = 40; }
|
204 | | - if ($type=="myspacetv") { $playerheight1 =40; $playerheight2 = 40; }
|
205 | | - if ($type=="myvideo") { $playerheight1 =46; $playerheight2 = 46; }
|
206 | | - if ($type=="photobucket") { $playerheight1 = 25; $playerheight2 = 25; }
|
207 | | - if ($type=="plejada") { $playerheight1 = 36; $playerheight2 = 36; }
|
208 | | - if ($type=="putfile") { $playerheight1 = 27; $playerheight2 = 50; }
|
209 | | - if ($type=="revver") { $playerheight1 = 32; $playerheight2 = 32; }
|
210 | | - if ($type=="rutube") { $playerheight1 = 36; $playerheight2 = 36; }
|
211 | | - if ($type=="selfcasttv") { $playerheight1 = 20; $playerheight2 = 20; }
|
212 | | - if ($type=="selfcast") { $playerheight1 = 20; $playerheight2 = 20; }
|
213 | | - if ($type=="sevenload") { $playerheight1 = 33; $playerheight2 = 33; }
|
214 | | - if ($type=="shoutfile") { $playerheight1 = 29; $playerheight2 = 29; }
|
215 | | - if ($type=="spike") { $playerheight1 = 31; $playerheight2 = 31; }
|
216 | | - if ($type=="superdeluxe") { $playerheight1 = 50; $playerheight2 = 50; }
|
217 | | - if ($type=="uncutvideo") { $playerheight1 = 47; $playerheight2 = 47; }
|
218 | | - if ($type=="veoh") { $playerheight1 = 34; $playerheight2 = 34; }
|
219 | | - if ($type=="viddler") { $playerheight1 = 42; $playerheight2 = 42; }
|
220 | | - if ($type=="videojug") { $playerheight1 = 30; $playerheight2 = 30; }
|
221 | | - if ($type=="yahoovideo") { $playerheight1 = 34; $playerheight2 = 34; }
|
222 | | - if ($type=="youtube") { $playerheight1 = 25; $playerheight2 = 25; }
|
223 | | - if ($type=="youtube2") { $playerheight1 = 25; $playerheight2 = 25; }
|
224 | | -
|
225 | | - if (array_key_exists('width', $args) && $type != 'vimeo' && $type != 'dailymotion' && $type != 'bliptv') { $width = htmlspecialchars($args['width']); }
|
226 | | - else { $width = $twidth[$type]; }
|
227 | | - if (array_key_exists('height', $args) && $type != 'vimeo' && $type != 'dailymotion' && $type != 'bliptv') { $height = htmlspecialchars($args['height']); }
|
228 | | - else { $height = $theight[$type]; }
|
229 | | -
|
230 | | - if ($type == 'dailymotion' || $type == 'vimeo') {
|
231 | | - if ((array_key_exists('height', $args)) && !(array_key_exists('width', $args))) {
|
232 | | - $height = htmlspecialchars($args['height']);
|
233 | | - $width = $defaultwidth;
|
234 | | - $height = (htmlspecialchars($args['height']) - $playerheight1) / $twidth[$type] * $defaultwidth + $playerheight2;
|
235 | | - $height = round($height);
|
236 | | - }
|
237 | | -
|
238 | | - if (!(array_key_exists('height', $args)) && !(array_key_exists('width', $args))) {
|
239 | | - $width = $defaultwidth;
|
240 | | - $rendervideo = false;
|
241 | | - $errorid[1] = 1;
|
242 | | - }
|
243 | | - if (!(array_key_exists('height', $args)) && (array_key_exists('width', $args))) {
|
244 | | - $width = htmlspecialchars($args['width']);
|
245 | | - $rendervideo = false;
|
246 | | - $errorid[2] = 1;
|
247 | | - }
|
248 | | - if ((array_key_exists('height', $args)) && (array_key_exists('width', $args))) {
|
249 | | - $height = htmlspecialchars($args['height']);
|
250 | | - $width = htmlspecialchars($args['width']);
|
251 | | - $height = (htmlspecialchars($args['height']) - $playerheight1) / $twidth[$type] * $defaultwidth + $playerheight2;
|
252 | | - $height = round($height);
|
253 | | - }
|
254 | | -
|
255 | | - }
|
256 | | -
|
257 | | - if ($type == 'bliptv') {
|
258 | | - if ((array_key_exists('height', $args)) && (array_key_exists('width2', $args)) && !(array_key_exists('width', $args))) {
|
259 | | - $width = htmlspecialchars($args['width2']);
|
260 | | - $height = htmlspecialchars($args['height']);
|
261 | | - if($width < 1) {
|
262 | | - $width = $defaultwidth;
|
263 | | - $rendervideo = false;
|
264 | | - $errorid[11] = 1;
|
265 | | - } else {
|
266 | | - $height = ($height - $playerheight1) * $defaultwidth / $width + $playerheight2;
|
267 | | - $width = $defaultwidth;
|
268 | | - }
|
269 | | - } elseif ((array_key_exists('height', $args)) && (array_key_exists('width', $args))) {
|
270 | | - $width = htmlspecialchars($args['width']);
|
271 | | - $height = htmlspecialchars($args['height']);
|
272 | | - } else {
|
273 | | - $rendervideo = false;
|
274 | | - $width = $defaultwidth;
|
275 | | - $errorid[10] = 1;
|
276 | | - }
|
277 | | - }
|
278 | | -
|
279 | | - $url['bbsports'] = 'http://broadbandsports.com/flv/bbs-xplayer.swf?n='.$id;
|
280 | | - $url['bliptv'] = 'http://blip.tv/play/'.$id;
|
281 | | - $url['break'] = 'http://embed.break.com/'.$id;
|
282 | | - $url['brightcove'] = 'http://';
|
283 | | - $url['broadcaster'] = 'http://www.broadcaster.com/video/external/player.swf?clip='. $id .'.flv';
|
284 | | - $url['clipshack'] = 'http://clipshack.com/player.swf?key='.$id;
|
285 | | - $url['comedycentral'] = 'http://www.comedycentral.com/sitewide/video_player/view/default/swf.jhtml';
|
286 | | - $url['dailymotion'] = 'http://www.dailymotion.com/swf/'.$id;
|
287 | | - $url['error'] = '';
|
288 | | - $url['eyespot'] = 'http://eyespot.com/flash/medialoader.swf?vurl=http://downloads.eyespot.com/direct/play?r='.$id.'&_autoPlay=false';
|
289 | | - $url['funnyordie'] = 'http://www2.funnyordie.com/public/flash/fodplayer.swf?7228';
|
290 | | - $url['gazeta'] = 'http://bi.gazeta.pl/im/loader.swf';
|
291 | | - $url['glumbert'] = 'http://www.glumbert.com/embed/'.$id;
|
292 | | - $url['godtube'] = '';
|
293 | | - $url['googlevideo'] = 'http://video.google.com/googleplayer.swf?docId='. $id .'&hl='.$wgLanguageCode.'&fs=true';
|
294 | | - $url['interia'] = 'http://video.interia.pl/player.js';
|
295 | | - $url['jumpcut'] = 'http://jumpcut.com/media/flash/jump.swf?id='.$id.'&asset_type=movie&asset_id='.$id.'&eb=1';
|
296 | | - $url['kewego'] = 'http://www.kewego.com/p/en/'. $id .'.html';
|
297 | | - $url['liveleak'] = 'http://www.liveleak.com/e/'.$id;
|
298 | | - $url['livevideo'] = '';
|
299 | | - $url['metacafe'] = 'http://www.metacafe.com/fplayer/'.$id.'.swf';
|
300 | | - $url['patrz'] = 'http://patrz.pl/patrz.pl.swf?id='. $id .'&r=5&o=';
|
301 | | - $url['photobucket'] = 'http://';
|
302 | | - $url['plejada'] = 'http://www.plejada.pl/_d/flash/'.$id.',player_loader.swf';
|
303 | | - $url['putfile'] = 'http://feat.putfile.com/flow/putfile.swf?videoFile='.$id;
|
304 | | - $url['revver'] = 'http://flash.revver.com/player/1.0/player.swf?mediaId='.$id;
|
305 | | - $url['rutube'] = 'http://video.rutube.ru/'.$id;
|
306 | | - $url['selfcast'] = 'http://www.selfcasttv.com/Selfcast/selfcast.swf?video_1=/s/'.$id;
|
307 | | - $url['selfcasttv'] = 'http://www.selfcasttv.com/Selfcast/selfcast.swf?video_1=/s/'.$id;
|
308 | | - $url['sevenload'] = 'http://en.sevenload.com/pl/'. $id .'/'. $width .'x'. $height .'/swf';
|
309 | | - $url['sharkle'] = 'http://www.sharkle.com/externalPlayer/'.$id;
|
310 | | - $url['shoutfile'] = 'http://www.shoutfile.com/emb/'.$id;
|
311 | | - $url['spike'] = 'http://www.spike.com/efp';
|
312 | | - $url['stickam'] = 'http://player.stickam.com/flashVarMediaPlayer/'.$id;
|
313 | | - $url['superdeluxe'] = 'http://i.cdn.turner.com/sdx/static/swf/share_vidplayer.swf';
|
314 | | - $url['uncutvideo'] = 'http://';
|
315 | | - $url['veoh'] = 'http://www.veoh.com/videodetails2.swf?permalinkId='. $id .'&id=anonymous&player=videodetailsembedded&videoAutoPlay=0';
|
316 | | - $url['videojug'] = 'http://www.videojug.com/film/player?id='.$id;
|
317 | | - $url['viddler'] = 'http://www.viddler.com/player/'. $id .'/';
|
318 | | - $url['vimeo'] = 'http://www.vimeo.com/moogaloop.swf?clip_id='. $id .'&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1';
|
319 | | - $url['wrzuta'] = 'http://www.wrzuta.pl/wrzuta_embed.js';
|
320 | | - $url['yahoovideo'] = 'http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.4';
|
321 | | - $url['youare'] = 'http://www.youare.tv/player/yatvplayer.swf?videoID='.$id;
|
322 | | - $url['youaretv'] = 'http://www.youare.tv/player/yatvplayer.swf?videoID='.$id;
|
323 | | - $url['youtube'] = 'http://www.youtube.com/v/'.$id;
|
324 | | - $url['youtube2'] = 'http://www.youtube.com/v/'.$id;
|
325 | | - $url['znajomi'] = 'http://video.interia.pl/player.js';
|
326 | | -
|
327 | | - if (array_key_exists('desc', $args)) { $desc = $args['desc']; }
|
328 | | - else { $desc = ''; }
|
329 | | - if (array_key_exists('size', $args)) { $size = htmlspecialchars($args['size']); }
|
330 | | - else { $size = ''; }
|
331 | | -
|
332 | | - if ($allowfullscreen == true && $forceallowfullscreen == false) {
|
333 | | - if (array_key_exists('allowfullscreen', $args)) {
|
334 | | - $allowfullscreen = htmlspecialchars($args['allowfullscreen']);
|
335 | | - if ($allowfullscreen != 'true') {
|
336 | | - $allowfullscreen = false;
|
337 | | - } else {
|
338 | | - $allowfullscreen = true;
|
339 | | - }
|
340 | | - }
|
341 | | - } elseif ($allowfullscreen == false && $forceallowfullscreen == true) {
|
342 | | - $allowfullscreen = false;
|
343 | | - } elseif ($allowfullscreen == false && $forceallowfullscreen == false && !(array_key_exists('allowfullscreen', $args))) {
|
344 | | - $allowfullscreen = false;
|
345 | | - } else {
|
346 | | - $allowfullscreen = true;
|
347 | | - }
|
348 | | -
|
349 | | - if ($allowfullscreen == false) {
|
350 | | - $allowfullscreen = "false";
|
351 | | - } else {
|
352 | | - $allowfullscreen = "true";
|
353 | | - }
|
354 | | -
|
355 | | - if ($frame == true && $forceframes == false) {
|
356 | | - if (array_key_exists('frame', $args)) {
|
357 | | - $frame = htmlspecialchars($args['frame']);
|
358 | | - if ($frame != "true") {
|
359 | | - $frame = false;
|
360 | | - } else {
|
361 | | - $frame = true;
|
362 | | - }
|
363 | | - }
|
364 | | - } elseif ($frame == false && $forceframes == true) {
|
365 | | - $frame = false;
|
366 | | - } elseif ($frame == false && $forceframes == false && !(array_key_exists('frame', $args))) {
|
367 | | - $frame = false;
|
368 | | - } else {
|
369 | | - $frame = true;
|
370 | | - }
|
371 | | - if ($forceposition == false) {
|
372 | | - if (array_key_exists('position', $args)) {
|
373 | | - $position = htmlspecialchars($args['position']);
|
374 | | - } else { $position = $position2; }
|
375 | | - } else {
|
376 | | - $position = $position2;
|
377 | | - }
|
378 | | -
|
379 | | - if ($type != 'vimeo' && $type != 'dailymotion' && $type != 'bliptv') {
|
380 | | - if ($forcesize == true) {
|
381 | | - $width = $defaultwidth;
|
382 | | - $height = round(($theight[$type] - $playerheight1) / $twidth[$type] * $defaultwidth) + $playerheight2;
|
383 | | - } elseif ($forcesize == false && !(array_key_exists('width', $args)) && !(array_key_exists('height', $args))) {
|
384 | | - $width = $defaultwidth;
|
385 | | - $height = round(($theight[$type] - $playerheight1) / $twidth[$type] * $defaultwidth) + $playerheight2;
|
386 | | - } elseif ($forcesize == false && (array_key_exists('width', $args)) && !(array_key_exists('height', $args))) {
|
387 | | - $height = round(($theight[$type] - $playerheight1) / $twidth[$type] * $width) + $playerheight2;
|
388 | | - } elseif ($forcesize == false && (array_key_exists('width', $args)) && (array_key_exists('height', $args))) {
|
389 | | - $width = htmlspecialchars($args['width']);
|
390 | | - $height = htmlspecialchars($args['height']);
|
391 | | - }
|
392 | | - }
|
393 | | -
|
394 | | - if($size=="full" && $forcesize==false) {
|
395 | | - $width = $twidth[$type];
|
396 | | - $height = $theight[$type];
|
397 | | - }
|
398 | | -
|
399 | | - if($size=="full") {
|
400 | | - if($type=="dailymotion" || $type=="vimeo") {
|
401 | | - $rendervideo = false;
|
402 | | - $errorid[9] = 1;
|
403 | | - $width = $defaultwidth;
|
404 | | - $height = 1;
|
405 | | - }
|
406 | | - }
|
407 | | -
|
408 | | - if($width > $maxwidth) {
|
409 | | - $width = $defaultwidth;
|
410 | | - $rendervideo = false;
|
411 | | - $errorid[5] = 1;
|
412 | | - }
|
413 | | -
|
414 | | - if($height > $maxheight) {
|
415 | | - $rendervideo = false;
|
416 | | - $errorid[6] = 1;
|
417 | | - }
|
418 | | -
|
419 | | -
|
420 | | - if($width < 1) {
|
421 | | - $width = $defaultwidth;
|
422 | | - $rendervideo = false;
|
423 | | - $errorid[7] = 1;
|
424 | | - }
|
425 | | -
|
426 | | - if($height < 1) {
|
427 | | - $height = 1;
|
428 | | - $rendervideo = false;
|
429 | | - $errorid[8] = 1;
|
430 | | - }
|
431 | | -
|
432 | | - $widthframe = ($width + 2);
|
433 | | -
|
434 | | - if ($position == null && $frame == true) {
|
435 | | - $output = '<div class="thumb tright"> <div class="thumbinner" style="width: '.$widthframe.'px;" border="0">';
|
436 | | - }
|
437 | | - if ($position != null && $frame == true) {
|
438 | | - if ($position == "center") {
|
439 | | - $output = '<div class="center"><div class="thumb tnone"> <div class="thumbinner" style="width: '.$widthframe.'px;" border="0">';
|
440 | | - } elseif ($position == "left") {
|
441 | | - $output = '<div class="thumb tleft"> <div class="thumbinner" style="width: '.$widthframe.'px;" border="0">';
|
442 | | - } else {
|
443 | | - $output = '<div class="thumb tright"> <div class="thumbinner" style="width: '.$widthframe.'px;" border="0">';
|
444 | | - }
|
445 | | - }
|
446 | | - if ($frame == false) {
|
447 | | - if ($position == "center") {
|
448 | | - $output = '<div class="center"><div class="floatnone" style="width: '.$width.'px;"><span>';
|
449 | | - } elseif ($position == "left") {
|
450 | | - $output = '<div class="floatleft" style="width: '.$width.'px;"><span>';
|
451 | | - } else {
|
452 | | - $output = '<div class="floatright" style="width: '.$width.'px;"><span>';
|
453 | | - }
|
454 | | - }
|
455 | | - if ($rendervideo == true) {
|
456 | | - if($type=='superdeluxe') {
|
457 | | - $output.= '<object width="'.$width.'" height="'.$height.'"><param name="allowFullScreen" value="'.$allowfullscreen.'" />'
|
458 | | - .'<param name="movie" value="http://i.cdn.turner.com/sdx/static/swf/share_vidplayer.swf" />'
|
459 | | - .'<param name="FlashVars" value="'.$id.'" />'
|
460 | | - .'<embed src="http://i.cdn.turner.com/sdx/static/swf/share_vidplayer.swf"'
|
461 | | - .'FlashVars="id='.$id.'" type="application/x-shockwave-flash"'
|
462 | | - .'width="'.$width.'" height="'.$height.'" allowFullScreen="true"';
|
463 | | - } elseif ($type=='interia' || $type=='znajomi') {
|
464 | | - $output.= '<script type="text/javascript" src="http://video.interia.pl/player.js#'.$id.','.$width.','.$height.'"></script>';
|
465 | | - } elseif ($type=='shoutfile') {
|
466 | | - $output.= '<object width="'.$width.'" height="'.$height.'">'
|
467 | | - .'<embed allowScriptAccess="always" src="http://www.shoutfile.com/emb/'.$id.'"'
|
468 | | - .' allowFullScreen="'.$allowfullscreen.'" width="'.$width.'" height="'.$height.'" border="0"'
|
469 | | - .' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"';
|
470 | | - } elseif ($type=='videojug') {
|
471 | | - $output.= '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'
|
472 | | - .' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"'
|
473 | | - .' id="vjplayer04062008" width="400" height="345" align="middle" allowFullScreen="true">'
|
474 | | - .'<param name="movie" value="http://www.videojug.com/film/player?id='.$id.'" />'
|
475 | | - .'<PARAM value="'.$allowfullscreen.'" name="allowFullScreen" /><PARAM value="always" name="allowScriptAccess" />'
|
476 | | - .'<embed src="http://www.videojug.com/film/player?id='.$id.'"'
|
477 | | - .' quality="high" width="'.$width.'" height="'.$height.'" type="application/x-shockwave-flash"'
|
478 | | - .' pluginspage="http://www.macromedia.com/go/getflashplayer" allowscriptaccess="always"'
|
479 | | - .' allowfullscreen="true"';
|
480 | | - } elseif ($type=='youaretv' || $type=='youare') {
|
481 | | - $output.= '<embed src=\'http://www.youare.tv/yatvplayer.swf?videoID='.$id.'\' allowScriptAccess=\'never\''
|
482 | | - .' loop=\'false\' quality=\'best\' wmode=\'transparent\' width=\''.$width.'\' height=\''.$height.'\''
|
483 | | - .' type=\'application\x-shockwave-flash\' ></embed>';
|
484 | | - } elseif ($type=='wrzuta') {
|
485 | | - $id = htmlspecialchars_decode($id);
|
486 | | - $id = preg_replace('/>/', '>', $id);
|
487 | | - $id = preg_replace('/</', "<", $id);
|
488 | | - $output.='<script type="text/javascript" src="http://www.wrzuta.pl/wrzuta_embed.js?wrzuta_key='.$id.'&wrzuta_width='.$width.'&wrzuta_height='.$height.'"></script>';
|
489 | | - } elseif ($type=='yahoovideo') {
|
490 | | - $output.='<object width="'.$width.'" height="'.$height.'">'
|
491 | | - .'<param name="movie" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.4" />'
|
492 | | - .'<param name="allowFullScreen" value="'.$allowfullscreen.'" />'
|
493 | | - .'<param name="flashVars" value="id='.$id.'&lang=en-us&intl=us&thumbUrl=&embed=1" />'
|
494 | | - .'<embed src="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.4" '
|
495 | | - .'type="application/x-shockwave-flash" width="'.$width.'" height="'.$height.'" '
|
496 | | - .'allowFullScreen="true" flashVars="id='.$id.'&lang=en-us&intl=us&thumbUrl=&embed=1" ';
|
497 | | - } elseif ($type == 'photobucket') {
|
498 | | - $output.='<embed width="'.$width.'" height="'.$height.'" type="application/x-shockwave-flash" '
|
499 | | - .'wmode="transparent" src="http://'.$id.'&sr=1">';
|
500 | | - } elseif ($type == 'uncutvideo') {
|
501 | | - $output.='<object width="'.$width.'" height="'.$height.'">'
|
502 | | - .'<param name="wmode" value="opaque" /><param name="movie" '
|
503 | | - .'value="http://uncutvideo.aol.com/v7.306/en-US/uc_videoplayer.swf" /><param name="FlashVars" '
|
504 | | - .'value="aID='.$id.'&site=http://uncutvideo.aol.com/"/>'
|
505 | | - .'<embed src="http://uncutvideo.aol.com/v7.306/en-US/uc_videoplayer.swf" wmode="opaque" '
|
506 | | - .'FlashVars="aID='.$id.'&site=http://uncutvideo.aol.com/" width="'.$width.'" height="'.$height.'" '
|
507 | | - .'type="application/x-shockwave-flash"';
|
508 | | - } elseif ($type == 'godtube' ) {
|
509 | | - $output.='<embed src="http://godtube.com/flvplayer.swf" FlashVars="viewkey='.$id.'" wmode="transparent" quality="high" '
|
510 | | - .'width="'.$width.'" height="'.$height.'" name="godtube" align="middle" allowScriptAccess="sameDomain" '
|
511 | | - .'type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>';
|
512 | | - } elseif ($type == 'glumbert') {
|
513 | | - $output.='<object width=\''.$width.'\' height=\''.$height.'\'><param name=\'movie\' '
|
514 | | - .'value=\'http://www.glumbert.com/embed/'.$id.'\'></param><param name=\'wmode\' value=\'opaque\'>'
|
515 | | - .'<param name=\'allowFullScreen\' value=\''.$allowfullscreen.'\' /></param><embed src=\'http://www.glumbert.com/embed/'.$id.'\' '
|
516 | | - .'type=\'application/x-shockwave-flash\' wmode=\'transparent\' allowFullScreen=\''.$allowfullscreen.'\' '
|
517 | | - .'width=\''.$width.'\' height=\''.$height.'\'></embed></object> ';
|
518 | | - } elseif ($type == 'livevideo') {
|
519 | | - $output.='<embed src="http://www.livevideo.com/flvplayer/embed/'.$id.'" '
|
520 | | - .'type="application/x-shockwave-flash" quality="high" WIDTH="'.$width.'" HEIGHT="'.$height.'" wmode="transparent"></embed>';
|
521 | | - } elseif ($type == 'youtube' || $type == 'youtube2') {
|
522 | | - $output.='<object width="'.$width.'" height="'.$height.'"><param name="movie" value="http://www.youtube.com/v/'.$id.'&hl='.$wgLanguageCode.'&fs=1">'
|
523 | | - .'</param><param name="allowFullScreen" value="'.$allowfullscreen.'"></param><embed '
|
524 | | - .'src="http://www.youtube.com/v/'.$id.'&hl='.$wgLanguageCode.'&fs=1" type="application/x-shockwave-flash" '
|
525 | | - .'allowfullscreen="'.$allowfullscreen.'" width="'.$width.'" height="'.$height.'"></embed></object>';
|
526 | | - } elseif ($type=='googlevideo') {
|
527 | | - $output.= '<embed id="VideoPlayback" src="http://video.google.com/googleplayer.swf?docid='.$id.'&hl='.$wgLanguageCode.'&fs=true" '
|
528 | | - .'style="width:'.$width.'px;height:'.$height.'px" allowFullScreen="'.$allowfullscreen.'" allowScriptAccess="always" '
|
529 | | - .'type="application/x-shockwave-flash"> </embed>';
|
530 | | - } elseif ($type=='myspace' || $type=='myspacetv') {
|
531 | | - $output.='<object width="'.$width.'px" height="'.$height.'px" ><param name="allowFullScreen" value="'.$allowfullscreen.'"/>'
|
532 | | - .'<param name="wmode" value="transparent"/><param name="movie" '
|
533 | | - .'value="http://mediaservices.myspace.com/services/media/embed.aspx/m='.$id.',t=1,mt=video,searchID=,'
|
534 | | - .'primarycolor=,secondarycolor="/><embed '
|
535 | | - .'src="http://mediaservices.myspace.com/services/media/embed.aspx/m='.$id.',t=1,mt=video,searchID=,'
|
536 | | - .'primarycolor=,secondarycolor=" width="'.$width.'" height="'.$height.'" allowFullScreen="'.$allowfullscreen.'" '
|
537 | | - .'type="application/x-shockwave-flash" wmode="transparent"/></object>';
|
538 | | - } elseif ($type=='myvideo') {
|
539 | | - $output.='<object style=\'width:'.$width.'px;height:'.$height.'px;\' type=\'application/x-shockwave-flash\' '
|
540 | | - .'data=\'http://www.myvideo.de/movie/'.$id.'\'> <param name=\'movie\' value=\'http://www.myvideo.de/movie/'.$id.'\' />'
|
541 | | - .'<param name=\'AllowFullscreen\' value=\''.$allowfullscreen.'\' /> </object>';
|
542 | | - } elseif ($type=='clipfish') {
|
543 | | - $output.='<object classid=\'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\' '
|
544 | | - .'codebase=\'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\' '
|
545 | | - .'width=\''.$width.'\' height=\''.$height.'\' id=\'player\' align=\'middle\'><param name=\'allowScriptAccess\' '
|
546 | | - .'value=\'always\' /><param name=\'movie\' value=\'http://www.clipfish.de/videoplayer.swf?as=0&vid='.$id.'&r=1\' />'
|
547 | | - .'<param name=\'quality\' value=\'high\' /><param name=\'bgcolor\' value=\'\#FF0000\' />'
|
548 | | - .'<param name=\'allowFullScreen\' value=\''.$allowfullscreen.'\' /><embed '
|
549 | | - .'src=\'http://www.clipfish.de/videoplayer.swf?as=0&videoid='.$id.'&r=1\' quality=\'high\' bgcolor=\'\#FF0000\' '
|
550 | | - .'width=\''.$width.'\' height=\''.$height.'\' name=\'player\' align=\'middle\' allowFullScreen=\''.$allowfullscreen.'\' '
|
551 | | - .'allowScriptAccess=\'always\' type=\'application/x-shockwave-flash\' '
|
552 | | - .'pluginspage=\'http://www.macromedia.com/go/getflashplayer\'></embed></object>';
|
553 | | - } else {
|
554 | | - $output.= '<object width="'.$width.'" height="'.$height.'">'
|
555 | | - .'<param name="movie" value="'.$url[$type].'"> <param name="allowfullscreen" value="'.$allowfullscreen.'" />'
|
556 | | - .'<param name="wmode" value="transparent"></param>'
|
557 | | - .'<embed src="'.$url[$type]
|
558 | | - .'" type="application/x-shockwave-flash" wmode="transparent"'
|
559 | | - .' width="'.$width.'" height="'.$height.'" allowfullscreen="'.$allowfullscreen.'"';
|
560 | | - if($type=='revver') {
|
561 | | - $output.='flashvars="mediaId='.$id.'&affiliateId=0"';
|
562 | | - }
|
563 | | - if($type=='gazeta') {
|
564 | | - $output.='FlashVars="m=http://serwisy.gazeta.pl/getDaneWideo?xx='.$id.'%26xxd=0&e=1&f=http://bi.gazeta.pl/im/"';
|
565 | | - }
|
566 | | - if($type=='funnyordie') {
|
567 | | - $output.='flashvars="key='.$id.'"';
|
568 | | - }
|
569 | | - if($type=='bbsports') {
|
570 | | - $output.='allowscriptaccess="always" flashvars="nid=.'.$id.'"';
|
571 | | - }
|
572 | | - if($type=='stickam') {
|
573 | | - $output.='scale="scale" allowScriptAccess="always"';
|
574 | | - }
|
575 | | - if($type=='comedycentral') {
|
576 | | - $output.='FlashVars="videoId='.$id.'" quality="high" bgcolor="#cccccc" name="comedy_central_player" align="middle" allownetworking="external"';
|
577 | | - }
|
578 | | - if($type=='spike') {
|
579 | | - $output.='flashvars="flvbaseclip='.$id.'&"';
|
580 | | - }
|
581 | | - if ($type != "interia" && $type != "znajomi" && $type != "youaretv" && $type != "youare" && $type != "wrzuta" && $type != 'brightcove') {
|
582 | | - $output.='></embed></object>';
|
583 | | - }
|
584 | | - }
|
585 | | - if (array_key_exists('desc', $args)) {
|
586 | | - $output.= '<div class="thumbcaption" align="left">';
|
587 | | - $desc2 = $parser->recursiveTagParse( $desc );
|
588 | | - $output.= $desc2.'</div>';
|
589 | | - }
|
590 | | - } else {
|
591 | | - global $wgFramedVideoError,$wgFramedVideoErrors,$wgFramedVideoErrorHeightRequired;
|
592 | | - global $wgFramedVideoErrorHeightRequiredNotOnlyWidth,$wgFramedVideoUnknownType,$wgFramedVideoErrorNoIdGiven;
|
593 | | - global $wgFramedVideoErrorWidthTooBig,$wgFramedVideoErrorHeightTooBig,$wgFramedVideoErrorLimitMaxWidth;
|
594 | | - global $wgFramedVideoErrorLimitMaxHeight,$wgFramedVideoErrorNoIntegerWidth,$wgFramedVideoErrorNoIntegerHeight;
|
595 | | - global $wgFramedVideoErrorFullSizeNotAllowed,$wgFramedVideoHeightAndWidthRequired,$wgFramedVideoErrorNoIntegerWidth;
|
596 | | - global $wgFramedVideoErrorSeeHelp;
|
597 | | - $output.= '<div class="thumbcaption" align="left">';
|
598 | | - wfLoadExtensionMessages('FramedVideo');
|
599 | | - $errors = array_sum($errorid);
|
600 | | - if ($errors == 1) {
|
601 | | - if ( !isset($wgFramedVideoError) ) { $wgFramedVideoError = wfMsg( 'framedvideo_error' ); }
|
602 | | - } else {
|
603 | | - if ( !isset($wgFramedVideoErrors) ) { $wgFramedVideoErrors = wfMsg( 'framedvideo_errors' ); }
|
604 | | - }
|
605 | | - if (array_key_exists(4, $errorid)) {
|
606 | | - if ( !isset($wgFramedVideoErrorNoIdGiven) ) {
|
607 | | - $wgFramedVideoErrorNoIdGiven = wfMsg( 'framedvideo_error_no_id_given' );
|
608 | | - }
|
609 | | - }
|
610 | | - if (array_key_exists(5, $errorid)) {
|
611 | | - if ( !isset($wgFramedVideoErrorWidthTooBig) ) {
|
612 | | - $wgFramedVideoErrorWidthTooBig = wfMsg( 'framedvideo_error_width_too_big' );
|
613 | | - }
|
614 | | - if ( !isset($wgFramedVideoErrorLimitMaxWidth) ) {
|
615 | | - $wgFramedVideoErrorLimitMaxWidth = wfMsg( 'framedvideo_error_limit', $maxwidth );
|
616 | | - }
|
617 | | - }
|
618 | | - if (array_key_exists(6, $errorid)) {
|
619 | | - if ( !isset($wgFramedVideoErrorHeightTooBig) ) {
|
620 | | - $wgFramedVideoErrorHeightTooBig = wfMsg( 'framedvideo_error_height_too_big' );
|
621 | | - }
|
622 | | - if ( !isset($wgFramedVideoErrorLimitMaxHeight) ) {
|
623 | | - $wgFramedVideoErrorLimitMaxHeight = wfMsg( 'framedvideo_error_limit', $maxheight );
|
624 | | - }
|
625 | | - }
|
626 | | - if (array_key_exists(7, $errorid)) {
|
627 | | - if ( !isset($wgFramedVideoErrorNoIntegerWidth) ) {
|
628 | | - $wgFramedVideoErrorNoIntegerWidth = wfMsg( 'framedvideo_error_no_integer', 'width' );
|
629 | | - }
|
630 | | - }
|
631 | | - if (array_key_exists(8, $errorid)) {
|
632 | | - if ( !isset($wgFramedVideoErrorNoIntegerHeight) ) {
|
633 | | - $wgFramedVideoErrorNoIntegerHeight = wfMsg( 'framedvideo_error_no_integer', 'height' );
|
634 | | - }
|
635 | | - }
|
636 | | - if (array_key_exists(9, $errorid)) { $output.= '<br />'.wfMsg( 'framedvideo_error_full_size_not_allowed', $type ); }
|
637 | | - if (array_key_exists(10, $errorid)) { $output.= '<br />'.wfMsg( 'framedvideo_error_height_and_width_required', $type ); }
|
638 | | - if (array_key_exists(11, $errorid)) {
|
639 | | - if ( !isset($wgFramedVideoErrorNoIntegerWidth2) ) {
|
640 | | - $wgFramedVideoErrorNoIntegerWidth2 = wfMsg( 'framedvideo_error_no_integer', 'width2' );
|
641 | | - }
|
642 | | - }
|
643 | | - if ( !isset($wgFramedVideoErrorSeeHelp) ) {
|
644 | | - $wgFramedVideoErrorSeeHelp = wfMsg( 'framedvideo_error_see_help' );
|
645 | | - }
|
646 | | - $errors = array_sum($errorid);
|
647 | | - if ($errors == 1) {
|
648 | | - $output.= $wgFramedVideoError;
|
649 | | - } else {
|
650 | | - $output.= $wgFramedVideoErrors;
|
651 | | - }
|
652 | | - if (array_key_exists(1, $errorid)) { $output.= '<br />'.wfMsg( 'framedvideo_error_height_required', $type ); }
|
653 | | - if (array_key_exists(2, $errorid)) { $output.= '<br />'.wfMsg( 'framedvideo_error_height_required_not_only_width', $type ); }
|
654 | | - if (array_key_exists(3, $errorid)) { $output.= '<br />'.wfMsg( 'framedvideo_error_unknown_type', $type2 ); }
|
655 | | - if (array_key_exists(4, $errorid)) { $output.= '<br />'.$wgFramedVideoErrorNoIdGiven; }
|
656 | | - if (array_key_exists(5, $errorid)) {
|
657 | | - $output.= '<br />'.$wgFramedVideoErrorWidthTooBig;
|
658 | | - $output.= ' '.$wgFramedVideoErrorLimitMaxWidth;
|
659 | | - }
|
660 | | - if (array_key_exists(6, $errorid)) {
|
661 | | - $output.= '<br />'.$wgFramedVideoErrorHeightTooBig;
|
662 | | - $output.= ' '.$wgFramedVideoErrorLimitMaxHeight;
|
663 | | - }
|
664 | | - if (array_key_exists(7, $errorid)) { $output.= '<br />'.$wgFramedVideoErrorNoIntegerWidth; }
|
665 | | - if (array_key_exists(8, $errorid)) { $output.= '<br />'.$wgFramedVideoErrorNoIntegerHeight; }
|
666 | | - if (array_key_exists(9, $errorid)) { $output.= '<br />'.wfMsg( 'framedvideo_error_full_size_not_allowed', $type ); }
|
667 | | - if (array_key_exists(10, $errorid)) { $output.= '<br />'.wfMsg( 'framedvideo_error_height_and_width_required', $type ); }
|
668 | | - if (array_key_exists(11, $errorid)) { $output.= '<br />'.$wgFramedVideoErrorNoIntegerWidth2; }
|
669 | | - $output.='<br />'.$parser->recursiveTagParse($wgFramedVideoErrorSeeHelp).'</div>';
|
670 | | - }
|
671 | | - if ($position == null) {
|
672 | | - $output.= '</div></div>';
|
673 | | - }
|
674 | | - if ($position != null && $frame == true) {
|
675 | | - if ($position == "center") {
|
676 | | - $output.= '</div></div></div>';
|
677 | | - } elseif ($position == "left") {
|
678 | | - $output.= '</div></div>';
|
679 | | - } else {
|
680 | | - $output.= '</div></div>';
|
681 | | - }
|
682 | | - }
|
683 | | - if ($position != null && $frame == false) {
|
684 | | - if ($position == "center") {
|
685 | | - $output.= '</span></div></div>';
|
686 | | - } elseif ($position == "left") {
|
687 | | - $output.= '</span></div>';
|
688 | | - } else {
|
689 | | - $output.= '</span></div>';
|
690 | | - }
|
691 | | - }
|
692 | | - return $output;
|
| 43 | + $wgParser->setHook( 'video', 'FramedVideo::renderFramedVideo' );
|
693 | 44 | }
|
694 | | -
|
695 | | -function trueOrFalse ($input) {
|
696 | | - if ($input == "true") { $output = true; }
|
697 | | - if ($input == "false") { $output = false; }
|
698 | | - return $output;
|
699 | | -}
|