Changeset 182

Show
Ignore:
Timestamp:
01/10/05 15:58:44 (3 years ago)
Author:
morganiq
Message:

Updated to accommodate feeds; added option to filter mini posts from feeds.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • mini-posts/trunk/mini-posts.php

    r181 r182  
    44Plugin URI: http://doocy.net/mini-posts/ 
    55Description: An approach to "asides", or small posts. Allows you to mark entries as "mini" posts and handle them differently than normal posts. <strong>Requires WordPress 1.5.</strong> 
    6 Version: 0.2 
     6Version: 0.4 
    77Author: Morgan Doocy 
    88Author URI: http://doocy.net/ 
     
    36360.2    - Corrected load_plugin_textdomain() domain. 
    37370.3    - Updated to accommodate WP pages. 
     380.4    - Updated to accommodate feeds; added option to filter mini posts from feeds. 
    3839 
    3940*/ 
     
    4445            update_option('filter_mini_posts_from_loop', $_POST['filter_mini_posts_from_loop'] == 1 ? 1 : 0); 
    4546            update_option('suppress_autop_on_mini_posts', $_POST['suppress_autop_on_mini_posts'] == 1 ? 1 : 0); 
     47            update_option('filter_mini_posts_from_feeds', $_POST['filter_mini_posts_from_feeds'] == 1 ? 1 : 0); 
    4648            echo '<div class="updated"><p><strong>' . __('Options updated.', 'MiniPosts') . '</strong></p></div>'; 
    4749      } 
     
    6163      $ck_filter_mini_posts_from_loop = get_settings('filter_mini_posts_from_loop') == 1 ? 'checked="checked" ' : ''; 
    6264      $ck_suppress_autop_on_mini_posts = get_settings('suppress_autop_on_mini_posts') == 1 ? 'checked="checked" ' : ''; 
     65      $ck_filter_mini_posts_from_feeds = get_settings('filter_mini_posts_from_feeds') == 1 ? 'checked="checked" ' : ''; 
    6366       
    6467      ?> 
     
    6972                  <tr valign="top"> 
    7073                        <th width="33%" scope="row"><?php _e('Show/hide:', 'MiniPost') ?></th> 
    71                         <td><label for="filter_mini_posts_from_loop"><input type="checkbox" name="filter_mini_posts_from_loop" id="filter_mini_posts_from_loop" <?php echo $ck_filter_mini_posts_from_loop ?> value="1" /> <?php _e('Filter mini posts from the Loop', 'MiniPosts') ?></label></td> 
     74                        <td> 
     75                              <label for="filter_mini_posts_from_loop"><input type="checkbox" name="filter_mini_posts_from_loop" id="filter_mini_posts_from_loop" <?php echo $ck_filter_mini_posts_from_loop ?> value="1" /> <?php _e('Filter mini posts from the Loop', 'MiniPosts') ?></label><br /> 
     76                              <label for="filter_mini_posts_from_feeds"><input type="checkbox" name="filter_mini_posts_from_feeds" id="filter_mini_posts_from_feeds" <?php echo $ck_filter_mini_posts_from_feeds ?> value="1" /> <?php _e('Filter mini posts from subscription feeds', 'MiniPosts') ?></label><br /> 
     77                        </td> 
    7278                  </tr> 
    7379                  <tr valign="top"> 
     
    143149      add_option('filter_mini_posts_from_loop', 1); 
    144150      add_option('suppress_autop_on_mini_posts', 1); 
     151      add_option('filter_mini_posts_from_feeds', 0); 
    145152       
    146153      // Auto-install: If there are no previous meta values for '_mini_post', automatically add one for each post 
     
    240247            global $wpdb, $pagenow; 
    241248             
    242             if ($pagenow != 'post.php' && $pagenow != 'edit.php' && get_settings('filter_mini_posts_from_loop') && !stristr($text, "wp_postmeta") && !is_page()) { 
     249            if (!is_plugin_page() && $pagenow != 'post.php' && $pagenow != 'edit.php' && get_settings('filter_mini_posts_from_loop') && !is_single() && !is_archive() && !is_page() && (is_feed() && get_settings('filter_mini_posts_from_feeds') || !is_feed()) && !stristr($text, "wp_postmeta")) { 
    243250                  $text .= " LEFT JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id)"; 
    244251            } 
     
    250257            global $user_ID, $user_level, $wpdb, $pagenow; 
    251258             
    252             if (!is_plugin_page() && $pagenow != 'post.php' && $pagenow != 'edit.php' && get_settings('filter_mini_posts_from_loop') && !is_single() && !is_archive() && !is_page()) { 
     259            if (!is_plugin_page() && $pagenow != 'post.php' && $pagenow != 'edit.php' && get_settings('filter_mini_posts_from_loop') && !is_single() && !is_archive() && !is_page() && (is_feed() && get_settings('filter_mini_posts_from_feeds') || !is_feed())) { 
    253260                  $text .= " AND ($wpdb->postmeta.meta_key = '_mini_post' AND $wpdb->postmeta.meta_value = 0)"; 
    254261            }