Changeset 6252

Show
Ignore:
Timestamp:
07/30/06 10:12:28 (2 years ago)
Author:
GamerZ
Message:

2.07 Commit

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wp-email/trunk/email/email-image-verify.php

    r6073 r6252  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.0 Plugin: WP-EMail 2.05                                                           | 
     5|     WordPress 2.0 Plugin: WP-EMail 2.07                                                           | 
    66|     Copyright (c) 2005 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
  • wp-email/trunk/email/email-manager.php

    r6073 r6252  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.0 Plugin: WP-EMail 2.05                                                           | 
     5|     WordPress 2.0 Plugin: WP-EMail 2.07                                                           | 
    66|     Copyright (c) 2005 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
  • wp-email/trunk/email/email-options.php

    r6084 r6252  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.0 Plugin: WP-EMail 2.05                                                           | 
     5|     WordPress 2.0 Plugin: WP-EMail 2.07                                                           | 
    66|     Copyright (c) 2005 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
     
    107107                        break; 
    108108                  case "sentfailed": 
    109                         default_template = "<div id=\"content\" class=\"narrowcolumn\"><p>An Error Has Occured When Trying To Send The E-Mail<br /><b>&raquo;</b> %EMAIL_ERROR_MSG%</p></div>"; 
     109                        default_template = "<p>An Error Has Occured When Trying To Send The E-Mail<br /><b>&raquo;</b> %EMAIL_ERROR_MSG%</p>"; 
    110110                        break; 
    111111                  case "error": 
    112                         default_template = "<div id=\"content\" class=\"narrowcolumn\"><p>An Error Has Occured<br /><b>&raquo;</b> %EMAIL_ERROR_MSG%</p><p><a href=\"#\" onclick=\"javascript:history.go(-1); return false;\">&laquo; Go Back</a></p></div>"; 
     112                        default_template = "<p>An Error Has Occured<br /><b>&raquo;</b> %EMAIL_ERROR_MSG%</p>"; 
    113113                        break; 
    114114            } 
  • wp-email/trunk/email/email.php

    r6243 r6252  
    7171add_action('wp_head', 'email_js'); 
    7272function email_js() { 
    73       echo '<script language="JavaScript" type="text/javascript">'."\n"; 
    74       echo 'function email_popup(email_url) {'."\n"; 
    75       echo 'window.open(email_url, "_blank", "width=500,height=500,toolbar=0,menubar=0,location=0,resizable=0,scrollbars=1,status=0");'."\n"; 
    76       echo '}'."\n"; 
     73      echo '<script type="text/javascript">'."\n"; 
     74      echo '/* Start Of Javascript Generated By WP-EMail 2.07 */'."\n"; 
     75      echo '/* <![CDATA[ */'."\n"; 
     76      echo "\t".'function email_popup(email_url) {'."\n"; 
     77      echo "\t\t".'window.open(email_url, "_blank", "width=500,height=500,toolbar=0,menubar=0,location=0,resizable=0,scrollbars=1,status=0");'."\n"; 
     78      echo "\t".'}'."\n"; 
     79      echo '/* End Of Javascript Generated By WP-EMail 2.07 */'."\n"; 
    7780      echo '</script>'."\n"; 
    7881} 
     
    294297      $email_ip = get_email_ipaddress(); 
    295298      $email_host = gethostbyaddr($email_ip); 
    296       $last_emailed = $wpdb->get_var("SELECT email_timestamp FROM $wpdb->email WHERE email_ip = '$email_ip' AND email_host = '$email_host' ORDER BY email_timestamp DESC LIMIT 1"); 
     299      $email_status = __('Success'); 
     300      $last_emailed = $wpdb->get_var("SELECT email_timestamp FROM $wpdb->email WHERE email_ip = '$email_ip' AND email_host = '$email_host' AND email_status = '$email_status' ORDER BY email_timestamp DESC LIMIT 1"); 
    297301      $email_allow_interval = intval(get_settings('email_interval'))*60; 
    298302      if(($current_time-$last_emailed) < $email_allow_interval) { 
     
    482486      'Article taken from %EMAIL_BLOG_NAME% - %EMAIL_BLOG_URL%'."\n". 
    483487      'URL to article: %EMAIL_PERMALINK%', 'Template For E-Mail Alternate Body'); 
    484       add_option('email_template_sentsuccess', '<div id="content" class="narrowcolumn"><p>Article: <b>%EMAIL_POST_TITLE%</b> Has Been Sent To <b>%EMAIL_FRIEND_NAME% (%EMAIL_FRIEND_EMAIL%)</b></p>', 'Template For E-Mail That Is Sent Successfully</div>'); 
    485       add_option('email_template_sentfailed', '<div id="content" class="narrowcolumn"><p>An Error Has Occured When Trying To Send The E-Mail<br /><b>&raquo;</b> %EMAIL_ERROR_MSG%</p>', 'Template For E-Mail That Failed To Sent</div>'); 
    486       add_option('email_template_error', '<div id="content" class="narrowcolumn"><p>An Error Has Occured<br /><b>&raquo;</b> %EMAIL_ERROR_MSG%</p><p><a href="#" onclick="javascript:history.go(-1); return false;">&laquo; Go Back</a></p>', 'Template For E-Mail That Has An Error</div>'); 
     488      add_option('email_template_sentsuccess', '<div id="content" class="narrowcolumn"><p>Article: <b>%EMAIL_POST_TITLE%</b> Has Been Sent To <b>%EMAIL_FRIEND_NAME% (%EMAIL_FRIEND_EMAIL%)</b></p></div>', 'Template For E-Mail That Is Sent Successfully'); 
     489      add_option('email_template_sentfailed', '<p>An Error Has Occured When Trying To Send The E-Mail<br /><b>&raquo;</b> %EMAIL_ERROR_MSG%</p>', 'Template For E-Mail That Failed To Sent'); 
     490      add_option('email_template_error', '<p>An Error Has Occured<br /><b>&raquo;</b> %EMAIL_ERROR_MSG%</p>', 'Template For E-Mail That Has An Error'); 
    487491      add_option('email_interval', 10, 'The Number Of Minutes Before The User Can E-Mail The Next Article'); 
    488492      add_option('email_snippet', 100, 'Enable Snippet Feature For Your E-Mail?'); 
  • wp-email/trunk/email/wp-email-popup.php

    r6236 r6252  
    3838### Require PHP-Mailer Class 
    3939require(ABSPATH.'wp-content/plugins/email/class-phpmailer.php'); 
     40 
     41### Form Variables 
     42$yourname = strip_tags(stripslashes(trim($_POST['yourname']))); 
     43$youremail = strip_tags(stripslashes(trim($_POST['youremail']))); 
     44$yourremarks = strip_tags(stripslashes(trim($_POST['yourremarks']))); 
     45$friendname = strip_tags(stripslashes(trim($_POST['friendname']))); 
     46$friendemail = strip_tags(stripslashes(trim($_POST['friendemail']))); 
    4047?> 
    4148<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    6067if(!empty($did_email)) { 
    6168      // Variables Variables Variables 
    62       $yourname = strip_tags(stripslashes(trim($_POST['yourname']))); 
    63       $youremail = strip_tags(stripslashes(trim($_POST['youremail']))); 
    64       $yourremarks = strip_tags(stripslashes(trim($_POST['yourremarks']))); 
    65       $friendname = strip_tags(stripslashes(trim($_POST['friendname']))); 
    66       $friendemail = strip_tags(stripslashes(trim($_POST['friendemail']))); 
    6769      $imageverify = $_POST['imageverify']; 
    6870      $smtp_info = get_settings('email_smtp'); 
    6971      $smtp_info = explode('|', $smtp_info); 
    7072      $error = ''; 
    71       // If Remarks Is Empty, Assign N/A 
    72       if(empty($yourremarks)) { $yourremarks = 'N/A'; } 
    7373 
    7474      // If There Is Post 
     
    8282                  $multiple_emails = explode(',', $friendemail); 
    8383                  $multiple_max = intval(get_settings('email_multiple')); 
    84  
    8584                  if($multiple_max == 0) { $multiple_max = 1; } 
    8685 
     
    126125                  } 
    127126                  if(sizeof($friends) > $multiple_max) { 
    128                         $error .= '<br /><b>&raquo;</b> '.__('Maximum '.$multiple_max.' entries allowed.'); 
     127                        $error .= '<br /><b>&raquo;</b> '.__('Maximum '.$multiple_max.' entries allowed'); 
    129128                  } 
    130129 
     
    140139                        } 
    141140                  } 
    142  
    143                   // If There Are Errors 
    144                   if(!empty($error)) { 
    145                         $error = substr($error, 20); 
    146                         $template_email_error = stripslashes(get_settings('email_template_error')); 
    147                         $template_email_error = str_replace("%EMAIL_ERROR_MSG%", $error, $template_email_error); 
    148                         $template_email_error = str_replace("%EMAIL_BLOG_NAME%", get_bloginfo('name'), $template_email_error); 
    149                         $template_email_error = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_email_error); 
    150                         $template_email_error = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_error); 
    151                         echo $template_email_error; 
    152  
    153                   // If There Are No Errors 
    154                   } else { 
     141                   
     142                  // If There Is No Error, We Process The E-Mail 
     143                  if(empty($error)) { 
     144                        // If Remarks Is Empty, Assign N/A 
     145                        if(empty($yourremarks)) { $yourremarks = 'N/A'; } 
     146 
    155147                        // Variables Variables Variables 
    156148                        $post_title = email_title(); 
     
    208200                        $template_email_bodyalt = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_email_bodyalt); 
    209201                        $template_email_bodyalt = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_bodyalt); 
    210  
     202                         
    211203                        // PHP Mailer Variables 
    212204                        $mail = new PHPMailer(); 
     
    243235                        // If There Is Error Sending 
    244236                        } else { 
     237                              if($yourremarks == 'N/A') { $yourremarks = ''; } 
    245238                              $email_status = __('Failed'); 
    246239                              // Template For Sent Failed 
     
    253246                              $template_email_sentfailed = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_email_sentfailed); 
    254247                              $template_email_sentfailed = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_sentfailed); 
    255                               echo $template_email_sentfailed; 
    256248                        } 
    257249 
     
    271263                              if(!$log_email_sending) { 
    272264                                    die('Error Logging E-Mail Sending'); 
    273                               } // End if(!$log_email_sending) 
    274                         } // End foreach($friends as $friend) 
    275                   } // End if(!empty($error)) 
     265                              } 
     266                        } 
     267 
     268                  // If There Are Errors 
     269                  } else {                 
     270                        $error = substr($error, 20); 
     271                        $template_email_error = stripslashes(get_settings('email_template_error')); 
     272                        $template_email_error = str_replace("%EMAIL_ERROR_MSG%", $error, $template_email_error); 
     273                        $template_email_error = str_replace("%EMAIL_BLOG_NAME%", get_bloginfo('name'), $template_email_error); 
     274                        $template_email_error = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_email_error); 
     275                        $template_email_error = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_error);                        
     276                  } // End if(empty($error)) 
    276277            } // End while (have_posts()) 
    277278      } // End if(have_posts()) 
    278 } else { 
     279} // End if(!empty($did_email)) 
    279280?> 
     281<?php if(empty($email_status) || $email_status == __('Failed')): ?> 
    280282      <?php if (not_spamming()): ?> 
    281283            <?php if (have_posts()) : ?> 
     
    286288                                    E-Mail A Copy Of <b><?php the_title(); ?></b> To A Friend. 
    287289                              </p> 
     290                              <!-- Display Error, If There Is Any --> 
     291                              <?php echo $template_email_sentfailed; ?> 
     292                              <?php echo $template_email_error; ?> 
     293                              <!-- End Display Error, If There Is Any --> 
    288294                              <p><b>* Required Field</b></p> 
    289295                              <p> 
    290296                                    <b><label for="yourname">Your Name: *</label></b><br /> 
    291                                     <input type="text" size="50" id="yourname" name="yourname" class="Forms" /> 
     297                                    <input type="text" size="50" id="yourname" name="yourname" class="Forms" value="<?php echo $yourname; ?>" /> 
    292298                              </p> 
    293299                              <p> 
    294300                                    <b><label for="youremail">Your E-Mail: *</label></b><br /> 
    295                                     <input type="text" size="50" id="youremail" name="youremail" class="Forms" /> 
     301                                    <input type="text" size="50" id="youremail" name="youremail" class="Forms" value="<?php echo $youremail; ?>" /> 
    296302                              </p> 
    297303                              <p> 
    298304                                    <b><label for="yourremarks">Your Remarks:</label></b><br /> 
    299                                     <textarea cols="49" rows="8" id="yourremarks" name="yourremarks" class="Forms"></textarea> 
     305                                    <textarea cols="49" rows="8" id="yourremarks" name="yourremarks" class="Forms"><?php echo $yourremarks; ?></textarea> 
    300306                              </p> 
    301307                              <p> 
    302308                                    <b><label for="friendname">Friend's Name: *</label></b><br /> 
    303                                     <input type="text" size="50" id="friendname" name="friendname" class="Forms" /><?php email_multiple(); ?> 
     309                                    <input type="text" size="50" id="friendname" name="friendname" class="Forms" value="<?php echo $friendname; ?>" /><?php email_multiple(); ?> 
    304310                              </p> 
    305311                              <p> 
    306312                                    <b><label for="friendemail">Friend's E-Mail: *</label></b><br /> 
    307                                     <input type="text" size="50" id="friendemail" name="friendemail" class="Forms" /><?php email_multiple(); ?> 
     313                                    <input type="text" size="50" id="friendemail" name="friendemail" class="Forms" value="<?php echo $friendemail; ?>" /><?php email_multiple(); ?> 
    308314                              </p> 
    309315                              <?php if($email_image_verify): ?> 
     
    325331                  <p>Please Wait For <b><?php email_flood_interval(); ?> Minutes</b> Before Sending The Next Article.</p> 
    326332      <?php endif; ?> 
    327 <?php } // End if(!empty($did_email)) ?> 
     333<?php endif; ?> 
    328334      <p style="text-align: center; padding-top: 20px;"><a href="#" onclick="window.close();">Close This Window</a></p> 
    329335</body> 
  • wp-email/trunk/email/wp-email.php

    r6236 r6252  
    3636require(ABSPATH.'wp-content/plugins/email/class-phpmailer.php'); 
    3737 
     38### Form Variables 
     39$yourname = strip_tags(stripslashes(trim($_POST['yourname']))); 
     40$youremail = strip_tags(stripslashes(trim($_POST['youremail']))); 
     41$yourremarks = strip_tags(stripslashes(trim($_POST['yourremarks']))); 
     42$friendname = strip_tags(stripslashes(trim($_POST['friendname']))); 
     43$friendemail = strip_tags(stripslashes(trim($_POST['friendemail']))); 
     44 
    3845### If User Click On Mail 
    3946if(!empty($did_email)) { 
    4047      // Variables Variables Variables 
    41       $yourname = strip_tags(stripslashes(trim($_POST['yourname']))); 
    42       $youremail = strip_tags(stripslashes(trim($_POST['youremail']))); 
    43       $yourremarks = strip_tags(stripslashes(trim($_POST['yourremarks']))); 
    44       $friendname = strip_tags(stripslashes(trim($_POST['friendname']))); 
    45       $friendemail = strip_tags(stripslashes(trim($_POST['friendemail']))); 
    4648      $imageverify = $_POST['imageverify']; 
    4749      $smtp_info = get_settings('email_smtp'); 
    4850      $smtp_info = explode('|', $smtp_info); 
    4951      $error = ''; 
    50       // If Remarks Is Empty, Assign N/A 
    51       if(empty($yourremarks)) { $yourremarks = 'N/A'; } 
    5252 
    5353      // If There Is Post 
     
    118118                        } 
    119119                  } 
     120                   
     121                  // If There Is No Error, We Process The E-Mail 
     122                  if(empty($error)) { 
     123                        // If Remarks Is Empty, Assign N/A 
     124                        if(empty($yourremarks)) { $yourremarks = 'N/A'; } 
     125 
     126                        // Variables Variables Variables 
     127                        $post_title = email_title(); 
     128                        $post_author = the_author('', false); 
     129                        $post_date = the_date('jS F Y @ H:i', '', '', false); 
     130                        $post_category = email_category(); 
     131                        $post_category_alt = strip_tags($post_category); 
     132                        $post_excerpt = get_the_excerpt(); 
     133                        $post_content .= email_content(); 
     134                        $post_content_alt = email_content_alt(); 
     135                                           
     136                        // Template For E-Mail Subject 
     137                        $template_email_subject = stripslashes(get_settings('email_template_subject')); 
     138                        $template_email_subject = str_replace("%EMAIL_YOUR_NAME%", $yourname, $template_email_subject); 
     139                        $template_email_subject = str_replace("%EMAIL_YOUR_EMAIL%", $youremail, $template_email_subject); 
     140                        $template_email_subject = str_replace("%EMAIL_POST_TITLE%", $post_title, $template_email_subject); 
     141                        $template_email_subject = str_replace("%EMAIL_POST_AUTHOR%", $post_author, $template_email_subject); 
     142                        $template_email_subject = str_replace("%EMAIL_POST_DATE%", $post_date, $template_email_subject); 
     143                        $template_email_subject = str_replace("%EMAIL_POST_CATEGORY%", $post_category_alt, $template_email_subject); 
     144                        $template_email_subject = str_replace("%EMAIL_BLOG_NAME%", get_bloginfo('name'), $template_email_subject); 
     145                        $template_email_subject = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_email_subject); 
     146                        $template_email_subject = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_subject); 
     147 
     148                        // Template For E-Mail Body 
     149                        $template_email_body = stripslashes(get_settings('email_template_body')); 
     150                        $template_email_body = str_replace("%EMAIL_YOUR_NAME%", $yourname, $template_email_body); 
     151                        $template_email_body = str_replace("%EMAIL_YOUR_EMAIL%", $youremail, $template_email_body); 
     152                        $template_email_body = str_replace("%EMAIL_YOUR_REMARKS%", $yourremarks, $template_email_body); 
     153                        $template_email_body = str_replace("%EMAIL_FRIEND_NAME%", $friendname, $template_email_body); 
     154                        $template_email_body = str_replace("%EMAIL_FRIEND_EMAIL%", $friendemail, $template_email_body); 
     155                        $template_email_body = str_replace("%EMAIL_POST_TITLE%", $post_title, $template_email_body); 
     156                        $template_email_body = str_replace("%EMAIL_POST_AUTHOR%", $post_author, $template_email_body); 
     157                        $template_email_body = str_replace("%EMAIL_POST_DATE%", $post_date, $template_email_body); 
     158                        $template_email_body = str_replace("%EMAIL_POST_CATEGORY%", $post_category, $template_email_body); 
     159                        $template_email_body = str_replace("%EMAIL_POST_EXCERPT%", $post_excerpt, $template_email_body); 
     160                        $template_email_body = str_replace("%EMAIL_POST_CONTENT%", $post_content, $template_email_body); 
     161                        $template_email_body = str_replace("%EMAIL_BLOG_NAME%", get_bloginfo('name'), $template_email_body); 
     162                        $template_email_body = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_email_body); 
     163                        $template_email_body = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_body); 
     164 
     165                        // Template For E-Mail Alternate Body 
     166                        $template_email_bodyalt = stripslashes(get_settings('email_template_bodyalt')); 
     167                        $template_email_bodyalt = str_replace("%EMAIL_YOUR_NAME%", $yourname, $template_email_bodyalt); 
     168                        $template_email_bodyalt = str_replace("%EMAIL_YOUR_EMAIL%", $youremail, $template_email_bodyalt); 
     169                        $template_email_bodyalt = str_replace("%EMAIL_YOUR_REMARKS%", $yourremarks, $template_email_bodyalt); 
     170                        $template_email_bodyalt = str_replace("%EMAIL_FRIEND_NAME%", $friendname, $template_email_bodyalt); 
     171                        $template_email_bodyalt = str_replace("%EMAIL_FRIEND_EMAIL%", $friendemail, $template_email_bodyalt); 
     172                        $template_email_bodyalt = str_replace("%EMAIL_POST_TITLE%", $post_title, $template_email_bodyalt); 
     173                        $template_email_bodyalt = str_replace("%EMAIL_POST_AUTHOR%", $post_author, $template_email_bodyalt); 
     174                        $template_email_bodyalt = str_replace("%EMAIL_POST_DATE%", $post_date, $template_email_bodyalt); 
     175                        $template_email_bodyalt = str_replace("%EMAIL_POST_CATEGORY%", $post_category_alt, $template_email_bodyalt); 
     176                        $template_email_bodyalt = str_replace("%EMAIL_POST_EXCERPT%", $post_excerpt, $template_email_bodyalt); 
     177                        $template_email_bodyalt = str_replace("%EMAIL_POST_CONTENT%", $post_content_alt, $template_email_bodyalt); 
     178                        $template_email_bodyalt = str_replace("%EMAIL_BLOG_NAME%", get_bloginfo('name'), $template_email_bodyalt); 
     179                        $template_email_bodyalt = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_email_bodyalt); 
     180                        $template_email_bodyalt = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_bodyalt); 
     181                         
     182                        // PHP Mailer Variables 
     183                        $mail = new PHPMailer(); 
     184                        $mail->From     = $youremail; 
     185                        $mail->FromName = $yourname; 
     186                        foreach($friends as $friend) { 
     187                              $mail->AddAddress($friend['email'], $friend['name']); 
     188                        } 
     189                        $mail->Username = $smtp_info[0];  
     190                        $mail->Password = $smtp_info[1]; 
     191                        $mail->Host     = $smtp_info[2]; 
     192                        $mail->Mailer   = get_settings('email_mailer'); 
     193                        $mail->ContentType =  get_settings('email_contenttype'); 
     194                        $mail->Subject = $template_email_subject; 
     195                        if(get_settings('email_contenttype') == 'text/plain') { 
     196                              $mail->Body    = $template_email_bodyalt; 
     197                        } else { 
     198                              $mail->Body    = $template_email_body; 
     199                              $mail->AltBody = $template_email_bodyalt; 
     200                        } 
     201                        // Send The Mail 
     202                        if($mail->Send()) { 
     203                              $email_status = __('Success'); 
     204                              get_header(); 
     205                              // Template For Sent Successfully 
     206                              $template_email_sentsuccess = stripslashes(get_settings('email_template_sentsuccess')); 
     207                              $template_email_sentsuccess = str_replace("%EMAIL_FRIEND_NAME%", $friendname, $template_email_sentsuccess); 
     208                              $template_email_sentsuccess = str_replace("%EMAIL_FRIEND_EMAIL%", $friendemail, $template_email_sentsuccess); 
     209                              $template_email_sentsuccess = str_replace("%EMAIL_POST_TITLE%", $post_title, $template_email_sentsuccess); 
     210                              $template_email_sentsuccess = str_replace("%EMAIL_BLOG_NAME%", get_bloginfo('name'), $template_email_sentsuccess); 
     211                              $template_email_sentsuccess = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_email_sentsuccess); 
     212                              $template_email_sentsuccess = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_sentsuccess); 
     213                              echo $template_email_sentsuccess; 
     214                              get_sidebar(); 
     215                              get_footer(); 
     216 
     217                        // If There Is Error Sending 
     218                        } else { 
     219                              if($yourremarks == 'N/A') { $yourremarks = ''; } 
     220                              $email_status = __('Failed'); 
     221                              // Template For Sent Failed 
     222                              $template_email_sentfailed = stripslashes(get_settings('email_template_sentfailed')); 
     223                              $template_email_sentfailed = str_replace("%EMAIL_FRIEND_NAME%", $friendname, $template_email_sentfailed); 
     224                              $template_email_sentfailed = str_replace("%EMAIL_FRIEND_EMAIL%", $friendemail, $template_email_sentfailed); 
     225                              $template_email_sentfailed = str_replace("%EMAIL_ERROR_MSG%", $mail->ErrorInfo, $template_email_sentfailed); 
     226                              $template_email_sentfailed = str_replace("%EMAIL_POST_TITLE%", $post_title, $template_email_sentfailed); 
     227                              $template_email_sentfailed = str_replace("%EMAIL_BLOG_NAME%", get_bloginfo('name'), $template_email_sentfailed); 
     228                              $template_email_sentfailed = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_email_sentfailed); 
     229                              $template_email_sentfailed = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_sentfailed); 
     230                        } 
     231 
     232                        // Logging 
     233                        $email_yourname = addslashes($yourname); 
     234                        $email_youremail = addslashes($youremail); 
     235                        $email_yourremarks = addslashes($yourremarks); 
     236                        $email_postid = email_id(); 
     237                        $email_posttitle = addslashes($post_title); 
     238                        $email_timestamp = current_time('timestamp'); 
     239                        $email_ip = get_email_ipaddress(); 
     240                        $email_host = gethostbyaddr($email_ip); 
     241                        foreach($friends as $friend) { 
     242                              $email_friendname = addslashes($friend['name']); 
     243                              $email_friendemail = addslashes($friend['email']); 
     244                              $log_email_sending = email_log("0, '$email_yourname', '$email_youremail', '$email_yourremarks', '$email_friendname', '$email_friendemail', $email_postid, '$email_posttitle', '$email_timestamp', '$email_ip', '$email_host', '$email_status'"); 
     245                              if(!$log_email_sending) { 
     246                                    die('Error Logging E-Mail Sending'); 
     247                              } 
     248                        } 
     249 
     250                        // If E-Mail Sent Successfully, We No Not Need The E-Mail Form Anymore 
     251                        if($email_status == __('Success')) { 
     252                              exit(); 
     253                        } 
    120254 
    121255                  // If There Are Errors 
    122                   if(!empty($error)) { 
     256                  } else {                
    123257                        $error = substr($error, 20); 
    124                         get_header(); 
    125258                        $template_email_error = stripslashes(get_settings('email_template_error')); 
    126259                        $template_email_error = str_replace("%EMAIL_ERROR_MSG%", $error, $template_email_error); 
    127260                        $template_email_error = str_replace("%EMAIL_BLOG_NAME%", get_bloginfo('name'), $template_email_error); 
    128261                        $template_email_error = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_email_error); 
    129                         $template_email_error = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_error); 
    130                         echo $template_email_error; 
    131                         get_sidebar(); 
    132                         get_footer(); 
    133                         exit(); 
    134                   } 
    135  
    136                   // Variables Variables Variables 
    137                   $post_title = email_title(); 
    138                   $post_author = the_author('', false); 
    139                   $post_date = the_date('jS F Y @ H:i', '', '', false); 
    140                   $post_category = email_category(); 
    141                   $post_category_alt = strip_tags($post_category); 
    142                   $post_excerpt = get_the_excerpt(); 
    143                   $post_content .= email_content(); 
    144                   $post_content_alt = email_content_alt(); 
    145                                      
    146                   // Template For E-Mail Subject 
    147                   $template_email_subject = stripslashes(get_settings('email_template_subject')); 
    148                   $template_email_subject = str_replace("%EMAIL_YOUR_NAME%", $yourname, $template_email_subject); 
    149                   $template_email_subject = str_replace("%EMAIL_YOUR_EMAIL%", $youremail, $template_email_subject); 
    150                   $template_email_subject = str_replace("%EMAIL_POST_TITLE%", $post_title, $template_email_subject); 
    151                   $template_email_subject = str_replace("%EMAIL_POST_AUTHOR%", $post_author, $template_email_subject); 
    152                   $template_email_subject = str_replace("%EMAIL_POST_DATE%", $post_date, $template_email_subject); 
    153                   $template_email_subject = str_replace("%EMAIL_POST_CATEGORY%", $post_category_alt, $template_email_subject); 
    154                   $template_email_subject = str_replace("%EMAIL_BLOG_NAME%", get_bloginfo('name'), $template_email_subject); 
    155                   $template_email_subject = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_email_subject); 
    156                   $template_email_subject = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_subject); 
    157  
    158                   // Template For E-Mail Body 
    159                   $template_email_body = stripslashes(get_settings('email_template_body')); 
    160                   $template_email_body = str_replace("%EMAIL_YOUR_NAME%", $yourname, $template_email_body); 
    161                   $template_email_body = str_replace("%EMAIL_YOUR_EMAIL%", $youremail, $template_email_body); 
    162                   $template_email_body = str_replace("%EMAIL_YOUR_REMARKS%", $yourremarks, $template_email_body); 
    163                   $template_email_body = str_replace("%EMAIL_FRIEND_NAME%", $friendname, $template_email_body); 
    164                   $template_email_body = str_replace("%EMAIL_FRIEND_EMAIL%", $friendemail, $template_email_body); 
    165                   $template_email_body = str_replace("%EMAIL_POST_TITLE%", $post_title, $template_email_body); 
    166                   $template_email_body = str_replace("%EMAIL_POST_AUTHOR%", $post_author, $template_email_body); 
    167                   $template_email_body = str_replace("%EMAIL_POST_DATE%", $post_date, $template_email_body); 
    168                   $template_email_body = str_replace("%EMAIL_POST_CATEGORY%", $post_category, $template_email_body); 
    169                   $template_email_body = str_replace("%EMAIL_POST_EXCERPT%", $post_excerpt, $template_email_body); 
    170                   $template_email_body = str_replace("%EMAIL_POST_CONTENT%", $post_content, $template_email_body); 
    171                   $template_email_body = str_replace("%EMAIL_BLOG_NAME%", get_bloginfo('name'), $template_email_body); 
    172                   $template_email_body = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_email_body); 
    173                   $template_email_body = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_body); 
    174  
    175                   // Template For E-Mail Alternate Body 
    176                   $template_email_bodyalt = stripslashes(get_settings('email_template_bodyalt')); 
    177                   $template_email_bodyalt = str_replace("%EMAIL_YOUR_NAME%", $yourname, $template_email_bodyalt); 
    178                   $template_email_bodyalt = str_replace("%EMAIL_YOUR_EMAIL%", $youremail, $template_email_bodyalt); 
    179                   $template_email_bodyalt = str_replace("%EMAIL_YOUR_REMARKS%", $yourremarks, $template_email_bodyalt); 
    180                   $template_email_bodyalt = str_replace("%EMAIL_FRIEND_NAME%", $friendname, $template_email_bodyalt); 
    181                   $template_email_bodyalt = str_replace("%EMAIL_FRIEND_EMAIL%", $friendemail, $template_email_bodyalt); 
    182                   $template_email_bodyalt = str_replace("%EMAIL_POST_TITLE%", $post_title, $template_email_bodyalt); 
    183                   $template_email_bodyalt = str_replace("%EMAIL_POST_AUTHOR%", $post_author, $template_email_bodyalt); 
    184                   $template_email_bodyalt = str_replace("%EMAIL_POST_DATE%", $post_date, $template_email_bodyalt); 
    185                   $template_email_bodyalt = str_replace("%EMAIL_POST_CATEGORY%", $post_category_alt, $template_email_bodyalt); 
    186                   $template_email_bodyalt = str_replace("%EMAIL_POST_EXCERPT%", $post_excerpt, $template_email_bodyalt); 
    187                   $template_email_bodyalt = str_replace("%EMAIL_POST_CONTENT%", $post_content_alt, $template_email_bodyalt); 
    188                   $template_email_bodyalt = str_replace("%EMAIL_BLOG_NAME%", get_bloginfo('name'), $template_email_bodyalt); 
    189                   $template_email_bodyalt = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_email_bodyalt); 
    190                   $template_email_bodyalt = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_bodyalt); 
    191                    
    192                   // PHP Mailer Variables 
    193                   $mail = new PHPMailer(); 
    194                   $mail->From     = $youremail; 
    195                   $mail->FromName = $yourname; 
    196                   foreach($friends as $friend) { 
    197                         $mail->AddAddress($friend['email'], $friend['name']); 
    198                   } 
    199                   $mail->Username = $smtp_info[0];  
    200                   $mail->Password = $smtp_info[1]; 
    201                   $mail->Host     = $smtp_info[2]; 
    202                   $mail->Mailer   = get_settings('email_mailer'); 
    203                   $mail->ContentType =  get_settings('email_contenttype'); 
    204                   $mail->Subject = $template_email_subject; 
    205                   if(get_settings('email_contenttype') == 'text/plain') { 
    206                         $mail->Body    = $template_email_bodyalt; 
    207                   } else { 
    208                         $mail->Body    = $template_email_body; 
    209                         $mail->AltBody = $template_email_bodyalt; 
    210                   } 
    211                   // Send The Mail 
    212                   if($mail->Send()) { 
    213                         $email_status = __('Success'); 
    214                         get_header(); 
    215                         // Template For Sent Successfully 
    216                         $template_email_sentsuccess = stripslashes(get_settings('email_template_sentsuccess')); 
    217                         $template_email_sentsuccess = str_replace("%EMAIL_FRIEND_NAME%", $friendname, $template_email_sentsuccess); 
    218                         $template_email_sentsuccess = str_replace("%EMAIL_FRIEND_EMAIL%", $friendemail, $template_email_sentsuccess); 
    219                         $template_email_sentsuccess = str_replace("%EMAIL_POST_TITLE%", $post_title, $template_email_sentsuccess); 
    220                         $template_email_sentsuccess = str_replace("%EMAIL_BLOG_NAME%", get_bloginfo('name'), $template_email_sentsuccess); 
    221                         $template_email_sentsuccess = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_email_sentsuccess); 
    222                         $template_email_sentsuccess = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_sentsuccess); 
    223                         echo $template_email_sentsuccess; 
    224                         get_sidebar(); 
    225                         get_footer(); 
    226  
    227                   // If There Is Error Sending 
    228                   } else { 
    229                         $email_status = __('Failed'); 
    230                         get_header(); 
    231                         // Template For Sent Failed 
    232                         $template_email_sentfailed = stripslashes(get_settings('email_template_sentfailed')); 
    233                         $template_email_sentfailed = str_replace("%EMAIL_FRIEND_NAME%", $friendname, $template_email_sentfailed); 
    234                         $template_email_sentfailed = str_replace("%EMAIL_FRIEND_EMAIL%", $friendemail, $template_email_sentfailed); 
    235                         $template_email_sentfailed = str_replace("%EMAIL_ERROR_MSG%", $mail->ErrorInfo, $template_email_sentfailed); 
    236                         $template_email_sentfailed = str_replace("%EMAIL_POST_TITLE%", $post_title, $template_email_sentfailed); 
    237                         $template_email_sentfailed = str_replace("%EMAIL_BLOG_NAME%", get_bloginfo('name'), $template_email_sentfailed); 
    238                         $template_email_sentfailed = str_replace("%EMAIL_BLOG_URL%", get_bloginfo('url'), $template_email_sentfailed); 
    239                         $template_email_sentfailed = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_sentfailed); 
    240                         echo $template_email_sentfailed; 
    241                         get_sidebar(); 
    242                         get_footer(); 
    243                   } 
    244  
    245                   // Logging 
    246                   $email_yourname = addslashes($yourname); 
    247                   $email_youremail = addslashes($youremail); 
    248                   $email_yourremarks = addslashes($yourremarks); 
    249                   $email_postid = email_id(); 
    250                   $email_posttitle = addslashes($post_title); 
    251                   $email_timestamp = current_time('timestamp'); 
    252                   $email_ip = get_email_ipaddress(); 
    253                   $email_host = gethostbyaddr($email_ip); 
    254                   foreach($friends as $friend) { 
    255                         $email_friendname = addslashes($friend['name']); 
    256                         $email_friendemail = addslashes($friend['email']); 
    257                         $log_email_sending = email_log("0, '$email_yourname', '$email_youremail', '$email_yourremarks', '$email_friendname', '$email_friendemail', $email_postid, '$email_posttitle', '$email_timestamp', '$email_ip', '$email_host', '$email_status'"); 
    258                         if(!$log_email_sending) { 
    259                               die('Error Logging E-Mail Sending'); 
    260                         } 
    261                   } 
    262                   exit(); 
    263             } 
    264       } 
    265 
     262                        $template_email_error = str_replace("%EMAIL_PERMALINK%", get_permalink(), $template_email_error);                        
     263                  } // End if(empty($error)) 
     264            } // End while (have_posts()) 
     265      } // End if(have_posts()) 
     266} // End if(!empty($did_email)) 
    266267?> 
    267268<?php get_header(); ?> 
     
    272273                              <?php if(not_password_protected()) { ?> 
    273274                                    <?php email_form_header(); ?>        
    274                                     <p align="center"> 
     275                                    <p style="text-align: center"> 
    275276                                          E-Mail A Copy Of <b><?php the_title(); ?></b> To A Friend. 
    276277                                    </p> 
     278                                    <!-- Display Error, If There Is Any --> 
     279                                    <?php echo $template_email_sentfailed; ?> 
     280                                    <?php echo $template_email_error; ?> 
     281                                    <!-- End Display Error, If There Is Any --> 
    277282                                    <p><b>* Required Field</b></p> 
    278283                                    <p> 
    279284                                          <b><label for="yourname">Your Name: *</label></b><br /> 
    280                                           <input type="text" size="50" id="yourname" name="yourname" class="Forms" /> 
     285                                          <input type="text" size="50" id="yourname" name="yourname" class="Forms" value="<?php echo $yourname; ?>" /> 
    281286                                    </p> 
    282287                                    <p> 
    283288                                          <b><label for="youremail">Your E-Mail: *</label></b><br /> 
    284                                           <input type="text" size="50" id="youremail" name="youremail" class="Forms" /> 
     289                                          <input type="text" size="50" id="youremail" name="youremail" class="Forms" value="<?php echo $youremail; ?>" /> 
    285290                                    </p> 
    286291                                    <p> 
    287292                                          <b><label for="yourremarks">Your Remarks:</label></b><br /> 
    288                                           <textarea cols="49" rows="8" id="yourremarks" name="yourremarks" class="Forms"></textarea> 
     293                                          <textarea cols="49" rows="8" id="yourremarks" name="yourremarks" class="Forms"><?php echo $yourremarks; ?></textarea> 
    289294                                    </p> 
    290295                                    <p> 
    291296                                          <b><label for="friendname">Friend's Name: *</label></b><br /> 
    292                                           <input type="text" size="50" id="friendname" name="friendname" class="Forms" /><?php email_multiple(); ?> 
     297                                          <input type="text" size="50" id="friendname" name="friendname" class="Forms" value="<?php echo $friendname; ?>" /><?php email_multiple(); ?> 
    293298                                    </p> 
    294299                                    <p> 
    295300                                          <b><label for="friendemail">Friend's E-Mail: *</label></b><br /> 
    296                                           <input type="text" size="50" id="friendemail" name="friendemail" class="Forms" /><?php email_multiple(); ?> 
     301                                          <input type="text" size="50" id="friendemail" name="friendemail" class="Forms" value="<?php echo $friendemail; ?>" /><?php email_multiple(); ?> 
    297302                                    </p> 
    298303                                    <?php if($email_image_verify): ?> 
  • wp-email/trunk/readme.html

    r6243 r6252  
    211211                  <p><b>Development:</b><br /><b>&raquo;</b> <a href="http://dev.wp-plugins.org/browser/wp-email/" title="http://dev.wp-plugins.org/browser/wp-email/">http://dev.wp-plugins.org/browser/wp-email/</a></p> 
    212212                  <p><b>Support Forums:</b><br /><b>&raquo;</b> <a href="http://forums.lesterchan.net/viewforum.php?f=13" title="http://forums.lesterchan.net/viewforum.php?f=13">http://forums.lesterchan.net/viewforum.php?f=13</a></p> 
    213                   <p><b>Updated:</b><br /><b>&raquo;</b> 1st August 2006</p> 
     213                  <p><b>Updated:</b><br /><b>&raquo;</b> 1st October 2006</p> 
    214214                  <div class="SubSubTitle">Changelog</div> 
    215215                  <ul> 
    216216                        <li> 
    217                               <b>Version 2.07 (01-08-2006)</b> 
     217                              <b>Version 2.07 (01-10-2006)</b> 
    218218                              <ul> 
    219219                                    <li>NEW: Added rel="nofollow" To All Links Generated By WP-EMail</li> 
    220220                                    <li>NEW: Added noindex, nofollow To Robots Meta Tag In wp-email-popup.php</li> 
     221                          &n