WordPress.org

Plugin Directory

Changeset 630306


Ignore:
Timestamp:
11/26/12 20:01:24 (17 months ago)
Author:
ramon fincken
Message:

New version 1.6:
Added: All categories support
Bugfix: Only get latest 50 posts (performance fix), every 30 seconds
Changed: Dropdown now on category name (sort)

Location:
auto-prune-posts
Files:
7 added
4 edited

Legend:

Unmodified
Added
Removed
  • auto-prune-posts/trunk/auto-prune-posts-adminpage.php

    r321902 r630306  
    1919 
    2020<form id="form1" name="form1" method="post" action="" onsubmit="return confirm('Are you sure?')"> 
    21 Delete posts in <?php wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'cat_id_add', 'hierarchical' => true)); ?> after 
    22  
     21Delete posts in <?php wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'cat_id_add', 'hierarchical' => true, 'orderby' => 'name', 'show_option_all' => 'true')); ?> after 
    2322<input type="text" maxlength="6" name="period_duration_add" style="width: 45px;"> 
    2423  <select name="period_add"> 
  • auto-prune-posts/trunk/auto-prune-posts.php

    r394359 r630306  
    44 Plugin URI: http://www.mijnpress.nl 
    55 Description: Auto deletes (prune) posts after a certain amount of time. On a per category basis. 
    6  Version: 1.5 
     6 Version: 1.6 
    77 Author: Ramon Fincken 
    88 Author URI: http://mijnpress.nl 
     
    3737        $reset = false; // If you really want to start over, only do this when you know what you are doing matie! HarrRrr 
    3838        if ($plugin_autopruneposts_conf === false) { 
    39             add_option('plugin_autopruneposts_conf', array ('version' => '1.1','settings' => $default_settings,'config' => array()), NULL, 'yes'); 
     39            add_option('plugin_autopruneposts_conf', array ('version' => '1.6','settings' => $default_settings,'config' => array()), NULL, 'yes'); 
    4040        } 
    4141        else 
     
    243243     
    244244                    // Get all posts for this category 
    245                     $myposts = get_posts('category=' . $cat_id.'&post_type='.$the_type.'&numberposts=-1'); 
     245                    //$myposts = get_posts('category=' . $cat_id.'&post_type='.$the_type.'&numberposts=-1'); 
     246                     
     247                    if($cat_id > 0) 
     248                    { 
     249                        // Do only the last 50 (by date, for 1 cat) 
     250                        $myposts = get_posts('category=' . $cat_id.'&post_type='.$the_type.'&numberposts=50&order=ASCorderby=post_date'); 
     251                    } 
     252                    else 
     253                    { 
     254                        // Do only the last 50 (by date, ALL) 
     255                        $myposts = get_posts('post_type='.$the_type.'&numberposts=50&order=ASCorderby=post_date'); 
     256                    } 
     257                     
     258                     
    246259                    foreach ($myposts AS $post) { 
    247260                        $post_date_plus_visibleperiod = strtotime($post->post_date . " +" . $period_php); 
  • auto-prune-posts/trunk/mijnpress_plugin_framework.php

    r491610 r630306  
    4444 * 1.5 
    4545 * Changed: credits 
     46 *  
     47 * 1.5.1 
     48 * Added: return functions 
    4649 * ------------------------------------------------------------------ 
    4750 *  
     
    5659    var $showcredits = true; 
    5760    var $showcredits_fordevelopers = true; 
    58     var $all_plugins = array('Admin renamer extended','Find replace','Simple add pages or posts','Force apply terms and conditions','GTmetrix website performance','Antispam for all fields','Mass Delete Tags','Auto Prune Posts','Warm cache','See attachments','Automatic Comment Scheduler','Register plus redux export users','Subscribe2 widget','Define Constants','Mass Delete Unused Tags','Prevent core update'); 
     61    var $all_plugins = array('Admin renamer extended','Find replace','Simple add pages or posts','Force apply terms and conditions','GTmetrix website performance','Antispam for all fields','Mass Delete Tags','Auto Prune Posts','Warm cache','See attachments','Automatic Comment Scheduler','Register plus redux export users','Subscribe2 widget','Define Constants','Mass Delete Unused Tags','Prevent core update','WPML flag in menu', 'WPsc MijnPress','Autoptimize admin bar fix'); 
    5962     
    6063    /** 
     
    8083        } 
    8184        return $links; 
     85    } 
     86     
     87    // To implement later 
     88    function refresh_rewrite() 
     89    { 
     90        if(isset($_GET['rwflush'])) 
     91        { 
     92            global $wp_rewrite; 
     93            $wp_rewrite->flush_rules(); 
     94        }        
    8295    } 
    8396 
     
    133146        if($this->showcredits) 
    134147        { 
    135             echo '<br/><br/>Do you like this plugin? <a href="http://donate.ramonfincken.com/">PayPal Donations</a> (even as small as $1,- or &euro;1,- are welcome!.'; 
     148            echo '<br/><br/>Do you like this plugin? <a href="http://donate.ramonfincken.com/">PayPal Donations</a> (even as small as $1,- or &euro;1,)- are welcome!.'; 
    136149        } 
    137150        echo '</div>'; 
     
    143156    } 
    144157 
     158    function return_zero() 
     159    { 
     160        return 0; 
     161    } 
     162     
     163    function return_false() 
     164    { 
     165        return false; 
     166    } 
     167     
     168    function return_true() 
     169    { 
     170        return true; 
     171    }     
     172     
    145173    /** 
    146174     * Shows credits or info for developers 
  • auto-prune-posts/trunk/readme.txt

    r394359 r630306  
    33Tags: mass, prune, delete, clean, remove, trash, attachment, attachments, coupon, schedule, post, posts, category 
    44Requires at least: 2.3 
    5 Tested up to: 3.1.3 
    6 Stable tag: 1.5 
     5Tested up to: 3.4.2 
     6Stable tag: 1.6 
    77 
    88Auto deletes (prune) posts after a certain amount of time. On a per category basis. Handy if you want to have posts with a limited timeframe such as offers, coupons etc.. Posts will auto delete on a per category basis. 
     
    3535 
    3636== Changelog == 
     37= 1.6 = 
     38Added: All categories support 
     39Bugfix: Only get latest 50 posts (performance fix), every 30 seconds 
     40Changed: Dropdown now on category name (sort) 
     41 
     42 
    3743= 1.5 = 
    3844Bugfix: Framework did not work on multisite, is_admin() problem.<br>If anyone could help me with that ? :) 
Note: See TracChangeset for help on using the changeset viewer.