Extension:YouTube (emijrp)

A modification of original Extension:YouTube (Iubito).



Code
xYHsaDDSF
 * 13) for a window of 100x100
 * 14) Align:
 * 15) xYHsaDDSF
 * 16) for a window of 100x100 on the right
 * 17) Other aligns: left
 * 18) Enjoy !
 * 1) Enjoy !

$wgExtensionFunctions[] = 'wfYouTube'; $wgExtensionCredits['parserhook'][] = array(		'name' => 'YouTube',		'description' => 'Display YouTube video',		'author' => 'Sylvain Machefert & emijrp',		'url' => 'http://www.mediawiki.org/wiki/Extension:YouTube_%28emijrp%29' );

function wfYouTube { global $wgParser; $wgParser->setHook('youtube', 'renderYouTube'); }

function renderYouTube($input, $argv) { //$input = "WZpeeRSk-0A" if ($argv['align']!='left' and $argv['align']!='right') {			$align = 'right'; }else{ $align = $argv['align']; }		if ($argv['size']) {			switch($argv['size']) {				case 'small': $width = 210; $height = 175; break; case 'medium': $width = 330; $height = 260; break; case 'normal': $width = 425; $height = 350; break; case 'big': $width = 640; $height = 525; break; default: $width = 425; $height = 350; break; }		}else{ if ($argv['width']) $width = $argv['width']; else $width = 425; if ($argv['height']) $height = $argv['height']; else $height = 350; }
 * 1) The callback function for converting the input text to HTML output

//Validate the video ID		if (preg_match('%[^A-Za-z0-9_\\-]%',$params['video'])) { return 'YouTube : bad video ID !'; }

$output='' .'' .'  ' .' ';

return $output; } ?>