Changeset 6073

Show
Ignore:
Timestamp:
05/30/06 11:18:45 (2 years ago)
Author:
GamerZ
Message:

Version 2.05 Update

Files:

Legend:

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

    r5522 r6073  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.0 Plugin: WP-EMail 2.04                                                           | 
     5|     WordPress 2.0 Plugin: WP-EMail 2.05                                                           | 
    66|     Copyright (c) 2005 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
     
    7070            $email_sortby_text = 'To E-Mail'; 
    7171            break; 
    72       case 'remarks': 
    73             $email_sortby = 'email_yourremarks'; 
    74             $email_sortby_text = 'Remarks'; 
    75             break; 
    7672      case 'postid': 
    7773            $email_sortby = 'email_postid'; 
     
    174170      <table width="100%"  border="0" cellspacing="3" cellpadding="3"> 
    175171      <tr> 
    176             <th width="2%"><?php _e('ID'); ?></th> 
    177             <th width="16%"><?php _e('From'); ?></th> 
    178             <th width="16%"><?php _e('To'); ?></th> 
    179             <th width="15%"><?php _e('Remarks'); ?></th> 
    180             <th width="16%"><?php _e('Date / Time'); ?></th> 
    181             <th width="14%"><?php _e('IP / Host'); ?></th> 
    182             <th width="16%"><?php _e('Post Title'); ?></th> 
    183             <th width="5%"><?php _e('Status'); ?></th> 
     172            <th width="5%"><?php _e('ID'); ?></th> 
     173            <th width="17%"><?php _e('From'); ?></th> 
     174            <th width="17%"><?php _e('To'); ?></th> 
     175            <th width="17%"><?php _e('Date / Time'); ?></th> 
     176            <th width="17%"><?php _e('IP / Host'); ?></th> 
     177            <th width="17%"><?php _e('Post Title'); ?></th> 
     178            <th width="10%"><?php _e('Status'); ?></th> 
    184179      </tr> 
    185180      <?php 
     
    195190                        $email_yourname = stripslashes($email_log->email_yourname); 
    196191                        $email_youremail = stripslashes($email_log->email_youremail); 
    197                         $email_yourremarks = stripslashes($email_log->email_yourremarks); 
    198192                        $email_friendname = stripslashes($email_log->email_friendname); 
    199193                        $email_friendemail = stripslashes($email_log->email_friendemail); 
     
    209203                        echo "<td>$email_yourname<br />$email_youremail</td>\n"; 
    210204                        echo "<td>$email_friendname<br />$email_friendemail</td>\n"; 
    211                         echo "<td>$email_yourremarks</td>\n"; 
    212205                        echo "<td>$email_date<br />$email_time</td>\n"; 
    213206                        echo "<td>$email_ip<br />$email_host</td>\n"; 
     
    218211                  } 
    219212            } else { 
    220                   echo '<tr><td colspan="8" align="center"><b>'.__('No E-Mail Logs Found').'</b></td></tr>'; 
     213                  echo '<tr><td colspan="7" align="center"><b>'.__('No E-Mail Logs Found').'</b></td></tr>'; 
    221214            } 
    222215      ?> 
     
    283276      <br /> 
    284277      <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get"> 
    285             <input type="hidden" name="page" value="<?php echo $base_name; ?>"
     278            <input type="hidden" name="page" value="<?php echo $base_name; ?>" /
    286279            Sort Options:&nbsp;&nbsp;&nbsp; 
    287280            <select name="by" size="1"> 
     
    291284                  <option value="toname"<?php if($email_sortby == 'email_friendname') { echo ' selected="selected"'; }?>>To Name</option> 
    292285                  <option value="toemail"<?php if($email_sortby == 'email_friendemail') { echo ' selected="selected"'; }?>>To E-Mail</option> 
    293                   <option value="remarks"<?php if($email_sortby == 'email_yourremarks') { echo ' selected="selected"'; }?>>Remarks</option> 
    294286                  <option value="date"<?php if($email_sortby == 'email_timestamp') { echo ' selected="selected"'; }?>>Date</option> 
    295287                  <option value="postid"<?php if($email_sortby == 'email_postid') { echo ' selected="selected"'; }?>>Post ID</option> 
  • wp-email/trunk/email/email-options.php

    r5522 r6073  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.0 Plugin: WP-EMail 2.04                                                           | 
     5|     WordPress 2.0 Plugin: WP-EMail 2.05                                                           | 
    66|     Copyright (c) 2005 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
     
    4040      $email_interval = intval(trim($_POST['email_interval'])); 
    4141      $email_multiple = intval(trim($_POST['email_multiple'])); 
     42      $email_imageverify = intval(trim($_POST['email_imageverify'])); 
    4243      $email_template_subject = strip_tags(trim($_POST['email_template_subject'])); 
    4344      $email_template_body = trim($_POST['email_template_body']); 
     
    5455      $update_email_queries[] = update_option('email_interval', $email_interval); 
    5556      $update_email_queries[] = update_option('email_multiple', $email_multiple); 
     57      $update_email_queries[] = update_option('email_imageverify', $email_imageverify); 
    5658      $update_email_queries[] = update_option('email_template_subject', $email_template_subject); 
    5759      $update_email_queries[] = update_option('email_template_body', $email_template_body); 
     
    6668      $update_email_text[] = __('Interval Option'); 
    6769      $update_email_text[] = __('Multiple E-Mails Option'); 
     70      $update_email_text[] = __('Image Verification Option'); 
    6871      $update_email_text[] = __('Subject Template'); 
    6972      $update_email_text[] = __('Body Template'); 
     
    8689 
    8790?> 
    88 <script language="JavaScript" type="text/javascript"> 
    89 function email_default_templates(template) { 
    90       var default_template; 
    91       switch(template) { 
    92             case "subject": 
    93                   default_template = "Recommended Article By %EMAIL_YOUR_NAME%: %EMAIL_POST_TITLE%"; 
    94                   break; 
    95             case "body": 
    96                   default_template = "<p>Hi <b>%EMAIL_FRIEND_NAME%</b>,<br />Your friend, <b>%EMAIL_YOUR_NAME%</b>, has recommended this article entitled '<b>%EMAIL_POST_TITLE%</b>' to you.</p><p><b>Here is his/her remarks:</b><br />%EMAIL_YOUR_REMARKS%</p><p><b>%EMAIL_POST_TITLE%</b><br />Posted By %EMAIL_POST_AUTHOR% On %EMAIL_POST_DATE% In %EMAIL_POST_CATEGORY%</p>%EMAIL_POST_CONTENT%<p>Article taken from %EMAIL_BLOG_NAME% - <a href=\"%EMAIL_BLOG_URL%\">%EMAIL_BLOG_URL%</a><br />URL to article: <a href=\"%EMAIL_PERMALINK%\">%EMAIL_PERMALINK%</a></p>"; 
    97                   break; 
    98             case "bodyalt": 
    99                   default_template = "Hi %EMAIL_FRIEND_NAME%,\nYour friend, %EMAIL_YOUR_NAME%, has recommended this article entitled '%EMAIL_POST_TITLE%' to you.\n\nHere is his/her remarks:\n%EMAIL_YOUR_REMARKS%\n\n%EMAIL_POST_TITLE%\nPosted By %EMAIL_POST_AUTHOR% On %EMAIL_POST_DATE% In %EMAIL_POST_CATEGORY%\n%EMAIL_POST_CONTENT%\nArticle taken from %EMAIL_BLOG_NAME% - %EMAIL_BLOG_URL%\nURL to article: %EMAIL_PERMALINK%"; 
    100                   break; 
    101             case "sentsuccess": 
    102                   default_template = "<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>"; 
    103                   break; 
    104             case "sentfailed": 
    105                   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>"; 
    106                   break; 
    107             case "error": 
    108                   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>"; 
    109                   break; 
    110       } 
    111       document.getElementById("email_template_" + template).value = default_template; 
     91<script type="text/javascript"> 
     92/* <![CDATA[*/ 
     93      function email_default_templates(template) { 
     94            var default_template; 
     95            switch(template) { 
     96                  case "subject": 
     97                        default_template = "Recommended Article By %EMAIL_YOUR_NAME%: %EMAIL_POST_TITLE%"; 
     98                        break; 
     99                  case "body": 
     100                        default_template = "<p>Hi <b>%EMAIL_FRIEND_NAME%</b>,<br />Your friend, <b>%EMAIL_YOUR_NAME%</b>, has recommended this article entitled '<b>%EMAIL_POST_TITLE%</b>' to you.</p><p><b>Here is his/her remarks:</b><br />%EMAIL_YOUR_REMARKS%</p><p><b>%EMAIL_POST_TITLE%</b><br />Posted By %EMAIL_POST_AUTHOR% On %EMAIL_POST_DATE% In %EMAIL_POST_CATEGORY%</p>%EMAIL_POST_CONTENT%<p>Article taken from %EMAIL_BLOG_NAME% - <a href=\"%EMAIL_BLOG_URL%\">%EMAIL_BLOG_URL%</a><br />URL to article: <a href=\"%EMAIL_PERMALINK%\">%EMAIL_PERMALINK%</a></p>"; 
     101                        break; 
     102                  case "bodyalt": 
     103                        default_template = "Hi %EMAIL_FRIEND_NAME%,\nYour friend, %EMAIL_YOUR_NAME%, has recommended this article entitled '%EMAIL_POST_TITLE%' to you.\n\nHere is his/her remarks:\n%EMAIL_YOUR_REMARKS%\n\n%EMAIL_POST_TITLE%\nPosted By %EMAIL_POST_AUTHOR% On %EMAIL_POST_DATE% In %EMAIL_POST_CATEGORY%\n%EMAIL_POST_CONTENT%\nArticle taken from %EMAIL_BLOG_NAME% - %EMAIL_BLOG_URL%\nURL to article: %EMAIL_PERMALINK%"; 
     104                        break; 
     105                  case "sentsuccess": 
     106                        default_template = "<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>"; 
     107                        break; 
     108                  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>"; 
     110                        break; 
     111                  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>"; 
     113                        break; 
     114            } 
     115            document.getElementById("email_template_" + template).value = default_template; 
    112116} 
     117/* ]]> */ 
    113118</script> 
    114119<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?> 
     
    169174                        </tr> 
    170175                        <tr valign="top">  
    171                               <th align="left" width="30%"><?php _e('Max Number Of Multiple E-Mails:'); ?></th> 
    172                               <td align="left"><input type="text" id="email_multiple" name="email_multiple" value="<?php echo  get_settings('email_multiple'); ?>" size="5" maxlength="3"><br />Setting this value more than 1 will enable this feature. It allows the maximum number of multiple e-mails that can be send at one go.</td>  
     176                              <th align="left" width="30%"><?php _e('Enable Image Verification:'); ?></th> 
     177                              <td align="left"> 
     178                                    <select name="email_imageverify" size="1"> 
     179                                          <option value="1"<?php selected('1', get_settings('email_imageverify')); ?>><?php _e('Yes'); ?></option> 
     180                                          <option value="0"<?php selected('0', get_settings('email_imageverify')); ?>><?php _e('No'); ?></option> 
     181                                    </select><br />It is recommanded to choose <b>Yes</b> unless your server does not support PHP GD Library. 
     182                              </td>  
    173183                        </tr> 
    174184                  </table> 
  • wp-email/trunk/email/email.php

    r5596 r6073  
    44Plugin URI: http://www.lesterchan.net/portfolio/programming.php 
    55Description: Enable You To Send Your Webblog Entry To A Friend. 
    6 Version: 2.04 
     6Version: 2.05 
    77Author: GaMerZ 
    88Author URI: http://www.lesterchan.net 
     
    479479      add_option('email_snippet', 100, 'Enable Snippet Feature For Your E-Mail?'); 
    480480      add_option('email_multiple', 5, 'Maximum Number Of Multiple E-Mails'); 
     481      // Version 2.05 Options 
     482      add_option('email_imageverify', 1, 'Enable Image Verification?'); 
    481483      // Set 'manage_email' Capabilities To Administrator    
    482484      $role = get_role('administrator'); 
  • wp-email/trunk/email/wp-email-popup.php

    r5596 r6073  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.0 Plugin: WP-EMail 2.04                                                           | 
     5|     WordPress 2.0 Plugin: WP-EMail 2.05                                                           | 
    66|     Copyright (c) 2005 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
     
    1818 
    1919 
     20### Session Start 
     21session_start(); 
     22 
    2023###  Load wp-blog-header.php 
    2124require('../../../wp-blog-header.php'); 
     25 
     26### Image Verification 
     27$email_image_verify = intval(get_settings('email_imageverify')); 
    2228 
    2329### Variables 
     
    5864      $friendname = strip_tags(stripslashes(trim($_POST['friendname']))); 
    5965      $friendemail = strip_tags(stripslashes(trim($_POST['friendemail']))); 
     66      $imageverify = $_POST['imageverify']; 
    6067      $smtp_info = get_settings('email_smtp'); 
    6168      $smtp_info = explode('|', $smtp_info); 
     
    118125                  } 
    119126                  if(sizeof($friends) > $multiple_max) { 
    120                         $error .= '<br /><b>&raquo;</b> '.__('Maximum '.$multiple_max.' entries allowed'); 
     127                        $error .= '<br /><b>&raquo;</b> '.__('Maximum '.$multiple_max.' entries allowed.'); 
     128                  } 
     129 
     130                  // Check Whether We Enable Image Verification 
     131                  if($email_image_verify) { 
     132                        if(empty($imageverify)) { 
     133                              $error .= '<br /><b>&raquo;</b> '.__('Image verification is empty.'); 
     134                        } else { 
     135                              if($_SESSION['email_verify'] != md5($imageverify)) { 
     136                                    $error .= '<br /><b>&raquo;</b> '.__('Image verification failed.'); 
     137                              } 
     138                        } 
    121139                  } 
    122140 
     
    268286                              <p><b>* Required Field</b></p> 
    269287                              <p> 
    270                                     <b>Your Name: *</b><br /> 
    271                                     <input type="text" size="50" maxlength="50" name="yourname" class="Forms" /> 
    272                               </p> 
    273                               <p> 
    274                                     <b>Your E-Mail: *</b><br /> 
    275                                     <input type="text" size="50" maxlength="100" name="youremail" class="Forms" /> 
    276                               </p> 
    277                               <p> 
    278                                     <b>Your Remarks:</b><br /> 
    279                                     <textarea cols="49" rows="8" name="yourremarks" class="Forms"></textarea> 
    280                               </p> 
    281                               <p> 
    282                                     <b>Friend's Name: *</b><br /> 
    283                                     <input type="text" size="50" maxlength="100" name="friendname" class="Forms" /><?php email_multiple(); ?> 
    284                               </p> 
    285                               <p> 
    286                                     <b>Friend's E-Mail: *</b><br /> 
    287                                     <input type="text" size="50" maxlength="100" name="friendemail" class="Forms" /><?php email_multiple(); ?> 
    288                               </p> 
     288                                    <b><label for="yourname">Your Name: *</label></b><br /> 
     289                                    <input type="text" size="50" id="yourname" name="yourname" class="Forms" /> 
     290                              </p> 
     291                              <p> 
     292                                    <b><label for="youremail">Your E-Mail: *</label></b><br /> 
     293                                    <input type="text" size="50" id="youremail" name="youremail" class="Forms" /> 
     294                              </p> 
     295                              <p> 
     296                                    <b><label for="yourremarks">Your Remarks:</label></b><br /> 
     297                                    <textarea cols="49" rows="8" id="yourremarks" name="yourremarks" class="Forms"></textarea> 
     298                              </p> 
     299                              <p> 
     300                                    <b><label for="friendname">Friend's Name: *</label></b><br /> 
     301                                    <input type="text" size="50" id="friendname" name="friendname" class="Forms" /><?php email_multiple(); ?> 
     302                              </p> 
     303                              <p> 
     304                                    <b><label for="friendemail">Friend's E-Mail: *</label></b><br /> 
     305                                    <input type="text" size="50" id="friendemail" name="friendemail" class="Forms" /><?php email_multiple(); ?> 
     306                              </p> 
     307                              <?php if($email_image_verify): ?> 
     308                                    <p> 
     309                                          <b><label for="imageverify">Image Verification: *</label></b><br /> 
     310                                          <img src="<?php echo get_settings('siteurl'); ?>/wp-content/plugins/email/email-image-verify.php" width="60" height="22" alt="Image Verification" /><input type="text" size="5" maxlength="5" id="imageverify" name="imageverify" class="Forms" /> 
     311                                    </p> 
     312                              <?php endif; ?> 
    289313                              <p style="text-align: center"> 
    290314                                    <input type="submit" value="     Mail It!     " name="wp-email" class="Buttons" /> 
  • wp-email/trunk/email/wp-email.php

    r5596 r6073  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.0 Plugin: WP-EMail 2.04                                                           | 
     5|     WordPress 2.0 Plugin: WP-EMail 2.05                                                           | 
    66|     Copyright (c) 2005 Lester "GaMerZ" Chan                                                   | 
    77|                                                                                                                                         | 
     
    1818 
    1919 
     20### Session Start 
     21session_start(); 
     22 
     23### Image Verification 
     24$email_image_verify = intval(get_settings('email_imageverify')); 
     25 
    2026### Variables 
    2127$did_email = get_query_var('wp-email'); 
     
    3844      $friendname = strip_tags(stripslashes(trim($_POST['friendname']))); 
    3945      $friendemail = strip_tags(stripslashes(trim($_POST['friendemail']))); 
     46      $imageverify = $_POST['imageverify']; 
    4047      $smtp_info = get_settings('email_smtp'); 
    4148      $smtp_info = explode('|', $smtp_info); 
     
    98105                  if(sizeof($friends) > $multiple_max) { 
    99106                        $error .= '<br /><b>&raquo;</b> '.__('Maximum '.$multiple_max.' entries allowed'); 
     107                  } 
     108 
     109                  // Check Whether We Enable Image Verification 
     110                  if($email_image_verify) { 
     111                        if(empty($imageverify)) { 
     112                              $error .= '<br /><b>&raquo;</b> '.__('Image verification is empty.'); 
     113                        } else { 
     114                              if($_SESSION['email_verify'] != md5($imageverify)) { 
     115                                    $error .= '<br /><b>&raquo;</b> '.__('Image verification failed.'); 
     116                              } 
     117                        } 
    100118                  } 
    101119 
     
    258276                                    <p><b>* Required Field</b></p> 
    259277                                    <p> 
    260                                           <b>Your Name: *</b><br /> 
    261                                           <input type="text" size="50" maxlength="50" name="yourname" class="Forms" /> 
    262                                     </p> 
    263                                     <p> 
    264                                           <b>Your E-Mail: *</b><br /> 
    265                                           <input type="text" size="50" maxlength="100" name="youremail" class="Forms" /> 
    266                                     </p> 
    267                                     <p> 
    268                                           <b>Your Remarks:</b><br /> 
    269                                           <textarea cols="49" rows="8" name="yourremarks" class="Forms"></textarea> 
    270                                     </p> 
    271                                     <p> 
    272                                           <b>Friend's Name: *</b><br /> 
    273                                           <input type="text" size="50" maxlength="100" name="friendname" class="Forms" /><?php email_multiple(); ?> 
    274                                     </p> 
    275                                     <p> 
    276                                           <b>Friend's E-Mail: *</b><br /> 
    277                                           <input type="text" size="50" maxlength="100" name="friendemail" class="Forms" /><?php email_multiple(); ?> 
    278                                     </p> 
     278                                          <b><label for="yourname">Your Name: *</label></b><br /> 
     279                                          <input type="text" size="50" id="yourname" name="yourname" class="Forms" /> 
     280                                    </p> 
     281                                    <p> 
     282                                          <b><label for="youremail">Your E-Mail: *</label></b><br /> 
     283                                          <input type="text" size="50" id="youremail" name="youremail" class="Forms" /> 
     284                                    </p> 
     285                                    <p> 
     286                                          <b><label for="yourremarks">Your Remarks:</label></b><br /> 
     287                                          <textarea cols="49" rows="8" id="yourremarks" name="yourremarks" class="Forms"></textarea> 
     288                                    </p> 
     289                                    <p> 
     290                                          <b><label for="friendname">Friend's Name: *</label></b><br /> 
     291                                          <input type="text" size="50" id="friendname" name="friendname" class="Forms" /><?php email_multiple(); ?> 
     292                                    </p> 
     293                                    <p> 
     294                                          <b><label for="friendemail">Friend's E-Mail: *</label></b><br /> 
     295                                          <input type="text" size="50" id="friendemail" name="friendemail" class="Forms" /><?php email_multiple(); ?> 
     296                                    </p> 
     297                                    <?php if($email_image_verify): ?> 
     298                                          <p> 
     299                                                <b><label for="imageverify">Image Verification: *</label></b><br /> 
     300                                                <img src="<?php echo get_settings('siteurl'); ?>/wp-content/plugins/email/email-image-verify.php" width="60" height="22" alt="Image Verification" /><input type="text" size="5" maxlength="5" id="imageverify" name="imageverify" class="Forms" /> 
     301                                          </p> 
     302                                    <?php endif; ?> 
    279303                                    <p align="center"> 
    280304                                          <input type="submit" value="     Mail It!     " name="wp-email" class="Buttons" />