Show
Ignore:
Timestamp:
08/27/08 17:21:27 (4 months ago)
Author:
rickc
Message:

Plugin: preapproved. Fixed it so it checks to see whether a comment has already been marked as spam. If it has, it doesn't get approved.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • plugins/preapproved/trunk/preapproved.plugin.php

    r723 r837  
    2222            'author' => 'Habari Community', 
    2323            'authorurl' => 'http://habariproject.org/', 
    24             'version' => '1.2', 
     24            'version' => '1.3', 
    2525            'description' => 'Automatically approve comments based on the number of approved comments the commenter has previously made.', 
    2626            'license' => 'Apache License 2.0', 
     
    8989    function action_comment_insert_before ( $comment ) 
    9090    { 
    91         // This plugin ignores non-comments 
    92         if( $comment->type == Comment::COMMENT ) { 
     91        // This plugin ignores non-comments and comments already marked as spam 
     92        if( $comment->type == Comment::COMMENT && $comment->status != Comment::STATUS_SPAM) { 
    9393            if( Comments::get( array( 'email' => $comment->email, 'name' => $comment->name, 
    9494                                'url' => $comment->url, 'status' => Comment::STATUS_APPROVED ) )->count >= Options::get( 'preapproved__approved_count' ) ) { 
    9595                $comment->status = Comment::STATUS_APPROVED; 
    96                 EventLog::log( 'Comment by ' . $comment->name . ' automatically approved.', 'info', 'PreApproved', 'PreApproved' ); 
     96                EventLog::log( 'Comment by ' . $comment->name . ' automatically approved.', 'info', 'PreApproved', 'Preapproved' ); 
    9797            } 
    9898        }