Plugin Directory

Changeset 411985


Ignore:
Timestamp:
07/19/2011 02:06:18 PM (15 years ago)
Author:
timhodson
Message:

modified debug output display to be independant of BIB pages

Location:
blog-in-blog
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • blog-in-blog/tags/1.0.8/blog-in-blog.php

    r411897 r411985  
    5555$plugin_dir = basename(dirname(__FILE__));
    5656load_plugin_textdomain('blog-in-blog', WP_PLUGIN_DIR . $plugin_dir, $plugin_dir . '/languages');
     57
     58global $blog_in_blog_opts;
    5759
    5860function blog_in_blog_func($atts) {
     
    220222    }
    221223
    222     // output debug stuff
    223     if ($blog_in_blog_opts['bib_debug']){
    224         $out .= "<br /><h2>BLOG_IN_BLOG DEBUG INFO</h2><small>Turn this off in the 'Misc' section of the blog_in_blog admin page.</small><textarea cols='100' rows='20'>{$blog_in_blog_opts['debug_output']}</textarea>";
    225         unset ($blog_in_blog_opts['debug_output']);
    226    }
    227 
     224   
    228225    // return the posts data.
    229226    return bib_do_shortcode($out);
     
    938935    $c = '';
    939936    $cat = get_option('bib_hide_category');
     937    $NONE_FLAG = 0;
    940938
    941939    if (is_home ()) {
     
    945943                if ($v != "NONE") {
    946944                    $c .= '-' . $v . ',';
     945                }else{
     946                    $NONE_FLAG = 1;
    947947                }
    948948            }
    949             $c = trim($c, ',');
    950             $wp_query->set('cat', $c);
    951             $wp_query->set('category__not_in', array_values($cat));
     949            if($NONE_FLAG == 0 ){
     950                $c = trim($c, ',');
     951                $wp_query->set('cat', $c);
     952                $wp_query->set('category__not_in', array_values($cat));
     953            }
    952954        }
    953955       
    954956    }
     957    bib_write_debug(__FUNCTION__, "Hide Category:".print_r($cat, true));
     958    bib_write_debug(__FUNCTION__, "wp_query:".print_r($wp_query, true));
    955959    return $wp_query ;
    956960}
     
    961965
    962966    $c = '';
    963 
     967    $NONE_FLAG = 0;
     968    $cat = get_option('bib_hide_category');
     969   
    964970    if (get_option('bib_hide_category_from_rss')) {
    965971        if ($query->is_feed) {
    966             $cat = get_option('bib_hide_category');
     972           
    967973            if (is_array($cat)) {
    968974                foreach ($cat as $v) {
    969975                    if ($v != "NONE") {
    970976                        $c .= '-' . $v . ',';
     977                    }else{
     978                        $NONE_FLAG = 1;
    971979                    }
    972980                }
    973                 $query->set('cat', $c);
    974                 $query->set('category__not_in', array_values($cat));
    975             }
    976         }
    977     }
     981                if($NONE_FLAG == 0 ){
     982                    $query->set('cat', $c);
     983                    $query->set('category__not_in', array_values($cat));
     984                }
     985            }
     986        }
     987    }
     988    bib_write_debug(__FUNCTION__, "Hide Category:".print_r($cat, true));
     989    bib_write_debug(__FUNCTION__, "query:".print_r($query, true));
    978990    return $query;
    979991}
     
    9961008}
    9971009
     1010
     1011add_action('wp_footer','bib_show_debug');
     1012function bib_show_debug() {
     1013    // output debug stuff
     1014    global $blog_in_blog_opts;
     1015
     1016    foreach ($blog_in_blog_opts as $key => $value) {
     1017        if($key != 'debug_output'){
     1018            bib_write_debug("OPTION $key", print_r($value,true));
     1019        }
     1020    }
     1021   
     1022   
     1023    $OPT = get_option('bib_debug');
     1024    if ($OPT){
     1025       
     1026        $output = "<br /><h2>BLOG_IN_BLOG DEBUG INFO</h2><small>Turn this off in the 'Misc' section of the blog_in_blog admin page.</small><br /><textarea cols='100' rows='20'>{$blog_in_blog_opts['debug_output']}</textarea>";
     1027        unset ($blog_in_blog_opts['debug_output']);
     1028        echo $output ; 
     1029    }
     1030}
     1031
     1032
     1033
     1034
    9981035//add_action('all', create_function('', 'var_dump( current_filter() ) ; '));
    9991036//add_action('shutdown', create_function('', ' global $wpdb; if(isset($wpdb)) var_dump( $wpdb->queries ); '));
  • blog-in-blog/trunk/blog-in-blog.php

    r411897 r411985  
    5555$plugin_dir = basename(dirname(__FILE__));
    5656load_plugin_textdomain('blog-in-blog', WP_PLUGIN_DIR . $plugin_dir, $plugin_dir . '/languages');
     57
     58global $blog_in_blog_opts;
    5759
    5860function blog_in_blog_func($atts) {
     
    220222    }
    221223
    222     // output debug stuff
    223     if ($blog_in_blog_opts['bib_debug']){
    224         $out .= "<br /><h2>BLOG_IN_BLOG DEBUG INFO</h2><small>Turn this off in the 'Misc' section of the blog_in_blog admin page.</small><textarea cols='100' rows='20'>{$blog_in_blog_opts['debug_output']}</textarea>";
    225         unset ($blog_in_blog_opts['debug_output']);
    226    }
    227 
     224   
    228225    // return the posts data.
    229226    return bib_do_shortcode($out);
     
    938935    $c = '';
    939936    $cat = get_option('bib_hide_category');
     937    $NONE_FLAG = 0;
    940938
    941939    if (is_home ()) {
     
    945943                if ($v != "NONE") {
    946944                    $c .= '-' . $v . ',';
     945                }else{
     946                    $NONE_FLAG = 1;
    947947                }
    948948            }
    949             $c = trim($c, ',');
    950             $wp_query->set('cat', $c);
    951             $wp_query->set('category__not_in', array_values($cat));
     949            if($NONE_FLAG == 0 ){
     950                $c = trim($c, ',');
     951                $wp_query->set('cat', $c);
     952                $wp_query->set('category__not_in', array_values($cat));
     953            }
    952954        }
    953955       
    954956    }
     957    bib_write_debug(__FUNCTION__, "Hide Category:".print_r($cat, true));
     958    bib_write_debug(__FUNCTION__, "wp_query:".print_r($wp_query, true));
    955959    return $wp_query ;
    956960}
     
    961965
    962966    $c = '';
    963 
     967    $NONE_FLAG = 0;
     968    $cat = get_option('bib_hide_category');
     969   
    964970    if (get_option('bib_hide_category_from_rss')) {
    965971        if ($query->is_feed) {
    966             $cat = get_option('bib_hide_category');
     972           
    967973            if (is_array($cat)) {
    968974                foreach ($cat as $v) {
    969975                    if ($v != "NONE") {
    970976                        $c .= '-' . $v . ',';
     977                    }else{
     978                        $NONE_FLAG = 1;
    971979                    }
    972980                }
    973                 $query->set('cat', $c);
    974                 $query->set('category__not_in', array_values($cat));
    975             }
    976         }
    977     }
     981                if($NONE_FLAG == 0 ){
     982                    $query->set('cat', $c);
     983                    $query->set('category__not_in', array_values($cat));
     984                }
     985            }
     986        }
     987    }
     988    bib_write_debug(__FUNCTION__, "Hide Category:".print_r($cat, true));
     989    bib_write_debug(__FUNCTION__, "query:".print_r($query, true));
    978990    return $query;
    979991}
     
    9961008}
    9971009
     1010
     1011add_action('wp_footer','bib_show_debug');
     1012function bib_show_debug() {
     1013    // output debug stuff
     1014    global $blog_in_blog_opts;
     1015
     1016    foreach ($blog_in_blog_opts as $key => $value) {
     1017        if($key != 'debug_output'){
     1018            bib_write_debug("OPTION $key", print_r($value,true));
     1019        }
     1020    }
     1021   
     1022   
     1023    $OPT = get_option('bib_debug');
     1024    if ($OPT){
     1025       
     1026        $output = "<br /><h2>BLOG_IN_BLOG DEBUG INFO</h2><small>Turn this off in the 'Misc' section of the blog_in_blog admin page.</small><br /><textarea cols='100' rows='20'>{$blog_in_blog_opts['debug_output']}</textarea>";
     1027        unset ($blog_in_blog_opts['debug_output']);
     1028        echo $output ; 
     1029    }
     1030}
     1031
     1032
     1033
     1034
    9981035//add_action('all', create_function('', 'var_dump( current_filter() ) ; '));
    9991036//add_action('shutdown', create_function('', ' global $wpdb; if(isset($wpdb)) var_dump( $wpdb->queries ); '));
Note: See TracChangeset for help on using the changeset viewer.