. */ // 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 .= '
'; $flashtag .= '

WP 3D-Twitter-Wall by Joerg Sontag Flashapplications requires Flash Player 10 or better.

'; $flashtag .= ''; } else { $flashtag = ''; $flashtag .= ''; $flashtag .= ''; $flashtag .= ''; $flashtag .= ''; if( $options['trans'] == 'true' ){ $flashtag .= ''; } $flashtag .= ''; // alternate content $flashtag .= '

WP 3D-Twitter-Wall by Joerg Sontag Flashapplications requires Flash Player 10 or better.

'; $flashtag .= '
'; } return $flashtag; } // options page function wp_3dtwitterwall_options() { $options = $newoptions = get_option('wp3dwall_options'); // if submitted, process results if ( $_POST["wp3dwall_submit"] ) { $newoptions['width'] = strip_tags(stripslashes($_POST["width"])); $newoptions['height'] = strip_tags(stripslashes($_POST["height"])); $newoptions['tcolor'] = strip_tags(stripslashes($_POST["tcolor"])); $newoptions['tcolor2'] = strip_tags(stripslashes($_POST["tcolor2"])); $newoptions['bgcolor'] = strip_tags(stripslashes($_POST["bgcolor"])); $newoptions['trans'] = strip_tags(stripslashes($_POST["trans"])); $newoptions['rsspath'] = strip_tags(stripslashes($_POST["rsspath"])); $newoptions['media'] = strip_tags(stripslashes($_POST["media"])); } // any changes? save! if ( $options != $newoptions ) { $options = $newoptions; update_option('wp3dwall_options', $options); } // options form echo '
'; echo "

Display options

"; echo ''; // width echo ''; echo ''; // height echo ''; echo ''; // text color echo ''; echo ''; // background color echo ''; echo ''; // transparent echo ''; echo ''; // RSS Path echo ''; echo ''; echo ''; echo ''; echo ''; echo '
SWF Width (min. 520)
SWF Height (min. 550)
Color of the 3DCube Text Color:
These should be 6 character hex color values without the # prefix (000000 for black, ffffff for white)
Background color
6 character hex color value
Use transparent Mode
Switches on Flash\'s wmode-transparent setting
Your Wall Hash Tag (example:Flash)
Background Picture URL
'; echo '

'; echo "
"; echo '
'; } //uninstall all options function wp_3dwall_uninstall () { delete_option('3dwall_options'); delete_option('3dwall_widget'); } // widget function widget_init_wp_3dwall_widget() { // Check for required functions if (!function_exists('register_sidebar_widget')) return; function wp_3dwall_widget($args){ extract($args); $options = get_option('wp3dwall_widget'); ?>