"afe-flash",
"css_id" => "afe-swf-",
"count" => 1,
"swfs" => array()
);
$afe = (object)$afe;
}
}
/**
* AFE function to initiate the help page
* @param null
* @return void
**/
if(!function_exists("afe_help_page_layout")){
function afe_help_page_layout()
{
?>
Anywhere Flash Embed Help page
-
Upload the anywhere-flash-embed page to plugin directory.
- Go to plugin dashboard and click on activate.
- To embed flash anywhere in page or post just post in editor something in the following format.
[swf src=\"http://www.example.com/my-flash-file.swf\" width=300 height=100]
\n";
echo "//swfs as $swf){
echo "swfobject.embedSWF(\"" . $swf->src . "\", \"" . $swf->replace_id . "\", \"" . $swf->width . "\", \"" . $swf->height . "\", \"" . $swf->version . "\", false, " . ( $swf->flashvars ? json_encode($swf->flashvars) : "false" ) . ", " . ( $swf->params ? json_encode($swf->params) : "false" ) . ");\n";
}
echo "//]]>\n";
echo "";
}
add_action("wp_footer", "afe_wp_footer");
/**
* AFE function to create the shortcode
* @param null
* @return void
**/
if(!function_exists('afe_shortcode')){
function afe_shortcode($atts, $content = false){
global $afe;
$args = shortcode_atts(array(
"src" => false,
"width" => false,
"height" => false,
"flashvars" => false,
"params" => false,
"version" => "9"
), $atts);
extract($args);
if(!$src || !$width || !$height)
return "";
if($params) $args["params"] = wp_parse_args(html_entity_decode($params), false);
if($flashvars) $args["flashvars"] = wp_parse_args(html_entity_decode($flashvars), false);
$id = $afe->css_id . $afe->count;
$afe->swfs[] = (object)array_merge($args, array(
"replace_id" => $id
));
$afe->count++;
return "css_class . "\">" . ($content ? $content : "") . "
";
}
}
add_shortcode("swf", "afe_shortcode");
?>