Changeset 16399
- Timestamp:
- 08/05/07 11:06:16 (12 months ago)
- Location:
- wp-email/trunk/email
- Files:
-
- 3 modified
-
email.php (modified) (16 diffs)
-
wp-email.mo (modified) (previous)
-
wp-email.pot (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-email/trunk/email/email.php
r16069 r16399 33 33 require_once('../../../wp-config.php'); 34 34 } 35 35 36 36 37 ### Create Text Domain For Translations … … 220 221 221 222 223 ### Function: Snippet Words 224 if(!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 222 232 ### Function: Snippet Text 223 233 if(!function_exists('snippet_chars')) { … … 312 322 function email_content() { 313 323 $content = get_email_content(); 314 $content = str_replace(']]>', ']]>', $content);315 324 $email_snippet = intval(get_option('email_snippet')); 316 325 if($email_snippet > 0) { 317 return snippet_ chars($content , $email_snippet);326 return snippet_words($content , $email_snippet); 318 327 } else { 319 328 return $content; … … 330 339 $email_snippet = intval(get_option('email_snippet')); 331 340 if($email_snippet > 0) { 332 return snippet_ chars($content , $email_snippet);341 return snippet_words($content , $email_snippet); 333 342 } else { 334 343 return $content; … … 339 348 ### Function: E-Mail Get The Content 340 349 function get_email_content() { 341 global $p ost;350 global $pages, $multipage, $numpages, $post; 342 351 if (!empty($post->post_password)) { 343 352 if (stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password) { … … 345 354 } 346 355 } 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 } 348 363 $content = html_entity_decode($content); 349 364 $content = htmlspecialchars_decode($content); … … 638 653 @session_start(); 639 654 header('Content-Type: text/html; charset='.get_option('blog_charset').''); 655 // POST Variables 640 656 $yourname = strip_tags(stripslashes(trim($_POST['yourname']))); 641 657 $youremail = strip_tags(stripslashes(trim($_POST['youremail']))); … … 644 660 $friendemail = strip_tags(stripslashes(trim($_POST['friendemail']))); 645 661 $email_popup = intval($_POST['popup']); 662 $imageverify = $_POST['imageverify']; 646 663 $p = intval($_POST['p']); 647 664 $page_id = intval($_POST['page_id']); 665 // Get Post Information 648 666 if($p > 0) { 649 $ post = get_post($p);667 $query_post = 'p='.$p; 650 668 $id = $p; 651 669 } else { 652 $ post = get_post($page_id);670 $query_post = 'page_id='.$page_id; 653 671 $id = $page_id; 654 672 } 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 655 688 $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 664 691 $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'); 670 694 // Multiple Names/Emails 671 695 $friends = array(); … … 831 855 $mail->AltBody = $template_email_bodyalt; 832 856 } 857 echo $mail->Body; 858 exit(); 833 859 // Send The Mail if($mail->Send()) { 834 860 if($mail->Send()) { … … 887 913 $output = $template_email_error; 888 914 if(!$email_popup) { 889 $output .= email_form(false, false, false, false, $ id);915 $output .= email_form(false, false, false, false, $error_field); 890 916 } else { 891 $output .= email_form(true, false, false, false, $ id);917 $output .= email_form(true, false, false, false, $error_field); 892 918 } 893 919 echo $output; … … 899 925 900 926 ### Function: E-Mail Form 901 function email_form($popup = false, $echo = true, $subtitle = true, $div = true, $ id = 0) {927 function email_form($popup = false, $echo = true, $subtitle = true, $div = true, $error_field = '') { 902 928 global $wpdb, $multipage; 903 929 // Variables … … 929 955 if(not_password_protected()) { 930 956 if($popup){ 931 $output .= email_popup_form_header(false, $ id);957 $output .= email_popup_form_header(false, $error_field['id']); 932 958 } else { 933 $output .= email_form_header(false, $ id);959 $output .= email_form_header(false, $error_field['id']); 934 960 } 935 961 $output .= '<!-- Display Error, If There Is Any -->'."\n"; … … 941 967 $output .= '<p>'."\n"; 942 968 $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"; 944 970 $output .= '</p>'."\n"; 945 971 } … … 947 973 $output .= '<p>'."\n"; 948 974 $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"; 950 976 $output .= '</p>'."\n"; 951 977 } … … 953 979 $output .= '<p>'."\n"; 954 980 $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"; 956 982 $output .= '</p>'."\n"; 957 983 } … … 959 985 $output .= '<p>'."\n"; 960 986 $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"; 962 988 $output .= '</p>'."\n"; 963 989 } 964 990 $output .= '<p>'."\n"; 965 991 $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"; 967 993 $output .= '</p>'."\n"; 968 994 if($email_image_verify) { -
wp-email/trunk/email/wp-email.pot
r16069 r16399 3 3 "Project-Id-Version: WP-EMail 2.20\n" 4 4 "POT-Creation-Date: \n" 5 "PO-Revision-Date: 2007-0 7-31 14:05+0800\n"5 "PO-Revision-Date: 2007-08-05 19:06+0800\n" 6 6 "Last-Translator: Lester 'GaMerZ' Chan <gamerz84@hotmail.com>\n" 7 7 "Language-Team: Lester Chan <gamerz84@hotmail.com>\n" … … 158 158 159 159 #: email-manager.php:126 160 #: email.php:4 21161 #: email.php:5 57162 #: email.php:8 35163 #: email.php:8 72164 #: email.php:1 084160 #: email.php:436 161 #: email.php:572 162 #: email.php:861 163 #: email.php:898 164 #: email.php:1110 165 165 msgid "Success" 166 166 msgstr "" 167 167 168 168 #: email-manager.php:127 169 #: email.php:5 71170 #: email.php:8 47171 #: email.php:1 085169 #: email.php:586 170 #: email.php:873 171 #: email.php:1111 172 172 msgid "Failed" 173 173 msgstr "" … … 372 372 373 373 #: email-options.php:122 374 #: email.php:11 56374 #: email.php:1182 375 375 msgid "E-Mail '%EMAIL_POST_TITLE%' To A Friend" 376 376 msgstr "" 377 377 378 378 #: email-options.php:125 379 #: email.php:1183 380 msgid "Email a copy of <strong>'%EMAIL_POST_TITLE%'</strong> to a friend" 381 msgstr "" 382 383 #: email-options.php:128 379 384 #: email.php:1157 380 msgid "Email a copy of <strong>'%EMAIL_POST_TITLE%'</strong> to a friend"381 msgstr ""382 383 #: email-options.php:128384 #: email.php:1131385 385 msgid "Recommended Article By %EMAIL_YOUR_NAME%: %EMAIL_POST_TITLE%" 386 386 msgstr "" … … 410 410 411 411 #: email-options.php:137 412 #: email.php:11 42412 #: email.php:1168 413 413 msgid "Back to %EMAIL_POST_TITLE%" 414 414 msgstr "" 415 415 416 416 #: email-options.php:140 417 #: email.php:11 43417 #: email.php:1169 418 418 msgid "An error has occurred when trying to send this email: " 419 419 msgstr "" 420 420 421 421 #: email-options.php:143 422 #: email.php:11 44422 #: email.php:1170 423 423 msgid "An error has occurred: " 424 424 msgstr "" 425 425 426 426 #: email-options.php:165 427 #: email.php:5 2427 #: email.php:53 428 428 msgid "E-Mail Options" 429 429 msgstr "" … … 791 791 #: email-uninstall.php:81 792 792 #: email-uninstall.php:91 793 #: email.php:5 3793 #: email.php:54 794 794 msgid "Uninstall WP-EMail" 795 795 msgstr "" … … 868 868 msgstr "" 869 869 870 #: email.php:4 8871 #: email.php:2 68870 #: email.php:49 871 #: email.php:278 872 872 msgid "E-Mail" 873 873 msgstr "" 874 874 875 #: email.php:5 1875 #: email.php:52 876 876 msgid "Manage E-Mail" 877 877 msgstr "" 878 878 879 #: email.php:21 6879 #: email.php:217 880 880 msgid "Note: There is an email link embedded within this post, please visit this post to email it." 881 881 msgstr "" 882 882 883 #: email.php:3 44883 #: email.php:353 884 884 msgid "Password Protected Post" 885 885 msgstr "" 886 886 887 #: email.php:5 29887 #: email.php:544 888 888 #, php-format 889 889 msgid "Separate multiple entries with a comma. Maximum %s entries." 890 890 msgstr "" 891 891 892 #: email.php: 598893 #: email.php:6 04892 #: email.php:613 893 #: email.php:619 894 894 msgid "emails" 895 895 msgstr "" 896 896 897 #: email.php:6 08898 #: email.php:7 69899 #: email.php:8 46897 #: email.php:623 898 #: email.php:793 899 #: email.php:872 900 900 msgid "N/A" 901 901 msgstr "" 902 902 903 #: email.php: 681903 #: email.php:705 904 904 msgid "Your Name is empty" 905 905 msgstr "" 906 906 907 #: email.php: 684907 #: email.php:708 908 908 msgid "Your Name is invalid" 909 909 msgstr "" 910 910 911 #: email.php: 690911 #: email.php:714 912 912 msgid "Your Email is empty" 913 913 msgstr "" 914 914 915 #: email.php: 693915 #: email.php:717 916 916 msgid "Your Email is invalid" 917 917 msgstr "" 918 918 919 #: email.php: 699919 #: email.php:723 920 920 msgid "Your Remarks is invalid" 921 921 msgstr "" 922 922 923 #: email.php:7 05923 #: email.php:729 924 924 msgid "Friend Name(s) is empty" 925 925 msgstr "" 926 926 927 #: email.php:7 11927 #: email.php:735 928 928 #, php-format 929 929 msgid "Friend Name is empty: %s" 930 930 msgstr "" 931 931 932 #: email.php:7 13932 #: email.php:737 933 933 #, php-format 934 934 msgid "Friend Name is invalid: %s" 935 935 msgstr "" 936 936 937 #: email.php:7 27937 #: email.php:751 938 938 msgid "Friend Email(s) is empty" 939 939 msgstr "" 940 940 941 #: email.php:7 33941 #: email.php:757 942 942 #, php-format 943 943 msgid "Friend Email is empty: %s" 944 944 msgstr "" 945 945 946 #: email.php:7 35946 #: email.php:759 947 947 #, php-format 948 948 msgid "Friend Email is invalid: %s" 949 949 msgstr "" 950 950 951 #: email.php:7 48951 #: email.php:772 952 952 #, php-format 953 953 msgid "Maximum %s Friend(s) allowed" 954 954 msgstr "" 955 955 956 #: email.php:7 52956 #: email.php:776 957 957 msgid "Friend Name(s) count does not tally with Friend Email(s) count" 958 958 msgstr "" 959 959 960 #: email.php:7 59960 #: email.php:783 961 961 msgid "Image Verification is empty" 962 962 msgstr "" 963 963 964 #: email.php:7 62964 #: email.php:786 965 965 msgid "Image Verification failed" 966 966 msgstr "" 967 967 968 #: email.php:9 39968 #: email.php:965 969 969 msgid "* Required Field" 970 970 msgstr "" 971 971 972 #: email.php:9 42972 #: email.php:968 973 973 msgid "Your Name: *" 974 974 msgstr "" 975 975 976 #: email.php:9 48976 #: email.php:974 977 977 msgid "Your E-Mail: *" 978 978 msgstr "" 979 979 980 #: email.php:9 54980 #: email.php:980 981 981 msgid "Your Remark:" 982 982 msgstr "" 983 983 984 #: email.php:9 60984 #: email.php:986 985 985 msgid "Friend's Name: *" 986 986 msgstr "" 987 987 988 #: email.php:9 65988 #: email.php:991 989 989 msgid "Friend's E-Mail: *" 990 990 msgstr "" 991 991 992 #: email.php:9 70992 #: email.php:996 993 993 msgid "Image Verification: *" 994 994 msgstr "" 995 995 996 #: email.php:9 71996 #: email.php:997 997 997 msgid "E-Mail Image Verification" 998 998 msgstr "" 999 999 1000 #: email.php: 9741000 #: email.php:1000 1001 1001 msgid " Mail It! " 1002 1002 msgstr "" 1003 1003 1004 #: email.php: 9801004 #: email.php:1006 1005 1005 #, php-format 1006 1006 msgid "Please wait for <strong>%s Minutes</strong> before sending the next article." 1007 1007 msgstr "" 1008 1008 1009 #: email.php: 9821009 #: email.php:1008 1010 1010 msgid "Loading" 1011 1011 msgstr "" 1012 1012 1013 #: email.php:10 461014 #: email.php:10 481015 #: email.php:1 0811013 #: email.php:1072 1014 #: email.php:1074 1015 #: email.php:1107 1016 1016 msgid "WP-EMail" 1017 1017 msgstr "" 1018 1018 1019 #: email.php:10 591020 #: email.php:10 611019 #: email.php:1085 1020 #: email.php:1087 1021 1021 msgid "Most Emailed Posts" 1022 1022 msgstr "" 1023 1023 1024 #: email.php:1 0831024 #: email.php:1109 1025 1025 msgid "emails were sent." 1026 1026 msgstr "" 1027 1027 1028 #: email.php:1 0841028 #: email.php:1110 1029 1029 msgid "emails were sent successfully." 1030 1030 msgstr "" 1031 1031 1032 #: email.php:1 0851032 #: email.php:1111 1033 1033 msgid "emails failed to send." 1034 1034 msgstr "" 1035 1035 1036 #: email.php:1 0971036 #: email.php:1123 1037 1037 msgid "Most Emailed Post" 1038 1038 msgstr "" 1039 1039 1040 #: email.php:11 321040 #: email.php:1158 1041 1041 msgid "<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>" 1042 1042 msgstr "" 1043 1043 1044 #: email.php:11 331044 #: email.php:1159 1045 1045 msgid "Hi %EMAIL_FRIEND_NAME%," 1046 1046 msgstr "" 1047 1047 1048 #: email.php:11 331049 #: email.php:11 351050 #: email.php:11 371051 #: email.php:11 381052 #: email.php:11 391053 #: email.php:11 401048 #: email.php:1159 1049 #: email.php:1161 1050 #: email.php:1163 1051 #: email.php:1164 1052 #: email.php:1165 1053 #: email.php:1166 1054 1054 msgid "\n" 1055 1055 msgstr "" 1056 1056 1057 #: email.php:11 341057 #: email.php:1160 1058 1058 msgid "Your friend, %EMAIL_YOUR_NAME%, has recommended this article entitled '%EMAIL_POST_TITLE%' to you." 1059 1059 msgstr "" 1060 1060 1061 #: email.php:11 341062 #: email.php:11 361061 #: email.php:1160 1062 #: email.php:1162 1063 1063 msgid "" 1064 1064 "\n" … … 1066 1066 msgstr "" 1067 1067 1068 #: email.php:11 351068 #: email.php:1161 1069 1069 msgid "Here is his/her remarks:" 1070 1070 msgstr "" 1071 1071 1072 #: email.php:11 361072 #: email.php:1162 1073 1073 msgid "%EMAIL_YOUR_REMARKS%" 1074 1074 msgstr "" 1075 1075 1076 #: email.php:11 371076 #: email.php:1163 1077 1077 msgid "%EMAIL_POST_TITLE%" 1078 1078 msgstr "" 1079 1079 1080 #: email.php:11 381080 #: email.php:1164 1081 1081 msgid "Posted By %EMAIL_POST_AUTHOR% On %EMAIL_POST_DATE% In %EMAIL_POST_CATEGORY%" 1082 1082 msgstr "" 1083 1083 1084 #: email.php:11 391084 #: email.php:1165 1085 1085 msgid "%EMAIL_POST_CONTENT%" 1086 1086 msgstr "" 1087 1087 1088 #: email.php:11 401088 #: email.php:1166 1089 1089 msgid "Article taken from %EMAIL_BLOG_NAME% - %EMAIL_BLOG_URL%" 1090 1090 msgstr "" 1091 1091 1092 #: email.php:11 411092 #: email.php:1167 1093 1093 msgid "URL to article: %EMAIL_PERMALINK%" 1094 1094 msgstr "" 1095 1095 1096 #: email.php:11 421096 #: email.php:1168 1097 1097 msgid "Article: <strong>%EMAIL_POST_TITLE%</strong> has been sent to <strong>%EMAIL_FRIEND_NAME% (%EMAIL_FRIEND_EMAIL%)</strong></p><p>« <a href=\"%EMAIL_PERMALINK%\">" 1098 1098 msgstr "" 1099 1099 1100 #: email.php:11 421100 #: email.php:1168 1101 1101 msgid "</a></p>" 1102 1102 msgstr "" 1103 1103 1104 #: email.php:11 511104 #: email.php:1177 1105 1105 msgid "Email This Post" 1106 1106 msgstr "" 1107 1107 1108 #: email.php:11 511108 #: email.php:1177 1109 1109 msgid "Email This Page" 1110 1110 msgstr ""
