Support » Plugins » [plugin:Commenter Email] How to Display all commenters ??

  • Resolved viky081

    (@viky081)


    I modified the Plugin Of commenter Email,I have a commenters data of about 54, But they display only 11! I really confuse what i did
    here is the mysql code of wordpress plugin, I need to display all the commenters emails(blank email also ) here is the code

    public static function get_emails( $fields = array( 'comment_author_email', 'comment_author','comment_author_IP'), $output = ARRAY_N ) {
    		global $wpdb;
    
    		// comment_author_email must be one of the fields
    		if ( ! in_array( 'comment_author_email', $fields ) )
    			array_unshift( $fields,  'comment_author_email' );
    
    		$fields = implode( ', ', $fields );
    		$sql = "SELECT $fields
    				FROM {$wpdb->comments} t1
    				INNER JOIN ( SELECT MAX(comment_author) AS author FROM {$wpdb->comments} GROUP BY comment_author_email ) t2 ON t1.comment_author = t2.author
    				WHERE
    					comment_approved = '1' OR
    					comment_author_email != '' OR
    					(comment_type = '' OR comment_type = 'comment')
    				GROUP BY comment_author_email
    				ORDER BY comment_author_email ASC";
    		$emails = $wpdb->get_results( $sql, $output );
    		return $emails;
    	}

    Anyone Much appreciated!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[plugin:Commenter Email] How to Display all commenters ??’ is closed to new replies.