Changeset 411985
- Timestamp:
- 07/19/2011 02:06:18 PM (15 years ago)
- Location:
- blog-in-blog
- Files:
-
- 2 edited
-
tags/1.0.8/blog-in-blog.php (modified) (6 diffs)
-
trunk/blog-in-blog.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
blog-in-blog/tags/1.0.8/blog-in-blog.php
r411897 r411985 55 55 $plugin_dir = basename(dirname(__FILE__)); 56 56 load_plugin_textdomain('blog-in-blog', WP_PLUGIN_DIR . $plugin_dir, $plugin_dir . '/languages'); 57 58 global $blog_in_blog_opts; 57 59 58 60 function blog_in_blog_func($atts) { … … 220 222 } 221 223 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 228 225 // return the posts data. 229 226 return bib_do_shortcode($out); … … 938 935 $c = ''; 939 936 $cat = get_option('bib_hide_category'); 937 $NONE_FLAG = 0; 940 938 941 939 if (is_home ()) { … … 945 943 if ($v != "NONE") { 946 944 $c .= '-' . $v . ','; 945 }else{ 946 $NONE_FLAG = 1; 947 947 } 948 948 } 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 } 952 954 } 953 955 954 956 } 957 bib_write_debug(__FUNCTION__, "Hide Category:".print_r($cat, true)); 958 bib_write_debug(__FUNCTION__, "wp_query:".print_r($wp_query, true)); 955 959 return $wp_query ; 956 960 } … … 961 965 962 966 $c = ''; 963 967 $NONE_FLAG = 0; 968 $cat = get_option('bib_hide_category'); 969 964 970 if (get_option('bib_hide_category_from_rss')) { 965 971 if ($query->is_feed) { 966 $cat = get_option('bib_hide_category');972 967 973 if (is_array($cat)) { 968 974 foreach ($cat as $v) { 969 975 if ($v != "NONE") { 970 976 $c .= '-' . $v . ','; 977 }else{ 978 $NONE_FLAG = 1; 971 979 } 972 980 } 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)); 978 990 return $query; 979 991 } … … 996 1008 } 997 1009 1010 1011 add_action('wp_footer','bib_show_debug'); 1012 function 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 998 1035 //add_action('all', create_function('', 'var_dump( current_filter() ) ; ')); 999 1036 //add_action('shutdown', create_function('', ' global $wpdb; if(isset($wpdb)) var_dump( $wpdb->queries ); ')); -
blog-in-blog/trunk/blog-in-blog.php
r411897 r411985 55 55 $plugin_dir = basename(dirname(__FILE__)); 56 56 load_plugin_textdomain('blog-in-blog', WP_PLUGIN_DIR . $plugin_dir, $plugin_dir . '/languages'); 57 58 global $blog_in_blog_opts; 57 59 58 60 function blog_in_blog_func($atts) { … … 220 222 } 221 223 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 228 225 // return the posts data. 229 226 return bib_do_shortcode($out); … … 938 935 $c = ''; 939 936 $cat = get_option('bib_hide_category'); 937 $NONE_FLAG = 0; 940 938 941 939 if (is_home ()) { … … 945 943 if ($v != "NONE") { 946 944 $c .= '-' . $v . ','; 945 }else{ 946 $NONE_FLAG = 1; 947 947 } 948 948 } 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 } 952 954 } 953 955 954 956 } 957 bib_write_debug(__FUNCTION__, "Hide Category:".print_r($cat, true)); 958 bib_write_debug(__FUNCTION__, "wp_query:".print_r($wp_query, true)); 955 959 return $wp_query ; 956 960 } … … 961 965 962 966 $c = ''; 963 967 $NONE_FLAG = 0; 968 $cat = get_option('bib_hide_category'); 969 964 970 if (get_option('bib_hide_category_from_rss')) { 965 971 if ($query->is_feed) { 966 $cat = get_option('bib_hide_category');972 967 973 if (is_array($cat)) { 968 974 foreach ($cat as $v) { 969 975 if ($v != "NONE") { 970 976 $c .= '-' . $v . ','; 977 }else{ 978 $NONE_FLAG = 1; 971 979 } 972 980 } 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)); 978 990 return $query; 979 991 } … … 996 1008 } 997 1009 1010 1011 add_action('wp_footer','bib_show_debug'); 1012 function 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 998 1035 //add_action('all', create_function('', 'var_dump( current_filter() ) ; ')); 999 1036 //add_action('shutdown', create_function('', ' global $wpdb; if(isset($wpdb)) var_dump( $wpdb->queries ); '));
Note: See TracChangeset
for help on using the changeset viewer.