Changeset 7640

Show
Ignore:
Timestamp:
01/27/07 07:59:41 (1 year ago)
Author:
GamerZ
Message:

WP-EMail 2.10 Beta

Files:

Legend:

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

    r6557 r7640  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.0 Plugin: WP-EMail 2.08                                                           | 
    6 |     Copyright (c) 2005 Lester "GaMerZ" Chan                                                 | 
     5|     WordPress 2.1 Plugin: WP-EMail 2.10                                                           | 
     6|     Copyright (c) 2007 Lester "GaMerZ" Chan                                                 | 
    77|                                                                                                                                         | 
    88|     File Written By:                                                                                                  | 
  • wp-email/trunk/email/email-manager.php

    r6556 r7640  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.0 Plugin: WP-EMail 2.08                                                           | 
    6 |     Copyright (c) 2005 Lester "GaMerZ" Chan                                                 | 
     5|     WordPress 2.1 Plugin: WP-EMail 2.10                                                           | 
     6|     Copyright (c) 2007 Lester "GaMerZ" Chan                                                 | 
    77|                                                                                                                                         | 
    88|     File Written By:                                                                                                  | 
     
    5252      case 'id': 
    5353            $email_sortby = 'email_id'; 
    54             $email_sortby_text = 'ID'
     54            $email_sortby_text = __('ID', 'wp-email')
    5555            break; 
    5656      case 'fromname': 
    5757            $email_sortby = 'email_yourname'; 
    58             $email_sortby_text = 'From Name'
     58            $email_sortby_text = __('From Name', 'wp-email')
    5959            break; 
    6060      case 'fromemail': 
    6161            $email_sortby = 'email_youremail'; 
    62             $email_sortby_text = 'From E-Mail'
     62            $email_sortby_text = __('From E-Mail', 'wp-email')
    6363            break; 
    6464      case 'toname': 
    6565            $email_sortby = 'email_friendname'; 
    66             $email_sortby_text = 'To Name'
     66            $email_sortby_text = __('To Name', 'wp-email')
    6767            break; 
    6868      case 'toemail': 
    6969            $email_sortby = 'email_friendemail'; 
    70             $email_sortby_text = 'To E-Mail'
     70            $email_sortby_text = __('To E-Mail', 'wp-email')
    7171            break; 
    7272      case 'postid': 
    7373            $email_sortby = 'email_postid'; 
    74             $email_sortby_text = 'Post ID'
     74            $email_sortby_text = __('Post ID', 'wp-email')
    7575            break; 
    7676      case 'posttitle': 
    7777            $email_sortby = 'email_posttitle'; 
    78             $email_sortby_text = 'Post Title'
     78            $email_sortby_text = __('Post Title', 'wp-email')
    7979            break; 
    8080      case 'ip': 
    8181            $email_sortby = 'email_ip'; 
    82             $email_sortby_text = 'IP'
     82            $email_sortby_text = __('IP', 'wp-email')
    8383            break; 
    8484      case 'host': 
    8585            $email_sortby = 'email_host'; 
    86             $email_sortby_text = 'Host'
     86            $email_sortby_text = __('Host', 'wp-email')
    8787            break; 
    8888      case 'status': 
    8989            $email_sortby = 'email_status'; 
    90             $email_sortby_text = 'Status'
     90            $email_sortby_text = __('Status', 'wp-email')
    9191            break; 
    9292      case 'date': 
    9393      default: 
    9494            $email_sortby = 'email_timestamp'; 
    95             $email_sortby_text = 'Date'
     95            $email_sortby_text = __('Date', 'wp-email')
    9696} 
    9797 
     
    101101      case 'asc': 
    102102            $email_sortorder = 'ASC'; 
    103             $email_sortorder_text = 'Ascending'
     103            $email_sortorder_text = __('Ascending', 'wp-email')
    104104            break; 
    105105      case 'desc': 
    106106      default: 
    107107            $email_sortorder = 'DESC'; 
    108             $email_sortorder_text = 'Descending'
     108            $email_sortorder_text = __('Descending', 'wp-email')
    109109} 
    110110 
     
    115115            $delete_logs = $wpdb->query("DELETE FROM $wpdb->email"); 
    116116            if($delete_logs) { 
    117                   $text = '<font color="green">All E-Mail Logs Have Been Deleted.</font>'; 
     117                  $text = '<font color="green">'.__('All E-Mail Logs Have Been Deleted.', 'wp-email').'</font>'; 
    118118            } else { 
    119                   $text = '<font color="red">An Error Has Occured While Deleting All E-Mail Logs.</font>'; 
     119                  $text = '<font color="red">'.__('An Error Has Occured While Deleting All E-Mail Logs.', 'wp-email').'</font>'; 
    120120            } 
    121121      } 
     
    124124 
    125125### Get E-Mail Logs Data 
    126 $total_email_success = $wpdb->get_var("SELECT COUNT(email_id) FROM $wpdb->email WHERE email_status = '".__('Success')."'"); 
    127 $total_email_failed = $wpdb->get_var("SELECT COUNT(email_id) FROM $wpdb->email WHERE email_status = '".__('Failed')."'"); 
     126$total_email_success = $wpdb->get_var("SELECT COUNT(email_id) FROM $wpdb->email WHERE email_status = '".__('Success', 'wp-email')."'"); 
     127$total_email_failed = $wpdb->get_var("SELECT COUNT(email_id) FROM $wpdb->email WHERE email_status = '".__('Failed', 'wp-email')."'"); 
    128128$total_email = $total_email_success+$total_email_failed; 
    129129 
     
    165165<!-- Manage E-Mail --> 
    166166<div class="wrap"> 
    167       <h2><?php _e('E-Mail Logs'); ?></h2> 
    168       <p><?php _e('Displaying'); ?> <strong><?php echo $display_on_page;?></strong> <?php _e('To'); ?> <strong><?php echo $max_on_page; ?></strong> <?php _e('Of'); ?> <strong><?php echo $total_email; ?></strong> <?php _e('E-Mail Logs'); ?></p> 
    169       <p><?php _e('Sorted By'); ?> <strong><?php echo $email_sortby_text;?></strong> <?php _e('In'); ?> <strong><?php echo $email_sortorder_text;?></strong> <?php _e('Order'); ?></p> 
     167      <h2><?php _e('E-Mail Logs', 'wp-email'); ?></h2> 
     168      <p><?php printf(__('Dispaying <strong>%s</strong> To <strong>%s</strong> Of <strong>%s</strong> E-Mail Logs', 'wp-email'), $display_on_page, $max_on_page, $total_email); ?></p> 
     169      <p><?php printf(__('Sorted By <strong>%s</strong> In <strong>%s</strong> Order', 'wp-email'), $email_sortby_text, $email_sortorder_text); ?></p> 
    170170      <table width="100%"  border="0" cellspacing="3" cellpadding="3"> 
    171       <tr
    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> 
     171      <tr class="thead"
     172            <th width="5%"><?php _e('ID', 'wp-email'); ?></th> 
     173            <th width="17%"><?php _e('From', 'wp-email'); ?></th> 
     174            <th width="17%"><?php _e('To', 'wp-email'); ?></th> 
     175            <th width="17%"><?php _e('Date / Time', 'wp-email'); ?></th> 
     176            <th width="17%"><?php _e('IP / Host', 'wp-email'); ?></th> 
     177            <th width="17%"><?php _e('Post Title', 'wp-email'); ?></th> 
     178            <th width="10%"><?php _e('Status', 'wp-email'); ?></th> 
    179179      </tr> 
    180180      <?php 
     
    183183                  foreach($email_logs as $email_log) { 
    184184                        if($i%2 == 0) { 
     185                              $style = 'style=\'background: none\'';                             
     186                        }  else { 
    185187                              $style = 'style=\'background-color: #eee\''; 
    186                         }  else { 
    187                               $style = 'style=\'background-color: none\''; 
    188188                        } 
    189189                        $email_id = intval($email_log->email_id); 
     
    193193                        $email_friendemail = stripslashes($email_log->email_friendemail); 
    194194                        $email_postid = intval($email_log->email_postid); 
    195                         $email_posttitle = stripslashes($email_log->email_posttitle); 
    196                         $email_date = gmdate("jS F Y", $email_log->email_timestamp); 
    197                         $email_time = gmdate("H:i", $email_log->email_timestamp); 
     195                        $email_posttitle = htmlspecialchars(stripslashes($email_log->email_posttitle)); 
     196                        $email_date = gmdate(get_option('date_format'), $email_log->email_timestamp); 
     197                        $email_time = gmdate(get_option('time_format'), $email_log->email_timestamp); 
    198198                        $email_ip = $email_log->email_ip; 
    199199                        $email_host = $email_log->email_host; 
     
    211211                  } 
    212212            } else { 
    213                   echo '<tr><td colspan="7" align="center"><strong>'.__('No E-Mail Logs Found').'</strong></td></tr>'; 
     213                  echo '<tr><td colspan="7" align="center"><strong>'.__('No E-Mail Logs Found', 'wp-email').'</strong></td></tr>'; 
    214214            } 
    215215      ?> 
     
    225225                              <?php 
    226226                                    if($email_page > 1 && ((($email_page*$email_log_perpage)-($email_log_perpage-1)) <= $total_email)) { 
    227                                           echo '<strong>&laquo;</strong> <a href="'.$base_page.'&amp;emailpage='.($email_page-1).'" title="&laquo; '.__('Previous Page').'">'.__('Previous Page').'</a>'; 
     227                                          echo '<strong>&laquo;</strong> <a href="'.$base_page.'&amp;emailpage='.($email_page-1).'" title="&laquo; '.__('Previous Page', 'wp-email').'">'.__('Previous Page', 'wp-email').'</a>'; 
    228228                                    } else { 
    229229                                          echo '&nbsp;'; 
     
    234234                              <?php 
    235235                                    if($email_page >= 1 && ((($email_page*$email_log_perpage)+1) <=  $total_email)) { 
    236                                           echo '<a href="'.$base_page.'&amp;emailpage='.($email_page+1).'" title="'.__('Next Page').' &raquo;">'.__('Next Page').'</a> <strong>&raquo;</strong>'; 
     236                                          echo '<a href="'.$base_page.'&amp;emailpage='.($email_page+1).'" title="'.__('Next Page', 'wp-email').' &raquo;">'.__('Next Page', 'wp-email').'</a> <strong>&raquo;</strong>'; 
    237237                                    } else { 
    238238                                          echo '&nbsp;'; 
     
    243243                  <tr> 
    244244                        <td colspan="2" align="center"> 
    245                               <?php _e('Pages'); ?> (<?php echo $total_pages; ?>)
     245                              <?php _e('Pages', 'wp-email'); ?> (<?php echo $total_pages; ?>)
    246246                              <?php 
    247247                                    if ($email_page >= 4) { 
    248                                           echo '<strong><a href="'.$base_page.'&amp;emailpage=1'.$email_sort_url.$email_sort_url.'" title="'.__('Go to First Page').'">&laquo; '.__('First').'</a></strong> ... '; 
     248                                          echo '<strong><a href="'.$base_page.'&amp;emailpage=1'.$email_sort_url.$email_sort_url.'" title="'.__('Go to First Page', 'wp-email').'">&laquo; '.__('First', 'wp-email').'</a></strong> ... '; 
    249249                                    } 
    250250                                    if($email_page > 1) { 
    251                                           echo ' <strong><a href="'.$base_page.'&amp;emailpage='.($email_page-1).$email_sort_url.'" title="&laquo; '.__('Go to Page').' '.($email_page-1).'">&laquo;</a></strong> '; 
     251                                          echo ' <strong><a href="'.$base_page.'&amp;emailpage='.($email_page-1).$email_sort_url.'" title="&laquo; '.__('Go to Page', 'wp-email').' '.($email_page-1).'">&laquo;</a></strong> '; 
    252252                                    } 
    253253                                    for($i = $email_page - 2 ; $i  <= $email_page +2; $i++) { 
     
    256256                                                      echo "<strong>[$i]</strong> "; 
    257257                                                } else { 
    258                                                       echo '<a href="'.$base_page.'&amp;emailpage='.($i).$email_sort_url.'" title="'.__('Page').' '.$i.'">'.$i.'</a> '; 
     258                                                      echo '<a href="'.$base_page.'&amp;emailpage='.($i).$email_sort_url.'" title="'.__('Page', 'wp-email').' '.$i.'">'.$i.'</a> '; 
    259259                                                } 
    260260                                          } 
    261261                                    } 
    262262                                    if($email_page < $total_pages) { 
    263                                           echo ' <strong><a href="'.$base_page.'&amp;emailpage='.($email_page+1).$email_sort_url.'" title="'.__('Go to Page').' '.($email_page+1).' &raquo;">&raquo;</a></strong> '; 
     263                                          echo ' <strong><a href="'.$base_page.'&amp;emailpage='.($email_page+1).$email_sort_url.'" title="'.__('Go to Page', 'wp-email').' '.($email_page+1).' &raquo;">&raquo;</a></strong> '; 
    264264                                    } 
    265265                                    if (($email_page+2) < $total_pages) { 
    266                                           echo ' ... <strong><a href="'.$base_page.'&amp;emailpage='.($total_pages).$email_sort_url.'" title="'.__('Go to Last Page').'">'.__('Last').' &raquo;</a></strong>'; 
     266                                          echo ' ... <strong><a href="'.$base_page.'&amp;emailpage='.($total_pages).$email_sort_url.'" title="'.__('Go to Last Page', 'wp-email'), 'wp-email'.'">'.__('Last', 'wp-email').' &raquo;</a></strong>'; 
    267267                                    } 
    268268                              ?> 
     
    275275            ?> 
    276276      <br /> 
    277       <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get"> 
     277      <form action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" method="get"> 
    278278            <input type="hidden" name="page" value="<?php echo $base_name; ?>" /> 
    279             Sort Options:&nbsp;&nbsp;&nbsp; 
     279            <?php _e('Sort Options:', 'wp-email'); ?>&nbsp;&nbsp;&nbsp; 
    280280            <select name="by" size="1"> 
    281                   <option value="id"<?php if($email_sortby == 'email_id') { echo ' selected="selected"'; }?>>ID</option> 
    282                   <option value="fromname"<?php if($email_sortby == 'email_yourname') { echo ' selected="selected"'; }?>>From Name</option> 
    283                   <option value="fromemail"<?php if($email_sortby == 'email_youremail') { echo ' selected="selected"'; }?>>From E-Mail</option> 
    284                   <option value="toname"<?php if($email_sortby == 'email_friendname') { echo ' selected="selected"'; }?>>To Name</option> 
    285                   <option value="toemail"<?php if($email_sortby == 'email_friendemail') { echo ' selected="selected"'; }?>>To E-Mail</option> 
    286                   <option value="date"<?php if($email_sortby == 'email_timestamp') { echo ' selected="selected"'; }?>>Date</option> 
    287                   <option value="postid"<?php if($email_sortby == 'email_postid') { echo ' selected="selected"'; }?>>Post ID</option> 
    288                   <option value="posttitle"<?php if($email_sortby == 'email_posttitle') { echo ' selected="selected"'; }?>>Post Title</option> 
    289                   <option value="ip"<?php if($email_sortby == 'email_ip') { echo ' selected="selected"'; }?>>IP</option> 
    290                   <option value="host"<?php if($email_sortby == 'email_host') { echo ' selected="selected"'; }?>>Host</option> 
    291                   <option value="status"<?php if($email_sortby == 'email_status') { echo ' selected="selected"'; }?>>Status</option>     
     281                  <option value="id"<?php if($email_sortby == 'email_id') { echo ' selected="selected"'; }?>><?php _e('ID', 'wp-email'); ?></option> 
     282                  <option value="fromname"<?php if($email_sortby == 'email_yourname') { echo ' selected="selected"'; }?>><?php _e('From Name', 'wp-email'); ?></option> 
     283                  <option value="fromemail"<?php if($email_sortby == 'email_youremail') { echo ' selected="selected"'; }?>><?php _e('From E-Mail', 'wp-email'); ?></option> 
     284                  <option value="toname"<?php if($email_sortby == 'email_friendname') { echo ' selected="selected"'; }?>><?php _e('To Name', 'wp-email'); ?></option> 
     285                  <option value="toemail"<?php if($email_sortby == 'email_friendemail') { echo ' selected="selected"'; }?>><?php _e('To E-Mail', 'wp-email'); ?></option> 
     286                  <option value="date"<?php if($email_sortby == 'email_timestamp') { echo ' selected="selected"'; }?>><?php _e('Date', 'wp-email'); ?></option> 
     287                  <option value="postid"<?php if($email_sortby == 'email_postid') { echo ' selected="selected"'; }?>><?php _e('Post ID', 'wp-email'); ?></option> 
     288                  <option value="posttitle"<?php if($email_sortby == 'email_posttitle') { echo ' selected="selected"'; }?>><?php _e('Post Title', 'wp-email'); ?></option> 
     289                  <option value="ip"<?php if($email_sortby == 'email_ip') { echo ' selected="selected"'; }?>><?php _e('IP', 'wp-email'); ?></option> 
     290                  <option value="host"<?php if($email_sortby == 'email_host') { echo ' selected="selected"'; }?>><?php _e('Host', 'wp-email'); ?></option> 
     291                  <option value="status"<?php if($email_sortby == 'email_status') { echo ' selected="selected"'; }?>><?php _e('Status', 'wp-email'); ?></option>       
    292292            </select> 
    293293            &nbsp;&nbsp;&nbsp; 
    294294            <select name="order" size="1"> 
    295                   <option value="asc"<?php if($email_sortorder == 'ASC') { echo ' selected="selected"'; }?>>Ascending</option> 
    296                   <option value="desc"<?php if($email_sortorder == 'DESC') { echo ' selected="selected"'; } ?>>Descending</option> 
     295                  <option value="asc"<?php if($email_sortorder == 'ASC') { echo ' selected="selected"'; }?>><?php _e('Ascending', 'wp-email'); ?></option> 
     296                  <option value="desc"<?php if($email_sortorder == 'DESC') { echo ' selected="selected"'; } ?>><?php _e('Descending', 'wp-email'); ?></option> 
    297297            </select> 
    298298            &nbsp;&nbsp;&nbsp; 
     
    301301                  for($i=10; $i <= 100; $i+=10) { 
    302302                        if($email_log_perpage == $i) { 
    303                               echo "<option value=\"$i\" selected=\"selected\">Per Page: $i</option>\n"; 
     303                              echo "<option value=\"$i\" selected=\"selected\">".__('Per Page', 'wp-email').": $i</option>\n"; 
    304304                        } else { 
    305                               echo "<option value=\"$i\">Per Page: $i</option>\n"; 
     305                              echo "<option value=\"$i\">".__('Per Page', 'wp-email').": $i</option>\n"; 
    306306                        } 
    307307                  } 
    308308            ?> 
    309309            </select> 
    310             <input type="submit" value="Sort" class="button" /> 
     310            <input type="submit" value="<?php _e('Sort', 'wp-email'); ?>" class="button" /> 
    311311      </form> 
    312312</div> 
     
    314314<!-- E-Mail Stats --> 
    315315<div class="wrap"> 
    316       <h2><?php _e('E-Mail Logs Stats'); ?></h2> 
     316      <h2><?php _e('E-Mail Logs Stats', 'wp-email'); ?></h2> 
    317317      <table border="0" cellspacing="3" cellpadding="3"> 
    318318      <tr> 
    319             <th align="left"><?php _e('Total E-Mails:'); ?></th> 
     319            <th align="left"><?php _e('Total E-Mails:', 'wp-email'); ?></th> 
    320320            <td align="left"><?php echo number_format($total_email); ?></td> 
    321321      </tr> 
    322322      <tr> 
    323             <th align="left"><?php _e('Total E-Mail Sent:'); ?></th> 
     323            <th align="left"><?php _e('Total E-Mail Sent:', 'wp-email'); ?></th> 
    324324            <td align="left"><?php echo number_format($total_email_success); ?></td> 
    325325      </tr> 
    326326      <tr> 
    327             <th align="left"><?php _e('Total E-Mail Failed:'); ?></th> 
     327            <th align="left"><?php _e('Total E-Mail Failed:', 'wp-email'); ?></th> 
    328328            <td align="left"><?php echo number_format($total_email_failed); ?></td> 
    329329      </tr> 
     
    333333<!-- Delete E-Mail Logs --> 
    334334<div class="wrap"> 
    335       <h2><?php _e('Delete E-Mail Logs'); ?></h2> 
     335      <h2><?php _e('Delete E-Mail Logs', 'wp-email'); ?></h2> 
    336336      <div align="center"> 
    337             <form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post"> 
    338                   <strong>Are You Sure You Want To Delete All E-Mail Logs?</strong><br /><br /> 
     337            <form action="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']); ?>" method="post"> 
     338                  <strong><?php _e('Are You Sure You Want To Delete All E-Mail Logs?', 'wp-email'); ?></strong><br /><br /> 
    339339                  <input type="checkbox" name="delete_logs_yes" value="yes" />&nbsp;Yes<br /><br /> 
    340                   <input type="submit" name="delete_logs" value="Delete" class="button" onclick="return confirm('You Are About To Delete All E-Mail Logs\nThis Action Is Not Reversible.\n\n Choose \'Cancel\' to stop, \'OK\' to delete.')" /> 
     340                  <input type="submit" name="delete_logs" value="Delete" class="button" onclick="return confirm('<?php _e('You Are About To Delete All E-Mail Logs\nThis Action Is Not Reversible.\n\n Choose [Cancel] to stop, [OK] to delete.', 'wp-email'); ?>')" /> 
    341341            </form> 
    342342      </div> 
  • wp-email/trunk/email/email-options.php

    r6556 r7640  
    33+----------------------------------------------------------------+ 
    44|                                                                                                                                         | 
    5 |     WordPress 2.0 Plugin: WP-EMail 2.08                                                           | 
    6 |     Copyright (c) 2005 Lester "GaMerZ" Chan                                                 | 
     5|     WordPress 2.1 Plugin: WP-EMail 2.10                                                           | 
     6|     Copyright (c) 2007 Lester "GaMerZ" Chan                                                 | 
    77|                                                                                                                                         | 
    88|     File Written By:                                                                                                  | 
     
    3535      $email_smtp_server = strip_tags(trim($_POST['email_smtp_server'])); 
    3636      $email_smtp = "$email_smtp_name|$email_smtp_password|$email_smtp_server"; 
     37      $email_options = array(); 
     38      $email_options['post_text'] = addslashes(trim($_POST['email_post_text'])); 
     39      $email_options['page_text'] = addslashes(trim($_POST['email_page_text'])); 
     40      $email_options['email_icon'] = trim($_POST['email_icon']); 
     41      $email_options['email_type'] = intval($_POST['email_type']); 
     42      $email_options['email_style'] = intval($_POST['email_style']); 
     43      $email_options['email_html'] = trim($_POST['email_html']); 
     44      $email_fields = array(); 
     45      $email_fields['yourname'] = intval($_POST['email_field_yourname']); 
     46      $email_fields['youremail'] = intval($_POST['email_field_youremail']); 
     47      $email_fields['yourremarks'] = intval($_POST['email_field_yourremarks']); 
     48      $email_fields['friendname'] = intval($_POST['email_field_friendname']); 
     49      $email_fields['friendemail'] = intval($_POST['email_field_friendemail']); 
    3750      $email_contenttype = strip_tags(trim($_POST['email_contenttype'])); 
    3851      $email_mailer = strip_tags(trim($_POST['email_mailer'])); 
     
    5063      $update_email_text = array(); 
    5164      $update_email_queries[] = update_option('email_smtp', $email_smtp); 
     65      $update_email_queries[] = update_option('email_options', $email_options); 
     66      $update_email_queries[] = update_option('email_fields', $email_fields); 
    5267      $update_email_queries[] = update_option('email_contenttype', $email_contenttype); 
    5368      $update_email_queries[] = update_option('email_mailer', $email_mailer); 
     
    6277      $update_email_queries[] = update_option('email_template_sentfailed', $email_template_sentfailed); 
    6378      $update_email_queries[] = update_option('email_template_error', $email_template_error); 
    64       $update_email_text[] = __('SMTP Information'); 
    65       $update_email_text[] = __('E-Mail Content Type'); 
    66       $update_email_text[] = __('Send E-Mail Method'); 
    67       $update_email_text[] = __('Snippet Option'); 
    68       $update_email_text[] = __('Interval Option'); 
    69       $update_email_text[] = __('Multiple E-Mails Option'); 
    70       $update_email_text[] = __('Image Verification Option'); 
    71       $update_email_text[] = __('Subject Template'); 
    72       $update_email_text[] = __('Body Template'); 
    73       $update_email_text[] = __('Alternate Body Template'); 
    74       $update_email_text[] = __('Sent Success Template'); 
    75       $update_email_text[] = __('Sent Failed Template'); 
    76       $update_email_text[] = __('Error Template'); 
     79      $update_email_text[] = __('SMTP Information', 'wp-email'); 
     80      $update_email_text[] = __('E-Mail Style', 'wp-email'); 
     81      $update_email_text[] = __('E-Mail Fields', 'wp-email'); 
     82      $update_email_text[] = __('E-Mail Content Type', 'wp-email'); 
     83      $update_email_text[] = __('Send E-Mail Method', 'wp-email'); 
     84      $update_email_text[] = __('Snippet Option', 'wp-email'); 
     85      $update_email_text[] = __('Interval Option', 'wp-email'); 
     86      $update_email_text[] = __('Multiple E-Mails Option', 'wp-email'); 
     87      $update_email_text[] = __('Image Verification Option', 'wp-email'); 
     88      $update_email_text[] = __('Subject Template', 'wp-email'); 
     89      $update_email_text[] = __('Body Template', 'wp-email'); 
     90      $update_email_text[] = __('Alternate Body Template', 'wp-email'); 
     91      $update_email_text[] = __('Sent Success Template', 'wp-email'); 
     92      $update_email_text[] = __('Sent Failed Template', 'wp-email'); 
     93      $update_email_text[] = __('Error Template', 'wp-email'); 
    7794      $i=0; 
    7895      $text = ''; 
    7996      foreach($update_email_queries as $update_email_query) { 
    8097            if($update_email_query) { 
    81                   $text .= '<font color="green">'.$update_email_text[$i].' '.__('Updated').'</font><br />'; 
     98                  $text .= '<font color="green">'.$update_email_text[$i].' '.__('Updated', 'wp-email').'</font><br />'; 
    8299            } 
    83100            $i++; 
    84101      } 
    85102      if(empty($text)) { 
    86             $text = '<font color="red">'.__('No E-Mail Option Updated').'</font>'; 
     103            $text = '<font color="red">'.__('No E-Mail Option Updated', 'wp-email').'</font>'; 
    87104      } 
    88105} 
    89  
     106$email_options = get_option('email_options'); 
     107$email_fields = get_option('email_fields'); 
    90108?> 
    91109<script type="text/javascript"> 
     
    95113            switch(template) { 
    96114                  case "subject": 
    97                         default_template = "Recommended Article By %EMAIL_YOUR_NAME%: %EMAIL_POST_TITLE%"; 
     115                        default_template = "<?php _e('Recommended Article By %EMAIL_YOUR_NAME%: %EMAIL_POST_TITLE%', 'wp-email'); ?>"; 
    98116                        break; 
    99117                  case "body": 
    100                         default_template = "<p>Hi <strong>%EMAIL_FRIEND_NAME%</strong>,<br />Your friend, <strong>%EMAIL_YOUR_NAME%</strong>, has recommended this article entitled '<strong>%EMAIL_POST_TITLE%</strong>' to you.</p><p><strong>Here is his/her remarks:</strong><br />%EMAIL_YOUR_REMARKS%</p><p><strong>%EMAIL_POST_TITLE%</strong><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>"; 
     118                        default_template = "<?php _e('<p>Hi <strong>%EMAIL_FRIEND_NAME%</strong>,<br />Your friend, <strong>%EMAIL_YOUR_NAME%</strong>, has recommended this article entitled \'<strong>%EMAIL_POST_TITLE%</strong>\' to you.</p><p><strong>Here is his/her remarks:</strong><br />%EMAIL_YOUR_REMARKS%</p><p><strong>%EMAIL_POST_TITLE%</strong><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>', 'wp-email'); ?>"; 
    101119                        break; 
    102120                  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%"; 
     121                        default_template = "<?php _e('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%', 'wp-email'); ?>"; 
    104122                        break; 
    105123                  case "sentsuccess": 
    106                         default_template = "<div id=\"content\" class=\"narrowcolumn\"><p>Article: <strong>%EMAIL_POST_TITLE%</strong> Has Been Sent To <strong>%EMAIL_FRIEND_NAME% (%EMAIL_FRIEND_EMAIL%)</strong></p></div>"; 
     124                        default_template = "<p><?php _e('Article: <strong>%EMAIL_POST_TITLE%</strong> Has Been Sent To <strong>%EMAIL_FRIEND_NAME% (%EMAIL_FRIEND_EMAIL%)</strong>', 'wp-email'); ?></p>"; 
    107125                        break; 
    108126                  case "sentfailed": 
    109                         default_template = "<p>An Error Has Occured When Trying To Send The E-Mail<br /><strong>&raquo;</strong> %EMAIL_ERROR_MSG%</p>"; 
     127                        default_template = "<p><?php _e('An Error Has Occured When Trying To Send The E-Mail', 'wp-email'); ?><br /><strong>&raquo;</strong> %EMAIL_ERROR_MSG%</p>"; 
    110128                        break; 
    111129                  case "error": 
    112                         default_template = "<p>An Error Has Occured<br /><strong>&raquo;</strong> %EMAIL_ERROR_MSG%</p>"; 
     130                        default_template = "<p><?php _e('An Error Has Occured', 'wp-email'); ?><br /><strong>&raquo;</strong> %EMAIL_ERROR_MSG%</p>"; 
     131                        break; 
     132                  case "html": 
     133                        default_template = '<a href="%EMAIL_URL%" rel="nofollow" title="%EMAIL_TEXT%">%EMAIL_TEXT%</a>'; 
    113134                        break; 
    114135            } 
    115136            document.getElementById("email_template_" + template).value = default_template; 
    116 
     137      } 
     138      function check_email_style() { 
     139            email_style_options = document.getElementById("email_style").value; 
     140            if (email_style_options == 4) { 
     141                        document.getElementById("email_style_custom").style.display = 'block'; 
     142            } else { 
     143                  if(document.getElementById("email_style_custom").style.display == 'block') { 
     144                        document.getElementById("email_style_custom").style.display = 'none'; 
     145                  } 
     146            } 
     147      } 
    117148/* ]]> */ 
    118149</script> 
    119150<?php if(!empty($text)) { echo '<!-- Last Action --><div id="message" class="updated fade"><p>'.$text.'</p></div>'; } ?> 
    120151<div class="wrap">  
    121       <h2><?php _e('E-Mail Options'); ?></h2>  
     152      <h2><?php _e('E-Mail Options', 'wp-email'); ?></h2>  
    122153      <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">  
    123154            <fieldset class="options"> 
    124                   <legend><?php _e('SMTP Settings'); ?></legend> 
     155                  <legend><?php _e('SMTP Settings', 'wp-email'); ?></legend> 
    125156                  <?php 
    126                         $smtp_info = get_settings('email_smtp'); 
     157                        $smtp_info = get_option('email_smtp'); 
    127158                        $smtp_info = explode('|', $smtp_info); 
    128159                  ?> 
    129160                  <table width="100%"  border="0" cellspacing="3" cellpadding="3"> 
    130161                         <tr valign="top"> 
    131                               <th align="left" width="20%"><?php _e('SMTP Username:'); ?></th> 
     162                              <th align="left" width="20%"><?php _e('SMTP Username:', 'wp-email'); ?></th> 
    132163                              <td align="left"><input type="text" name="email_smtp_name" value="<?php echo $smtp_info[0]; ?>" size="30" /></td> 
    133164                        </tr> 
    134165                        <tr valign="top"> 
    135                               <th align="left" width="20%"><?php _e('SMTP Password:'); ?></th> 
     166                              <th align="left" width="20%"><?php _e('SMTP Password:', 'wp-email'); ?></th> 
    136167                              <td align="left"><input type="text" name="email_smtp_password" value="<?php echo $smtp_info[1]; ?>" size="30" /></td> 
    137168                        </tr> 
    138169                        <tr valign="top"> 
    139                               <th align="left" width="20%"><?php _e('SMTP Server:'); ?></th> 
    140                               <td align="left"><input type="text" name="email_smtp_server" value="<?php echo $smtp_info[2]; ?>" size="30" /><br />You may leave the above fields blank if you do not use a SMTP server.</td> 
    141                         </tr> 
    142                   </table> 
    143             </fieldset> 
    144             <fieldset class="options"> 
    145                   <legend><?php _e('E-Mail Settings'); ?></legend> 
    146                   <table width="100%"  border="0" cellspacing="3" cellpadding="3"> 
     170                              <th align="left" width="20%"><?php _e('SMTP Server:', 'wp-email'); ?></th> 
     171                              <td align="left"><input type="text" name="email_smtp_server" value="<?php echo $smtp_info[2]; ?>" size="30" /><br /><?php _e('You may leave the above fields blank if you do not use a SMTP server.', 'wp-email'); ?></td> 
     172                        </tr> 
     173                  </table> 
     174            </fieldset> 
     175            <?php ?> 
     176            <fieldset class="options"> 
     177                  <legend><?php _e('E-Mail Styles', 'wp-email'); ?></legend> 
     178                  <table width="100%"  border="0" cellspacing="3" cellpadding="3"> 
     179                        <tr valign="top"> 
     180                              <th align="left" width="30%"><?php _e('E-Mail Text Link For Post', 'wp-email'); ?></th> 
     181                              <td align="left"> 
     182                                    <input type="text" name="email_post_text" value="<?php echo stripslashes($email_options['post_text']); ?>" size="30" /> 
     183                              </td> 
     184                        </tr> 
     185                        <tr valign="top"> 
     186                              <th align="left" width="30%"><?php _e('E-Mail Text Link For Page', 'wp-email'); ?></th> 
     187                              <td align="left"> 
     188                                    <input type="text" name="email_page_text" value="<?php echo stripslashes($email_options['page_text']); ?>" size="30" /> 
     189                              </td> 
     190                        </tr> 
     191                        <tr valign="top"> 
     192                              <th align="left" width="30%"><?php _e('E-Mail Icon', 'wp-email'); ?></th> 
     193                              <td align="left"> 
     194                                    <?php 
     195                                          $email_icon = $email_options['email_icon']; 
     196                                          $email_icon_url = get_option('siteurl').'/wp-content/plugins/email/images'; 
     197                                          $email_icon_path = ABSPATH.'/wp-content/plugins/email/images'; 
     198                                          if($handle = @opendir($email_icon_path)) {      
     199                                                while (false !== ($filename = readdir($handle))) {   
     200                                                      if ($filename != '.' && $filename != '..') { 
     201                                                            if(is_file($email_icon_path.'/'.$filename)) { 
     202                                                                  if($email_icon == $filename) { 
     203                                                                        echo '<input type="radio" name="email_icon" value="'.$filename.'" checked="checked" />'."\n";                                                          
     204                                                                  } else { 
     205                                                                        echo '<input type="radio" name="email_icon" value="'.$filename.'" />'."\n"; 
     206                                                                  } 
     207                                                                  echo '&nbsp;&nbsp;&nbsp;'; 
     208                                                                  echo '<img src="'.$email_icon_url.'/'.$filename.'" alt="'.$filename.'" />'."\n"; 
     209                                                                  echo '&nbsp;&nbsp;&nbsp;('.$filename.')'; 
     210                                                                  echo '<br /><br />'."\n"; 
     211                                                            } 
     212                                                      }  
     213                                                }  
     214                                                closedir($handle); 
     215                                          } 
     216                                    ?> 
     217                              </td> 
     218                        </tr> 
     219                        <tr valign="top"> 
     220                              <th align="left" width="30%"><?php _e('E-Mail Link Type', 'wp-email'); ?></th> 
     221                              <td align="left"> 
     222                                    <select name="email_type" size="1"> 
     223                                          <option value="1"<?php selected('1', $email_options['email_type']); ?>><?php _e('E-Mail Standalone Page', 'wp-email'); ?></option> 
     224                                          <option value="2"<?php selected('2', $email_options['email_type']); ?>><?php _e('E-Mail Popup', 'wp-email'); ?></option> 
     225                                    </select> 
     226                              </td> 
     227                        </tr> 
     228                        <tr valign="top"> 
     229                              <th align="left" width="30%"><?php _e('E-Mail Text Link Style', 'wp-email'); ?></th> 
     230                              <td align="left"> 
     231                                    <select name="email_style" id="email_style" size="1" onchange="check_email_style();"> 
     232                                          <option value="1"<?php selected('1', $email_options['email_style']); ?>><?php _e('E-Mail Icon With Text Link', 'wp-email'); ?></option> 
     233                                          <option value="2"<?php selected('2', $email_options['email_style']); ?>><?php _e('E-Mail Icon Only', 'wp-email'); ?></option> 
     234                                          <option value="3"<?php selected('3', $email_options['email_style']); ?>><?php _e('E-Mail Text Link Only', 'wp-email'); ?></option> 
     235                                          <option value="4"<?php selected('4', $email_options['email_style']); ?>><?php _e('Custom', 'wp-email'); ?></option> 
     236                                    </select> 
     237                                    <div id="email_style_custom" style="display: <?php if(intval($email_options['email_style']) == 4) { echo 'block'; } else { echo 'none'; } ?>; margin-top: 20px;"> 
     238                                          <textarea rows="2" cols="80" name="email_html" id="email_template_html"><?php echo htmlspecialchars(stripslashes($email_options['email_html'])); ?></textarea><br /> 
     239                                          <?php _e('HTML is allowed.', 'wp-email'); ?><br /> 
     240                                          %EMAIL_URL% - <?php _e('URL to the email post/page.', 'wp-email'); ?><br /> 
     241                                          %EMAIL_POPUP% - <?php _e('It will produce the onclick html code which is nescassary for popup.', 'wp-email'); ?><br /> 
     242                                          <?php _e('Example Popup Template:', 'wp-email'); ?><br /> 
     243                                          <?php echo htmlspecialchars('<a href="%EMAIL_URL%" %EMAIL_POPUP% rel="nofollow" title="%EMAIL_TEXT%">%EMAIL_TEXT%</a>'); ?><br /> 
     244                                          %EMAIL_TEXT% - <?php _e('E-Mail text link of the post/page that you have typed in above.', 'wp-email'); ?><br /> 
     245                                          %EMAIL_ICON_URL% - <?php _e('URL to the email icon you have chosen above.', 'wp-email'); ?><br /> 
     246                                          <input type="button" name="RestoreDefault" value="<?php _e('Restore Default Template', 'wp-email'); ?>" onclick="javascript: email_default_templates('html');" class="button" /> 
     247                                    </div> 
     248                              </td> 
     249                        </tr> 
     250                  </table> 
     251            </fieldset> 
     252            <fieldset class="options"> 
     253                  <legend><?php _e('E-Mail Settings', 'wp-email'); ?></legend> 
     254                  <table width="100%"  border="0" cellspacing="3" cellpadding="3"> 
     255                        <tr valign="top"> 
     256                              <th align="left" width="30%"><?php _e('E-Mail Fields:', 'wp-email'); ?></th> 
     257                               <td align="left"> 
     258                                    <input type="checkbox" name="email_field_yourname" value="1"<?php checked('1', $email_fields['yourname']); ?> />&nbsp;<?php _e('Your Name', 'wp-email'); ?><br /> 
     259                                    <input type="checkbox" name="email_field_youremail" value="1"<?php checked('1', $email_fields['youremail']); ?> />&nbsp;<?php _e('Your E-Mail', 'wp-email'); ?><br /> 
     260                                    <input type="checkbox" name="email_field_yourremarks" value="1"<?php checked('1', $email_fields['yourremarks']); ?> />&nbsp;<?php _e('Your Remarks', 'wp-email'); ?><br /> 
     261                                    <input type="checkbox" name="email_field_friendname" value="1"<?php checked('1', $email_fields['friendname']); ?> />&nbsp;<?php _e('Friend\'s Name', 'wp-email'); ?><br /> 
     262                                    <input type="checkbox" name="email_field_friendemail" value="1"<?php checked('1', $email_fields['friendemail']); ?> />&nbsp;<?php _e('Friend\'s E-Mail', 'wp-email'); ?> 
     263                              </td> 
     264                        </tr> 
    147265                         <tr valign="top"> 
    148                               <th align="left" width="30%"><?php _e('E-Mail Content Type:'); ?></th> 
     266                              <th align="left" width="30%"><?php _e('E-Mail Content Type:', 'wp-email'); ?></th> 
    149267                               <td align="left"> 
    150268                                    <select name="email_contenttype" size="1"> 
    151                                           <option value="text/plain"<?php selected('text/plain', get_settings('email_contenttype')); ?>><?php _e('Plain Text'); ?></option> 
    152                                           <option value="text/html"<?php selected('text/html', get_settings('email_contenttype')); ?>><?php _e('HTML'); ?></option> 
     269                                          <option value="text/plain"<?php selected('text/plain', get_option('email_contenttype')); ?>><?php _e('Plain Text', 'wp-email'); ?></option>