Processing ...

Processing ...

Auto Embed Flash Movie XHTML

Written by : Gerrit van Weele , 2013-05-13


This function lets you auto embed Flash movie in your PHP applications.
It will read the Height and Width size of Flash movie.

Function Input Parameters:
function VISION_TO_FLASH (

$file_name = 'default.swf', // path to your FLASH movie
$movie_id = 'vision_to_cms', // the ID of flash movie if you embed more than one on same page
$width = '250', //default width
$height = '250', //default height
$bgcolor = '#fefefe', //background color
$wmode = 'transparent', //mode default transparent
$use_bg = false, //set to true if you want to use background image
$bg_img = '',// if you want to add background image to your div
$flash_param = '' // additional movie parameters

)
The functions:
function VISION_TO_FLASH ($file_name = '', $movie_id = 'vision_to_cms', $width = '250', $height = '250', $bgcolor = '#fefefe', $wmode = 'transparent', $use_bg = false, $bg_img = '',$flash_param = '')
{
// Copyright by www.vision.to
// Author: Femi Hasani
// please leave credits above for free use.

if (file_exists($file_name))
{
if ($width == 250 && $height == 250)
{

@list($width, $height, $type, $attr) = getimagesize($file_name);
//$height= $height+40;
}
$width2 = $width . "px";
$height2 = $height . "px";
$flash_movie = "";
$flash_movie .= "
";
if ($use_bg == true) {
$flash_movie .= "
n";
}
$flash_movie .= " nn";
$flash_movie .= "n";
$flash_movie .= "n";
$flash_movie .= "n";
$flash_movie .= "n";
$flash_movie .= "n";
$flash_movie .= "Get Flash Player";
$flash_movie .= "n";
if ($use_bg == true) {
$flash_movie .= "
n";
}
$flash_movie .= "
n";

return $flash_movie;
} else {
return " Vision.To CMS :Error :Flash Movie: " . $file_name . " Not Found! ";
}

}

// =======================================================================================================
// part of VISION_TO_DISPLAY Class
//
// =======================================================================================================
function VISION_TO_FLASH_JS ($file_name = 'media/website.swf', $width = '250', $height = '250', $movie_id='vision_to_accordion', $bgcolor = '#fefefe', $wmode = 'transparent', $use_bg = false, $bg_img = '',$flash_param = '',$so = "feha")
{
// Copyright by www.vision.to
// Author: Femi Hasani
// please leave credits above for free use.

if (file_exists($file_name))
{
if ($width == 250 && $height == 250)
{

@list($width, $height, $type, $attr) = getimagesize($file_name);
//$height= $height+40;
}
$width2 = $width . "px";
$height2 = $height . "px";
$flash_movie = "";
$flash_movie .="n";
$flash_movie .= "
n";
if ($use_bg == true) {
$flash_movie .= "
n";
}
$flash_movie .= "
n";
// $flash_movie .= "
Your browser does not have Latest Version of Flash Player installed. Click here to download the latest version of the Flash Player. If you believe this is an error, click here to bypass detection.
n";
$flash_movie .= "
n";
$flash_movie .= "n";
if ($use_bg == true) {
$flash_movie .= "
n";

}
$flash_movie .= "
n";

return $flash_movie;
} else {
return "";
}

}

This can be useful if you have many file names in your DB and want to create a Flash Movies Gallery or You get tired of writing XHTML for each of your movie you want to embed.