Electric Tree House (bottom of the right sidebar) to try it out yourself. See Plugin website for more details and customization options. Version: 2.2 Author: Eric Burger Author URI: http://electrictreehouse.com/ */ class Asteroids_Widget extends WP_Widget { function Asteroids_Widget() { $widget_ops = array('classname' => 'widget_asteroids', 'description' => __('Play Asteroids and Blow Stuff Up')); $control_ops = array('width' => 500, 'height' => 350); $this->WP_Widget('asteroids', __('Asteroids Widget'), $widget_ops, $control_ops); } function widget( $args, $options ) { extract($args); $title = apply_filters( 'widget_title', empty($options['title']) ? '' : $options['title'], $options ); $text = apply_filters( 'widget_asteroids', $options['text'], $options ); $plugin_dir = basename(dirname(__FILE__)); $bloginfo = home_url(); $linkAsteroids = ''. $bloginfo . '/wp-content/plugins/' . $plugin_dir . '/gears/play-asteroids.min.js'; $yellow = ''. $bloginfo . '/wp-content/plugins/' . $plugin_dir . '/gears/play-asteroids-yellow.min.js'; /* Set Image Locations */ $mainimage = ''. $bloginfo . '/wp-content/plugins/' . $plugin_dir . '/gears/asteroids-image.jpg'; $rocketimage = ''. $bloginfo . '/wp-content/plugins/' . $plugin_dir . '/gears/asteroids-rocket.png'; $nohoverimage = ''. $bloginfo . '/wp-content/plugins/' . $plugin_dir . '/gears/asteroids.jpg'; $hoverimage = ''. $bloginfo . '/wp-content/plugins/' . $plugin_dir . '/gears/asteroids-hover.jpg'; $show = $options['show']; $slug = $options['slug']; $buttonopt = $options['button-opt']; $imageopt = $options['image-opt']; switch ($show) { case "all": echo $before_widget; if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?>'.$text); ?>
'.$text); ?> '.$text); ?> '.$text); ?> '.$text); $text = ob_get_contents(); ob_end_clean(); ?> '', 'text' => '' ) ); $title = strip_tags($options['title']); $text = format_to_edit($options['text']); switch ($options['button-opt']) { case "text 1": $text1Selected = true; break; case "push 1": $push1Selected = true; break; case "push 2": $push2Selected = true; break; } switch ($options['image-opt']) { case "image 1": $image1Selected = true; break; case "image 2": $image2Selected = true; break; case "image 3": $image3Selected = true; break; } $allSelected = $frontSelected = $postSelected = $postInCategorySelected = $pageSelected = $categorySelected = false; switch ($options['show']) { case "all": $allSelected = true; break; case "": $allSelected = true; break; case "front": $frontSelected = true; break; case "post": $postSelected = true; break; case "page": $pageSelected = true; break; case "category": $categorySelected = true; break; } ?>
Add a description so people know what they are clicking on. Add directions like: fly with the arrow keys and shoot with spacebar. Or add html/php code to include a picture. All PHP code must be enclosed in the standard < ?php and ?> tags for it to be recognized. See Read Me for more editing options.
/> />
/>
/>
Though Erik and I are upstanding young people, have put a lot of time and work into this widget, and would appreciate the link, you can use the "Page(s)" option to disable the link.
In Post In Category add one or more cat. IDs (not Slug or Title) comma separated!
" ?> " name="play-asteroid-submit-" value="1" />