WordPress.org

Plugin Directory

Changeset 476888


Ignore:
Timestamp:
12/17/11 18:14:46 (2 years ago)
Author:
ramon fincken
Message:

New version

Location:
automatic-comment-scheduler
Files:
7 added
3 edited

Legend:

Unmodified
Added
Removed
  • automatic-comment-scheduler/trunk/mijnpress_plugin_framework.php

    r394360 r476888  
    5050 * 1.4 
    5151 * Changed: is_admin as this gives problems on multisite installs 
     52 *  
     53 * 1.4.1 
     54 * Added: New plugins 
    5255 * ------------------------------------------------------------------ 
    5356 *  
     
    6265    var $showcredits = true; 
    6366    var $showcredits_fordevelopers = true; 
    64     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'); 
     67    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'); 
    6568     
    6669    /** 
  • automatic-comment-scheduler/trunk/plugin.php

    r394360 r476888  
    44 Plugin URI: http://www.mijnpress.nl 
    55 Description: A plugin that automatically schedules pending comments for approval, depending on a min/max threshold and the last comment's publish date and time. 
    6  Version: 1.5 
     6 Version: 1.6 
    77 Author: Ramon Fincken 
    88 Author URI: http://www.mijnpress.nl 
     
    3737 
    3838        define('PLUGIN_ACS_COMMENT_SET_APPROVE_STATUS','approve'); 
    39              
    40         $comment_id = $this->has_unapproved(); 
    41         if($comment_id) 
    42         { 
    43             $approved_time = $this->calculate_next_time(); 
    44             $this->check_for_approval($comment_id, $approved_time); 
    45         } 
     39        global $wpdb; 
     40        $i = 0; 
     41        while($i < 5) 
     42        { 
     43            $comment_id = $this->has_unapproved(); 
     44            if($comment_id) 
     45            { 
     46                $approved_time = $this->calculate_next_time(); 
     47                $this->check_for_approval($comment_id, $approved_time); 
     48            } 
     49            $i++; 
     50        } 
     51         
     52        // Bugfix 
     53        $sql = 'UPDATE '.$wpdb->comments.' SET comment_approved = \''.PLUGIN_ACS_COMMENT_UNAPPROVED_STATUS.'\' WHERE comment_approved = \'\' LIMIT 10'; 
     54        $wpdb->get_results($sql);        
    4655    } 
    4756 
     
    169178 
    170179        // Perform a status change, this will activate any hooks 
    171         wp_set_comment_status($id, PLUGIN_ACS_COMMENT_SET_APPROVE_STATUS); 
     180        wp_set_comment_status($id, PLUGIN_ACS_COMMENT_APPROVED_STATUS); 
    172181 
    173182        // Now update the comment's date, otherwise the comments will be directly after eachother 
     
    295304 * @param unknown_type $status 
    296305 */ 
    297 function plugin_automatic_comment_scheduler($status = array()) 
     306function plugin_automatic_comment_scheduler($approved = false) 
    298307{ 
    299308    $automatic_comment_scheduler = new automatic_comment_scheduler(); 
     309    return $approved; 
    300310} 
    301311 
    302312// To trigger check 
    303313add_filter('pre_comment_approved', 'plugin_automatic_comment_scheduler', 0); 
     314add_action('wp_head', 'plugin_automatic_comment_scheduler'); 
    304315add_action( 'admin_menu', 'plugin_automatic_comment_scheduler' ); 
    305316 
  • automatic-comment-scheduler/trunk/readme.txt

    r394360 r476888  
    44Tags: automatic, auto, schedule, approve, comment, comments, pending, notify, notification 
    55Requires at least: 2.0.2 
    6 Tested up to: 3.1.3 
    7 Stable tag: 1.5 
     6Tested up to: 3.3 
     7Stable tag: 1.6 
    88 
    99A plugin that automatically schedules pending comments for approval, depending on a min/max threshold and the last comment's publish date and time. 
     
    1414<br>When a comment is posted or when the admin is logged in, the plugin computes the most recent interval when a comment can be auto approved and picks a timestamp in that interval when to approve the pending comment. 
    1515<br>Optional: Notify the site admin by email when a comment is approved. 
     16<br>Warning All pending comments will be scheduled, make sure you have an antispam plugin in place. <a href="http://wordpress.org/extend/plugins/antispam-for-all-fields/">I wrote one over here</a>. 
    1617<br>Based on: <a href="http://wordpress.org/extend/plugins/automatic-post-scheduler/">Automatic Post Scheduler</a> by <a href="http://profiles.wordpress.org/users/tetele/">Tetele</a> 
    1718<br> 
     
    3132 
    3233== Changelog == 
     34= 1.6 = 
     35Bugfix: Failed to return status upon default call. 
     36Added: More calls to make sure that comments are scheduled 
     37 
    3338= 1.5 = 
    3439Bugfix: 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.