No posts.
No posts.
. */ //initially set the options function wp_cumulus_install () { $newoptions = get_option('wpcumulus_options'); $newoptions['width'] = '550'; $newoptions['height'] = '375'; $newoptions['tcolor'] = 'ffffff'; $newoptions['tcolor2'] = 'ffffff'; $newoptions['hicolor'] = 'ffffff'; $newoptions['bgcolor'] = '333333'; $newoptions['speed'] = '100'; $newoptions['trans'] = 'false'; $newoptions['distr'] = 'false'; $newoptions['args'] = ''; $newoptions['mode'] = 'tags'; add_option('wpcumulus_options', $newoptions); // widget options $widgetoptions = get_option('wpcumulus_widget'); $newoptions['width'] = '160'; $newoptions['height'] = '160'; $newoptions['tcolor'] = '333333'; $newoptions['tcolor2'] = '333333'; $newoptions['hicolor'] = '000000'; $newoptions['bgcolor'] = 'ffffff'; $newoptions['speed'] = '100'; $newoptions['trans'] = 'false'; $newoptions['distr'] = 'false'; $newoptions['args'] = ''; $newoptions['mode'] = 'tags'; add_option('wpcumulus_widget', $newoptions); } // add the admin page function wp_cumulus_add_pages() { add_options_page('WP Cumulus', 'WP Cumulus', 8, __FILE__, 'wp_cumulus_options'); } // replace tag in content with tag cloud function wp_cumulus_init($content){ if( strpos($content, '[WP-CUMULUS]') === false ){ return $content; } else { $code = wp_cumulus_createflashcode(false); $content = str_replace( '[WP-CUMULUS]', $code, $content ); return $content; } } // template function function wp_cumulus_insert(){ echo wp_cumulus_createflashcode(false); } // piece together the flash code function wp_cumulus_createflashcode($widget){ // get the options if( $widget != true ){ $options = get_option('wpcumulus_options'); $soname = "so"; $divname = "wpcumuluscontent"; } else { $options = get_option('wpcumulus_widget'); $soname = "widget_so"; $divname = "wpcumuluswidgetcontent"; } // get the tag cloud... if( $options['mode'] != "cats" ){ ob_start(); wp_tag_cloud( $options['args'] ); $tagcloud = urlencode( str_replace( " ", " ", ob_get_clean() ) ); } // get categories if( $options['mode'] != "tags" ){ ob_start(); wp_list_categories('title_li=&show_count=1&hierarchical=0&style=none'); $cats = urlencode( ob_get_clean() ); } // get some paths if( function_exists('plugins_url') ){ // 2.6 or better $movie = plugins_url('wp-cumulus/tagcloud.swf'); $path = plugins_url('wp-cumulus/'); } else { // pre 2.6 $movie = get_bloginfo('wpurl') . "/wp-content/plugins/wp-cumulus/tagcloud.swf"; $path = get_bloginfo('wpurl')."/wp-content/plugins/wp-cumulus/"; } // write flash tag $flashtag = ''; $flashtag .= ''; $flashtag .= '

'; // alternate content if( $options['mode'] != "cats" ){ $flashtag .= urldecode($tagcloud); } if( $options['mode'] != "tags" ){ $flashtag .= urldecode($cats); } $flashtag .= '

WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

'; $flashtag .= ''; return $flashtag; } // function to display the options page function wp_cumulus_options() { $options = $newoptions = get_option('wpcumulus_options'); // if submitted, process results if ( $_POST["wpcumulus_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['hicolor'] = strip_tags(stripslashes($_POST["hicolor"])); $newoptions['bgcolor'] = strip_tags(stripslashes($_POST["bgcolor"])); $newoptions['trans'] = strip_tags(stripslashes($_POST["trans"])); $newoptions['speed'] = strip_tags(stripslashes($_POST["speed"])); $newoptions['distr'] = strip_tags(stripslashes($_POST["distr"])); $newoptions['mode'] = strip_tags(stripslashes($_POST["mode"])); $newoptions['args'] = strip_tags(stripslashes($_POST["args"])); } // any changes? save! if ( $options != $newoptions ) { $options = $newoptions; update_option('wpcumulus_options', $options); } // options form echo '
'; echo "

WP Cumulus options

"; echo ''; // width echo ''; echo ''; // height echo ''; echo ''; // text color echo ''; echo ''; // background color echo ''; echo ''; // transparent echo ''; echo ''; // speed echo ''; echo ''; // distribution echo ''; echo ''; // end table echo '
Width of the Flash tag cloud
Width in pixels (500 or more is recommended)
Height of the Flash tag cloud
Height in pixels (ideally around 3/4 of the width)
Color of the tags Optional second color for gradient: Optional highlighl 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
Rotation speed
Speed (percentage, default is 100)
Distribute tags evenly on sphere
Places tags at equal intervals instead of random
'; // tags, cats? echo '

Output options

'; echo ''; echo ''; echo '
Display: Tags
Categories
Both (you may want to consider lowering the number of tags , using the advanced options below)'; // end table echo '
'; // advanced options echo '

Advanced options

Please leave this setting empty unless you know what you\'re doing.

'; echo ''; // arguments echo ''; echo ''; // close stuff echo ''; echo '
wp_tag_cloud parameters
Parameter string for wp_tag_cloud (see the codex for more details)

Example uses
number=20 - limit the number of tags to 20
smallest=5&largest=50 - specify custom font sizes

Known issues
  • Currently, the \'units\', \'orderby\' and \'order\' parameters are not supported.
  • Setting \'format\' to anything but \'flat\' will cause the plugin to fail.
'; echo '

'; echo "
"; echo '
'; } //uninstall all options function wp_cumulus_uninstall () { delete_option('cumulus_options'); delete_option('cumulus_widget'); } // widget function widget_init_wp_cumulus_widget() { // Check for required functions if (!function_exists('register_sidebar_widget')) return; function wp_cumulus_widget($args){ extract($args); $options = get_option('wpcumulus_widget'); $title = empty($options['title']) ? __('Tag Cloud') : $options['title']; ?>

> Tags
> Categories
> Both