zyx_Hixie_flash: Source code

By the Web Warlock, Thursday, 27/May/2010 3:49

<?php function zyx_Hixie_flash( $src , $width = '100%' , $height = '100%' , $args = NULL ,
	$id = 'flash_movie' , $alt = __( 'Alternative content' , 'zyx-analog-clock' ) ){
/* adds the tags for a flash embedded with the Hixie method */
/*
classid (outer object element only, value is always clsid:D27CDB6E-AE6D-11cf-96B8-444553540000)
type (inner object element only, value is always application/x-shockwave-flash)
data (inner object element only, defines the URL of a SWF)
width (both object elements, defines the width of a SWF)
height (both object elements, defines the height of a SWF)
*/
	$params = '';
	foreach( $args as $param => $param_val ){
		$params .= "\t" . '<param name="' . esc_attr( $param ) . '"';
		$params .= ' value="' . esc_attr( $param_val ) . '" />' . "\n";
	};
	$tag = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
	$tag .= ' width="' . $width . '" height="' . $height . '"' . ' id="' . $id . '" >' . "\n";
	$tag .= "\t" . '<param name="movie" value="' . esc_url( $src ) .'" />'."\n";
	$tag .= $params;
	$tag .= "\t" . '<!--[if !IE]>-->' . "\n";
	$tag .= "\t" . '<object type="application/x-shockwave-flash" ';
	$tag .= ' id="' . $id . '"';
	$tag .= ' data="' . esc_url( $src ) . '" width="' . $width . '" height="' . $height . '" >' . "\n";
	$tag .= $params;
	$tag .= "\t" . '<!--<![endif]-->' . "\n";
	if( $alt ) $tag .= "\t" . $alt . "\n";
	$tag .= "\t" . '<!--[if !IE]>-->' . "\n";
	$tag .= "\t" . '</object>' . "\n";
	$tag .= "\t" . '<!--<![endif]-->' . "\n";
	$tag .= "\t" . '</object>'."\n";
	return $tag;
}; ?>

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment