'ataglist', 'description' => __('Display advanced tag lists.', 'ataglist') ); /* Widget control settings. */ $control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => 'ataglist-widget' ); /* Create the widget. */ $this->WP_Widget( 'ataglist-widget', __('Advanced Tag List', 'ataglist'), $widget_ops, $control_ops ); $this->defaults = array ('taglist_title' => '', 'taglist_show_count' => 1, 'taglist_order' => 1, 'taglist_limit' => 0, 'taglist_dropdown' => 0, 'taglist_cat_inc' => '', 'taglist_cat_exc' => '', 'taglist_tag_exc' => '', 'taglist_cache' => '' ); if(!get_option('ataglist')) { add_option('ataglist', $this->defaults); } } function widget( $args, $instance ) { extract( $args ); $cache = get_option('ataglist'); echo $before_widget; if($instance['taglist_title'] != '') { echo $before_title . $instance['taglist_title'] . $after_title; } echo $cache['taglist_cache']; echo $after_widget; } function update( $new_instance, $old_instance ) { $instance = $old_instance; /* Strip tags for title and name to remove HTML (important for text inputs). */ foreach($new_instance as $key => $val) { $instance[$key] = strip_tags( $new_instance[$key] ); } $instance['taglist_show_count'] = ( $new_instance['taglist_show_count'] == 1 ) ? 1 : 0; $instance['taglist_dropdown'] = ( $new_instance['taglist_dropdown'] == 1 ) ? 1 : 0; update_option('ataglist', $instance); ataglist_generate_tag_cache(); return $instance; } function form( $instance ) { $instance = wp_parse_args( (array) $instance, $this->defaults ); ?>

>


(0 = display all tags)


* Exclude field is applied only if Include field is empty.

>

posts p LEFT JOIN $wpdb->term_relationships rl ON p.ID = rl.object_id LEFT JOIN $wpdb->term_taxonomy xl ON rl.term_taxonomy_id = xl.term_taxonomy_id LEFT JOIN $wpdb->terms tl ON tl.term_id = xl.term_id RIGHT JOIN $wpdb->term_relationships rr ON p.ID = rr.object_id RIGHT JOIN $wpdb->term_taxonomy xr ON rr.term_taxonomy_id = xr.term_taxonomy_id RIGHT JOIN $wpdb->terms tr ON tr.term_id = xr.term_id WHERE $termquery xr.taxonomy = 'post_tag' AND p.post_status = 'publish' GROUP BY tr.slug ORDER BY $orderby $limit"; $tags = $wpdb->get_results( $query ); } $instance['taglist_cache'] = ''; if($tags) { if($instance['taglist_dropdown'] == 1) { $instance['taglist_cache'] .= '"; } else { $instance['taglist_cache'] .= ''; } } else { $instance['taglist_cache'] .= 'No tags to display.'; } update_option('ataglist', $instance); } function jme_taglist_options_page() { $taglist = get_option('ataglist'); if($_POST['save_settings']) { $taglist['taglist_show_count'] = ($_POST['taglist_show_count'] == 1) ? 1 : 0; $taglist['taglist_order'] = $_POST['taglist_order']; $taglist['taglist_limit'] = $_POST['taglist_limit']; $taglist['taglist_tag_exc'] = htmlspecialchars($_POST['taglist_tag_exc']); $taglist['taglist_cat_exc'] = htmlspecialchars($_POST['taglist_cat_exc']); $taglist['taglist_cat_inc'] = htmlspecialchars($_POST['taglist_cat_inc']); $taglist['taglist_dropdown'] = ($_POST['taglist_dropdown'] == 1) ? 1 : 0; update_option('ataglist', $taglist); ataglist_generate_tag_cache(); $taglist = get_option('ataglist'); echo '

Your options have been saved.

'; } ?>

Advanced Tag List

Advanced Tag List Widget to add the widget to sidebar, or paste this code into your template where you want the widget to display:','ataglist'); ?>
<?php if(function_exists('jme_taglist')) { jme_taglist(); } ?>

>
:
:
(0 = display all tags)
:
:
:
* Exclude field is applied only if Include field is empty.
: >