Changeset 163268
- Timestamp:
- 10/14/2009 06:34:14 AM (16 years ago)
- Location:
- contact-commenters/trunk
- Files:
-
- 2 edited
-
contact_commenters_manage.php (modified) (10 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
contact-commenters/trunk/contact_commenters_manage.php
r122355 r163268 3 3 Author: Ajith Prasad Edassery 4 4 URL : http://www.DollarShower.com/ 5 RSS : http://feeds .feedburner.com/DollarShower5 RSS : http://feeds2.feedburner.com/DollarShower 6 6 Notes : Please feel free to modify and use this piece of code as you wish. 7 7 */ … … 62 62 case "ALL": 63 63 $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";64 AND comment_approved = '1' AND comment_author_email <> '' GROUP BY comment_author_email ORDER BY comment_author"; 65 65 break; 66 66 … … 68 68 $sql = "SELECT DISTINCT comment_author_email, comment_author from $wpdb->comments WHERE comment_type NOT IN ('pingback','trackback') 69 69 AND 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"; 70 DATE_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 > ( 71 DATE_SUB(curdate(),INTERVAL $actdays day)) ) GROUP BY comment_author_email ORDER BY comment_author"; 74 72 break; 75 73 … … 78 76 if ($dateto == "" || strlen($dateto) != 10) $dateto = date("m/d/Y"); 79 77 $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";78 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') GROUP BY comment_author_email ORDER BY comment_author"; 81 79 break; 82 80 83 81 case "PST": 84 82 $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";83 AND comment_approved = '1' AND comment_author_email <> '' AND comment_post_ID = '$postid' GROUP BY comment_author_email ORDER BY comment_author"; 86 84 break; 87 85 … … 96 94 $sql = "SELECT DISTINCT comment_author_email, comment_author from $wpdb->comments WHERE comment_type NOT IN ('pingback','trackback') 97 95 AND 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"; 96 DATE_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 < ( 97 DATE_SUB(curdate(),INTERVAL $newdays day)) ) GROUP BY comment_author_email ORDER BY comment_date DESC"; 102 98 break; 103 99 … … 106 102 107 103 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"; 109 105 break; 110 106 } … … 142 138 } elseif ($stepsubmitted == '2') { 143 139 // Update last mail options 144 update_option('mail-sender', $_POST['mail_sender']);140 update_option('mail-sender', stripslashes($_POST['mail_sender'])); 145 141 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'])); 148 144 update_option('mail-ind', $_POST['mail_individ']); 149 145 … … 159 155 160 156 $emailcount = count($sendeeslist) - 1; 161 $emailtemp = $_POST['mail_text'];157 $emailtemp = stripslashes($_POST['mail_text']); 162 158 $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"; 164 160 $emailbccheader = ""; 165 161 $ccsenderror = 0; … … 179 175 $contentstr = str_replace("[NAME]", $namestr, $emailtemp); 180 176 181 if (FALSE == mail($emailstr, $_POST['mail_subject'], $contentstr, $emailheaders)) {177 if (FALSE == mail($emailstr, stripslashes($_POST['mail_subject']), $contentstr, $emailheaders)) { 182 178 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>"); 183 179 $ccsenderror = 1; … … 201 197 $emailbccheader = $emailbccheader . "\r\n"; 202 198 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)) { 204 200 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>"); 205 201 $ccsenderror = 1; -
contact-commenters/trunk/readme.txt
r122359 r163268 4 4 Tags: contact, commenters, comments, contact commenters, email commenters 5 5 Requires at least: 2.2 6 Tested up to: 2. 7.16 Tested up to: 2.8.2 7 7 Stable tag: trunk 8 8 … … 32 32 33 33 http://www.dollarshower.com/downloads/plugins/contact-commenters-2.jpg 34 35 == Recent Fixes == 36 1. The extra slash characters that used to appear on mail content removed 37 2. 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. 38 Note: The version remains at 1.0 as there were no enhancements
Note: See TracChangeset
for help on using the changeset viewer.