Changeset 16399

Show
Ignore:
Timestamp:
08/05/07 11:06:16 (12 months ago)
Author:
GamerZ
Message:

Fixed Missing Stuff

Location:
wp-email/trunk/email
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • wp-email/trunk/email/email.php

    r16069 r16399  
    3333      require_once('../../../wp-config.php'); 
    3434} 
     35 
    3536 
    3637### Create Text Domain For Translations 
     
    220221 
    221222 
     223### Function: Snippet Words 
     224if(!function_exists('snippet_words')) { 
     225      function snippet_words($text, $length = 0) { 
     226            $words = split(' ', $text);  
     227            return join(" ",array_slice($words, 0, $length)).'...'; 
     228      } 
     229} 
     230 
     231 
    222232### Function: Snippet Text 
    223233if(!function_exists('snippet_chars')) { 
     
    312322function email_content() { 
    313323      $content = get_email_content(); 
    314       $content = str_replace(']]>', ']]>', $content); 
    315324      $email_snippet = intval(get_option('email_snippet')); 
    316325      if($email_snippet > 0) { 
    317             return snippet_chars($content , $email_snippet); 
     326            return snippet_words($content , $email_snippet); 
    318327      } else { 
    319328            return $content; 
     
    330339      $email_snippet = intval(get_option('email_snippet')); 
    331340      if($email_snippet > 0) { 
    332             return snippet_chars($content , $email_snippet); 
     341            return snippet_words($content , $email_snippet); 
    333342      } else { 
    334343            return $content; 
     
    339348### Function: E-Mail Get The Content 
    340349function get_email_content() { 
    341       global $post; 
     350      global $pages, $multipage, $numpages, $post; 
    342351      if (!empty($post->post_password)) { 
    343352            if (stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password) { 
     
    345354            } 
    346355      } 
    347       $content = $post->post_content; 
     356      if($multipage) { 
     357            for($page = 0; $page < $numpages; $page++) { 
     358                  $content .= $pages[$page]; 
     359            } 
     360      } else { 
     361            $content = $pages[0]; 
     362      } 
    348363      $content = html_entity_decode($content); 
    349364      $content = htmlspecialchars_decode($content); 
     
    638653            @session_start(); 
    639654            header('Content-Type: text/html; charset='.get_option('blog_charset').''); 
     655            // POST Variables 
    640656            $yourname = strip_tags(stripslashes(trim($_POST['yourname']))); 
    641657            $youremail = strip_tags(stripslashes(trim($_POST['youremail']))); 
     
    644660            $friendemail = strip_tags(stripslashes(trim($_POST['friendemail']))); 
    645661            $email_popup = intval($_POST['popup']); 
     662            $imageverify = $_POST['imageverify']; 
    646663            $p = intval($_POST['p']); 
    647664            $page_id = intval($_POST['page_id']); 
     665            // Get Post Information 
    648666            if($p > 0) { 
    649                   $post = get_post($p); 
     667                  $query_post = 'p='.$p; 
    650668                  $id = $p; 
    651669            } else { 
    652                   $post = get_post($page_id); 
     670                  $query_post = 'page_id='.$page_id; 
    653671                  $id = $page_id; 
    654672            } 
     673            query_posts($query_post); 
     674            if(have_posts()) { 
     675                  while(have_posts()) { 
     676                        the_post(); 
     677                        $post_title = get_the_title(); 
     678                        $post_author = get_the_author(); 
     679                        $post_date = get_the_time(get_option('date_format').' ('.get_option('time_format').')', '', '', false); 
     680                        $post_category = email_category();               
     681                        $post_category_alt = strip_tags($post_category); 
     682                        $post_excerpt = get_the_excerpt(); 
     683                        $post_content = email_content(); 
     684                        $post_content_alt = email_content_alt(); 
     685                  } 
     686            } 
     687            // Error 
    655688            $error = ''; 
    656             $post_title = get_the_title(); 
    657             $post_author = the_author('', false);                  
    658             $post_date = get_the_time(get_option('date_format').' ('.get_option('time_format').')', '', '', false); 
    659             $post_category = email_category();               
    660             $post_category_alt = strip_tags($post_category); 
    661             $post_excerpt = get_the_excerpt(); 
    662             $post_content = email_content(); 
    663             $post_content_alt = email_content_alt(); 
     689            $error_field = array('yourname' => $yourname, 'youremail' => $youremail, 'yourremarks' => $yourremarks, 'friendname' => $friendname, 'friendemail' => $friendemail, 'id' => $id); 
     690            // Get Options 
    664691            $email_fields = get_option('email_fields'); 
    665             $email_image_verify = intval(get_option('email_imageverify')); 
    666             // SMTP 
    667             $imageverify = $_POST['imageverify']; 
    668             $email_smtp = get_option('email_smtp'); 
    669             $error = ''; 
     692            $email_image_verify = intval(get_option('email_imageverify'));           
     693            $email_smtp = get_option('email_smtp');          
    670694            // Multiple Names/Emails 
    671695            $friends = array(); 
     
    831855                        $mail->AltBody = $template_email_bodyalt; 
    832856                  } 
     857                  echo $mail->Body; 
     858                  exit(); 
    833859                  // Send The Mail if($mail->Send()) { 
    834860                  if($mail->Send()) { 
     
    887913                  $output = $template_email_error; 
    888914                  if(!$email_popup) { 
    889                         $output .= email_form(false, false, false, false, $id); 
     915                        $output .= email_form(false, false, false, false, $error_field); 
    890916                  } else { 
    891                         $output .= email_form(true, false, false, false, $id); 
     917                        $output .= email_form(true, false, false, false, $error_field); 
    892918                  } 
    893919                  echo $output; 
     
    899925 
    900926### Function: E-Mail Form 
    901 function email_form($popup = false, $echo = true, $subtitle = true, $div = true, $id = 0) { 
     927function email_form($popup = false, $echo = true, $subtitle = true, $div = true, $error_field = '') { 
    902928      global $wpdb, $multipage;      
    903929      // Variables 
     
    929955            if(not_password_protected()) { 
    930956                  if($popup){ 
    931                         $output .= email_popup_form_header(false, $id); 
     957                        $output .= email_popup_form_header(false, $error_field['id']); 
    932958                  } else { 
    933                         $output .= email_form_header(false, $id); 
     959                        $output .= email_form_header(false, $error_field['id']); 
    934960                  } 
    935961                  $output .= '<!-- Display Error, If There Is Any -->'."\n"; 
     
    941967                        $output .= '<p>'."\n"; 
    942968                        $output .= '<strong><label for="yourname">'.__('Your Name: *', 'wp-email').'</label></strong><br />'."\n"; 
    943                         $output .= '<input type="text" size="50" id="yourname" name="yourname" class="Forms" value="'.$yourname.'" />'."\n"; 
     969                        $output .= '<input type="text" size="50" id="yourname" name="yourname" class="Forms" value="'.$error_field['yourname'].'" />'."\n"; 
    944970                        $output .= '</p>'."\n"; 
    945971                  } 
     
    947973                        $output .= '<p>'."\n"; 
    948974                        $output .= '<strong><label for="youremail">'.__('Your E-Mail: *', 'wp-email').'</label></strong><br />'."\n"; 
    949                         $output .= '<input type="text" size="50" id="youremail" name="youremail" class="Forms" value="'.$youremail.'" />'."\n"; 
     975                        $output .= '<input type="text" size="50" id="youremail" name="youremail" class="Forms" value="'.$error_field['youremail'].'" />'."\n"; 
    950976                        $output .= '</p>'."\n"; 
    951977                  } 
     
    953979                        $output .= '<p>'."\n"; 
    954980                        $output .= '      <strong><label for="yourremarks">'.__('Your Remark:', 'wp-email').'</label></strong><br />'."\n"; 
    955                         $output .= '      <textarea cols="49" rows="8" id="yourremarks" name="yourremarks" class="Forms">'.$yourremarks.'</textarea>'."\n"; 
     981                        $output .= '      <textarea cols="49" rows="8" id="yourremarks" name="yourremarks" class="Forms">'.$error_field['yourremarks'].'</textarea>'."\n"; 
    956982                        $output .= '</p>'."\n"; 
    957983                  } 
     
    959985                        $output .= '<p>'."\n"; 
    960986                        $output .= '<strong><label for="friendname">'.__('Friend\'s Name: *', 'wp-email').'</label></strong><br />'."\n"; 
    961                         $output .= '<input type="text" size="50" id="friendname" name="friendname" class="Forms" value="'.$friendname.'" />'.email_multiple(false)."\n"; 
     987                        $output .= '<input type="text" size="50" id="friendname" name="friendname" class="Forms" value="'.$error_field['friendname'].'" />'.email_multiple(false)."\n"; 
    962988                        $output .= '</p>'."\n"; 
    963989                  } 
    964990                  $output .= '<p>'."\n"; 
    965991                  $output .= '<strong><label for="friendemail">'.__('Friend\'s E-Mail: *', 'wp-email').'</label></strong><br />'."\n"; 
    966                   $output .= '<input type="text" size="50" id="friendemail" name="friendemail" class="Forms" value="'.$friendemail.'" />'.email_multiple(false)."\n"; 
     992                  $output .= '<input type="text" size="50" id="friendemail" name="friendemail" class="Forms" value="'.$error_field['friendemail'].'" />'.email_multiple(false)."\n"; 
    967993                  $output .= '</p>'."\n"; 
    968994                  if($email_image_verify) { 
  • wp-email/trunk/email/wp-email.pot

    r16069 r16399  
    33"Project-Id-Version: WP-EMail 2.20\n" 
    44"POT-Creation-Date: \n" 
    5 "PO-Revision-Date: 2007-07-31 14:05+0800\n" 
     5"PO-Revision-Date: 2007-08-05 19:06+0800\n" 
    66"Last-Translator: Lester 'GaMerZ' Chan <gamerz84@hotmail.com>\n" 
    77"Language-Team: Lester Chan <gamerz84@hotmail.com>\n" 
     
    158158 
    159159#: email-manager.php:126 
    160 #: email.php:421 
    161 #: email.php:557 
    162 #: email.php:835 
    163 #: email.php:872 
    164 #: email.php:1084 
     160#: email.php:436 
     161#: email.php:572 
     162#: email.php:861 
     163#: email.php:898 
     164#: email.php:1110 
    165165msgid "Success" 
    166166msgstr "" 
    167167 
    168168#: email-manager.php:127 
    169 #: email.php:571 
    170 #: email.php:847 
    171 #: email.php:1085 
     169#: email.php:586 
     170#: email.php:873 
     171#: email.php:1111 
    172172msgid "Failed" 
    173173msgstr "" 
     
    372372 
    373373#: email-options.php:122 
    374 #: email.php:1156 
     374#: email.php:1182 
    375375msgid "E-Mail '%EMAIL_POST_TITLE%' To A Friend" 
    376376msgstr "" 
    377377 
    378378#: email-options.php:125 
     379#: email.php:1183 
     380msgid "Email a copy of <strong>'%EMAIL_POST_TITLE%'</strong> to a friend" 
     381msgstr "" 
     382 
     383#: email-options.php:128 
    379384#: email.php:1157 
    380 msgid "Email a copy of <strong>'%EMAIL_POST_TITLE%'</strong> to a friend" 
    381 msgstr "" 
    382  
    383 #: email-options.php:128 
    384 #: email.php:1131 
    385385msgid "Recommended Article By %EMAIL_YOUR_NAME%: %EMAIL_POST_TITLE%" 
    386386msgstr "" 
     
    410410 
    411411#: email-options.php:137 
    412 #: email.php:1142 
     412#: email.php:1168 
    413413msgid "Back to %EMAIL_POST_TITLE%" 
    414414msgstr "" 
    415415 
    416416#: email-options.php:140 
    417 #: email.php:1143 
     417#: email.php:1169 
    418418msgid "An error has occurred when trying to send this email: " 
    419419msgstr "" 
    420420 
    421421#: email-options.php:143 
    422 #: email.php:1144 
     422#: email.php:1170 
    423423msgid "An error has occurred: " 
    424424msgstr "" 
    425425 
    426426#: email-options.php:165 
    427 #: email.php:52 
     427#: email.php:53 
    428428msgid "E-Mail Options" 
    429429msgstr "" 
     
    791791#: email-uninstall.php:81 
    792792#: email-uninstall.php:91 
    793 #: email.php:53 
     793#: email.php:54 
    794794msgid "Uninstall WP-EMail" 
    795795msgstr "" 
     
    868868msgstr "" 
    869869 
    870 #: email.php:48 
    871 #: email.php:268 
     870#: email.php:49 
     871#: email.php:278 
    872872msgid "E-Mail" 
    873873msgstr "" 
    874874 
    875 #: email.php:51 
     875#: email.php:52 
    876876msgid "Manage E-Mail" 
    877877msgstr "" 
    878878 
    879 #: email.php:216 
     879#: email.php:217 
    880880msgid "Note: There is an email link embedded within this post, please visit this post to email it." 
    881881msgstr "" 
    882882 
    883 #: email.php:344 
     883#: email.php:353 
    884884msgid "Password Protected Post" 
    885885msgstr "" 
    886886 
    887 #: email.php:529 
     887#: email.php:544 
    888888#, php-format 
    889889msgid "Separate multiple entries with a comma. Maximum %s entries." 
    890890msgstr "" 
    891891 
    892 #: email.php:598 
    893 #: email.php:604 
     892#: email.php:613 
     893#: email.php:619 
    894894msgid "emails" 
    895895msgstr "" 
    896896 
    897 #: email.php:608 
    898 #: email.php:769 
    899 #: email.php:846 
     897#: email.php:623 
     898#: email.php:793 
     899#: email.php:872 
    900900msgid "N/A" 
    901901msgstr "" 
    902902 
    903 #: email.php:681 
     903#: email.php:705 
    904904msgid "Your Name is empty" 
    905905msgstr "" 
    906906 
    907 #: email.php:684 
     907#: email.php:708 
    908908msgid "Your Name is invalid" 
    909909msgstr "" 
    910910 
    911 #: email.php:690 
     911#: email.php:714 
    912912msgid "Your Email is empty" 
    913913msgstr "" 
    914914 
    915 #: email.php:693 
     915#: email.php:717 
    916916msgid "Your Email is invalid" 
    917917msgstr "" 
    918918 
    919 #: email.php:699 
     919#: email.php:723 
    920920msgid "Your Remarks is invalid" 
    921921msgstr "" 
    922922 
    923 #: email.php:705 
     923#: email.php:729 
    924924msgid "Friend Name(s) is empty" 
    925925msgstr "" 
    926926 
    927 #: email.php:711 
     927#: email.php:735 
    928928#, php-format 
    929929msgid "Friend Name is empty: %s" 
    930930msgstr "" 
    931931 
    932 #: email.php:713 
     932#: email.php:737 
    933933#, php-format 
    934934msgid "Friend Name is invalid: %s" 
    935935msgstr "" 
    936936 
    937 #: email.php:727 
     937#: email.php:751 
    938938msgid "Friend Email(s) is empty" 
    939939msgstr "" 
    940940 
    941 #: email.php:733 
     941#: email.php:757 
    942942#, php-format 
    943943msgid "Friend Email is empty: %s" 
    944944msgstr "" 
    945945 
    946 #: email.php:735 
     946#: email.php:759 
    947947#, php-format 
    948948msgid "Friend Email is invalid: %s" 
    949949msgstr "" 
    950950 
    951 #: email.php:748 
     951#: email.php:772 
    952952#, php-format 
    953953msgid "Maximum %s Friend(s) allowed" 
    954954msgstr "" 
    955955 
    956 #: email.php:752 
     956#: email.php:776 
    957957msgid "Friend Name(s) count does not tally with Friend Email(s) count" 
    958958msgstr "" 
    959959 
    960 #: email.php:759 
     960#: email.php:783 
    961961msgid "Image Verification is empty" 
    962962msgstr "" 
    963963 
    964 #: email.php:762 
     964#: email.php:786 
    965965msgid "Image Verification failed" 
    966966msgstr "" 
    967967 
    968 #: email.php:939 
     968#: email.php:965 
    969969msgid "* Required Field" 
    970970msgstr "" 
    971971 
    972 #: email.php:942 
     972#: email.php:968 
    973973msgid "Your Name: *" 
    974974msgstr "" 
    975975 
    976 #: email.php:948 
     976#: email.php:974 
    977977msgid "Your E-Mail: *" 
    978978msgstr "" 
    979979 
    980 #: email.php:954 
     980#: email.php:980 
    981981msgid "Your Remark:" 
    982982msgstr "" 
    983983 
    984 #: email.php:960 
     984#: email.php:986 
    985985msgid "Friend's Name: *" 
    986986msgstr "" 
    987987 
    988 #: email.php:965 
     988#: email.php:991 
    989989msgid "Friend's E-Mail: *" 
    990990msgstr "" 
    991991 
    992 #: email.php:970 
     992#: email.php:996 
    993993msgid "Image Verification: *" 
    994994msgstr "" 
    995995 
    996 #: email.php:971 
     996#: email.php:997 
    997997msgid "E-Mail Image Verification" 
    998998msgstr "" 
    999999 
    1000 #: email.php:974 
     1000#: email.php:1000 
    10011001msgid "     Mail It!     " 
    10021002msgstr "" 
    10031003 
    1004 #: email.php:980 
     1004#: email.php:1006 
    10051005#, php-format 
    10061006msgid "Please wait for <strong>%s Minutes</strong> before sending the next article." 
    10071007msgstr "" 
    10081008 
    1009 #: email.php:982 
     1009#: email.php:1008 
    10101010msgid "Loading" 
    10111011msgstr "" 
    10121012 
    1013 #: email.php:1046 
    1014 #: email.php:1048 
    1015 #: email.php:1081 
     1013#: email.php:1072 
     1014#: email.php:1074 
     1015#: email.php:1107 
    10161016msgid "WP-EMail" 
    10171017msgstr "" 
    10181018 
    1019 #: email.php:1059 
    1020 #: email.php:1061 
     1019#: email.php:1085 
     1020#: email.php:1087 
    10211021msgid "Most Emailed Posts" 
    10221022msgstr "" 
    10231023 
    1024 #: email.php:1083 
     1024#: email.php:1109 
    10251025msgid "emails were sent." 
    10261026msgstr "" 
    10271027 
    1028 #: email.php:1084 
     1028#: email.php:1110 
    10291029msgid "emails were sent successfully." 
    10301030msgstr "" 
    10311031 
    1032 #: email.php:1085 
     1032#: email.php:1111 
    10331033msgid "emails failed to send." 
    10341034msgstr "" 
    10351035 
    1036 #: email.php:1097 
     1036#: email.php:1123 
    10371037msgid "Most Emailed Post" 
    10381038msgstr "" 
    10391039 
    1040 #: email.php:1132 
     1040#: email.php:1158 
    10411041msgid "<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 remark:</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>" 
    10421042msgstr "" 
    10431043 
    1044 #: email.php:1133 
     1044#: email.php:1159 
    10451045msgid "Hi %EMAIL_FRIEND_NAME%," 
    10461046msgstr "" 
    10471047 
    1048 #: email.php:1133 
    1049 #: email.php:1135 
    1050 #: email.php:1137 
    1051 #: email.php:1138 
    1052 #: email.php:1139 
    1053 #: email.php:1140 
     1048#: email.php:1159 
     1049#: email.php:1161 
     1050#: email.php:1163 
     1051#: email.php:1164 
     1052#: email.php:1165 
     1053#: email.php:1166 
    10541054msgid "\n" 
    10551055msgstr "" 
    10561056 
    1057 #: email.php:1134 
     1057#: email.php:1160 
    10581058msgid "Your friend, %EMAIL_YOUR_NAME%, has recommended this article entitled '%EMAIL_POST_TITLE%' to you." 
    10591059msgstr "" 
    10601060 
    1061 #: email.php:1134 
    1062 #: email.php:1136 
     1061#: email.php:1160 
     1062#: email.php:1162 
    10631063msgid "" 
    10641064"\n" 
     
    10661066msgstr "" 
    10671067 
    1068 #: email.php:1135 
     1068#: email.php:1161 
    10691069msgid "Here is his/her remarks:" 
    10701070msgstr "" 
    10711071 
    1072 #: email.php:1136 
     1072#: email.php:1162 
    10731073msgid "%EMAIL_YOUR_REMARKS%" 
    10741074msgstr "" 
    10751075 
    1076 #: email.php:1137 
     1076#: email.php:1163 
    10771077msgid "%EMAIL_POST_TITLE%" 
    10781078msgstr "" 
    10791079 
    1080 #: email.php:1138 
     1080#: email.php:1164 
    10811081msgid "Posted By %EMAIL_POST_AUTHOR% On %EMAIL_POST_DATE% In %EMAIL_POST_CATEGORY%" 
    10821082msgstr "" 
    10831083 
    1084 #: email.php:1139 
     1084#: email.php:1165 
    10851085msgid "%EMAIL_POST_CONTENT%" 
    10861086msgstr "" 
    10871087 
    1088 #: email.php:1140 
     1088#: email.php:1166 
    10891089msgid "Article taken from %EMAIL_BLOG_NAME% - %EMAIL_BLOG_URL%" 
    10901090msgstr "" 
    10911091 
    1092 #: email.php:1141 
     1092#: email.php:1167 
    10931093msgid "URL to article: %EMAIL_PERMALINK%" 
    10941094msgstr "" 
    10951095 
    1096 #: email.php:1142 
     1096#: email.php:1168 
    10971097msgid "Article: <strong>%EMAIL_POST_TITLE%</strong> has been sent to <strong>%EMAIL_FRIEND_NAME% (%EMAIL_FRIEND_EMAIL%)</strong></p><p>&laquo; <a href=\"%EMAIL_PERMALINK%\">" 
    10981098msgstr "" 
    10991099 
    1100 #: email.php:1142 
     1100#: email.php:1168 
    11011101msgid "</a></p>" 
    11021102msgstr "" 
    11031103 
    1104 #: email.php:1151 
     1104#: email.php:1177 
    11051105msgid "Email This Post" 
    11061106msgstr "" 
    11071107 
    1108 #: email.php:1151 
     1108#: email.php:1177 
    11091109msgid "Email This Page" 
    11101110msgstr ""