// -------------------- // Snippet: InsertFlash // -------------------- // Version: 0.6b // Date: 2004.12.20 // [email protected] // // This snippet was designed as an easy means to insert Flash // movies. This is particularly useful if you have a multitude of swf // files sharing the same dimensions, in a common folder, etc. // Config // $baseFolder [ string ] // The base FOLDER where all swf files are held. You can just leave // this as "/" if you want to declare the site root. $baseFolder = 'flash/'; // $swf [ string ] // Set ONLY in snippet call. This is the tail end of the file path // to your swf file. For example, if you have a file // assets/flash/2004/promo.swf // and your $baseFolder is "assets/flash/" then you would call the // snippet like so: // [[InsertFlash?swf=2004/promo.swf]] // $height, $width [ int ] // If you have a standard height and width to use, declare so here. // These can be overridden in the snippet call for different cases // using h and w: // [[InsertFlash?swf=2004/promo.swf&h=300&w=400]] $height = '300'; $width = '354'; // $includePluginLink [ true | false ] // Toggle to include (or not) a "get Flash" plugin link. This will // appear directly under the flash movie. Override in snippet call // with plugin=0 (false) or plugin=1 (true). $includePluginLink = true; // ############ // End config # // ############ // Get variables $height = (isset($h))? $h : $height ; $width = (isset($w))? $w : $width ; $includePluginLink = (isset($plugin))? $plugin : $includePluginLink ; $newline = "\n"; // Make sure a movie is selected and valid if (isset($swf)){ $output = ''; $output .= '<object height="'.$height.'" width="'.$width.'" '; $output .= 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" '; $output .= 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">'.$newline; $output .= '<param value="'.$baseFolder.$swf.'" name="movie" />'.$newline; $output .= '<param value="high" name="quality" />'.$newline; $output .= '<embed height="'.$height.'" width="'.$width.'" type="application/x-shockwave-flash" '; $output .= 'pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" '; $output .= 'quality="high" src="'.$baseFolder.$swf.'" />'.$newline; $output .= '</object>'.$newline; if ($includePluginLink){ $output .= '<a href="http://www.macromedia.com/go/getflashplayer" target="_blank" class="IF_flashPlugin">'; $output .= '<img border="0" src="http://www.macromedia.com/images/shared/download_buttons/get_flash_player.gif" /></a>'; } return $output; } else { return false; }