Plugin Directory

Changeset 163268


Ignore:
Timestamp:
10/14/2009 06:34:14 AM (16 years ago)
Author:
edassery
Message:

Tested for WordPress 2.8.2
Fix 1: The bug whereby additional slash characters used to appear on mail body has been fixed
Fix 2: Duplicate mails problem solved

Location:
contact-commenters/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • contact-commenters/trunk/contact_commenters_manage.php

    r122355 r163268  
    33Author: Ajith Prasad Edassery
    44URL   : http://www.DollarShower.com/
    5 RSS   : http://feeds.feedburner.com/DollarShower
     5RSS   : http://feeds2.feedburner.com/DollarShower
    66Notes : Please feel free to modify and use this piece of code as you wish.
    77*/
     
    6262            case "ALL":
    6363                $sql = "SELECT DISTINCT comment_author_email, comment_author from $wpdb->comments WHERE comment_type NOT IN ('pingback','trackback')
    64 AND comment_approved = '1' AND comment_author_email <> '' ORDER BY comment_author";
     64AND comment_approved = '1' AND comment_author_email <> '' GROUP BY comment_author_email ORDER BY comment_author";
    6565                break;
    6666
     
    6868                $sql = "SELECT DISTINCT comment_author_email, comment_author from $wpdb->comments WHERE comment_type NOT IN ('pingback','trackback')
    6969AND comment_approved = '1' AND comment_author_email <> '' AND comment_date <= (
    70 DATE_SUB(curdate(),INTERVAL $actdays day)) AND comment_author_email NOT IN (SELECT DISTINCT comment_author_email from $wpdb->comments
    71 
    72 WHERE comment_approved = '1' AND comment_date > (
    73 DATE_SUB(curdate(),INTERVAL $actdays day)) ) ORDER BY comment_author";
     70DATE_SUB(curdate(),INTERVAL $actdays day)) AND comment_author_email NOT IN (SELECT DISTINCT comment_author_email from $wpdb->comments WHERE comment_approved = '1' AND comment_date > (
     71DATE_SUB(curdate(),INTERVAL $actdays day)) ) GROUP BY comment_author_email ORDER BY comment_author";
    7472                break;
    7573
     
    7876                if ($dateto == "" || strlen($dateto) != 10) $dateto = date("m/d/Y");
    7977                $sql = "SELECT DISTINCT comment_author_email, comment_author from $wpdb->comments WHERE comment_type NOT IN ('pingback','trackback')
    80 AND comment_approved = '1' AND comment_author_email <> '' AND comment_date >= STR_TO_DATE('$datefrom', '%m/%d/%Y') AND comment_date <= STR_TO_DATE('$dateto', '%m/%d/%Y') ORDER BY comment_author";
     78AND comment_approved = '1' AND comment_author_email <> '' AND comment_date >= STR_TO_DATE('$datefrom', '%m/%d/%Y') AND comment_date <= STR_TO_DATE('$dateto', '%m/%d/%Y') GROUP BY comment_author_email ORDER BY comment_author";
    8179                break;
    8280           
    8381            case "PST":
    8482                $sql = "SELECT DISTINCT comment_author_email, comment_author from $wpdb->comments WHERE comment_type NOT IN ('pingback','trackback')
    85 AND comment_approved = '1' AND comment_author_email <> '' AND comment_post_ID = '$postid' ORDER BY comment_author";
     83AND comment_approved = '1' AND comment_author_email <> '' AND comment_post_ID = '$postid' GROUP BY comment_author_email ORDER BY comment_author";
    8684                break;
    8785
     
    9694                $sql = "SELECT DISTINCT comment_author_email, comment_author from $wpdb->comments WHERE comment_type NOT IN ('pingback','trackback')
    9795AND comment_approved = '1' AND comment_author_email <> '' AND comment_date >= (
    98 DATE_SUB(curdate(),INTERVAL $newdays day)) AND comment_author_email NOT IN (SELECT DISTINCT comment_author_email from $wpdb->comments
    99 
    100 WHERE comment_approved = '1' AND comment_date < (
    101 DATE_SUB(curdate(),INTERVAL $newdays day)) ) ORDER BY comment_date DESC";
     96DATE_SUB(curdate(),INTERVAL $newdays day)) AND comment_author_email NOT IN (SELECT DISTINCT comment_author_email from $wpdb->comments WHERE comment_approved = '1' AND comment_date < (
     97DATE_SUB(curdate(),INTERVAL $newdays day)) ) GROUP BY comment_author_email ORDER BY comment_date DESC";
    10298                break;
    10399
     
    106102
    107103            default:
    108                 $sql = "SELECT DISTINCT comment_author_email, comment_author from $wpdb->comments WHERE comment_author_email <> '' ORDER BY comment_author_email LIMIT 100";
     104                $sql = "SELECT DISTINCT comment_author_email, comment_author from $wpdb->comments WHERE comment_author_email <> ''GROUP BY comment_author_email ORDER BY comment_author_email LIMIT 100";
    109105                break;
    110106        }
     
    142138    } elseif ($stepsubmitted == '2') {
    143139        // Update last mail options
    144         update_option('mail-sender', $_POST['mail_sender']);
     140        update_option('mail-sender', stripslashes($_POST['mail_sender']));
    145141        update_option('mail-sender-email', $_POST['mail_sender_email']);
    146         update_option('mail-subject', $_POST['mail_subject']);
    147         update_option('mail-content', $_POST['mail_text']);
     142        update_option('mail-subject', stripslashes($_POST['mail_subject']));
     143        update_option('mail-content', stripslashes($_POST['mail_text']));
    148144        update_option('mail-ind', $_POST['mail_individ']);
    149145
     
    159155
    160156        $emailcount = count($sendeeslist) - 1;
    161         $emailtemp = $_POST['mail_text'];
     157        $emailtemp = stripslashes($_POST['mail_text']);
    162158        $emailindi = $_POST['mail_individ'];
    163         $emailheaders = "MIME-Version: 1.0\r\n" . "From: " . $_POST['mail_sender'] . " <" . $_POST['mail_sender_email'] . ">\r\n";
     159        $emailheaders = "MIME-Version: 1.0\r\n" . "From: " . stripslashes($_POST['mail_sender']) . " <" . $_POST['mail_sender_email'] . ">\r\n";
    164160        $emailbccheader = "";
    165161        $ccsenderror = 0;
     
    179175                    $contentstr = str_replace("[NAME]", $namestr, $emailtemp);
    180176
    181                     if (FALSE == mail($emailstr, $_POST['mail_subject'], $contentstr, $emailheaders)) {
     177                    if (FALSE == mail($emailstr, stripslashes($_POST['mail_subject']), $contentstr, $emailheaders)) {
    182178                        echo("<br/><br/><font color=red><strong>Error while sending email(s). Please make sure that your server is set up to handle PHP mails!</strong></font>");
    183179                        $ccsenderror = 1;
     
    201197                        $emailbccheader = $emailbccheader . "\r\n";
    202198
    203                         if (FALSE == mail($_POST['mail_sender_email'], $_POST['mail_subject'], $emailtemp, $emailheaders . $emailbccheader)) {
     199                        if (FALSE == mail($_POST['mail_sender_email'], stripslashes($_POST['mail_subject']), $emailtemp, $emailheaders . $emailbccheader)) {
    204200                            echo("<br/><br/><font color=red><strong>Error while sending email(s). Please make sure that your server is set up to handle PHP mails!</strong></font>");
    205201                            $ccsenderror = 1;
  • contact-commenters/trunk/readme.txt

    r122359 r163268  
    44Tags: contact, commenters, comments, contact commenters, email commenters
    55Requires at least: 2.2
    6 Tested up to: 2.7.1
     6Tested up to: 2.8.2
    77Stable tag: trunk
    88
     
    3232
    3333http://www.dollarshower.com/downloads/plugins/contact-commenters-2.jpg
     34
     35== Recent Fixes ==
     361. The extra slash characters that used to appear on mail content removed
     372. There was a bug whereby duplicate mails were sent to people who commented with different names but the same email address. This issue has been fixed as well.
     38Note: The version remains at 1.0 as there were no enhancements
Note: See TracChangeset for help on using the changeset viewer.