Source for file data.youtube.php
Documentation is available at data.youtube.php
* @subpackage plugins_data
define( 'PLUGIN_GUID_DATAYOUTUBE', 'datayoutube' );
'auto_activate' => FALSE,
'requires_pair' => FALSE,
'load_function' => 'data_youtube',
'help_page' => 'DataPluginYoutube',
'description' => tra( "This plugin allows you to simply and safely insert a YouTube video in a page." ),
'help_function' => 'data_youtube_help',
'syntax' => "{youtube id=}",
* @return HTML help in a table
'<table class="data help">'
. '<th>' . tra( "Key" ) . '</th>'
. '<th>' . tra( "Type" ) . '</th>'
. '<th>' . tra( "Comments" ) . '</th>'
. '<td>' . tra( "string" ) . '<br />' . tra("(required)") . '</td>'
. '<td>' . tra( "ID nr of the Youtube video. You can get this from the URL of the Youtube video you are watching e.g.: pShf2VuAu_Q" ) . '</td>'
. '<td>' . tra( "numeric" ) . '<br />' . tra( "(optional)" ) . '</td>'
. '<td>' . tra( "Alternate width of the youtube box in pixels." ) . '</td>'
. '<td>' . tra( "numeric" ) . '<br />' . tra("(optional)") . '</td>'
. '<td>' . tra( "Alternate height of the youtube box in pixels." ) . '</td>'
. '<td>' . tra( "string" ) . '<br />' . tra("(optional)") . '</td>'
. '<td>' . tra( "Alternate language of the Youtube interface, default is 'en'" ). '</td>'
. '<td>' . tra( "numeric" ) . '<br />' . tra("(optional)") . '</td>'
. '<td>' . tra( "Fetch different video format instead of the default one. Format 6 and Format 18 seem to work quite well for some videos. Please note that this might be buggy and is not available for all videos." ). '</td>'
. tra( "Example: " ) . '{youtube id=XXXXX width=425 height=355 lang=en}';
* @return TRUE on success, FALSE on failure - mErrors will contain reason for failure
$width = ( !empty( $width ) ? $width : "425" );
$height = ( !empty( $height ) ? $height : "355" );
$lang = "&hl=". ( !empty( $lang ) ? $lang : "en" );
$format = ( !empty( $format ) ? "&ap=%2526fmt%3D". $format : "" );
return '<!--~np~--><object width="'. $width. '" height="'. $height. '"><param name="movie" value="http://www.youtube.com/v/'. $id. $lang. $format. '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/'. $id. $lang. $format. '" type="application/x-shockwave-flash" wmode="transparent" width="'. $width. '" height="'. $height. '""></embed></object><!--~/np~-->';
return tra( 'No ID given' );
|