youtube Addon

#CMSimple $output=cms_youtube('video_id');#

 
#######################
#
#  Youtube Addon V0.1
#
# very easy function...
#
#######################
#
##--[OPEN]-------------
#
 
/cmsimple/functions.php
 
#
#--[FIND]--------------
# last Line
 
?>
 
#
#--[Before ADD]---------
#
 
// UTAKA'S Functions ver0.1
// Use within content
// http://www.youtube.com/watch?v=video_id
// #CMSimple $output=cms_youtube('video_id');#
//
function cms_youtube($vid) {
   global $u, $c, $s;
    $out='<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/';
    $out.=$vid;
    $out.='&hl=en&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/';
    $out.=$vid;
    $out.='&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>';
 
   return preg_replace("/".chr(35)."CMSimple.*".chr(35)."/Uis",$out,$c[$s]);
}
 
###############

Demo&Sample

back to addons

Discussion

Micha, 2009/07/21 12:56

i really like this addon, but i only can put one video on a page. is there a way to get different video on a page?

dies ist ein schönes addon, aber wenn ich mehrere verschiedene videos auf einer seite zeigen möchte erhalte ich mehrmals das gleiche video. gibt es einen weg das dies doch möglich ist?

addons/youtube.txt · Last modified: 2009/12/03 18:55 (external edit)
Webdesign: NMuD chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0