. */ // check for WP context if ( !defined('ABSPATH') ){ die(); } //initially set the options function wp_3dwall_install () { $newoptions = get_option('wp3dwall_options'); $newoptions['width'] = '800'; $newoptions['height'] = '600'; $newoptions['media'] = 'Picture Path'; $newoptions['tcolor'] = 'ffffff'; $newoptions['tcolor2'] = '333333'; $newoptions['bgcolor'] = '0097AA'; $newoptions['trans'] = 'false'; $newoptions['rsspath'] = 'Flash'; add_option('wp3dwall_options', $newoptions); // widget options $widgetoptions = get_option('wp3dwall_widget'); $newoptions['width'] = '800'; $newoptions['height'] = '600'; $newoptions['media'] = 'Picture Path'; $newoptions['tcolor'] = '333333'; $newoptions['tcolor2'] = '333333'; $newoptions['bgcolor'] = 'ffffff'; $newoptions['trans'] = 'false'; $newoptions['rsspath'] = 'Flash'; add_option('wp3dwall_widget', $newoptions); } // add the admin page function wp_3dwall_add_pages() { add_options_page('WP 3D Twitter Wall', 'WP 3D Twitter Wall', 8, __FILE__, 'wp_3dtwitterwall_options'); } // replace tag in content with tag cloud (non-shortcode version for WP 2.3.x) function wp_3dwall_init($content){ if( strpos($content, '[WP-3DWALL]') === false ){ return $content; } else { $code = wp_3dwall_createflashcode(false); $content = str_replace( '[WP-3DWALL]', $code, $content ); return $content; } } // template function function wp_3dwall_insert( $atts=NULL ){ echo wp_3dwall_createflashcode( false, $atts ); } // shortcode function function wp_3dwall_shortcode( $atts=NULL ){ return wp_3dwall_createflashcode( false, $atts ); } // piece together the flash code function wp_3dwall_createflashcode( $widget=false, $atts=NULL ){ // get the options if( $widget == true ){ $options = get_option('wp3dwall_widget'); $soname = "widget_so"; $divname = "wp3dwallwidgetcontent"; // get compatibility mode variable from the main options $mainoptions = get_option('wp3dwall_options'); } else if( $atts != NULL ){ $options = shortcode_atts( get_option('wp3dwall_options'), $atts ); $soname = "shortcode_so"; $divname = "wp3dwallcontent"; } else { $options = get_option('wp3dwall_options'); $soname = "so"; $divname = "wp3dwallcontent"; } // get some paths if( function_exists('plugins_url') ){ // 2.6 or better $movie = plugins_url('3d-twitter-wall/T3Dwall.swf'); $path = plugins_url('3d-twitter-wall/'); } else { // pre 2.6 $movie = get_bloginfo('wpurl') . "/wp-content/plugins/3d-twitter-wall/T3Dwall.swf"; $path = get_bloginfo('wpurl')."/wp-content/plugins/3d-twitter-wall/"; } // add random seeds to so name and movie url to avoid collisions and force reloading (needed for IE) $soname .= rand(0,9999999); $movie .= '?r=' . rand(0,9999999); $divname .= rand(0,9999999); // write flash tag if( $options['compmode']!='true' ){ $flashtag = ''; $flashtag .= ''; $flashtag .= '
WP 3D-Twitter-Wall by Joerg Sontag Flashapplications requires Flash Player 10 or better.