0, // number of 3D Banner FX embeds 'read_settings_from_url' => false, // true only when the settings XML file must be read via HTTP (is generated dynamically or is hosted on another domain) ); /* end global parameters */ /* start client side functions */ function bannerfx_get_embed_code($bannerfx_attributes) { global $bannerfx_params; $bannerfx_params['count']++; $plugin_dir = get_option('bannerfx_path'); if ($plugin_dir === false) { $plugin_dir = 'flashxml/3d-banner-fx'; } $plugin_dir = trim($plugin_dir, '/'); $settings_file_name = !empty($bannerfx_attributes[2]) ? html_entity_decode(urldecode($bannerfx_attributes[2])) : 'settings.xml'; $settings_wp_content_prefix = $bannerfx_params['read_settings_from_url'] && strtolower(ini_get('allow_url_fopen')) == 'on' || strtolower(ini_get('allow_url_fopen')) == '1' ? WP_CONTENT_URL : WP_CONTENT_DIR; $settings_path = "{$settings_wp_content_prefix}/{$plugin_dir}/{$settings_file_name}"; $width = $height = 0; if (function_exists('simplexml_load_file') && ($settings_wp_content_prefix == WP_CONTENT_URL || $settings_wp_content_prefix == WP_CONTENT_DIR && file_exists($settings_path))) { $data = simplexml_load_file($settings_path); if ($data) { $width_attributes_array = $data->General_Properties->componentWidth->attributes(); $width = !empty($width_attributes_array) ? (int)$width_attributes_array['value'] : 0; $height_attributes_array = $data->General_Properties->componentHeight->attributes(); $height = !empty($height_attributes_array) ? (int)$height_attributes_array['value'] : 0; } } if (!($width > 0 && $height > 0)) { if ((int)$bannerfx_attributes[4] > 0 && (int)$bannerfx_attributes[6] > 0) { $width = (int)$bannerfx_attributes[4]; $height = (int)$bannerfx_attributes[6]; } else { return ''; } } $swf_embed = array( 'width' => $width, 'height' => $height, 'text' => isset($bannerfx_attributes[7]) ? trim($bannerfx_attributes[7]) : '', 'component_path' => WP_CONTENT_URL . "/{$plugin_dir}/", 'swf_name' => '3DBannerFX.swf', ); $swf_embed['swf_path'] = $swf_embed['component_path'].$swf_embed['swf_name']; if (!is_feed()) { $embed_code = '
'; $embed_code .= ''; } else { $embed_code = '