Postie - Version 1.6.6

Version Description

(2014.10.29) = * Add additional debugging to isValidSmtpServer * Add Japanese translation * Fixed bug where a subject present in the body is not recognized

Download this release

Release Info

Developer WayneAllen
Plugin Icon 128x128 Postie
Version 1.6.6
Comparing to
See all releases

Code changes from version 1.6.5 to 1.6.6

config_form.php CHANGED
@@ -1,985 +1,985 @@
1
- <div class="wrap">
2
- <div style="float:right; width: 220px; border: 1px solid darkgrey; padding:2px;border-radius:10px;margin-left: 10px;" >
3
- <p class="" style="text-align:center;font-weight: bolder; margin-top: 0px; margin-bottom: 2px;">Please Donate, Every $ Helps!</p>
4
- <p style="margin-top: 0;margin-bottom: 2px;">Your generous donation allows me to continue developing Postie for the WordPress community.</p>
5
- <form style="" action="https://www.paypal.com/cgi-bin/webscr" method="post">
6
- <input type="hidden" name="cmd" value="_s-xclick">
7
- <input type="hidden" name="hosted_button_id" value="HPK99BJ88V4C2">
8
- <div style="text-align:center;">
9
- <input style="border: none; margin: 0;" type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" name="submit" alt="PayPal - The safer, easier way to pay online!">
10
- </div>
11
- </form>
12
- </div>
13
- <h2>
14
- <a style='text-decoration:none' href='admin.php?page=postie-settings'>
15
- <?php
16
- echo '<img src="' . plugins_url('images/mail.png', __FILE__) . '" alt="postie" />';
17
- _e('Postie Settings', 'postie');
18
- ?>
19
- </a>
20
- <span class="description">(v<?php _e(POSTIE_VERSION, 'postie'); ?>)</span>
21
- </h2>
22
-
23
- <?php
24
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'postie-functions.php');
25
- if (isset($_POST["action"])) {
26
- switch ($_POST["action"]) {
27
- case "reset":
28
- config_ResetToDefault();
29
- $message = 1;
30
- break;
31
- case "cronless":
32
- check_postie();
33
- $message = 1;
34
- break;
35
- case "test":
36
- postie_test_config();
37
- exit;
38
- break;
39
- case "runpostie":
40
- EchoInfo("Checking for mail manually");
41
- postie_get_mail();
42
- exit;
43
- break;
44
- case "runpostie-debug":
45
- EchoInfo("Checking for mail manually with debug output");
46
- if (!defined('POSTIE_DEBUG')) {
47
- define('POSTIE_DEBUG', true);
48
- }
49
- postie_get_mail();
50
- exit;
51
- break;
52
- default:
53
- $message = 2;
54
- break;
55
- }
56
- }
57
- global $wpdb, $wp_roles;
58
-
59
- $config = config_Read();
60
- if (empty($config)) {
61
- $config = config_ResetToDefault();
62
- }
63
-
64
- $arrays = config_ArrayedSettings();
65
- // some fields are stored as arrays, because that makes back-end processing much easier
66
- // and we need to convert those fields to strings here, for the options form
67
- foreach ($arrays as $sep => $fields) {
68
- foreach ($fields as $field) {
69
- $config[$field] = implode($sep, $config[$field]);
70
- }
71
- }
72
- extract($config);
73
- if (!isset($maxemails)) {
74
- DebugEcho("New setting: maxemails");
75
- $maxemails = 0;
76
- }
77
- if (!isset($category_match)) {
78
- $category_match = true;
79
- }
80
-
81
- if ($interval == 'manual') {
82
- wp_clear_scheduled_hook('check_postie_hook');
83
- }
84
-
85
- $messages[1] = __("Configuration successfully updated!", 'postie');
86
- $messages[2] = __("Error - unable to save configuration", 'postie');
87
- ?>
88
- <?php if (isset($_GET['message'])) : ?>
89
- <div class="updated"><p><?php _e($messages[$_GET['message']], 'postie'); ?></p></div>
90
- <?php endif; ?>
91
-
92
- <form name="postie-options" method='post'>
93
- <input type="hidden" name="action" value="runpostie" />
94
- <input name="Submit" value="<?php _e("Run Postie", 'postie'); ?> &raquo;" type="submit" class='button'>
95
- <?php _e("(To run the check mail script manually)", 'postie'); ?>
96
- </form>
97
- <form name="postie-options" method='post'>
98
- <input type="hidden" name="action" value="runpostie-debug" />
99
- <input name="Submit" value="<?php _e("Run Postie (Debug)", 'postie'); ?> &raquo;" type="submit" class='button'>
100
- <?php _e("(To run the check mail script manually with full debug output)", 'postie'); ?>
101
- </form>
102
- <form name="postie-options" method="post">
103
- <input type="hidden" name="action" value="test" />
104
- <input name="Submit" value="<?php _e("Test Config", 'postie'); ?>&raquo;" type="submit" class='button'>
105
- <?php _e("this will check your configuration options", 'postie'); ?>
106
- </form>
107
-
108
- <form name="postie-options" method="post" action='options.php' autocomplete="off">
109
- <!-- fake fields are a workaround for chrome autofill getting the wrong fields -->
110
- <input style="display:none" type="text" name="fakeusernameremembered"/>
111
- <input style="display:none" type="password" name="fakepasswordremembered"/>
112
-
113
- <?php settings_fields('postie-settings'); ?>
114
- <input type="hidden" name="action" value="config" />
115
- <div id="simpleTabs">
116
- <div class="simpleTabs-nav">
117
- <ul>
118
- <li id="simpleTabs-nav-1"><?php _e('Mailserver', 'postie') ?></li>
119
- <li id="simpleTabs-nav-2"><?php _e('User', 'postie') ?></li>
120
- <li id="simpleTabs-nav-3"><?php _e('Message', 'postie') ?></li>
121
- <li id="simpleTabs-nav-4"><?php _e('Image', 'postie') ?></li>
122
- <li id="simpleTabs-nav-5"><?php _e('Video and Audio', 'postie') ?></li>
123
- <li id="simpleTabs-nav-6"><?php _e('Attachments', 'postie') ?></li>
124
- <li id="simpleTabs-nav-7"><?php _e('Support', 'postie') ?></li>
125
- </ul>
126
- </div>
127
- <div id="simpleTabs-content-1" class="simpleTabs-content">
128
- <table class='form-table'>
129
-
130
- <tr>
131
- <th scope="row"><?php _e('Mail Protocol:', 'postie') ?> </th>
132
- <td>
133
- <select name='postie-settings[input_protocol]' id='postie-settings-input_protocol'>
134
- <option value="pop3" <?php echo (($input_protocol == "pop3") ? " selected='selected' " : "") ?>>POP3</option>
135
- <?php if (HasIMAPSupport(false)): ?>
136
- <option value="imap" <?php echo ($input_protocol == "imap") ? "selected='selected' " : "" ?>>IMAP</option>
137
- <option value="pop3-ssl" <?php echo ($input_protocol == "pop3-ssl") ? "selected='selected' " : "" ?>>POP3-SSL</option>
138
- <option value="imap-ssl" <?php echo ($input_protocol == "imap-ssl") ? "selected='selected' " : "" ?>>IMAP-SSL</option>
139
- <?php endif; ?>
140
- </select>
141
- <?php if (!HasIMAPSupport(false)): ?>
142
- <span class="recommendation">IMAP/IMAP-SSL/POP3-SSL unavailable</span>
143
- <?php endif; ?>
144
- </td>
145
- </tr>
146
-
147
- <?php echo BuildBooleanSelect(__("Use Transport Layer Security (TLS)"), 'postie-settings[email_tls]', $email_tls, __("Choose Yes if your server requres TLS")); ?>
148
-
149
- <tr>
150
- <th scope="row"><?php _e('Port:', 'postie') ?><br />
151
- <span class='recommendation'><?php _e("Standard Ports:", 'postie'); ?><br />
152
- <?php _e("POP3", 'postie'); ?> - 110<br />
153
- <?php _e("IMAP", 'postie'); ?> - 143<br />
154
- <?php _e("IMAP-SSL", 'postie'); ?>- 993 <br />
155
- <?php _e("POP3-SSL", 'postie'); ?> - 995 <br />
156
- </span>
157
- </th>
158
- <td valign="top">
159
- <br/><input name='postie-settings[mail_server_port]' style="width: 70px;" type="number" min="0" id='postie-settings-mail_server_port' value="<?php echo esc_attr($mail_server_port); ?>" size="6" />
160
- </td>
161
- </tr>
162
- <tr valign="top">
163
- <th scope="row"><?php _e('Mail Server:', 'postie') ?></th>
164
- <td><input name='postie-settings[mail_server]' type="text" id='postie-settings-mail_server' value="<?php echo esc_attr($mail_server); ?>" size="40" />
165
- </td>
166
- </tr>
167
- <tr valign="top">
168
- <th width="33%" scope="row"><?php _e('Mail Userid:', 'postie') ?></th>
169
- <td><input name='postie-settings[mail_userid]' type="text" id='postie-settings-mail_userid' autocomplete='off' value="<?php echo esc_attr($mail_userid); ?>" size="40" /></td>
170
- </tr>
171
- <tr valign="top">
172
- <th scope="row"><?php _e('Mail Password:', 'postie') ?></th>
173
- <td>
174
- <input name='postie-settings[mail_password]' type="password" id='postie-settings-mail_password' autocomplete='off' value="<?php echo esc_attr($mail_password); ?>" size="40" />
175
- </td>
176
- </tr>
177
- <tr>
178
- <th scope="row"><?php _e('Postie Time Correction:', 'postie') ?>
179
- <br />
180
- <span class='recommendation'><?php _e("Should be the same as your normal offset, but this lets you adjust it in cases where that doesn't work.", 'postie'); ?></span>
181
- </th>
182
- <td><input style="width: 50px;" name='postie-settings[time_offset]' type="number" id='postie-settings-time_offset' size="2" value="<?php echo esc_attr($time_offset); ?>" />
183
- <?php _e('hours', 'postie') ?>
184
-
185
- </td>
186
- </tr>
187
- <tr>
188
- <th>
189
- <?php _e('Check for mail every', 'postie') ?>:
190
- </th>
191
- <td>
192
- <select name='postie-settings[interval]' id='postie-settings-interval'>
193
- <option value="weekly" <?php
194
- if ($interval == "weekly") {
195
- echo "selected='selected'";
196
- }
197
- ?>><?php _e('Once weekly', 'postie') ?></option>
198
- <option value="daily"<?php
199
- if ($interval == "daily") {
200
- echo "selected='selected'";
201
- }
202
- ?>><?php _e('daily', 'postie') ?></option>
203
- <option value="hourly" <?php
204
- if ($interval == "hourly") {
205
- echo "selected='selected'";
206
- }
207
- ?>><?php _e('hourly', 'postie') ?></option>
208
- <option value="twiceperhour" <?php
209
- if ($interval == "twiceperhour") {
210
- echo "selected='selected'";
211
- }
212
- ?>><?php _e('twice per hour', 'postie') ?></option>
213
- <option value="tenminutes" <?php
214
- if ($interval == "tenminutes") {
215
- echo "selected='selected'";
216
- }
217
- ?>><?php _e('every ten minutes', 'postie') ?></option>
218
- <option value="fiveminutes" <?php
219
- if ($interval == "fiveminutes") {
220
- echo "selected='selected'";
221
- }
222
- ?>><?php _e('every five minutes', 'postie') ?></option>
223
- <option value="manual" <?php
224
- if ($interval == "manual") {
225
- echo "selected='selected'";
226
- }
227
- ?>><?php _e('check manually', 'postie') ?></option>
228
- </select>
229
- </td>
230
- </tr>
231
- <tr>
232
- <th>
233
- <?php _e('Maximum number of emails to process:', 'postie'); ?>
234
- </th>
235
- <td>
236
- <select name='postie-settings[maxemails]' id='postie-settings-maxemails'>
237
- <option value="0" <?php if ($maxemails == '0') echo "selected='selected'" ?>>All</option>
238
- <option value="1" <?php if ($maxemails == '1') echo "selected='selected'" ?>>1</option>
239
- <option value="2" <?php if ($maxemails == '2') echo "selected='selected'" ?>>2</option>
240
- <option value="5" <?php if ($maxemails == '5') echo "selected='selected'" ?>>5</option>
241
- <option value="10" <?php if ($maxemails == '10') echo "selected='selected'" ?>>10</option>
242
- <option value="25" <?php if ($maxemails == '25') echo "selected='selected'" ?>>25</option>
243
- <option value="50" <?php if ($maxemails == '50') echo "selected='selected'" ?>>50</option>
244
- </select>
245
- </td>
246
- </tr>
247
- <?php echo BuildBooleanSelect(__("Delete email after posting"), 'postie-settings[delete_mail_after_processing]', $delete_mail_after_processing, __("Only set to no for testing purposes")); ?>
248
- </table>
249
- </div>
250
-
251
- <div id="simpleTabs-content-2" class="simpleTabs-content">
252
- <table class='form-table'>
253
-
254
- <?php echo BuildBooleanSelect(__("Allow Anyone To Post Via Email"), "postie-settings[turn_authorization_off]", $turn_authorization_off, "Changing this to yes <b style='color: red'>is not recommended</b> - anything that gets sent in will automatically be posted."); ?>
255
- <tr>
256
- <th scope="row">
257
- <?php _e('Roles That Can Post:', 'postie') ?><br />
258
- <span class='recommendation'><?php _e("This allows you to grant access to other users to post if they have the proper access level. Administrators can always post.", 'postie'); ?></span>
259
- </th>
260
- <td>
261
- <br />
262
- <table class="checkbox-table">
263
- <?php
264
- foreach ($wp_roles->role_names as $roleId => $name) {
265
- $name = translate_user_role($name);
266
- $role = $wp_roles->get_role($roleId);
267
- if ($roleId != "administrator") {
268
- ?>
269
- <tr>
270
- <td>
271
- <input type='checkbox' value='1' name='postie-settings[role_access][<?php echo $roleId; ?>]' <?php echo ($role->has_cap("post_via_postie")) ? 'checked="checked"' : "" ?> >
272
- <?php echo $name; ?>
273
- </td>
274
- </tr>
275
- <?php
276
- } else {
277
- ?>
278
- <tr>
279
- <td>
280
- <input type='checkbox' value='1' disabled='disabled' checked='checked' > <?php echo $name; ?>
281
- </td>
282
- </tr>
283
- <?php
284
- }
285
- }
286
- ?>
287
- </table>
288
- </td>
289
- </tr>
290
-
291
- <?php echo BuildTextArea("Authorized Addresses", "postie-settings[authorized_addresses]", $authorized_addresses, "Put each email address on a single line. Posts from emails in this list will be treated as if they came from the admin. If you would prefer to have users post under their own name - create a WordPress user with the correct access level."); ?>
292
- <tr>
293
- <th width="33%" valign="top" scope="row">
294
- <?php _e('Default Poster:') ?> <br />
295
- <span class='recommendation'><?php _e("This will be the poster if you allow posting from emails that are not a registered blog user.", 'postie'); ?></span>
296
- </th>
297
- <td>
298
- <select name='postie-settings[admin_username]' id='postie-settings[admin_username]'>
299
- <?php
300
- $adminusers = get_users('orderby=nicename&role=administrator');
301
- foreach ($adminusers as $user) {
302
- $selected = "";
303
- if ($user->user_login == $admin_username) {
304
- $selected = " selected='selected'";
305
- }
306
- echo "<option value='$user->user_login'$selected>$user->user_nicename ($user->user_login)</option>";
307
- }
308
- ?>
309
- </select>
310
- </td>
311
- </tr>
312
- </table>
313
- </div>
314
-
315
- <div id = "simpleTabs-content-3" class = "simpleTabs-content">
316
- <table class = 'form-table'>
317
- <tr valign = "top">
318
- <th scope = "row"><?php _e('Default post by mail category:', 'postie') ?></th>
319
- <td>
320
- <?php
321
- $defaultCat = $default_post_category;
322
- $args = array('name' => 'postie-settings[default_post_category]', 'hierarchical' => 1, 'selected' => $defaultCat, 'hide_empty' => 0);
323
- wp_dropdown_categories($args);
324
- ?>
325
- </tr>
326
- <?php echo BuildBooleanSelect("Match short category", "postie-settings[category_match]", $category_match, "Try to match categories using 'starts with logic' otherwise only do exact matches.<br />Note that custom taxonomies will not be found if this setting is 'No'"); ?>
327
-
328
- <tr valign="top">
329
- <th scope="row">
330
- <?php _e('Default post by mail tag(s)', 'postie') ?>:<br />
331
- <span
332
- class='recommendation'><?php _e('separated by commas', 'postie') ?>
333
- </span>
334
- </th>
335
- <td>
336
- <input type='text' name='postie-settings[default_post_tags]' id='postie-settings-default_post_tags' value='<?php echo esc_attr($default_post_tags) ?>' />
337
- </td>
338
- </tr>
339
-
340
- <tr>
341
- <th width="33%" valign="top" scope="row"><?php _e('Default Post Status:', 'postie') ?> </th>
342
- <td>
343
- <select name='postie-settings[post_status]' id='postie-settings-post_status'>
344
- <option value="publish" <?php
345
- if ($post_status == "publish") {
346
- echo "selected";
347
- }
348
- ?>>Published</option>
349
- <option value="draft" <?php
350
- if ($post_status == "draft") {
351
- echo "selected";
352
- }
353
- ?>>Draft</option>
354
- <option value="pending" <?php
355
- if ($post_status == "pending") {
356
- echo "selected";
357
- }
358
- ?>>Pending Review</option>
359
- <option value="private" <?php
360
- if ($post_status == "private") {
361
- echo "selected";
362
- }
363
- ?>>Private</option>
364
- </select>
365
- </td>
366
- </tr>
367
-
368
- <tr>
369
- <th width="33%" valign="top" scope="row"><?php _e('Default Post Format:', 'postie') ?> </th>
370
- <td>
371
- <select name='postie-settings[post_format]' id='postie-settings-post_format'>
372
- <?php
373
- $formats = get_theme_support('post-formats');
374
- if (is_array($formats[0])) {
375
- $formats = $formats[0];
376
- } else {
377
- $formats = array();
378
- }
379
- array_unshift($formats, "standard");
380
- foreach ($formats as $format) {
381
- $selected = "";
382
- if ($config['post_format'] == $format) {
383
- $selected = " selected='selected'";
384
- }
385
- echo "<option value='$format'$selected>$format</option>";
386
- }
387
- ?>
388
- </select>
389
- </td>
390
- </tr>
391
-
392
- <tr>
393
- <th width="33%" valign="top" scope="row"><?php _e('Default Post Type:', 'postie') ?> </th>
394
- <td>
395
- <select name='postie-settings[post_type]' id='postie-settings-post_type'>
396
- <?php
397
- $types = get_post_types();
398
- //array_unshift($types, "standard");
399
- foreach ($types as $type) {
400
- $selected = "";
401
- if ($config['post_type'] == $type) {
402
- $selected = " selected='selected'";
403
- }
404
- echo "<option value='$type'$selected>$type</option>";
405
- }
406
- ?>
407
- </select>
408
- </td>
409
- </tr>
410
-
411
- <tr>
412
- <th width="33%" valign="top" scope="row"><?php _e('Default Title:', 'postie') ?> </th>
413
- <td>
414
- <input name='postie-settings[default_title]' type="text" id='postie-settings-default_title' value="<?php echo esc_attr($default_title); ?>" size="50" /><br />
415
- </td>
416
- </tr>
417
- <tr>
418
- <th width="33%" valign="top" scope="row"><?php _e('Preferred Text Type:', 'postie') ?> </th>
419
- <td>
420
- <select name='postie-settings[prefer_text_type]' id='postie-settings-prefer_text_type'>
421
- <?php printf('<option value="plain" %s>plain</option>', ($prefer_text_type == "plain") ? "selected" : "") ?>
422
- <?php printf('<option value="html" %s>html</option>', ($prefer_text_type == "html") ? "selected" : "") ?>
423
- </select>
424
- </td>
425
- </tr>
426
- <?php echo BuildBooleanSelect("Forward Rejected Mail", "postie-settings[forward_rejected_mail]", $forward_rejected_mail); ?>
427
- <?php echo BuildBooleanSelect("Allow Subject In Mail", "postie-settings[allow_subject_in_mail]", $allow_subject_in_mail); ?>
428
- <?php echo BuildBooleanSelect("Allow HTML In Mail Subject", "postie-settings[allow_html_in_subject]", $allow_html_in_subject); ?>
429
- <?php echo BuildBooleanSelect("Allow HTML In Mail Body", "postie-settings[allow_html_in_body]", $allow_html_in_body); ?>
430
- <tr>
431
- <th width="33%" valign="top" scope="row"><?php _e('Tag Of Message Start:', 'postie') ?> <br />
432
- <span class='recommendation'><?php _e('Use to remove any text from a message that the email provider puts at the top of the message', 'postie') ?></span></th>
433
- <td>
434
- <input name='postie-settings[message_start]' type="text" id='postie-settings-message_start' value="<?php echo esc_attr($message_start); ?>" size="50" /><br />
435
- </td>
436
- </tr>
437
- <tr>
438
- <th width="33%" valign="top" scope="row"><?php _e('Tag Of Message End:', 'postie') ?> <br />
439
- <span class='recommendation'><?php _e('Use to remove any text from a message that the email provider puts at the end of the message', 'postie') ?></span></th>
440
- <td>
441
- <input name='postie-settings[message_end]' type="text" id='postie-settings-message_end' value="<?php echo esc_attr($message_end); ?>" size="50" /><br />
442
- </td>
443
- </tr>
444
-
445
- <?php
446
- echo BuildBooleanSelect("Wrap content in pre tags", "postie-settings[wrap_pre]", $wrap_pre);
447
- echo BuildBooleanSelect("Filter newlines", "postie-settings[filternewlines]", $filternewlines, "Retain newlines from plain text. Set to no if using markdown or textitle syntax");
448
- echo BuildBooleanSelect("Replace newline characters with html line breaks (&lt;br /&gt;)", "postie-settings[convertnewline]", $convertnewline, "Filter newlines must be turned on for this option to take effect.");
449
- echo BuildBooleanSelect("Return rejected mail to sender", "postie-settings[return_to_sender]", $return_to_sender);
450
- ?>
451
- <tr>
452
- <th>
453
- <?php _e("Send post confirmation email to", 'postie') ?>:
454
- </th>
455
- <td>
456
- <select name='postie-settings[confirmation_email]' id='postie-settings-confirmation_email'>
457
- <option value="sender" <?php echo($confirmation_email == "sender") ? "selected" : "" ?>><?php _e('sender', 'postie') ?></option>
458
- <option value="admin" <?php echo ($confirmation_email == "admin") ? "selected" : "" ?>><?php _e('administrator', 'postie') ?></option>
459
- <option value="both" <?php echo ($confirmation_email == "both") ? "selected" : "" ?>><?php _e('sender and administrator', 'postie') ?></option>
460
- <option value="" <?php echo ($confirmation_email == "") ? "selected" : "" ?>><?php _e('none', 'postie') ?></option>
461
- </select>
462
- </td>
463
- </tr>
464
-
465
- <?php
466
- echo BuildBooleanSelect("Automatically convert urls to links", "postie-settings[converturls]", $converturls);
467
- echo BuildBooleanSelect("Use shortcode for embedding video (youtube and others)", "postie-settings[shortcode]", $shortcode);
468
- ?>
469
- <tr>
470
- <th width="33%" valign="top" scope="row"><?php _e('Encoding for pages and feeds:', 'postie') ?> <br />
471
- <span class='recommendation'><?php _e('The character set for your blog.', 'postie') ?></span></th>
472
- <td>
473
- <input name='postie-settings[message_encoding]' type="text" id='postie-settings-message_encoding' value="<?php echo esc_attr($message_encoding); ?>" size="10" />
474
- <span class='recommendation'>UTF-8 <?php _e("should handle ISO-8859-1 as well", 'postie'); ?></span>
475
- </td>
476
- </tr>
477
- <?php echo BuildBooleanSelect("Decode Quoted Printable Data", "postie-settings[message_dequote]", $message_dequote); ?>
478
- <?php echo BuildTextArea("Supported MIME Types", "postie-settings[supported_file_types]", $supported_file_types, "Add just the type (not the subtype). Text, Video, Audio, Image and Multipart are always supported. Put each type on a single line."); ?>
479
- <?php echo BuildTextArea("Banned File Names", "postie-settings[banned_files_list]", $banned_files_list, "Put each file name on a single line.Files matching this list will never be posted to your blog. You can use wildcards such as *.xls, or *.* for all files"); ?>
480
- <?php echo BuildBooleanSelect("Drop The Signature From Mail", "postie-settings[drop_signature]", $drop_signature); ?>
481
- <?php echo BuildTextArea("Signature Patterns", "postie-settings[sig_pattern_list]", $sig_pattern_list, "Put each pattern on a separate line. Patterns are <a href='http://regex101.com/' target='_blank'>regular expressions</a>."); ?>
482
- <?php echo BuildTextArea("Allowed SMTP servers", "postie-settings[smtp]", $smtp, "Only allow messages which have been sent throught the following smtp servers. Put each server on a separate line. Leave blank to not check smtp servers."); ?>
483
- </table>
484
- </div>
485
- <div id="simpleTabs-content-4" class="simpleTabs-content">
486
- <table class='form-table'>
487
-
488
- <?php
489
- echo BuildBooleanSelect("Use First Image as Featured Image", "postie-settings[featured_image]", $featured_image, "If any images are attached, the first one will be the featured image for the post");
490
- echo BuildBooleanSelect("Automatically insert image gallery", "postie-settings[auto_gallery]", $auto_gallery, "If any images are attached, they will automatically be inserted as a gallery");
491
- echo BuildBooleanSelect("Image Location", "postie-settings[images_append]", $images_append, "Location of attachments if using 'plain' format. Before or After content.", array('After', 'Before'));
492
- echo BuildBooleanSelect("Start Image Count At", "postie-settings[start_image_count_at_zero]", $start_image_count_at_zero, 'For use if using "Image Place Holder Tag" below.', array('Start at 0', 'Start at 1'));
493
- echo BuildBooleanSelect("Generate Thumbnails", "postie-settings[generate_thumbnails]", $generate_thumbnails, "Some hosts crash during thumbnail generation. Set this to 'No' if you have this issue.");
494
- ?>
495
- <tr>
496
- <th width="33%" valign="top" scope="row"><?php _e('Image Place Holder Tag:', 'postie') ?> <br />
497
- <span class='recommendation'>For use in 'plain' messages. The code for inserting an image. I.e. put "#img1# in your email where you want the first image to show. See also "Start Image Count At" </span>
498
- </th>
499
- <td>
500
- <input name='postie-settings[image_placeholder]' type="text" id='postie-settings-image_placeholder' value="<?php echo esc_attr($image_placeholder); ?>" size="50" /><br />
501
- </td>
502
- </tr>
503
- <tr>
504
- <th width="33%" valign="top" scope="row"><?php _e('Image Template', 'postie') ?>:<br />
505
- <span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie'); ?></span><br /><br />
506
- <span class='recommendation'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></span><br /><br />
507
- <span class='recommendation'><?php _e('Sizes for thumbnail, medium, and large images can be chosen in the <a href="options-media.php">Media Settings</a>. The samples here use the default sizes, and will not reflect the sizes you have chosen.', 'postie'); ?></span>
508
- </th>
509
- <td>
510
- <input type='hidden' id='postie-settings-selected_imagetemplate' name='postie-settings[selected_imagetemplate]'
511
- value="<?php echo esc_attr($selected_imagetemplate) ?>" />
512
- <select name='imagetemplateselect' id='imagetemplateselect'
513
- onchange="changeStyle('imageTemplatePreview', 'postie-settings-imagetemplate',
514
- 'imagetemplateselect', 'postie-settings-selected_imagetemplate', 'smiling.jpg');" >
515
- <?php
516
- include(POSTIE_ROOT . '/templates/image_templates.php');
517
- $styleOptions = $imageTemplates;
518
- $selected = $selected_imagetemplate;
519
- foreach ($styleOptions as $key => $value) {
520
- if ($key != 'selected') {
521
- if ($key == $selected) {
522
- $select = ' selected=selected ';
523
- } else {
524
- $select = ' ';
525
- }
526
- if ($key == 'custom')
527
- $value = $imagetemplate;
528
- echo '<option' . $select . 'value="' .
529
- esc_attr($value) . '" >' . $key . '</option>';
530
- }
531
- }
532
- ?>
533
- </select>
534
- <div>
535
- <?php _e('Preview', 'postie'); ?>
536
- </div>
537
- <div id='imageTemplatePreview'></div>
538
- <textarea onchange='changeStyle("imageTemplatePreview", "postie-settings-imagetemplate", "imagetemplateselect",
539
- "postie-settings-selected_imagetemplate", "smiling.jpg", true);' cols='70' rows='7' id='postie-settings-imagetemplate' name='postie-settings[imagetemplate]'>
540
- <?php echo esc_attr($imagetemplate) ?>
541
- </textarea>
542
- <div class='recommendation'>
543
- <ul>
544
- <li>{CAPTION} gets replaced with the caption you specified (if any)</li>
545
- <li>{FILELINK} gets replaced with the url to the media</li>
546
- <li>{FILENAME} gets replaced with the name of the attachment from the email</li>
547
- <li>{FULL} same as {FILELINK}</li>
548
- <li>{HEIGHT} gets replaced with the height of the photo</li>
549
- <li>{ID} gets replaced with the post id</li>
550
- <li>{IMAGE} same as {FILELINK}</li>
551
- <li>{LARGEHEIGHT} gets replaced with the height of a large image</li>
552
- <li>{LARGEWIDTH} gets replaced with the width of a large image</li>
553
- <li>{LARGE} gets replaced with the url to the large-sized image</li>
554
- <li>{MEDIUMHEIGHT} gets replaced with the height of a medium image</li>
555
- <li>{MEDIUMWIDTH} gets replaced with the width of a medium image</li>
556
- <li>{MEDIUM} gets replaced with the url to the medium-sized image</li>
557
- <li>{PAGELINK} gets replaced with the URL of the file in WordPress</li>
558
- <li>{RELFILENAME} gets replaced with the relative path to the full-size image</li>
559
- <li>{THUMBHEIGHT} gets replaced with the height of a thumbnail image</li>
560
- <li>{THUMB} gets replaced with the url to the thumbnail image</li>
561
- <li>{THUMBNAIL} same as {THUMB}</li>
562
- <li>{THUMBWIDTH} gets replaced with the width of a thumbnail image</li>
563
- <li>{TITLE} same as {FILENAME}</li>
564
- <li>{URL} same as {FILELINK}</li>
565
- <li>{WIDTH} gets replaced with width of the photo</li>
566
- <li>{ICON} insert the icon for the attachment (for non-audio/image/video attachments only)</li>
567
- </ul>
568
- </div>
569
- </td>
570
- </tr>
571
- </table>
572
- </div>
573
-
574
- <!--
575
- ########## VIDEO AND AUDIO OPTIONS ###################
576
- -->
577
-
578
- <div id="simpleTabs-content-5" class="simpleTabs-content">
579
- <table class='form-table'>
580
-
581
- <tr>
582
- <th scope='row'><?php _e('Video template 1', 'postie') ?>:<br />
583
- <span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></span><br />
584
- <span class='recommendation'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></span><br />
585
- </th>
586
- <?php $templateDir = get_option('siteurl') . '/' . PLUGINDIR . '/postie/templates'; ?>
587
- <td>
588
- <input type='hidden' id='postie-settings-selected_video1template' name='postie-settings[selected_video1template]'
589
- value="<?php echo esc_attr($selected_video1template) ?>" />
590
- <select name='video1templateselect' id='video1templateselect'
591
- onchange="changeStyle('video1TemplatePreview', 'postie-settings-video1template', 'video1templateselect', 'postie-settings-selected_video1template', 'hi.mp4');" />
592
- <?php
593
- include(POSTIE_ROOT . '/templates/video1_templates.php');
594
- $styleOptions = $video1Templates;
595
- $selected = $selected_video1template;
596
- foreach ($styleOptions as $key => $value) {
597
- if ($key != 'selected') {
598
- if ($key == $selected) {
599
- $select = ' selected=selected ';
600
- } else {
601
- $select = ' ';
602
- }
603
- if ($key == 'custom')
604
- $value = $video1template;
605
- echo '<option' . $select . 'value="' .
606
- esc_attr($value) . '" >' . $key . '</option>';
607
- }
608
- }
609
- ?>
610
- </select>
611
- <div>
612
- <?php _e('Preview', 'postie'); ?>
613
- </div>
614
- <div id='video1TemplatePreview'></div>
615
- <textarea onchange="changeStyle('video1TemplatePreview', 'postie-settings-video1template',
616
- 'video1templateselect', 'postie-settings-selected_video1template', 'hi.mp4', true);" cols='70' rows='7' id='postie-settings-video1template'
617
- name='postie-settings[video1template]'><?php echo esc_attr($video1template) ?></textarea>
618
- </td>
619
- </tr>
620
- <tr>
621
- <th width="33%" valign="top" scope="row">
622
- <?php _e('Video 1 file extensions:') ?><br /><span class='recommendation'>
623
- <?php _e('Use video template 1 for files with these extensions (separated by commas)', 'postie') ?></span> </th>
624
- <td>
625
- <br/><input name='postie-settings[video1types]' type="text" id='postie-settings-video1types'
626
- value="<?php if ($video1types != '') echo esc_attr($video1types); ?>" size="40" />
627
- </td>
628
- </tr>
629
- <tr><td colspan="2"><hr /></td></tr>
630
- <tr>
631
- <th scope='row'><?php _e('Video template 2', 'postie') ?>:<br />
632
- <span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></span><br/>
633
- <span class='recommendation'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></span><br />
634
- </th>
635
- <td>
636
- <input type='hidden' id='postie-settings-selected_video2template' name='postie-settings[selected_video2template]'
637
- value="<?php echo esc_attr($selected_video2template) ?>" />
638
- <select name='video2templateselect' id='video2templateselect'
639
- onchange="changeStyle('video2TemplatePreview', 'postie-settings-video2template',
640
- 'video2templateselect', 'postie-settings-selected_video2template', 'hi.flv');" >
641
- <?php
642
- include(POSTIE_ROOT . '/templates/video2_templates.php');
643
- $styleOptions = $video2Templates;
644
- $selected = $selected_video2template;
645
- foreach ($styleOptions as $key => $value) {
646
- if ($key != 'selected') {
647
- if ($key == $selected) {
648
- $select = ' selected=selected ';
649
- } else {
650
- $select = ' ';
651
- }
652
- if ($key == 'custom')
653
- $value = $video2template;
654
- echo '<option' . $select . 'value="' . esc_attr($value) . '" >' . $key . '</option>';
655
- }
656
- }
657
- ?>
658
- </select>
659
- <div>
660
- <?php _e('Preview', 'postie'); ?>
661
- </div>
662
- <div id='video2TemplatePreview'></div>
663
- <textarea onchange="changeStyle('video2TemplatePreview', 'postie-settings-video2template',
664
- 'video2templateselect', 'postie-settings-selected_video2template', 'hi.flv', true);" cols='70' rows='7' id='postie-settings-video2template'
665
- name='postie-settings[video2template]'>
666
- <?php echo esc_attr($video2template) ?>
667
- </textarea>
668
- </td>
669
- </tr>
670
- <tr>
671
- <th width="33%" valign="top" scope="row">
672
- <?php _e('Video 2 file extensions:') ?><br /><span class='recommendation'>
673
- <?php _e('Use video template 2 for files with these extensions (separated by commas)', 'postie') ?></span> <br />
674
- </th>
675
- <td>
676
- <br/><input name='postie-settings[video2types]' type="text" id='postie-settings-video2types'
677
- value="<?php if ($video2types != '') echo esc_attr($video2types); ?>" size="40" />
678
- </td>
679
- </tr>
680
- <tr><td colspan="2"><hr /></td></tr>
681
- <tr>
682
- <th scope='row'><?php _e('Audio template', 'postie') ?>:<br />
683
- <span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></span>
684
- <br />
685
- <span class='recommendation'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></span><br />
686
- </th>
687
- <td>
688
- <input type='hidden' id='postie-settings-selected_audiotemplate' name='postie-settings[selected_audiotemplate]'
689
- value="<?php echo esc_attr($selected_audiotemplate) ?>" />
690
- <select name='audiotemplateselect' id='audiotemplateselect'
691
- onchange="changeStyle('audioTemplatePreview', 'postie-settings-audiotemplate',
692
- 'audiotemplateselect', 'postie-settings-selected_audiotemplate', 'funky.mp3', false);" >
693
- <?php
694
- include(POSTIE_ROOT . '/templates/audio_templates.php');
695
- $styleOptions = $audioTemplates;
696
- $selected = $selected_audiotemplate;
697
- foreach ($styleOptions as $key => $value) {
698
- if ($key != 'selected') {
699
- if ($key == $selected) {
700
- $select = ' selected=selected ';
701
- } else {
702
- $select = ' ';
703
- }
704
- if ($key == 'custom')
705
- $value = $audiotemplate;
706
- echo '<option' . $select . 'value="' .
707
- esc_attr($value) . '" >' . $key . '</option>';
708
- }
709
- }
710
- ?>
711
- </select>
712
- <div>
713
- <?php _e('Preview', 'postie'); ?>
714
- </div>
715
- <div id='audioTemplatePreview'></div>
716
- <textarea onchange="changeStyle('audioTemplatePreview', 'postie-settings-audiotemplate',
717
- 'audiotemplateselect', 'postie-settings-selected_audiotemplate', 'funky.mp3', true);" cols='70' rows='7' id='postie-settings-audiotemplate'
718
- name='postie-settings[audiotemplate]'><?php echo esc_attr($audiotemplate) ?></textarea>
719
- </td>
720
- </tr>
721
- <tr>
722
- <th width="33%" valign="top" scope="row">
723
- <?php _e('Audio file extensions:') ?><br />
724
- <span class='recommendation'><?php _e('Use the audio template for files with these extensions (separated by commas)', 'postie') ?></span> <br />
725
-
726
- </th>
727
- <td>
728
- <br/><input name='postie-settings[audiotypes]' type="text" id='postie-settings-audiotypes' value="<?php echo esc_attr($audiotypes); ?>" size="40" />
729
- </td>
730
- </tr>
731
- </table>
732
- </div>
733
- <div id="simpleTabs-content-6" class="simpleTabs-content">
734
- <table class='form-table'>
735
-
736
- <tr>
737
- <th scope='row'><?php _e('Attachment icon set', 'postie') ?>:<br /></th>
738
- <td>
739
- <input type='hidden' id='postie-settings-icon_set' name='postie-settings[icon_set]'
740
- value="<?php echo esc_attr($icon_set) ?>" />
741
-
742
- <?php
743
- $icon_sets = array('silver', 'black', 'white', 'custom', 'none');
744
- $icon_sizes = array(32, 48, 64);
745
- ?>
746
- <select name='icon_set_select' id='icon_set_select' onchange="changeIconSet(this);" >
747
- <?php
748
- $styleOptions = $icon_sets;
749
- $selected = $icon_set;
750
- foreach ($styleOptions as $key) {
751
- if ($key != 'selected') {
752
- if ($key == $selected) {
753
- $select = ' selected=selected ';
754
- } else {
755
- $select = ' ';
756
- }
757
- echo '<option' . $select . 'value="' . esc_attr($key) . '" >' . $key . '</option>';
758
- }
759
- }
760
- ?>
761
- </select>
762
- <div id='postie-settings-attachment_preview'></div>
763
- </td>
764
- </tr>
765
- <tr>
766
- <th scope='row'><?php _e('Attachment icon size (in pixels)', 'postie') ?>:<br /></th>
767
- <td>
768
- <input type='hidden' id='postie-settings-icon_size' name='postie-settings[icon_size]'
769
- value="<?php echo esc_attr($icon_size) ?>" />
770
- <select name='icon_size_select' id='icon_size_select' onchange="changeIconSet(this, true);" >
771
- <?php
772
- $styleOptions = $icon_sizes;
773
- $selected = $icon_size;
774
- foreach ($styleOptions as $key) {
775
- if ($key != 'selected') {
776
- if ($key == $selected) {
777
- $select = ' selected=selected ';
778
- } else {
779
- $select = ' ';
780
- }
781
- echo '<option' . $select . 'value="' . esc_attr($key) . '" >' . $key . '</option>';
782
- }
783
- }
784
- ?>
785
- </select>
786
- </td>
787
- </tr>
788
- <tr>
789
- <th scope='row'><?php _e('Attachment template', 'postie') ?>:<br />
790
- <span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></span>
791
- <br />
792
- <span class='recommendation'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></span><br />
793
- </th>
794
- <td>
795
- <input type='hidden' id='postie-settings-selected_generaltemplate' name='postie-settings[selected_generaltemplate]'
796
- value="<?php echo esc_attr($selected_generaltemplate) ?>" />
797
- <select name='generaltemplateselect' id='generaltemplateselect'
798
- onchange="changeStyle('generalTemplatePreview', 'postie-settings-generaltemplate',
799
- 'generaltemplateselect', 'postie-settings-selected_generaltemplate', 'interesting_document.doc', false);" >
800
- <?php
801
- include(POSTIE_ROOT . '/templates/general_template.php');
802
- $styleOptions = $generalTemplates;
803
- $selected = $selected_generaltemplate;
804
- foreach ($styleOptions as $key => $value) {
805
- if ($key != 'selected') {
806
- if ($key == $selected) {
807
- $select = ' selected="selected" ';
808
- } else {
809
- $select = ' ';
810
- }
811
- if ($key == 'custom')
812
- $value = $generaltemplate;
813
- echo '<option' . $select . 'value="' . esc_attr($value) . '" >' . $key . '</option>';
814
- }
815
- }
816
- ?>
817
- </select>
818
- <div>
819
- <?php _e('Preview', 'postie'); ?>
820
- </div>
821
- <div id='generalTemplatePreview'></div>
822
- <textarea onchange="changeStyle('generalTemplatePreview', 'postie-settings-generaltemplate', 'generaltemplateselect', 'postie-settings-selected_generaltemplate', 'interesting_document.doc', true);"
823
- cols='70' rows='7'
824
- id='postie-settings-generaltemplate'
825
- name='postie-settings[generaltemplate]'><?php echo esc_attr($generaltemplate) ?></textarea>
826
- </td>
827
- </tr>
828
- <?php echo BuildBooleanSelect("Use custom image field for attachments", "postie-settings[custom_image_field]", $custom_image_field, "When set to 'Yes' no attachments will appear in the post (including images, video &amp; sound files). Instead the url to the attachment will be put into a custom field named 'image'. Your theme will need logic to display these attachments."); ?>
829
- </table>
830
- </div>
831
- <div id="simpleTabs-content-7" class="simpleTabs-content">
832
- <div style="">
833
- <h3>Postie Support</h3>
834
- <p>Please use the Postie <a href="https://wordpress.org/support/plugin/postie" target="_blank">support forums</a></p>
835
- <h3>More Postie info</h3>
836
- <p>Visit <a href="http://postieplugin.com/" target="_blank">PostiePlugin.com</a> for lots of information and assistance
837
- including information for developers wanting to leverage/extend Postie.</p>
838
- </div>
839
- <div>
840
- <h3>Postie AddOns</h3>
841
- <p>There are a number of different AddOns available to extend Postie's functionality.
842
- See <a href='http://postieplugin.com/add-ons/' target='_blank'>the list</a> for more information.</p>
843
- <div>
844
- <div id='postie-addons'></div>
845
- </div>
846
- </div>
847
- </div>
848
-
849
-
850
- <p class="submit" style="clear: both;">
851
- <input type="hidden" name="action" value="update" />
852
- <input type="hidden" name="page_options" value="postie-settings" />
853
- <input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" class="button button-primary" />
854
- </p>
855
- </form>
856
- <form id="postie-options" name="postie-options" method="post">
857
- <input type="hidden" name="action" value="reset" />
858
- <input name="Submit" value="<?php _e("Reset Settings To Defaults", 'postie') ?>" type="submit" class='button'>
859
- <span>&nbsp;(Your Mail server settings will be retained)</span>
860
- </form>
861
- </div>
862
-
863
- <?php $iconDir = get_option('siteurl') . '/' . PLUGINDIR . '/postie/icons'; ?>
864
- <script type="text/javascript">
865
- jQuery(document).ready(function () {
866
- jQuery("#simpleTabs").simpleTabs({
867
- fadeSpeed: "medium", // @param : low, medium, fast
868
- defautContent: 1, // @param : number ( simpleTabs-nav-number)
869
- autoNav: "false", // @param : true or false
870
- closeTabs: "false" // @param : true or false;
871
- });
872
- jQuery("#simpleTabs-nav-7").click(function () {
873
- jQuery.get('http://postieplugin.com/feed/?post_type=download', function (data) {
874
- console.log(data);
875
- var h = '';
876
- jQuery(data).find("item").each(function () {
877
- var t = jQuery(this).find("title").text();
878
- if (t != 'Donation') {
879
- h += "<div style='float: left; width: 300px;'>";
880
- h += "<h4 class='title'><a href='" + jQuery(this).find("link").text() + "' target='_blank'>" + t + "</a></h4>";
881
- var d = jQuery(this).find("description").text();
882
- if ((i = d.indexOf('<p class="more')) != -1) {
883
- d = d.substring(0, i);
884
- }
885
- else if ((i = d.indexOf('<p>The post <a')) != -1) {
886
- d = d.substring(0, i);
887
- }
888
- h += "<div>" + d + "</div>";
889
- h += "</div>";
890
- }
891
- });
892
- jQuery("#postie-addons").html(h);
893
- });
894
- });
895
- });
896
-
897
- function changeIconSet(selectBox, size) {
898
- var iconSet = document.getElementById('postie-settings-icon_set');
899
- var iconSize = document.getElementById('postie-settings-icon_size');
900
- var preview = document.getElementById('postie-settings-attachment_preview');
901
- var iconDir = '<?php echo $iconDir ?>/';
902
- if (size == true) {
903
- var hiddenInput = iconSize
904
- } else {
905
- var hiddenInput = iconSet;
906
- }
907
- for (i = 0; i < selectBox.options.length; i++) {
908
- if (selectBox.options[i].selected == true) {
909
- hiddenInput.value = selectBox.options[i].value;
910
- }
911
- }
912
- var fileTypes = new Array('doc', 'pdf', 'xls', 'default');
913
- preview.innerHTML = '';
914
- for (j = 0; j < fileTypes.length; j++) {
915
- preview.innerHTML += "<img src='" + iconDir + iconSet.value + '/' +
916
- fileTypes[j] + '-' + iconSize.value + ".png' />";
917
- }
918
- }
919
-
920
- function changeStyle(preview, template, select, selected, sample, custom) {
921
- var preview = document.getElementById(preview);
922
- var pageStyles = document.getElementById(select);
923
- var selectedStyle;
924
- var hiddenStyle = document.getElementById(selected);
925
- var pageStyle = document.getElementById(template);
926
- if (custom == true) {
927
- selectedStyle = pageStyles.options[pageStyles.options.length - 1];
928
- selectedStyle.value = pageStyle.value;
929
- selectedStyle.selected = true;
930
- } else {
931
- for (i = 0; i < pageStyles.options.length; i++) {
932
- if (pageStyles.options[i].selected == true) {
933
- selectedStyle = pageStyles.options[i];
934
- }
935
- }
936
- }
937
- hiddenStyle.value = selectedStyle.innerHTML
938
- var previewHTML = selectedStyle.value;
939
- var fileLink = '<?php echo $templateDir ?>/' + sample;
940
- var thumb = '<?php echo $templateDir ?>/' + sample.replace(/\.jpg/, '-150x150.jpg');
941
- var medium = '<?php echo $templateDir ?>/' + sample.replace(/\.jpg/, '-300x200.jpg');
942
- var large = '<?php echo $templateDir ?>/' + sample.replace(/\.jpg/, '-1024x682.jpg');
943
- var pagelink = '<?php echo get_option("siteurl") ?>' + '/?attachment_id=9999';
944
- previewHTML = previewHTML.replace(/{FILELINK}/g, fileLink);
945
- previewHTML = previewHTML.replace(/{FULL}/g, fileLink);
946
- previewHTML = previewHTML.replace(/{IMAGE}/g, fileLink);
947
- previewHTML = previewHTML.replace(/{FILENAME}/, sample);
948
- previewHTML = previewHTML.replace(/{PAGELINK}/, pagelink);
949
- previewHTML = previewHTML.replace(/{RELFILENAME}/, sample);
950
- previewHTML = previewHTML.replace(/{THUMB(NAIL|)}/, thumb);
951
- previewHTML = previewHTML.replace(/{MEDIUM}/, medium);
952
- previewHTML = previewHTML.replace(/{LARGE}/, large);
953
- previewHTML = previewHTML.replace(/{HEIGHT}/, 800);
954
- previewHTML = previewHTML.replace(/{WIDTH}/, 1200);
955
- previewHTML = previewHTML.replace(/{THUMBWIDTH}/, 150);
956
- previewHTML = previewHTML.replace(/{THUMBHEIGHT}/, 150);
957
- previewHTML = previewHTML.replace(/{MEDIUMWIDTH}/, 300);
958
- previewHTML = previewHTML.replace(/{MEDIUMHEIGHT}/, 200);
959
- previewHTML = previewHTML.replace(/{LARGEWIDTH}/, 1024);
960
- previewHTML = previewHTML.replace(/{LARGEHEIGHT}/, 682);
961
- previewHTML = previewHTML.replace(/{ID}/, 9999);
962
- previewHTML = previewHTML.replace(/{POSTTITLE}/g, 'Post title');
963
- previewHTML = previewHTML.replace(/{CAPTION}/g, 'Spencer smiling');
964
- preview.innerHTML = previewHTML;
965
- pageStyle.value = selectedStyle.value;
966
- }
967
-
968
- function showAdvanced(advancedId, arrowId) {
969
- var advanced = document.getElementById(advancedId);
970
- var arrow = document.getElementById(arrowId);
971
- if (advanced.style.display == 'none') {
972
- advanced.style.display = 'block';
973
- arrow.innerHTML = '&#9660;';
974
- } else {
975
- advanced.style.display = 'none';
976
- arrow.innerHTML = '&#9654;';
977
- }
978
- }
979
-
980
- changeStyle('imageTemplatePreview', 'postie-settings-imagetemplate', 'imagetemplateselect', 'postie-settings-selected_imagetemplate', 'smiling.jpg', false);
981
- changeStyle('audioTemplatePreview', 'postie-settings-audiotemplate', 'audiotemplateselect', 'postie-settings-selected_audiotemplate', 'funky.mp3', false);
982
- changeStyle('video1TemplatePreview', 'postie-settings-video1template', 'video1templateselect', 'postie-settings-selected_video1template', 'hi.mp4', false);
983
- changeStyle('video2TemplatePreview', 'postie-settings-video2template', 'video2templateselect', 'postie-settings-selected_video2template', 'hi.flv', false);
984
- changeIconSet(document.getElementById('icon_set_select'));
985
- </script>
1
+ <div class="wrap">
2
+ <div style="float:right; width: 220px; border: 1px solid darkgrey; padding:2px;border-radius:10px;margin-left: 10px;" >
3
+ <p class="" style="text-align:center;font-weight: bolder; margin-top: 0px; margin-bottom: 2px;"><?php _e("Please Donate, Every $ Helps!", 'postie'); ?></p>
4
+ <p style="margin-top: 0;margin-bottom: 2px;"><?php _e("Your generous donation allows me to continue developing Postie for the WordPress community.", 'postie'); ?></p>
5
+ <form style="" action="https://www.paypal.com/cgi-bin/webscr" method="post">
6
+ <input type="hidden" name="cmd" value="_s-xclick">
7
+ <input type="hidden" name="hosted_button_id" value="HPK99BJ88V4C2">
8
+ <div style="text-align:center;">
9
+ <input style="border: none; margin: 0;" type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" name="submit" alt="PayPal - The safer, easier way to pay online!">
10
+ </div>
11
+ </form>
12
+ </div>
13
+ <h2>
14
+ <a style='text-decoration:none' href='admin.php?page=postie-settings'>
15
+ <?php
16
+ echo '<img src="' . plugins_url('images/mail.png', __FILE__) . '" alt="postie" />';
17
+ _e('Postie Settings', 'postie');
18
+ ?>
19
+ </a>
20
+ <span class="description">(v<?php _e(POSTIE_VERSION, 'postie'); ?>)</span>
21
+ </h2>
22
+
23
+ <?php
24
+ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'postie-functions.php');
25
+ if (isset($_POST["action"])) {
26
+ switch ($_POST["action"]) {
27
+ case "reset":
28
+ config_ResetToDefault();
29
+ $message = 1;
30
+ break;
31
+ case "cronless":
32
+ check_postie();
33
+ $message = 1;
34
+ break;
35
+ case "test":
36
+ postie_test_config();
37
+ exit;
38
+ break;
39
+ case "runpostie":
40
+ EchoInfo(__("Checking for mail manually", "postie"));
41
+ postie_get_mail();
42
+ exit;
43
+ break;
44
+ case "runpostie-debug":
45
+ EchoInfo(__("Checking for mail manually with debug output", "postie"));
46
+ if (!defined('POSTIE_DEBUG')) {
47
+ define('POSTIE_DEBUG', true);
48
+ }
49
+ postie_get_mail();
50
+ exit;
51
+ break;
52
+ default:
53
+ $message = 2;
54
+ break;
55
+ }
56
+ }
57
+ global $wpdb, $wp_roles;
58
+
59
+ $config = config_Read();
60
+ if (empty($config)) {
61
+ $config = config_ResetToDefault();
62
+ }
63
+
64
+ $arrays = config_ArrayedSettings();
65
+ // some fields are stored as arrays, because that makes back-end processing much easier
66
+ // and we need to convert those fields to strings here, for the options form
67
+ foreach ($arrays as $sep => $fields) {
68
+ foreach ($fields as $field) {
69
+ $config[$field] = implode($sep, $config[$field]);
70
+ }
71
+ }
72
+ extract($config);
73
+ if (!isset($maxemails)) {
74
+ EchoInfo(__("New setting: maxemails", "postie"));
75
+ $maxemails = 0;
76
+ }
77
+ if (!isset($category_match)) {
78
+ $category_match = true;
79
+ }
80
+
81
+ if ($interval == 'manual') {
82
+ wp_clear_scheduled_hook('check_postie_hook');
83
+ }
84
+
85
+ $messages[1] = __("Configuration successfully updated!", 'postie');
86
+ $messages[2] = __("Error - unable to save configuration", 'postie');
87
+ ?>
88
+ <?php if (isset($_GET['message'])) : ?>
89
+ <div class="updated"><p><?php _e($messages[$_GET['message']], 'postie'); ?></p></div>
90
+ <?php endif; ?>
91
+
92
+ <form name="postie-options" method='post'>
93
+ <input type="hidden" name="action" value="runpostie" />
94
+ <input name="Submit" value="<?php _e("Run Postie", 'postie'); ?> &raquo;" type="submit" class='button'>
95
+ <?php _e("(To run the check mail script manually)", 'postie'); ?>
96
+ </form>
97
+ <form name="postie-options" method='post'>
98
+ <input type="hidden" name="action" value="runpostie-debug" />
99
+ <input name="Submit" value="<?php _e("Run Postie (Debug)", 'postie'); ?> &raquo;" type="submit" class='button'>
100
+ <?php _e("(To run the check mail script manually with full debug output)", 'postie'); ?>
101
+ </form>
102
+ <form name="postie-options" method="post">
103
+ <input type="hidden" name="action" value="test" />
104
+ <input name="Submit" value="<?php _e("Test Config", 'postie'); ?>&raquo;" type="submit" class='button'>
105
+ <?php _e("this will check your configuration options", 'postie'); ?>
106
+ </form>
107
+
108
+ <form name="postie-options" method="post" action='options.php' autocomplete="off">
109
+ <!-- fake fields are a workaround for chrome autofill getting the wrong fields -->
110
+ <input style="display:none" type="text" name="fakeusernameremembered"/>
111
+ <input style="display:none" type="password" name="fakepasswordremembered"/>
112
+
113
+ <?php settings_fields('postie-settings'); ?>
114
+ <input type="hidden" name="action" value="config" />
115
+ <div id="simpleTabs">
116
+ <div class="simpleTabs-nav">
117
+ <ul>
118
+ <li id="simpleTabs-nav-1"><?php _e('Mailserver', 'postie') ?></li>
119
+ <li id="simpleTabs-nav-2"><?php _e('User', 'postie') ?></li>
120
+ <li id="simpleTabs-nav-3"><?php _e('Message', 'postie') ?></li>
121
+ <li id="simpleTabs-nav-4"><?php _e('Image', 'postie') ?></li>
122
+ <li id="simpleTabs-nav-5"><?php _e('Video and Audio', 'postie') ?></li>
123
+ <li id="simpleTabs-nav-6"><?php _e('Attachments', 'postie') ?></li>
124
+ <li id="simpleTabs-nav-7"><?php _e('Support', 'postie') ?></li>
125
+ </ul>
126
+ </div>
127
+ <div id="simpleTabs-content-1" class="simpleTabs-content">
128
+ <table class='form-table'>
129
+
130
+ <tr>
131
+ <th scope="row"><?php _e('Mail Protocol:', 'postie') ?> </th>
132
+ <td>
133
+ <select name='postie-settings[input_protocol]' id='postie-settings-input_protocol'>
134
+ <option value="pop3" <?php echo (($input_protocol == "pop3") ? " selected='selected' " : "") ?>>POP3</option>
135
+ <?php if (HasIMAPSupport(false)): ?>
136
+ <option value="imap" <?php echo ($input_protocol == "imap") ? "selected='selected' " : "" ?>>IMAP</option>
137
+ <option value="pop3-ssl" <?php echo ($input_protocol == "pop3-ssl") ? "selected='selected' " : "" ?>>POP3-SSL</option>
138
+ <option value="imap-ssl" <?php echo ($input_protocol == "imap-ssl") ? "selected='selected' " : "" ?>>IMAP-SSL</option>
139
+ <?php endif; ?>
140
+ </select>
141
+ <?php if (!HasIMAPSupport(false)): ?>
142
+ <span class="recommendation">IMAP/IMAP-SSL/POP3-SSL unavailable</span>
143
+ <?php endif; ?>
144
+ </td>
145
+ </tr>
146
+
147
+ <?php echo BuildBooleanSelect(__("Use Transport Layer Security (TLS)", "postie"), 'postie-settings[email_tls]', $email_tls, __("Choose Yes if your server requres TLS", "postie")); ?>
148
+
149
+ <tr>
150
+ <th scope="row"><?php _e('Port:', 'postie') ?><br />
151
+ <span class='recommendation'><?php _e("Standard Ports:", 'postie'); ?><br />
152
+ <?php _e("POP3", 'postie'); ?> - 110<br />
153
+ <?php _e("IMAP", 'postie'); ?> - 143<br />
154
+ <?php _e("IMAP-SSL", 'postie'); ?>- 993 <br />
155
+ <?php _e("POP3-SSL", 'postie'); ?> - 995 <br />
156
+ </span>
157
+ </th>
158
+ <td valign="top">
159
+ <br/><input name='postie-settings[mail_server_port]' style="width: 70px;" type="number" min="0" id='postie-settings-mail_server_port' value="<?php echo esc_attr($mail_server_port); ?>" size="6" />
160
+ </td>
161
+ </tr>
162
+ <tr valign="top">
163
+ <th scope="row"><?php _e('Mail Server:', 'postie') ?></th>
164
+ <td><input name='postie-settings[mail_server]' type="text" id='postie-settings-mail_server' value="<?php echo esc_attr($mail_server); ?>" size="40" />
165
+ </td>
166
+ </tr>
167
+ <tr valign="top">
168
+ <th width="33%" scope="row"><?php _e('Mail Userid:', 'postie') ?></th>
169
+ <td><input name='postie-settings[mail_userid]' type="text" id='postie-settings-mail_userid' autocomplete='off' value="<?php echo esc_attr($mail_userid); ?>" size="40" /></td>
170
+ </tr>
171
+ <tr valign="top">
172
+ <th scope="row"><?php _e('Mail Password:', 'postie') ?></th>
173
+ <td>
174
+ <input name='postie-settings[mail_password]' type="password" id='postie-settings-mail_password' autocomplete='off' value="<?php echo esc_attr($mail_password); ?>" size="40" />
175
+ </td>
176
+ </tr>
177
+ <tr>
178
+ <th scope="row"><?php _e('Postie Time Correction:', 'postie') ?>
179
+ <br />
180
+ <span class='recommendation'><?php _e("Should be the same as your normal offset, but this lets you adjust it in cases where that doesn't work.", 'postie'); ?></span>
181
+ </th>
182
+ <td><input style="width: 50px;" name='postie-settings[time_offset]' type="number" id='postie-settings-time_offset' size="2" value="<?php echo esc_attr($time_offset); ?>" />
183
+ <?php _e('hours', 'postie') ?>
184
+
185
+ </td>
186
+ </tr>
187
+ <tr>
188
+ <th>
189
+ <?php _e('Check for mail every', 'postie') ?>:
190
+ </th>
191
+ <td>
192
+ <select name='postie-settings[interval]' id='postie-settings-interval'>
193
+ <option value="weekly" <?php
194
+ if ($interval == "weekly") {
195
+ echo "selected='selected'";
196
+ }
197
+ ?>><?php _e('Once weekly', 'postie') ?></option>
198
+ <option value="daily"<?php
199
+ if ($interval == "daily") {
200
+ echo "selected='selected'";
201
+ }
202
+ ?>><?php _e('daily', 'postie') ?></option>
203
+ <option value="hourly" <?php
204
+ if ($interval == "hourly") {
205
+ echo "selected='selected'";
206
+ }
207
+ ?>><?php _e('hourly', 'postie') ?></option>
208
+ <option value="twiceperhour" <?php
209
+ if ($interval == "twiceperhour") {
210
+ echo "selected='selected'";
211
+ }
212
+ ?>><?php _e('twice per hour', 'postie') ?></option>
213
+ <option value="tenminutes" <?php
214
+ if ($interval == "tenminutes") {
215
+ echo "selected='selected'";
216
+ }
217
+ ?>><?php _e('every ten minutes', 'postie') ?></option>
218
+ <option value="fiveminutes" <?php
219
+ if ($interval == "fiveminutes") {
220
+ echo "selected='selected'";
221
+ }
222
+ ?>><?php _e('every five minutes', 'postie') ?></option>
223
+ <option value="manual" <?php
224
+ if ($interval == "manual") {
225
+ echo "selected='selected'";
226
+ }
227
+ ?>><?php _e('check manually', 'postie') ?></option>
228
+ </select>
229
+ </td>
230
+ </tr>
231
+ <tr>
232
+ <th>
233
+ <?php _e('Maximum number of emails to process:', 'postie'); ?>
234
+ </th>
235
+ <td>
236
+ <select name='postie-settings[maxemails]' id='postie-settings-maxemails'>
237
+ <option value="0" <?php if ($maxemails == '0') echo "selected='selected'" ?>><?php _e('All', 'postie'); ?></option>
238
+ <option value="1" <?php if ($maxemails == '1') echo "selected='selected'" ?>>1</option>
239
+ <option value="2" <?php if ($maxemails == '2') echo "selected='selected'" ?>>2</option>
240
+ <option value="5" <?php if ($maxemails == '5') echo "selected='selected'" ?>>5</option>
241
+ <option value="10" <?php if ($maxemails == '10') echo "selected='selected'" ?>>10</option>
242
+ <option value="25" <?php if ($maxemails == '25') echo "selected='selected'" ?>>25</option>
243
+ <option value="50" <?php if ($maxemails == '50') echo "selected='selected'" ?>>50</option>
244
+ </select>
245
+ </td>
246
+ </tr>
247
+ <?php echo BuildBooleanSelect(__("Delete email after posting", "postie"), 'postie-settings[delete_mail_after_processing]', $delete_mail_after_processing, __("Only set to no for testing purposes", "postie")); ?>
248
+ </table>
249
+ </div>
250
+
251
+ <div id="simpleTabs-content-2" class="simpleTabs-content">
252
+ <table class='form-table'>
253
+
254
+ <?php echo BuildBooleanSelect(__("Allow Anyone To Post Via Email", "postie"), "postie-settings[turn_authorization_off]", $turn_authorization_off, __("Changing this to yes <b style='color: red'>is not recommended</b> - anything that gets sent in will automatically be posted.", "postie")); ?>
255
+ <tr>
256
+ <th scope="row">
257
+ <?php _e('Roles That Can Post:', 'postie') ?><br />
258
+ <span class='recommendation'><?php _e("This allows you to grant access to other users to post if they have the proper access level. Administrators can always post.", 'postie'); ?></span>
259
+ </th>
260
+ <td>
261
+ <br />
262
+ <table class="checkbox-table">
263
+ <?php
264
+ foreach ($wp_roles->role_names as $roleId => $name) {
265
+ $name = translate_user_role($name);
266
+ $role = $wp_roles->get_role($roleId);
267
+ if ($roleId != "administrator") {
268
+ ?>
269
+ <tr>
270
+ <td>
271
+ <input type='checkbox' value='1' name='postie-settings[role_access][<?php echo $roleId; ?>]' <?php echo ($role->has_cap("post_via_postie")) ? 'checked="checked"' : "" ?> >
272
+ <?php echo $name; ?>
273
+ </td>
274
+ </tr>
275
+ <?php
276
+ } else {
277
+ ?>
278
+ <tr>
279
+ <td>
280
+ <input type='checkbox' value='1' disabled='disabled' checked='checked' > <?php echo $name; ?>
281
+ </td>
282
+ </tr>
283
+ <?php
284
+ }
285
+ }
286
+ ?>
287
+ </table>
288
+ </td>
289
+ </tr>
290
+
291
+ <?php echo BuildTextArea(__("Authorized Addresses", "postie"), "postie-settings[authorized_addresses]", $authorized_addresses, __("Put each email address on a single line. Posts from emails in this list will be treated as if they came from the admin. If you would prefer to have users post under their own name - create a WordPress user with the correct access level.", "postie")); ?>
292
+ <tr>
293
+ <th width="33%" valign="top" scope="row">
294
+ <?php _e('Default Poster:', 'postie') ?> <br />
295
+ <span class='recommendation'><?php _e("This will be the poster if you allow posting from emails that are not a registered blog user.", 'postie'); ?></span>
296
+ </th>
297
+ <td>
298
+ <select name='postie-settings[admin_username]' id='postie-settings[admin_username]'>
299
+ <?php
300
+ $adminusers = get_users('orderby=nicename&role=administrator');
301
+ foreach ($adminusers as $user) {
302
+ $selected = "";
303
+ if ($user->user_login == $admin_username) {
304
+ $selected = " selected='selected'";
305
+ }
306
+ echo "<option value='$user->user_login'$selected>$user->user_nicename ($user->user_login)</option>";
307
+ }
308
+ ?>
309
+ </select>
310
+ </td>
311
+ </tr>
312
+ </table>
313
+ </div>
314
+
315
+ <div id = "simpleTabs-content-3" class = "simpleTabs-content">
316
+ <table class = 'form-table'>
317
+ <tr valign = "top">
318
+ <th scope = "row"><?php _e('Default post by mail category:', 'postie') ?></th>
319
+ <td>
320
+ <?php
321
+ $defaultCat = $default_post_category;
322
+ $args = array('name' => 'postie-settings[default_post_category]', 'hierarchical' => 1, 'selected' => $defaultCat, 'hide_empty' => 0);
323
+ wp_dropdown_categories($args);
324
+ ?>
325
+ </tr>
326
+ <?php echo BuildBooleanSelect(__("Match short category", "postie") , "postie-settings[category_match]", $category_match, __("Try to match categories using 'starts with logic' otherwise only do exact matches.<br />Note that custom taxonomies will not be found if this setting is 'No'", "postie")); ?>
327
+
328
+ <tr valign="top">
329
+ <th scope="row">
330
+ <?php _e('Default post by mail tag(s)', 'postie') ?>:<br />
331
+ <span
332
+ class='recommendation'><?php _e('separated by commas', 'postie') ?>
333
+ </span>
334
+ </th>
335
+ <td>
336
+ <input type='text' name='postie-settings[default_post_tags]' id='postie-settings-default_post_tags' value='<?php echo esc_attr($default_post_tags) ?>' />
337
+ </td>
338
+ </tr>
339
+
340
+ <tr>
341
+ <th width="33%" valign="top" scope="row"><?php _e('Default Post Status:', 'postie') ?> </th>
342
+ <td>
343
+ <select name='postie-settings[post_status]' id='postie-settings-post_status'>
344
+ <option value="publish" <?php
345
+ if ($post_status == "publish") {
346
+ echo "selected";
347
+ }
348
+ ?>><?php _e('Published', 'postie') ?></option>
349
+ <option value="draft" <?php
350
+ if ($post_status == "draft") {
351
+ echo "selected";
352
+ }
353
+ ?>><?php _e('Draft', 'postie') ?></option>
354
+ <option value="pending" <?php
355
+ if ($post_status == "pending") {
356
+ echo "selected";
357
+ }
358
+ ?>><?php _e('Pending Review', 'postie') ?></option>
359
+ <option value="private" <?php
360
+ if ($post_status == "private") {
361
+ echo "selected";
362
+ }
363
+ ?>><?php _e('Private', 'postie') ?></option>
364
+ </select>
365
+ </td>
366
+ </tr>
367
+
368
+ <tr>
369
+ <th width="33%" valign="top" scope="row"><?php _e('Default Post Format:', 'postie') ?> </th>
370
+ <td>
371
+ <select name='postie-settings[post_format]' id='postie-settings-post_format'>
372
+ <?php
373
+ $formats = get_theme_support('post-formats');
374
+ if (is_array($formats[0])) {
375
+ $formats = $formats[0];
376
+ } else {
377
+ $formats = array();
378
+ }
379
+ array_unshift($formats, "standard");
380
+ foreach ($formats as $format) {
381
+ $selected = "";
382
+ if ($config['post_format'] == $format) {
383
+ $selected = " selected='selected'";
384
+ }
385
+ echo "<option value='$format'$selected>$format</option>";
386
+ }
387
+ ?>
388
+ </select>
389
+ </td>
390
+ </tr>
391
+
392
+ <tr>
393
+ <th width="33%" valign="top" scope="row"><?php _e('Default Post Type:', 'postie') ?> </th>
394
+ <td>
395
+ <select name='postie-settings[post_type]' id='postie-settings-post_type'>
396
+ <?php
397
+ $types = get_post_types();
398
+ //array_unshift($types, "standard");
399
+ foreach ($types as $type) {
400
+ $selected = "";
401
+ if ($config['post_type'] == $type) {
402
+ $selected = " selected='selected'";
403
+ }
404
+ echo "<option value='$type'$selected>$type</option>";
405
+ }
406
+ ?>
407
+ </select>
408
+ </td>
409
+ </tr>
410
+
411
+ <tr>
412
+ <th width="33%" valign="top" scope="row"><?php _e('Default Title:', 'postie') ?> </th>
413
+ <td>
414
+ <input name='postie-settings[default_title]' type="text" id='postie-settings-default_title' value="<?php echo esc_attr($default_title); ?>" size="50" /><br />
415
+ </td>
416
+ </tr>
417
+ <tr>
418
+ <th width="33%" valign="top" scope="row"><?php _e('Preferred Text Type:', 'postie') ?> </th>
419
+ <td>
420
+ <select name='postie-settings[prefer_text_type]' id='postie-settings-prefer_text_type'>
421
+ <?php printf('<option value="plain" %s>plain</option>', ($prefer_text_type == "plain") ? "selected" : "") ?>
422
+ <?php printf('<option value="html" %s>html</option>', ($prefer_text_type == "html") ? "selected" : "") ?>
423
+ </select>
424
+ </td>
425
+ </tr>
426
+ <?php echo BuildBooleanSelect(__("Forward Rejected Mail", "postie"), "postie-settings[forward_rejected_mail]", $forward_rejected_mail); ?>
427
+ <?php echo BuildBooleanSelect(__("Allow Subject In Mail", "postie"), "postie-settings[allow_subject_in_mail]", $allow_subject_in_mail); ?>
428
+ <?php echo BuildBooleanSelect(__("Allow HTML In Mail Subject", "postie"), "postie-settings[allow_html_in_subject]", $allow_html_in_subject); ?>
429
+ <?php echo BuildBooleanSelect(__("Allow HTML In Mail Body", "postie"), "postie-settings[allow_html_in_body]", $allow_html_in_body); ?>
430
+ <tr>
431
+ <th width="33%" valign="top" scope="row"><?php _e('Tag Of Message Start:', 'postie') ?> <br />
432
+ <span class='recommendation'><?php _e('Use to remove any text from a message that the email provider puts at the top of the message', 'postie') ?></span></th>
433
+ <td>
434
+ <input name='postie-settings[message_start]' type="text" id='postie-settings-message_start' value="<?php echo esc_attr($message_start); ?>" size="50" /><br />
435
+ </td>
436
+ </tr>
437
+ <tr>
438
+ <th width="33%" valign="top" scope="row"><?php _e('Tag Of Message End:', 'postie') ?> <br />
439
+ <span class='recommendation'><?php _e('Use to remove any text from a message that the email provider puts at the end of the message', 'postie') ?></span></th>
440
+ <td>
441
+ <input name='postie-settings[message_end]' type="text" id='postie-settings-message_end' value="<?php echo esc_attr($message_end); ?>" size="50" /><br />
442
+ </td>
443
+ </tr>
444
+
445
+ <?php
446
+ echo BuildBooleanSelect(__("Wrap content in pre tags", "postie"), "postie-settings[wrap_pre]", $wrap_pre);
447
+ echo BuildBooleanSelect(__("Filter newlines", "postie"), "postie-settings[filternewlines]", $filternewlines, __("Retain newlines from plain text. Set to no if using markdown or textitle syntax", "postie"));
448
+ echo BuildBooleanSelect(__("Replace newline characters with html line breaks (&lt;br /&gt;)", "postie"), "postie-settings[convertnewline]", $convertnewline, __("Filter newlines must be turned on for this option to take effect.", "postie"));
449
+ echo BuildBooleanSelect(__("Return rejected mail to sender", "postie"), "postie-settings[return_to_sender]", $return_to_sender);
450
+ ?>
451
+ <tr>
452
+ <th>
453
+ <?php _e("Send post confirmation email to", 'postie') ?>:
454
+ </th>
455
+ <td>
456
+ <select name='postie-settings[confirmation_email]' id='postie-settings-confirmation_email'>
457
+ <option value="sender" <?php echo($confirmation_email == "sender") ? "selected" : "" ?>><?php _e('sender', 'postie') ?></option>
458
+ <option value="admin" <?php echo ($confirmation_email == "admin") ? "selected" : "" ?>><?php _e('administrator', 'postie') ?></option>
459
+ <option value="both" <?php echo ($confirmation_email == "both") ? "selected" : "" ?>><?php _e('sender and administrator', 'postie') ?></option>
460
+ <option value="" <?php echo ($confirmation_email == "") ? "selected" : "" ?>><?php _e('none', 'postie') ?></option>
461
+ </select>
462
+ </td>
463
+ </tr>
464
+
465
+ <?php
466
+ echo BuildBooleanSelect(__("Automatically convert urls to links", "postie"), "postie-settings[converturls]", $converturls);
467
+ echo BuildBooleanSelect(__("Use shortcode for embedding video (youtube and others)", "postie"), "postie-settings[shortcode]", $shortcode);
468
+ ?>
469
+ <tr>
470
+ <th width="33%" valign="top" scope="row"><?php _e('Encoding for pages and feeds:', 'postie') ?> <br />
471
+ <span class='recommendation'><?php _e('The character set for your blog.', 'postie') ?></span></th>
472
+ <td>
473
+ <input name='postie-settings[message_encoding]' type="text" id='postie-settings-message_encoding' value="<?php echo esc_attr($message_encoding); ?>" size="10" />
474
+ <span class='recommendation'>UTF-8 <?php _e("should handle ISO-8859-1 as well", 'postie'); ?></span>
475
+ </td>
476
+ </tr>
477
+ <?php echo BuildBooleanSelect(__("Decode Quoted Printable Data", "postie"), "postie-settings[message_dequote]", $message_dequote); ?>
478
+ <?php echo BuildTextArea(__("Supported MIME Types", "postie"), "postie-settings[supported_file_types]", $supported_file_types, __("Add just the type (not the subtype). Text, Video, Audio, Image and Multipart are always supported. Put each type on a single line.", "postie")); ?>
479
+ <?php echo BuildTextArea(__("Banned File Names", "postie"), "postie-settings[banned_files_list]", $banned_files_list, __("Put each file name on a single line.Files matching this list will never be posted to your blog. You can use wildcards such as *.xls, or *.* for all files", "postie")); ?>
480
+ <?php echo BuildBooleanSelect(__("Drop The Signature From Mail", "postie"), "postie-settings[drop_signature]", $drop_signature); ?>
481
+ <?php echo BuildTextArea(__("Signature Patterns", "postie"), "postie-settings[sig_pattern_list]", $sig_pattern_list, __("Put each pattern on a separate line. Patterns are <a href='http://regex101.com/' target='_blank'>regular expressions</a>.", "postie")); ?>
482
+ <?php echo BuildTextArea(__("Allowed SMTP servers", "postie"), "postie-settings[smtp]", $smtp, __("Only allow messages which have been sent throught the following smtp servers. Put each server on a separate line. Leave blank to not check smtp servers.", "postie")); ?>
483
+ </table>
484
+ </div>
485
+ <div id="simpleTabs-content-4" class="simpleTabs-content">
486
+ <table class='form-table'>
487
+
488
+ <?php
489
+ echo BuildBooleanSelect(__("Use First Image as Featured Image", "postie"), "postie-settings[featured_image]", $featured_image, __("If any images are attached, the first one will be the featured image for the post", "postie"));
490
+ echo BuildBooleanSelect(__("Automatically insert image gallery", "postie"), "postie-settings[auto_gallery]", $auto_gallery, __("If any images are attached, they will automatically be inserted as a gallery", "postie"));
491
+ echo BuildBooleanSelect(__("Image Location", "postie"), "postie-settings[images_append]", $images_append, __("Location of attachments if using 'plain' format. Before or After content.", "postie"), array('After', 'Before'));
492
+ echo BuildBooleanSelect(__("Start Image Count At", "postie"), "postie-settings[start_image_count_at_zero]", $start_image_count_at_zero, __('For use if using "Image Place Holder Tag" below.', "postie"), array('Start at 0', 'Start at 1'));
493
+ echo BuildBooleanSelect(__("Generate Thumbnails", "postie"), "postie-settings[generate_thumbnails]", $generate_thumbnails, __("Some hosts crash during thumbnail generation. Set this to 'No' if you have this issue.", "postie"));
494
+ ?>
495
+ <tr>
496
+ <th width="33%" valign="top" scope="row"><?php _e('Image Place Holder Tag:', 'postie') ?> <br />
497
+ <span class='recommendation'><?php _e("For use in 'plain' messages. The code for inserting an image. I.e. put \"#img1# in your email where you want the first image to show. See also \"Start Image Count At\"" , 'postie') ?></span>
498
+ </th>
499
+ <td>
500
+ <input name='postie-settings[image_placeholder]' type="text" id='postie-settings-image_placeholder' value="<?php echo esc_attr($image_placeholder); ?>" size="50" /><br />
501
+ </td>
502
+ </tr>
503
+ <tr>
504
+ <th width="33%" valign="top" scope="row"><?php _e('Image Template', 'postie') ?>:<br />
505
+ <span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie'); ?></span><br /><br />
506
+ <span class='recommendation'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></span><br /><br />
507
+ <span class='recommendation'><?php _e('Sizes for thumbnail, medium, and large images can be chosen in the <a href="options-media.php">Media Settings</a>. The samples here use the default sizes, and will not reflect the sizes you have chosen.', 'postie'); ?></span>
508
+ </th>
509
+ <td>
510
+ <input type='hidden' id='postie-settings-selected_imagetemplate' name='postie-settings[selected_imagetemplate]'
511
+ value="<?php echo esc_attr($selected_imagetemplate) ?>" />
512
+ <select name='imagetemplateselect' id='imagetemplateselect'
513
+ onchange="changeStyle('imageTemplatePreview', 'postie-settings-imagetemplate',
514
+ 'imagetemplateselect', 'postie-settings-selected_imagetemplate', 'smiling.jpg');" >
515
+ <?php
516
+ include(POSTIE_ROOT . '/templates/image_templates.php');
517
+ $styleOptions = $imageTemplates;
518
+ $selected = $selected_imagetemplate;
519
+ foreach ($styleOptions as $key => $value) {
520
+ if ($key != 'selected') {
521
+ if ($key == $selected) {
522
+ $select = ' selected=selected ';
523
+ } else {
524
+ $select = ' ';
525
+ }
526
+ if ($key == 'custom')
527
+ $value = $imagetemplate;
528
+ echo '<option' . $select . 'value="' .
529
+ esc_attr($value) . '" >' . $key . '</option>';
530
+ }
531
+ }
532
+ ?>
533
+ </select>
534
+ <div>
535
+ <?php _e('Preview', 'postie'); ?>
536
+ </div>
537
+ <div id='imageTemplatePreview'></div>
538
+ <textarea onchange='changeStyle("imageTemplatePreview", "postie-settings-imagetemplate", "imagetemplateselect",
539
+ "postie-settings-selected_imagetemplate", "smiling.jpg", true);' cols='70' rows='7' id='postie-settings-imagetemplate' name='postie-settings[imagetemplate]'>
540
+ <?php echo esc_attr($imagetemplate) ?>
541
+ </textarea>
542
+ <div class='recommendation'>
543
+ <ul>
544
+ <li>{CAPTION} gets replaced with the caption you specified (if any)</li>
545
+ <li>{FILELINK} gets replaced with the url to the media</li>
546
+ <li>{FILENAME} gets replaced with the name of the attachment from the email</li>
547
+ <li>{FULL} same as {FILELINK}</li>
548
+ <li>{HEIGHT} gets replaced with the height of the photo</li>
549
+ <li>{ID} gets replaced with the post id</li>
550
+ <li>{IMAGE} same as {FILELINK}</li>
551
+ <li>{LARGEHEIGHT} gets replaced with the height of a large image</li>
552
+ <li>{LARGEWIDTH} gets replaced with the width of a large image</li>
553
+ <li>{LARGE} gets replaced with the url to the large-sized image</li>
554
+ <li>{MEDIUMHEIGHT} gets replaced with the height of a medium image</li>
555
+ <li>{MEDIUMWIDTH} gets replaced with the width of a medium image</li>
556
+ <li>{MEDIUM} gets replaced with the url to the medium-sized image</li>
557
+ <li>{PAGELINK} gets replaced with the URL of the file in WordPress</li>
558
+ <li>{RELFILENAME} gets replaced with the relative path to the full-size image</li>
559
+ <li>{THUMBHEIGHT} gets replaced with the height of a thumbnail image</li>
560
+ <li>{THUMB} gets replaced with the url to the thumbnail image</li>
561
+ <li>{THUMBNAIL} same as {THUMB}</li>
562
+ <li>{THUMBWIDTH} gets replaced with the width of a thumbnail image</li>
563
+ <li>{TITLE} same as {FILENAME}</li>
564
+ <li>{URL} same as {FILELINK}</li>
565
+ <li>{WIDTH} gets replaced with width of the photo</li>
566
+ <li>{ICON} insert the icon for the attachment (for non-audio/image/video attachments only)</li>
567
+ </ul>
568
+ </div>
569
+ </td>
570
+ </tr>
571
+ </table>
572
+ </div>
573
+
574
+ <!--
575
+ ########## VIDEO AND AUDIO OPTIONS ###################
576
+ -->
577
+
578
+ <div id="simpleTabs-content-5" class="simpleTabs-content">
579
+ <table class='form-table'>
580
+
581
+ <tr>
582
+ <th scope='row'><?php _e('Video template 1', 'postie') ?>:<br />
583
+ <span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></span><br />
584
+ <span class='recommendation'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></span><br />
585
+ </th>
586
+ <?php $templateDir = get_option('siteurl') . '/' . PLUGINDIR . '/postie/templates'; ?>
587
+ <td>
588
+ <input type='hidden' id='postie-settings-selected_video1template' name='postie-settings[selected_video1template]'
589
+ value="<?php echo esc_attr($selected_video1template) ?>" />
590
+ <select name='video1templateselect' id='video1templateselect'
591
+ onchange="changeStyle('video1TemplatePreview', 'postie-settings-video1template', 'video1templateselect', 'postie-settings-selected_video1template', 'hi.mp4');" />
592
+ <?php
593
+ include(POSTIE_ROOT . '/templates/video1_templates.php');
594
+ $styleOptions = $video1Templates;
595
+ $selected = $selected_video1template;
596
+ foreach ($styleOptions as $key => $value) {
597
+ if ($key != 'selected') {
598
+ if ($key == $selected) {
599
+ $select = ' selected=selected ';
600
+ } else {
601
+ $select = ' ';
602
+ }
603
+ if ($key == 'custom')
604
+ $value = $video1template;
605
+ echo '<option' . $select . 'value="' .
606
+ esc_attr($value) . '" >' . $key . '</option>';
607
+ }
608
+ }
609
+ ?>
610
+ </select>
611
+ <div>
612
+ <?php _e('Preview', 'postie'); ?>
613
+ </div>
614
+ <div id='video1TemplatePreview'></div>
615
+ <textarea onchange="changeStyle('video1TemplatePreview', 'postie-settings-video1template',
616
+ 'video1templateselect', 'postie-settings-selected_video1template', 'hi.mp4', true);" cols='70' rows='7' id='postie-settings-video1template'
617
+ name='postie-settings[video1template]'><?php echo esc_attr($video1template) ?></textarea>
618
+ </td>
619
+ </tr>
620
+ <tr>
621
+ <th width="33%" valign="top" scope="row">
622
+ <?php _e('Video 1 file extensions:', 'postie') ?><br /><span class='recommendation'>
623
+ <?php _e('Use video template 1 for files with these extensions (separated by commas)', 'postie') ?></span> </th>
624
+ <td>
625
+ <br/><input name='postie-settings[video1types]' type="text" id='postie-settings-video1types'
626
+ value="<?php if ($video1types != '') echo esc_attr($video1types); ?>" size="40" />
627
+ </td>
628
+ </tr>
629
+ <tr><td colspan="2"><hr /></td></tr>
630
+ <tr>
631
+ <th scope='row'><?php _e('Video template 2', 'postie') ?>:<br />
632
+ <span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></span><br/>
633
+ <span class='recommendation'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></span><br />
634
+ </th>
635
+ <td>
636
+ <input type='hidden' id='postie-settings-selected_video2template' name='postie-settings[selected_video2template]'
637
+ value="<?php echo esc_attr($selected_video2template) ?>" />
638
+ <select name='video2templateselect' id='video2templateselect'
639
+ onchange="changeStyle('video2TemplatePreview', 'postie-settings-video2template',
640
+ 'video2templateselect', 'postie-settings-selected_video2template', 'hi.flv');" >
641
+ <?php
642
+ include(POSTIE_ROOT . '/templates/video2_templates.php');
643
+ $styleOptions = $video2Templates;
644
+ $selected = $selected_video2template;
645
+ foreach ($styleOptions as $key => $value) {
646
+ if ($key != 'selected') {
647
+ if ($key == $selected) {
648
+ $select = ' selected=selected ';
649
+ } else {
650
+ $select = ' ';
651
+ }
652
+ if ($key == 'custom')
653
+ $value = $video2template;
654
+ echo '<option' . $select . 'value="' . esc_attr($value) . '" >' . $key . '</option>';
655
+ }
656
+ }
657
+ ?>
658
+ </select>
659
+ <div>
660
+ <?php _e('Preview', 'postie'); ?>
661
+ </div>
662
+ <div id='video2TemplatePreview'></div>
663
+ <textarea onchange="changeStyle('video2TemplatePreview', 'postie-settings-video2template',
664
+ 'video2templateselect', 'postie-settings-selected_video2template', 'hi.flv', true);" cols='70' rows='7' id='postie-settings-video2template'
665
+ name='postie-settings[video2template]'>
666
+ <?php echo esc_attr($video2template) ?>
667
+ </textarea>
668
+ </td>
669
+ </tr>
670
+ <tr>
671
+ <th width="33%" valign="top" scope="row">
672
+ <?php _e('Video 2 file extensions:', 'postie') ?><br /><span class='recommendation'>
673
+ <?php _e('Use video template 2 for files with these extensions (separated by commas)', 'postie') ?></span> <br />
674
+ </th>
675
+ <td>
676
+ <br/><input name='postie-settings[video2types]' type="text" id='postie-settings-video2types'
677
+ value="<?php if ($video2types != '') echo esc_attr($video2types); ?>" size="40" />
678
+ </td>
679
+ </tr>
680
+ <tr><td colspan="2"><hr /></td></tr>
681
+ <tr>
682
+ <th scope='row'><?php _e('Audio template', 'postie') ?>:<br />
683
+ <span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></span>
684
+ <br />
685
+ <span class='recommendation'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></span><br />
686
+ </th>
687
+ <td>
688
+ <input type='hidden' id='postie-settings-selected_audiotemplate' name='postie-settings[selected_audiotemplate]'
689
+ value="<?php echo esc_attr($selected_audiotemplate) ?>" />
690
+ <select name='audiotemplateselect' id='audiotemplateselect'
691
+ onchange="changeStyle('audioTemplatePreview', 'postie-settings-audiotemplate',
692
+ 'audiotemplateselect', 'postie-settings-selected_audiotemplate', 'funky.mp3', false);" >
693
+ <?php
694
+ include(POSTIE_ROOT . '/templates/audio_templates.php');
695
+ $styleOptions = $audioTemplates;
696
+ $selected = $selected_audiotemplate;
697
+ foreach ($styleOptions as $key => $value) {
698
+ if ($key != 'selected') {
699
+ if ($key == $selected) {
700
+ $select = ' selected=selected ';
701
+ } else {
702
+ $select = ' ';
703
+ }
704
+ if ($key == 'custom')
705
+ $value = $audiotemplate;
706
+ echo '<option' . $select . 'value="' .
707
+ esc_attr($value) . '" >' . $key . '</option>';
708
+ }
709
+ }
710
+ ?>
711
+ </select>
712
+ <div>
713
+ <?php _e('Preview', 'postie'); ?>
714
+ </div>
715
+ <div id='audioTemplatePreview'></div>
716
+ <textarea onchange="changeStyle('audioTemplatePreview', 'postie-settings-audiotemplate',
717
+ 'audiotemplateselect', 'postie-settings-selected_audiotemplate', 'funky.mp3', true);" cols='70' rows='7' id='postie-settings-audiotemplate'
718
+ name='postie-settings[audiotemplate]'><?php echo esc_attr($audiotemplate) ?></textarea>
719
+ </td>
720
+ </tr>
721
+ <tr>
722
+ <th width="33%" valign="top" scope="row">
723
+ <?php _e('Audio file extensions:', 'postie') ?><br />
724
+ <span class='recommendation'><?php _e('Use the audio template for files with these extensions (separated by commas)', 'postie') ?></span> <br />
725
+
726
+ </th>
727
+ <td>
728
+ <br/><input name='postie-settings[audiotypes]' type="text" id='postie-settings-audiotypes' value="<?php echo esc_attr($audiotypes); ?>" size="40" />
729
+ </td>
730
+ </tr>
731
+ </table>
732
+ </div>
733
+ <div id="simpleTabs-content-6" class="simpleTabs-content">
734
+ <table class='form-table'>
735
+
736
+ <tr>
737
+ <th scope='row'><?php _e('Attachment icon set', 'postie') ?>:<br /></th>
738
+ <td>
739
+ <input type='hidden' id='postie-settings-icon_set' name='postie-settings[icon_set]'
740
+ value="<?php echo esc_attr($icon_set) ?>" />
741
+
742
+ <?php
743
+ $icon_sets = array('silver', 'black', 'white', 'custom', 'none');
744
+ $icon_sizes = array(32, 48, 64);
745
+ ?>
746
+ <select name='icon_set_select' id='icon_set_select' onchange="changeIconSet(this);" >
747
+ <?php
748
+ $styleOptions = $icon_sets;
749
+ $selected = $icon_set;
750
+ foreach ($styleOptions as $key) {
751
+ if ($key != 'selected') {
752
+ if ($key == $selected) {
753
+ $select = ' selected=selected ';
754
+ } else {
755
+ $select = ' ';
756
+ }
757
+ echo '<option' . $select . 'value="' . esc_attr($key) . '" >' . $key . '</option>';
758
+ }
759
+ }
760
+ ?>
761
+ </select>
762
+ <div id='postie-settings-attachment_preview'></div>
763
+ </td>
764
+ </tr>
765
+ <tr>
766
+ <th scope='row'><?php _e('Attachment icon size (in pixels)', 'postie') ?>:<br /></th>
767
+ <td>
768
+ <input type='hidden' id='postie-settings-icon_size' name='postie-settings[icon_size]'
769
+ value="<?php echo esc_attr($icon_size) ?>" />
770
+ <select name='icon_size_select' id='icon_size_select' onchange="changeIconSet(this, true);" >
771
+ <?php
772
+ $styleOptions = $icon_sizes;
773
+ $selected = $icon_size;
774
+ foreach ($styleOptions as $key) {
775
+ if ($key != 'selected') {
776
+ if ($key == $selected) {
777
+ $select = ' selected=selected ';
778
+ } else {
779
+ $select = ' ';
780
+ }
781
+ echo '<option' . $select . 'value="' . esc_attr($key) . '" >' . $key . '</option>';
782
+ }
783
+ }
784
+ ?>
785
+ </select>
786
+ </td>
787
+ </tr>
788
+ <tr>
789
+ <th scope='row'><?php _e('Attachment template', 'postie') ?>:<br />
790
+ <span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></span>
791
+ <br />
792
+ <span class='recommendation'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></span><br />
793
+ </th>
794
+ <td>
795
+ <input type='hidden' id='postie-settings-selected_generaltemplate' name='postie-settings[selected_generaltemplate]'
796
+ value="<?php echo esc_attr($selected_generaltemplate) ?>" />
797
+ <select name='generaltemplateselect' id='generaltemplateselect'
798
+ onchange="changeStyle('generalTemplatePreview', 'postie-settings-generaltemplate',
799
+ 'generaltemplateselect', 'postie-settings-selected_generaltemplate', 'interesting_document.doc', false);" >
800
+ <?php
801
+ include(POSTIE_ROOT . '/templates/general_template.php');
802
+ $styleOptions = $generalTemplates;
803
+ $selected = $selected_generaltemplate;
804
+ foreach ($styleOptions as $key => $value) {
805
+ if ($key != 'selected') {
806
+ if ($key == $selected) {
807
+ $select = ' selected="selected" ';
808
+ } else {
809
+ $select = ' ';
810
+ }
811
+ if ($key == 'custom')
812
+ $value = $generaltemplate;
813
+ echo '<option' . $select . 'value="' . esc_attr($value) . '" >' . $key . '</option>';
814
+ }
815
+ }
816
+ ?>
817
+ </select>
818
+ <div>
819
+ <?php _e('Preview', 'postie'); ?>
820
+ </div>
821
+ <div id='generalTemplatePreview'></div>
822
+ <textarea onchange="changeStyle('generalTemplatePreview', 'postie-settings-generaltemplate', 'generaltemplateselect', 'postie-settings-selected_generaltemplate', 'interesting_document.doc', true);"
823
+ cols='70' rows='7'
824
+ id='postie-settings-generaltemplate'
825
+ name='postie-settings[generaltemplate]'><?php echo esc_attr($generaltemplate) ?></textarea>
826
+ </td>
827
+ </tr>
828
+ <?php echo BuildBooleanSelect(__("Use custom image field for attachments", "postie"), "postie-settings[custom_image_field]", $custom_image_field, __("When set to 'Yes' no attachments will appear in the post (including images, video &amp; sound files). Instead the url to the attachment will be put into a custom field named 'image'. Your theme will need logic to display these attachments.", "postie")); ?>
829
+ </table>
830
+ </div>
831
+ <div id="simpleTabs-content-7" class="simpleTabs-content">
832
+ <div style="">
833
+ <h3>Postie Support</h3>
834
+ <p>Please use the Postie <a href="https://wordpress.org/support/plugin/postie" target="_blank">support forums</a></p>
835
+ <h3>More Postie info</h3>
836
+ <p>Visit <a href="http://postieplugin.com/" target="_blank">PostiePlugin.com</a> for lots of information and assistance
837
+ including information for developers wanting to leverage/extend Postie.</p>
838
+ </div>
839
+ <div>
840
+ <h3>Postie AddOns</h3>
841
+ <p>There are a number of different AddOns available to extend Postie's functionality.
842
+ See <a href='http://postieplugin.com/add-ons/' target='_blank'>the list</a> for more information.</p>
843
+ <div>
844
+ <div id='postie-addons'></div>
845
+ </div>
846
+ </div>
847
+ </div>
848
+
849
+
850
+ <p class="submit" style="clear: both;">
851
+ <input type="hidden" name="action" value="update" />
852
+ <input type="hidden" name="page_options" value="postie-settings" />
853
+ <input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" class="button button-primary" />
854
+ </p>
855
+ </form>
856
+ <form id="postie-options" name="postie-options" method="post">
857
+ <input type="hidden" name="action" value="reset" />
858
+ <input name="Submit" value="<?php _e("Reset Settings To Defaults", 'postie') ?>" type="submit" class='button'>
859
+ <span>&nbsp;<?php _e('(Your Mail server settings will be retained)' , 'postie') ?></span>
860
+ </form>
861
+ </div>
862
+
863
+ <?php $iconDir = get_option('siteurl') . '/' . PLUGINDIR . '/postie/icons'; ?>
864
+ <script type="text/javascript">
865
+ jQuery(document).ready(function () {
866
+ jQuery("#simpleTabs").simpleTabs({
867
+ fadeSpeed: "medium", // @param : low, medium, fast
868
+ defautContent: 1, // @param : number ( simpleTabs-nav-number)
869
+ autoNav: "false", // @param : true or false
870
+ closeTabs: "false" // @param : true or false;
871
+ });
872
+ jQuery("#simpleTabs-nav-7").click(function () {
873
+ jQuery.get('http://postieplugin.com/feed/?post_type=download', function (data) {
874
+ console.log(data);
875
+ var h = '';
876
+ jQuery(data).find("item").each(function () {
877
+ var t = jQuery(this).find("title").text();
878
+ if (t != 'Donation') {
879
+ h += "<div style='float: left; width: 300px;'>";
880
+ h += "<h4 class='title'><a href='" + jQuery(this).find("link").text() + "' target='_blank'>" + t + "</a></h4>";
881
+ var d = jQuery(this).find("description").text();
882
+ if ((i = d.indexOf('<p class="more')) != -1) {
883
+ d = d.substring(0, i);
884
+ }
885
+ else if ((i = d.indexOf('<p>The post <a')) != -1) {
886
+ d = d.substring(0, i);
887
+ }
888
+ h += "<div>" + d + "</div>";
889
+ h += "</div>";
890
+ }
891
+ });
892
+ jQuery("#postie-addons").html(h);
893
+ });
894
+ });
895
+ });
896
+
897
+ function changeIconSet(selectBox, size) {
898
+ var iconSet = document.getElementById('postie-settings-icon_set');
899
+ var iconSize = document.getElementById('postie-settings-icon_size');
900
+ var preview = document.getElementById('postie-settings-attachment_preview');
901
+ var iconDir = '<?php echo $iconDir ?>/';
902
+ if (size == true) {
903
+ var hiddenInput = iconSize
904
+ } else {
905
+ var hiddenInput = iconSet;
906
+ }
907
+ for (i = 0; i < selectBox.options.length; i++) {
908
+ if (selectBox.options[i].selected == true) {
909
+ hiddenInput.value = selectBox.options[i].value;
910
+ }
911
+ }
912
+ var fileTypes = new Array('doc', 'pdf', 'xls', 'default');
913
+ preview.innerHTML = '';
914
+ for (j = 0; j < fileTypes.length; j++) {
915
+ preview.innerHTML += "<img src='" + iconDir + iconSet.value + '/' +
916
+ fileTypes[j] + '-' + iconSize.value + ".png' />";
917
+ }
918
+ }
919
+
920
+ function changeStyle(preview, template, select, selected, sample, custom) {
921
+ var preview = document.getElementById(preview);
922
+ var pageStyles = document.getElementById(select);
923
+ var selectedStyle;
924
+ var hiddenStyle = document.getElementById(selected);
925
+ var pageStyle = document.getElementById(template);
926
+ if (custom == true) {
927
+ selectedStyle = pageStyles.options[pageStyles.options.length - 1];
928
+ selectedStyle.value = pageStyle.value;
929
+ selectedStyle.selected = true;
930
+ } else {
931
+ for (i = 0; i < pageStyles.options.length; i++) {
932
+ if (pageStyles.options[i].selected == true) {
933
+ selectedStyle = pageStyles.options[i];
934
+ }
935
+ }
936
+ }
937
+ hiddenStyle.value = selectedStyle.innerHTML
938
+ var previewHTML = selectedStyle.value;
939
+ var fileLink = '<?php echo $templateDir ?>/' + sample;
940
+ var thumb = '<?php echo $templateDir ?>/' + sample.replace(/\.jpg/, '-150x150.jpg');
941
+ var medium = '<?php echo $templateDir ?>/' + sample.replace(/\.jpg/, '-300x200.jpg');
942
+ var large = '<?php echo $templateDir ?>/' + sample.replace(/\.jpg/, '-1024x682.jpg');
943
+ var pagelink = '<?php echo get_option("siteurl") ?>' + '/?attachment_id=9999';
944
+ previewHTML = previewHTML.replace(/{FILELINK}/g, fileLink);
945
+ previewHTML = previewHTML.replace(/{FULL}/g, fileLink);
946
+ previewHTML = previewHTML.replace(/{IMAGE}/g, fileLink);
947
+ previewHTML = previewHTML.replace(/{FILENAME}/, sample);
948
+ previewHTML = previewHTML.replace(/{PAGELINK}/, pagelink);
949
+ previewHTML = previewHTML.replace(/{RELFILENAME}/, sample);
950
+ previewHTML = previewHTML.replace(/{THUMB(NAIL|)}/, thumb);
951
+ previewHTML = previewHTML.replace(/{MEDIUM}/, medium);
952
+ previewHTML = previewHTML.replace(/{LARGE}/, large);
953
+ previewHTML = previewHTML.replace(/{HEIGHT}/, 800);
954
+ previewHTML = previewHTML.replace(/{WIDTH}/, 1200);
955
+ previewHTML = previewHTML.replace(/{THUMBWIDTH}/, 150);
956
+ previewHTML = previewHTML.replace(/{THUMBHEIGHT}/, 150);
957
+ previewHTML = previewHTML.replace(/{MEDIUMWIDTH}/, 300);
958
+ previewHTML = previewHTML.replace(/{MEDIUMHEIGHT}/, 200);
959
+ previewHTML = previewHTML.replace(/{LARGEWIDTH}/, 1024);
960
+ previewHTML = previewHTML.replace(/{LARGEHEIGHT}/, 682);
961
+ previewHTML = previewHTML.replace(/{ID}/, 9999);
962
+ previewHTML = previewHTML.replace(/{POSTTITLE}/g, 'Post title');
963
+ previewHTML = previewHTML.replace(/{CAPTION}/g, 'Spencer smiling');
964
+ preview.innerHTML = previewHTML;
965
+ pageStyle.value = selectedStyle.value;
966
+ }
967
+
968
+ function showAdvanced(advancedId, arrowId) {
969
+ var advanced = document.getElementById(advancedId);
970
+ var arrow = document.getElementById(arrowId);
971
+ if (advanced.style.display == 'none') {
972
+ advanced.style.display = 'block';
973
+ arrow.innerHTML = '&#9660;';
974
+ } else {
975
+ advanced.style.display = 'none';
976
+ arrow.innerHTML = '&#9654;';
977
+ }
978
+ }
979
+
980
+ changeStyle('imageTemplatePreview', 'postie-settings-imagetemplate', 'imagetemplateselect', 'postie-settings-selected_imagetemplate', 'smiling.jpg', false);
981
+ changeStyle('audioTemplatePreview', 'postie-settings-audiotemplate', 'audiotemplateselect', 'postie-settings-selected_audiotemplate', 'funky.mp3', false);
982
+ changeStyle('video1TemplatePreview', 'postie-settings-video1template', 'video1templateselect', 'postie-settings-selected_video1template', 'hi.mp4', false);
983
+ changeStyle('video2TemplatePreview', 'postie-settings-video2template', 'video2templateselect', 'postie-settings-selected_video2template', 'hi.flv', false);
984
+ changeIconSet(document.getElementById('icon_set_select'));
985
+ </script>
docs/Changes.txt CHANGED
@@ -27,6 +27,11 @@ All script, style and body tags are stripped from html emails.
27
  Attachments are now processed in the order they were attached.
28
 
29
  == CHANGELOG ==
 
 
 
 
 
30
  = 1.6.5 (2014.10.22) =
31
  * Fixed charset encoding bug when there wasn't a content-transfer-encoding header
32
  * Upgraded simple_html_dom
27
  Attachments are now processed in the order they were attached.
28
 
29
  == CHANGELOG ==
30
+ = 1.6.6 (2014.10.29) =
31
+ * Add additional debugging to isValidSmtpServer
32
+ * Add Japanese translation
33
+ * Fixed bug where a subject present in the body is not recognized
34
+
35
  = 1.6.5 (2014.10.22) =
36
  * Fixed charset encoding bug when there wasn't a content-transfer-encoding header
37
  * Upgraded simple_html_dom
docs/Installation.txt CHANGED
@@ -1,12 +1,12 @@
1
  == Installation ==
2
  * Either:
3
  * Put the postie.zip file in wp-content/plugins/ and unzip it
4
- * Goto the Plugins tab in the WordPress Admin Site
5
- * Activate "Postie"
6
  * Or:
7
  * Use the automatic installer (WP 2.7+)
8
  * Login to WordPress as an administrator
9
- * Click "Postie" on the lefthand menu to configure it.
 
 
10
  * Make sure you enter the mailserver information correctly, including the type
11
  of connection and the port number. Common port configurations:
12
  * (Postie ignores the settings under Settings->Writing->Writing-by-Email)
1
  == Installation ==
2
  * Either:
3
  * Put the postie.zip file in wp-content/plugins/ and unzip it
 
 
4
  * Or:
5
  * Use the automatic installer (WP 2.7+)
6
  * Login to WordPress as an administrator
7
+ * Goto the Plugins tab in the WordPress Admin Site
8
+ * Activate "Postie"
9
+ * Goto to the "Settings" tab and click on the sub-tab "Postie" to configure it.
10
  * Make sure you enter the mailserver information correctly, including the type
11
  of connection and the port number. Common port configurations:
12
  * (Postie ignores the settings under Settings->Writing->Writing-by-Email)
docs/Postie.txt CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.0
8
  Tested up to: 4.0
9
- Stable tag: 1.6.5
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.0
8
  Tested up to: 4.0
9
+ Stable tag: 1.6.6
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
languages/postie-ja.mo ADDED
Binary file
languages/postie-ja.po ADDED
@@ -0,0 +1,531 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Postie v1.6.3\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2014-10-19 14:05+0900\n"
7
+ "Last-Translator: stranger-jp <wordpress.stranger.jp@gmail.com>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=1; plural=0;\n"
13
+ "X-Generator: Poedit 1.6.4\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;__ngettext: 1,2;_n: 1,2;__ngettext_noop: 1,2;"
16
+ "_n_noop: 1,2;_c,_nc: 4c,1,2;_x: 1,2c;_ex: 1,2c;_nx: 4c,1,2;_nx_noop: 4c,1,2\n"
17
+ "X-Poedit-Basepath: ../../../../../\n"
18
+ "X-Textdomain-Support: yes\n"
19
+ "Language: ja_JP\n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+
22
+ msgid "Postie Settings"
23
+ msgstr "Postie設定"
24
+
25
+ msgid "Configuration successfully updated!"
26
+ msgstr "設定が正常に更新!"
27
+
28
+ msgid "Error - unable to save configuration"
29
+ msgstr "エラー - 設定を保存できません"
30
+
31
+ msgid "message"
32
+ msgstr "メッセージ"
33
+
34
+ msgid "Run Postie"
35
+ msgstr "Postieを実行"
36
+
37
+ msgid "(To run the check mail script manually)"
38
+ msgstr "(手動でメール確認スクリプトを実行)"
39
+
40
+ msgid "Run Postie (Debug)"
41
+ msgstr "Postieを実行 (デバッグ)"
42
+
43
+ msgid "(To run the check mail script manually with full debug output)"
44
+ msgstr "(完全なデバッグ出力を使用して手動でメール確認スクリプトを実行)"
45
+
46
+ msgid "Test Config"
47
+ msgstr "設定テスト"
48
+
49
+ msgid "this will check your configuration options"
50
+ msgstr "設定オプションのチェックを実行"
51
+
52
+ msgid "Mailserver"
53
+ msgstr "メールサーバー"
54
+
55
+ msgid "User"
56
+ msgstr "ユーザー"
57
+
58
+ msgid "Message"
59
+ msgstr "メッセージ"
60
+
61
+ msgid "Image"
62
+ msgstr "画像"
63
+
64
+ msgid "Video and Audio"
65
+ msgstr "動画と音声"
66
+
67
+ msgid "Attachments"
68
+ msgstr "添付ファイル"
69
+
70
+ msgid "Support"
71
+ msgstr "サポート"
72
+
73
+ msgid "Mail Protocol:"
74
+ msgstr "メールプロトコル:"
75
+
76
+ msgid "Use Transport Layer Security (TLS)"
77
+ msgstr "トランスポートレイヤーセキュリティを使用 (TLS)"
78
+
79
+ msgid "Choose Yes if your server requres TLS"
80
+ msgstr "サーバーがTLSを必要とする場合は'Yes'を選択します。"
81
+
82
+ msgid "Port:"
83
+ msgstr "ポート:"
84
+
85
+ msgid "Standard Ports:"
86
+ msgstr "標準ポート:"
87
+
88
+ msgid "POP3"
89
+ msgstr "POP3"
90
+
91
+ msgid "IMAP"
92
+ msgstr "IMAP"
93
+
94
+ msgid "IMAP-SSL"
95
+ msgstr "IMAP-SSL"
96
+
97
+ msgid "POP3-SSL"
98
+ msgstr "POP3-SSL"
99
+
100
+ msgid "Mail Server:"
101
+ msgstr "メールサーバー:"
102
+
103
+ msgid "Mail Userid:"
104
+ msgstr "メールユーザーID:"
105
+
106
+ msgid "Mail Password:"
107
+ msgstr "メールパスワード:"
108
+
109
+ msgid "Postie Time Correction:"
110
+ msgstr "Postieの時刻補正:"
111
+
112
+ msgid "Should be the same as your normal offset, but this lets you adjust it in cases where that doesn't work."
113
+ msgstr "通常はオフセットと同じにする必要がありますが、動作しない場合は調整してください。。"
114
+
115
+ msgid "hours"
116
+ msgstr "時間"
117
+
118
+ msgid "Check for mail every"
119
+ msgstr "メールのチェック頻度"
120
+
121
+ msgid "Once weekly"
122
+ msgstr "週1回"
123
+
124
+ msgid "daily"
125
+ msgstr "毎日"
126
+
127
+ msgid "hourly"
128
+ msgstr "毎時"
129
+
130
+ msgid "twice per hour"
131
+ msgstr "1時間に2回"
132
+
133
+ msgid "every ten minutes"
134
+ msgstr "10分ごと"
135
+
136
+ msgid "every five minutes"
137
+ msgstr "5分ごと"
138
+
139
+ msgid "check manually"
140
+ msgstr "手動チェック"
141
+
142
+ msgid "Maximum number of emails to process:"
143
+ msgstr "処理するメールの最大数:"
144
+
145
+ msgid "Delete email after posting"
146
+ msgstr "投稿後にメールを削除"
147
+
148
+ msgid "Only set to no for testing purposes"
149
+ msgstr "テスト目的の場合のみ'No'に設定してください。"
150
+
151
+ msgid "Allow Anyone To Post Via Email"
152
+ msgstr "誰でもメールで投稿可能"
153
+
154
+ msgid "Roles That Can Post:"
155
+ msgstr "投稿可能な権限:"
156
+
157
+ msgid "This allows you to grant access to other users to post if they have the proper access level. Administrators can always post."
158
+ msgstr "適切なアクセス権限を持っている場合、投稿する他のユーザーにアクセスを許可することができます。管理者は常に投稿可能です。"
159
+
160
+ msgid "Default Poster:"
161
+ msgstr "デフォルトの投稿者:"
162
+
163
+ msgid "This will be the poster if you allow posting from emails that are not a registered blog user."
164
+ msgstr "登録済みユーザーではないメールアドレスからの投稿を許可した場合、このユーザーが投稿者になります。"
165
+
166
+ msgid "Default post by mail category:"
167
+ msgstr "デフォルトの投稿カテゴリー:"
168
+
169
+ msgid "Default post by mail tag(s)"
170
+ msgstr "デフォルトのメール投稿タグ"
171
+
172
+ msgid "separated by commas"
173
+ msgstr "カンマ区切り"
174
+
175
+ msgid "Default Post Status:"
176
+ msgstr "デフォルトの投稿状態:"
177
+
178
+ msgid "Default Post Format:"
179
+ msgstr "デフォルトの投稿フォーマット:"
180
+
181
+ msgid "Default Post Type:"
182
+ msgstr "デフォルトの投稿タイプ:"
183
+
184
+ msgid "Default Title:"
185
+ msgstr "デフォルトのタイトル:"
186
+
187
+ msgid "Preferred Text Type:"
188
+ msgstr "好みのテキストの種類:"
189
+
190
+ msgid "Tag Of Message Start:"
191
+ msgstr "メッセージ開始タグ:"
192
+
193
+ msgid "Use to remove any text from a message that the email provider puts at the top of the message"
194
+ msgstr "メールプロバイダがメッセージの最初に置くメッセージから任意のテキストを削除するために使用します。"
195
+
196
+ msgid "Tag Of Message End:"
197
+ msgstr "メッセージ終了タグ:"
198
+
199
+ msgid "Use to remove any text from a message that the email provider puts at the end of the message"
200
+ msgstr "メールプロバイダがメッセージの最後に置くメッセージから任意のテキストを削除するために使用します。"
201
+
202
+ msgid "sender"
203
+ msgstr "送信者"
204
+
205
+ msgid "administrator"
206
+ msgstr "管理者"
207
+
208
+ msgid "sender and administrator"
209
+ msgstr "送信者と管理者"
210
+
211
+ msgid "none"
212
+ msgstr "送信しない"
213
+
214
+ msgid "Encoding for pages and feeds:"
215
+ msgstr "ページとフィードの文字コード:"
216
+
217
+ msgid "The character set for your blog."
218
+ msgstr "ブログの文字コード設定です。"
219
+
220
+ msgid "should handle ISO-8859-1 as well"
221
+ msgstr "だけでなくISO-8859-1を処理する必要があり"
222
+
223
+ msgid "Image Place Holder Tag:"
224
+ msgstr "画像プレースホルダタグ:"
225
+
226
+ msgid "Image Template"
227
+ msgstr "画像テンプレート"
228
+
229
+ msgid "Choose a default template, then customize to your liking in the text box"
230
+ msgstr "デフォルトのテンプレートを選択し、好みに合わせてテキストボックスをカスタマイズします。"
231
+
232
+ msgid "Note that this template are only used if the \"Preferred Text Type\" setting is set to \"plain\""
233
+ msgstr "'好みのテキストの種類の設定'が'plain'に設定されている場合、このテンプレートにのみ使用されていることにご注意ください"
234
+
235
+ msgid "Sizes for thumbnail, medium, and large images can be chosen in the <a href=\"options-media.php\">Media Settings</a>. The samples here use the default sizes, and will not reflect the sizes you have chosen."
236
+ msgstr "サムネイル、中、大画像用のサイズが<a href=\"options-media.php\">メディア設定</a>で選択することができます。このサンプル画像はデフォルトのサイズを使用するので、選択したサイズは反映されません。"
237
+
238
+ msgid "Preview"
239
+ msgstr "プレビュー"
240
+
241
+ msgid "Video template 1"
242
+ msgstr "動画テンプレート 1"
243
+
244
+ msgid "Video 1 file extensions:"
245
+ msgstr "動画ファイル拡張子 1:"
246
+
247
+ msgid "Use video template 1 for files with these extensions (separated by commas)"
248
+ msgstr "これらの拡張子を持つファイルは動画テンプレート 1を使用します。 (カンマ区切り)"
249
+
250
+ msgid "Video template 2"
251
+ msgstr "動画テンプレート 2"
252
+
253
+ msgid "Video 2 file extensions:"
254
+ msgstr "動画ファイル拡張子 2:"
255
+
256
+ msgid "Use video template 2 for files with these extensions (separated by commas)"
257
+ msgstr "これらの拡張子を持つファイルは動画テンプレート 2を使用します。 (カンマ区切り)"
258
+
259
+ msgid "Audio template"
260
+ msgstr "音声テンプレート"
261
+
262
+ msgid "Audio file extensions:"
263
+ msgstr "音声ファイルの拡張子:"
264
+
265
+ msgid "Use the audio template for files with these extensions (separated by commas)"
266
+ msgstr "これらの拡張子を持つファイルは音声テンプレートを使用します。 (カンマ区切り)"
267
+
268
+ msgid "Attachment icon set"
269
+ msgstr "添付ファイルのアイコンセット"
270
+
271
+ msgid "Attachment icon size (in pixels)"
272
+ msgstr "添付ファイルアイコンのサイズ (ピクセル数)"
273
+
274
+ msgid "Attachment template"
275
+ msgstr "添付ファイルのテンプレート"
276
+
277
+ msgid "Save Changes"
278
+ msgstr "変更を保存"
279
+
280
+ msgid "Reset Settings To Defaults"
281
+ msgstr "設定をデフォルトにリセット"
282
+
283
+ msgid "memory at start of e-mail processing:"
284
+ msgstr "メール処理の開始時にメモリ:"
285
+
286
+ msgid "Dang, message is empty!"
287
+ msgstr "メッセージが空です!"
288
+
289
+ msgid "Message is already marked 'read'."
290
+ msgstr "'読み取り'のメッセージがすでにマークされています。"
291
+
292
+ msgid "The uploaded file exceeds the <code>upload_max_filesize</code> directive in <code>php.ini</code>."
293
+ msgstr "アップロードされたファイルは<code>php.ini</code>の<code>upload_max_filesize</code>ディレクティブを超えています。"
294
+
295
+ msgid "The uploaded file exceeds the <em>MAX_FILE_SIZE</em> directive that was specified in the HTML form."
296
+ msgstr "アップロードされたファイルは、HTMLフォームで指定された<em>MAX_FILE_SIZE</em>ディレクティブを超えています。"
297
+
298
+ msgid "The uploaded file was only partially uploaded."
299
+ msgstr "アップロードされたファイルは、部分的にアップロードされました。"
300
+
301
+ msgid "No file was uploaded."
302
+ msgstr "ファイルはアップロードできませんでした。"
303
+
304
+ msgid "Missing a temporary folder."
305
+ msgstr "一時フォルダが見つかりません。"
306
+
307
+ msgid "Failed to write file to disk."
308
+ msgstr "ディスクへのファイルの書き込みに失敗しました。"
309
+
310
+ msgid "File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini."
311
+ msgstr "ファイルが空です。実体のあるファイルをアップロードしてください。また、このエラーは、アップロードがphp.iniで無効になっている場合も発生します。"
312
+
313
+ msgid "Specified file failed upload test."
314
+ msgstr "指定されたファイルはアップロードのテストに失敗しました。"
315
+
316
+ msgid "File type does not meet security guidelines. Try another."
317
+ msgstr "ファイルタイプは、セキュリティガイドラインを満たしていません。別のものをお試しください。"
318
+
319
+ msgid "The uploaded file could not be moved to %s."
320
+ msgstr "アップロードされたファイルを%sに移動できませんでした。"
321
+
322
+ msgid "Edit Plugins"
323
+ msgstr "プラグインを編集"
324
+
325
+ msgid "Postie is almost ready."
326
+ msgstr "Postieは、ほぼ準備ができています。"
327
+
328
+ msgid "You must <a href=\"%1$s\">enter your email settings</a> for it to work."
329
+ msgstr "それが機能するために<a href=\"%1$s\">メール設定</a>を行う必要があります。"
330
+
331
+ msgid "Warning: the IMAP php extension is not installed. Postie can not use IMAP, IMAP-SSL or POP-SSL without this extension."
332
+ msgstr "警告: IMAPのPHP拡張モジュールがインストールされていません。Postieは、IMAP、IMAP-SSLまたはPOP-SSLのモジュールが無い場合は使用できません。"
333
+
334
+ msgid "Warning: The POP3 connector does not support TLS."
335
+ msgstr "警告: POP3コネクタはTLSをサポートしていません。"
336
+
337
+ msgid "Warning: the Multibyte String php extension (mbstring) is not installed. Postie will not function without this extension."
338
+ msgstr "警告: PHPマルチバイト文字列拡張モジュール (mbstring) がインストールされていません。Postieは、このモジュールが無い場合は使用できません。"
339
+
340
+ msgid "Warning: the Admin username is not a valid WordPress login. Postie may reject emails if this is not corrected."
341
+ msgstr "警告: 管理者のユーザー名はWordPressで有効ではありません。これが修正されていない場合Postieがメールを拒否することができます。"
342
+
343
+ msgid "Once Weekly"
344
+ msgstr "週1回"
345
+
346
+ msgid "Twice per hour"
347
+ msgstr "1時間に2回"
348
+
349
+ msgid "Every 10 minutes"
350
+ msgstr "10分ごと"
351
+
352
+ msgid "Every 5 minutes"
353
+ msgstr "5分ごと"
354
+
355
+ msgid "Postie Diagnosis"
356
+ msgstr "Postieの診断"
357
+
358
+ msgid "Welcome %s!"
359
+ msgstr "ようこそ %s!"
360
+
361
+ msgid "A string with low priority!"
362
+ msgstr "優先度の低い文字列!"
363
+
364
+ msgid "Bye\n"
365
+ msgstr "さようなら\n"
366
+
367
+ msgid "You have one new message."
368
+ msgid_plural "You have %s new messages."
369
+ msgstr[0] "%sの新しいメッセージがあります。"
370
+
371
+ msgid "(Your Mail server settings will be retained)"
372
+ msgstr " (メールサーバーの設定は保持します)"
373
+
374
+ msgid "Changing this to yes <b style='color: red'>is not recommended</b> - anything that gets sent in will automatically be posted."
375
+ msgstr "これをYesにするのは<b style='color: red'>お勧めしません</b>。 - 送信されたメールが全て自動的に投稿されます。"
376
+
377
+ msgid "Authorized Addresses"
378
+ msgstr "投稿を許可するメールアドレス"
379
+
380
+ msgid "Put each email address on a single line. Posts from emails in this list will be treated as if they came from the admin. If you would prefer to have users post under their own name - create a WordPress user with the correct access level."
381
+ msgstr "一行に1つずつメールアドレスを入力します。このリスト内のアドレスから送信されたメールは投稿されます。任意の投稿ユーザーがある場合は適切なアクセスレベルのWordPressユーザーを作成します。"
382
+
383
+ msgid "Forward Rejected Mail"
384
+ msgstr "転送メールを拒否"
385
+
386
+ msgid "Allow Subject In Mail"
387
+ msgstr "メールの件名を許可"
388
+
389
+ msgid "Allow HTML In Mail Subject"
390
+ msgstr "メールの件名にHTMLを許可"
391
+
392
+ msgid "Allow HTML In Mail Body"
393
+ msgstr "メール本文にHTMLを許可"
394
+
395
+ msgid "Wrap content in pre tags"
396
+ msgstr "preタグ内のコンテンツを折り返す"
397
+
398
+ msgid "Filter newlines"
399
+ msgstr "改行フィルター"
400
+
401
+ msgid "Replace newline characters with html line breaks (&lt;br /&gt;)"
402
+ msgstr "HTMLの改行を改行文字に置換 (&lt;br /&gt;)"
403
+
404
+ msgid "Return rejected mail to sender"
405
+ msgstr "拒否メールを送信者に返す"
406
+
407
+ msgid "Send post confirmation email to"
408
+ msgstr "確認メールを送信"
409
+
410
+ msgid "Automatically convert urls to links"
411
+ msgstr "自動的にリンクをURLに変換"
412
+
413
+ msgid "Use shortcode for embedding video (youtube and others)"
414
+ msgstr "動画を埋め込むためのショートコードを使用 (YouTubeや他のもの)"
415
+
416
+ msgid "When set to 'Yes' no attachments will appear in the post (including images, video &amp; sound files). Instead the url to the attachment will be put into a custom field named 'image'. Your theme will need logic to display these attachments."
417
+ msgstr "'Yes'に設定すると添付ファイルが無い場合に投稿に表示します。(画像、動画や音声ファイルを含む) 代わりの添付ファイルのURLが'image'という名前のカスタムフィールドに入ります。あなたのテーマは、これらの添付ファイルを表示するためのロジックが必要になります。"
418
+
419
+ msgid "Visit <a href=\"http://postieplugin.com/\" target=\"_blank\">PostiePlugin.com</a> for lots of information and assistance."
420
+ msgstr "多くの情報や支援のための<a href=\"http://postieplugin.com/\" target=\"_blank\">PostiePlugin.com</a>を参照してください。"
421
+
422
+ msgid "Add just the type (not the subtype). Text, Video, Audio, Image and Multipart are always supported. Put each type on a single line."
423
+ msgstr "タイプを追加します。(サブタイプではない) テキストは動画、音声、画像やマルチパートを常にサポートしています。一行に1つずつ入力してください。"
424
+
425
+ msgid "Allowed SMTP servers"
426
+ msgstr "許可済SMTPサーバー"
427
+
428
+ msgid "Automatically insert image gallery"
429
+ msgstr "自動的に画像ギャラリーを挿入"
430
+
431
+ msgid "Banned File Names"
432
+ msgstr "禁止ファイル名"
433
+
434
+ msgid "Decode Quoted Printable Data"
435
+ msgstr "引用符で囲まれた印刷可能なデータをデコード"
436
+
437
+ msgid "For use if using \"Image Place Holder Tag\" below."
438
+ msgstr "下の'画像プレースホルダタグ'を使用する場合に使用します。"
439
+
440
+ msgid "For use in 'plain' messages. The code for inserting an image. I.e. put \"#img1# in your email where you want the first image to show. See also \"Start Image Count At\""
441
+ msgstr "'plainメッセージで使用する画像を挿入するためのコードで、すなわち#img1#はメールの最初の画像を配置します。\"画像のカウント\"を参照してください。"
442
+
443
+ msgid "Generate Thumbnails"
444
+ msgstr "サムネイルを生成する"
445
+
446
+ msgid "If any images are attached, the first one will be the featured image for the post"
447
+ msgstr "画像が添付されている場合は、最初の画像をアイキャッチ画像に設定します。"
448
+
449
+ msgid "If any images are attached, they will automatically be inserted as a gallery"
450
+ msgstr "すべての画像が結合している場合、それらを自動的にギャラリーとして挿入します。"
451
+
452
+ msgid "Image Location"
453
+ msgstr "画像の位置"
454
+
455
+ msgid "Location of attachments if using 'plain' format. Before or After content."
456
+ msgstr "添付ファイルに'plain'形式を使用する場合に配置する場所です。コンテンツの前"
457
+
458
+ msgid "Match short category"
459
+ msgstr "ショートカテゴリにマッチ"
460
+
461
+ msgid "Only allow messages which have been sent throught the following smtp servers. Put each server on a separate line. Leave blank to not check smtp servers."
462
+ msgstr "指定したSMTPサーバーを介して送信されたメッセージのみ許可します。許可するSMTPサーバーを一行に1つずつ入力します。SMTPサーバーをチェックしない場合は空白にしてください。"
463
+
464
+ msgid "Put each file name on a single line.Files matching this list will never be posted to your blog. You can use wildcards such as *.xls, or *.* for all files"
465
+ msgstr "一行に1つずつファイル名を入力してください。 このリストに一致するファイルは投稿されません。例えばワイルドカードを用いて*.xlsのようにするか、すべてのファイルを*.*で指定します"
466
+
467
+ msgid "Put each pattern on a separate line. Patterns are <a href='http://regex101.com/' target='_blank'>regular expressions</a>."
468
+ msgstr "一行に1つずつ各パターンを入力してください。パターンは<a href='http://regex101.com/' target='_blank'>正規表現</a>です。"
469
+
470
+ msgid "Signature Patterns"
471
+ msgstr "シグネチャーパターン"
472
+
473
+ msgid "Some hosts crash during thumbnail generation. Set this to 'No' if you have this issue."
474
+ msgstr "サムネイル生成時にホストがクラッシュする場合はこの設定を'No'にしてください。"
475
+
476
+ msgid "Start Image Count At"
477
+ msgstr "画像のカウント"
478
+
479
+ msgid "Supported MIME Types"
480
+ msgstr "サポートされたMIMEタイプ"
481
+
482
+ msgid "Try to match categories using 'starts with logic' otherwise only do exact matches.<br />Note that custom taxonomies will not be found if this setting is 'No'"
483
+ msgstr "カテゴリはそれ以外の完全一致のみを行う'ロジックで開始'を使用して一致させるようにしてください。<br />この設定が'No'の場合、カスタムタクソノミーは検出されないのでご注意ください。"
484
+
485
+ msgid "Use custom image field for attachments"
486
+ msgstr "添付ファイルの画像用カスタムフィールドを使用"
487
+
488
+ msgid "Use First Image as Featured Image"
489
+ msgstr "最初の画像をアイキャッチ画像にする"
490
+
491
+ msgid "Filter newlines must be turned on for this option to take effect."
492
+ msgstr "改行フィルターを有効にする場合は、このオプションを'Yes'にします。"
493
+
494
+ msgid "Retain newlines from plain text. Set to no if using markdown or textitle syntax"
495
+ msgstr "プレーンテキストから新しい行を保持します。マークダウンまたはtextitleの構文を使用している場合はNoに設定します。"
496
+
497
+ msgid "Drop The Signature From Mail"
498
+ msgstr "メールから署名を削除"
499
+
500
+ msgid "Please Donate, Every $ Helps!"
501
+ msgstr "寄付してください!"
502
+
503
+ msgid "Your generous donation allows me to continue developing Postie for the WordPress community."
504
+ msgstr "あなたの寛大な寄付でWordPressコミュニティのためのPostieの開発を継続することができます。"
505
+
506
+ msgid "Clock Tests"
507
+ msgstr "クロックテスト"
508
+
509
+ msgid "This shows what time it would be if you posted right now"
510
+ msgstr "これは今投稿したかどうかの時間を示しています"
511
+
512
+ msgid "Postie Configuration Test"
513
+ msgstr "Postieの設定テスト"
514
+
515
+ msgid "Connect to Mail Host"
516
+ msgstr "メールホストに接続"
517
+
518
+ msgid "Published"
519
+ msgstr "公開"
520
+
521
+ msgid "Draft"
522
+ msgstr "下書き"
523
+
524
+ msgid "Pending Review"
525
+ msgstr "レビュー待ち"
526
+
527
+ msgid "Private"
528
+ msgstr "非公開"
529
+
530
+ msgid "All"
531
+ msgstr "全て"
postie-functions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- $Id: postie-functions.php 1012303 2014-10-22 18:57:48Z WayneAllen $
4
  */
5
 
6
  //to turn on debug output add the following line to wp-config.php
@@ -298,7 +298,7 @@ function CreatePost($poster, $mimeDecodedEmail, $post_id, &$is_reply, $config, $
298
  }
299
  }
300
 
301
- filter_VodafoneHandler($content, $attachments, $config);
302
  if ($fulldebug) {
303
  DebugEcho("post vodafone: $content");
304
  }
@@ -972,11 +972,12 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
972
  DecodeBase64Part($part);
973
 
974
  //look for banned file names
975
- if (property_exists($part, 'ctype_parameters') && is_array($part->ctype_parameters) && array_key_exists('name', $part->ctype_parameters))
976
  if (isBannedFileName($part->ctype_parameters['name'], $banned_files_list)) {
977
  DebugEcho("GetContent: found banned filename");
978
  return NULL;
979
  }
 
980
 
981
  if (property_exists($part, "ctype_primary") && $part->ctype_primary == "application" && $part->ctype_secondary == "octet-stream") {
982
  if (property_exists($part, 'disposition') && $part->disposition == "attachment") {
@@ -1254,7 +1255,7 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
1254
  break;
1255
  }
1256
  }
1257
- DebugEcho("GetContent: meta_return: " . $meta_return);
1258
  DebugEcho("GetContent: ==== end");
1259
  return $meta_return;
1260
  }
@@ -1362,7 +1363,6 @@ function filter_CleanHtml($content) {
1362
  function ValidatePoster(&$mimeDecodedEmail, $config) {
1363
  $test_email = '';
1364
  extract($config);
1365
- global $wpdb;
1366
  $poster = NULL;
1367
  $from = "";
1368
  if (property_exists($mimeDecodedEmail, "headers") && array_key_exists('from', $mimeDecodedEmail->headers)) {
@@ -1396,8 +1396,9 @@ function ValidatePoster(&$mimeDecodedEmail, $config) {
1396
  if (!empty($from)) {
1397
  DebugEcho("Confirming Access For $from ");
1398
  $user = get_user_by('email', $from);
1399
- if ($user !== false)
1400
  $user_ID = $user->ID;
 
1401
  } else {
1402
  $user_ID = "";
1403
  }
@@ -1448,19 +1449,21 @@ function ValidatePoster(&$mimeDecodedEmail, $config) {
1448
  }
1449
 
1450
  function isValidSmtpServer($mimeDecodedEmail, $smtpservers) {
1451
- if (empty($smtpservers))
1452
  return true;
 
1453
 
1454
  foreach ((array) $mimeDecodedEmail->headers['received'] as $received) {
 
1455
  foreach ($smtpservers as $smtp) {
1456
  if (stristr($received, $smtp) !== false) {
1457
- DebugEcho("Sent from valid SMTP server.");
1458
  return true;
1459
  }
1460
  }
1461
  }
1462
 
1463
- EchoInfo("Sent from invalid SMTP server.");
1464
  return false;
1465
  }
1466
 
@@ -1524,6 +1527,7 @@ function filter_RemoveSignature(&$content, $config) {
1524
 
1525
  function filter_RemoveSignatureWorker(&$html, $pattern) {
1526
  $found = false;
 
1527
  if (preg_match($pattern, trim($html->plaintext), $matches)) {
1528
  DebugEcho("filter_RemoveSignatureWorker: signature found in base, removing");
1529
  DebugDump($matches);
@@ -1562,8 +1566,9 @@ function filter_End(&$content, $config) {
1562
  $end = $config['message_end'];
1563
  if ($end) {
1564
  $pos = strpos($content, $end);
1565
- if ($pos === false)
1566
  return $content;
 
1567
  DebugEcho("end filter: $end");
1568
  $content = substr($content, 0, $pos);
1569
  }
@@ -1673,6 +1678,7 @@ function DecodeBase64Part(&$part) {
1673
  function tag_AllowCommentsOnPost(&$content) {
1674
  $comments_allowed = get_option('default_comment_status'); // 'open' or 'closed'
1675
 
 
1676
  if (preg_match("/comments:([0|1|2])/i", $content, $matches)) {
1677
  $content = preg_replace("/comments:$matches[1]/i", "", $content);
1678
  if ($matches[1] == "1") {
@@ -1688,6 +1694,7 @@ function tag_AllowCommentsOnPost(&$content) {
1688
 
1689
  function tag_Status(&$content, $currentstatus) {
1690
  $poststatus = $currentstatus;
 
1691
  if (preg_match("/status:\s*(draft|publish|pending|private)/i", $content, $matches)) {
1692
  DebugEcho("tag_Status: found status $matches[1]");
1693
  DebugDump($matches);
@@ -1704,18 +1711,21 @@ function tag_Status(&$content, $currentstatus) {
1704
  */
1705
  function filter_Delay(&$content, $message_date = NULL, $offset = 0) {
1706
  $delay = 0;
1707
-
1708
  if (preg_match("/delay:(-?[0-9dhm]+)/i", $content, $matches) && trim($matches[1])) {
1709
  DebugEcho("found delay: " . $matches[1]);
1710
  $days = 0;
1711
  $hours = 0;
1712
  $minutes = 0;
 
1713
  if (preg_match("/(-?[0-9]+)d/i", $matches[1], $dayMatches)) {
1714
  $days = $dayMatches[1];
1715
  }
 
1716
  if (preg_match("/(-?[0-9]+)h/i", $matches[1], $hourMatches)) {
1717
  $hours = $hourMatches[1];
1718
  }
 
1719
  if (preg_match("/(-?[0-9]+)m/i", $matches[1], $minuteMatches)) {
1720
  $minutes = $minuteMatches[1];
1721
  }
@@ -1741,18 +1751,19 @@ function filter_Delay(&$content, $message_date = NULL, $offset = 0) {
1741
  * This function takes the content of the message - looks for a subject at the begining surrounded by # and then removes that from the content
1742
  */
1743
  function tag_Subject($content, $defaultTitle) {
1744
- DebugEcho("Looking for subject in email body");
1745
  if (substr($content, 0, 1) != "#") {
1746
- DebugEcho("No subject found, using default [1]");
1747
  return(array($defaultTitle, $content));
1748
  }
1749
  $subjectEndIndex = strpos($content, "#", 1);
1750
  if (!$subjectEndIndex > 0) {
1751
- DebugEcho("No subject found, using default [2]");
1752
  return(array($defaultTitle, $content));
1753
  }
1754
  $subject = substr($content, 1, $subjectEndIndex - 1);
1755
  $content = substr($content, $subjectEndIndex + 1, strlen($content));
 
1756
  return array($subject, $content);
1757
  }
1758
 
@@ -2025,7 +2036,6 @@ function filename_fix($filename) {
2025
  function filter_PreferedText($mimeDecodedEmail, $preferTextType) {
2026
  DebugEcho("filter_PreferedText: begin " . count($mimeDecodedEmail->parts));
2027
  $newParts = array();
2028
- $found = false;
2029
 
2030
  for ($i = 0; $i < count($mimeDecodedEmail->parts); $i++) {
2031
  if (!property_exists($mimeDecodedEmail->parts[$i], "ctype_primary")) {
@@ -2071,16 +2081,14 @@ function filter_PreferedText($mimeDecodedEmail, $preferTextType) {
2071
  * This function can be used to send confirmation or rejection emails
2072
  * It accepts an object containing the entire message
2073
  */
2074
- function MailToRecipients(&$mail_content, $testEmail = false, $recipients = array(), $returnToSender, $reject = true, $postid = null) {
2075
  DebugEcho("MailToRecipients: send mail");
2076
  if ($testEmail) {
2077
  return false;
2078
  }
2079
- $user = get_userdata('1');
2080
- $myname = $user->user_nicename;
2081
  $myemailadd = get_option("admin_email");
2082
  $blogname = get_option("blogname");
2083
- $blogurl = get_option("siteurl");
2084
  $posturl = '';
2085
  if ($postid != null) {
2086
  $posturl = get_permalink($postid);
@@ -2136,16 +2144,19 @@ function MailToRecipients(&$mail_content, $testEmail = false, $recipients = arra
2136
  }
2137
  foreach ($mailparts as $part) {
2138
  $mailtext .= "--$boundary\r\n";
2139
- if (array_key_exists('content-type', $part->headers))
2140
  $mailtext .= "Content-Type: " . $part->headers["content-type"] . "\n";
2141
- if (array_key_exists('content-transfer-encoding', $part->headers))
 
2142
  $mailtext .= "Content-Transfer-Encoding: " . $part->headers["content-transfer-encoding"] . "\n";
 
2143
  if (array_key_exists('content-disposition', $part->headers)) {
2144
  $mailtext .= "Content-Disposition: " . $part->headers["content-disposition"] . "\n";
2145
  }
2146
  $mailtext .= "\n";
2147
- if (property_exists($part, 'body'))
2148
  $mailtext .= $part->body;
 
2149
  }
2150
  } else {
2151
  $alert_subject = "Successfully posted to $blogname";
@@ -2244,8 +2255,9 @@ function GetNameFromEmail($address) {
2244
  * the attachment
2245
  */
2246
  function chooseAttachmentIcon($file, $primary, $secondary, $iconSet = 'silver', $size = '32') {
2247
- if ($iconSet == 'none')
2248
  return('');
 
2249
  $fileName = basename($file);
2250
  $parts = explode('.', $fileName);
2251
  $ext = $parts[count($parts) - 1];
@@ -2298,8 +2310,9 @@ function chooseAttachmentIcon($file, $primary, $secondary, $iconSet = 'silver',
2298
  $fileType = 'default';
2299
  }
2300
  $fileName = "/icons/$iconSet/$fileType-$size.png";
2301
- if (!file_exists(POSTIE_ROOT . $fileName))
2302
  $fileName = "/icons/$iconSet/default-$size.png";
 
2303
  $iconHtml = "<img src='" . POSTIE_URL . $fileName . "' alt='$fileType icon' />";
2304
  DebugEcho("icon: $iconHtml");
2305
  return $iconHtml;
@@ -2508,7 +2521,6 @@ function filter_ReplaceImagePlaceHolders(&$content, $attachments, $config, $post
2508
  */
2509
  function GetSubject(&$mimeDecodedEmail, &$content, $config) {
2510
  extract($config);
2511
- global $charset;
2512
  //assign the default title/subject
2513
  if (!array_key_exists('subject', $mimeDecodedEmail->headers) || empty($mimeDecodedEmail->headers['subject'])) {
2514
  DebugEcho("No subject in email");
@@ -2527,6 +2539,8 @@ function GetSubject(&$mimeDecodedEmail, &$content, $config) {
2527
  DebugEcho("subject before htmlentities: $subject");
2528
  $subject = htmlentities($subject, ENT_COMPAT, $message_encoding);
2529
  DebugEcho("subject after htmlentities: $subject");
 
 
2530
  }
2531
  }
2532
  //This is for ISO-2022-JP - Can anyone confirm that this is still neeeded?
@@ -2568,6 +2582,7 @@ function tag_Tags(&$content, $defaultTags) {
2568
 
2569
  function tag_TagsWorker(&$content) {
2570
  $post_tags = array();
 
2571
  if (preg_match('/tags: ?(.*)$/im', $content, $matches)) {
2572
  if (!empty($matches[1])) {
2573
  DebugEcho("Found tags: $matches[1]");
@@ -2581,6 +2596,7 @@ function tag_TagsWorker(&$content) {
2581
  function tag_Tags2(&$content, $defaultTags) {
2582
  $post_tags = array();
2583
  //try and determine tags
 
2584
  if (preg_match('/tags: ?(.*)$/im', $content, $matches)) {
2585
  if (!empty($matches[1])) {
2586
  DebugEcho("Found tags: $matches[1]");
@@ -2601,6 +2617,7 @@ function tag_Tags2(&$content, $defaultTags) {
2601
  */
2602
  function tag_Excerpt(&$content, $config) {
2603
  $post_excerpt = '';
 
2604
  if (preg_match('/:excerptstart ?(.*):excerptend/s', $content, $matches)) {
2605
  $content = str_replace($matches[0], "", $content);
2606
  $post_excerpt = $matches[1];
@@ -2782,8 +2799,9 @@ function config_ResetToDefault() {
2782
  $newconfig = config_GetDefaults();
2783
  $config = get_option('postie-settings');
2784
  $save_keys = array('mail_password', 'mail_server', 'mail_server_port', 'mail_userid', 'input_protocol');
2785
- foreach ($save_keys as $key)
2786
  $newconfig[$key] = $config[$key];
 
2787
  update_option('postie-settings', $newconfig);
2788
  config_Update($newconfig);
2789
  return $newconfig;
@@ -2928,140 +2946,191 @@ function config_ReadOld() {
2928
  */
2929
  function config_UpgradeOld() {
2930
  $config = config_ReadOld();
2931
- if (!isset($config["ADMIN_USERNAME"]))
2932
  $config["ADMIN_USERNAME"] = 'admin';
2933
- if (!isset($config["PREFER_TEXT_TYPE"]))
 
2934
  $config["PREFER_TEXT_TYPE"] = "plain";
2935
- if (!isset($config["DEFAULT_TITLE"]))
 
2936
  $config["DEFAULT_TITLE"] = "Live From The Field";
2937
- if (!isset($config["INPUT_PROTOCOL"]))
 
2938
  $config["INPUT_PROTOCOL"] = "pop3";
2939
- if (!isset($config["IMAGE_PLACEHOLDER"]))
 
2940
  $config["IMAGE_PLACEHOLDER"] = "#img%#";
2941
- if (!isset($config["IMAGES_APPEND"]))
 
2942
  $config["IMAGES_APPEND"] = true;
2943
-
2944
- if (!isset($config["ALLOW_SUBJECT_IN_MAIL"]))
2945
  $config["ALLOW_SUBJECT_IN_MAIL"] = true;
2946
- if (!isset($config["DROP_SIGNATURE"]))
 
2947
  $config["DROP_SIGNATURE"] = true;
2948
- if (!isset($config["MESSAGE_START"]))
 
2949
  $config["MESSAGE_START"] = ":start";
2950
-
2951
- if (!isset($config["MESSAGE_END"]))
2952
  $config["MESSAGE_END"] = ":end";
2953
- if (!isset($config["FORWARD_REJECTED_MAIL"]))
 
2954
  $config["FORWARD_REJECTED_MAIL"] = true;
2955
- if (!isset($config["RETURN_TO_SENDER"]))
 
2956
  $config["RETURN_TO_SENDER"] = false;
2957
- if (!isset($config["CONFIRMATION_EMAIL"]))
 
2958
  $config["CONFIRMATION_EMAIL"] = '';
2959
- if (!isset($config["ALLOW_HTML_IN_SUBJECT"]))
 
2960
  $config["ALLOW_HTML_IN_SUBJECT"] = true;
2961
- if (!isset($config["ALLOW_HTML_IN_BODY"]))
 
2962
  $config["ALLOW_HTML_IN_BODY"] = true;
2963
- if (!isset($config["START_IMAGE_COUNT_AT_ZERO"]))
 
2964
  $config["START_IMAGE_COUNT_AT_ZERO"] = false;
2965
- if (!isset($config["MESSAGE_ENCODING"]))
 
2966
  $config["MESSAGE_ENCODING"] = "UTF-8";
2967
- if (!isset($config["MESSAGE_DEQUOTE"]))
 
2968
  $config["MESSAGE_DEQUOTE"] = true;
2969
-
2970
- if (!isset($config["TURN_AUTHORIZATION_OFF"]))
2971
  $config["TURN_AUTHORIZATION_OFF"] = false;
2972
- if (!isset($config["CUSTOM_IMAGE_FIELD"]))
 
2973
  $config["CUSTOM_IMAGE_FIELD"] = false;
2974
- if (!isset($config["CONVERTNEWLINE"]))
 
2975
  $config["CONVERTNEWLINE"] = false;
2976
- if (!isset($config["SIG_PATTERN_LIST"]))
 
2977
  $config["SIG_PATTERN_LIST"] = array('--', '---');
2978
- if (!isset($config["BANNED_FILES_LIST"]))
 
2979
  $config["BANNED_FILES_LIST"] = array();
2980
- if (!isset($config["SUPPORTED_FILE_TYPES"]))
 
2981
  $config["SUPPORTED_FILE_TYPES"] = array("application");
2982
- if (!isset($config["AUTHORIZED_ADDRESSES"]))
 
2983
  $config["AUTHORIZED_ADDRESSES"] = array();
2984
- if (!isset($config["MAIL_SERVER"]))
 
2985
  $config["MAIL_SERVER"] = NULL;
2986
- if (!isset($config["MAIL_SERVER_PORT"]))
 
2987
  $config["MAIL_SERVER_PORT"] = NULL;
2988
- if (!isset($config["MAIL_USERID"]))
 
2989
  $config["MAIL_USERID"] = NULL;
2990
- if (!isset($config["MAIL_PASSWORD"]))
 
2991
  $config["MAIL_PASSWORD"] = NULL;
2992
- if (!isset($config["DEFAULT_POST_CATEGORY"]))
 
2993
  $config["DEFAULT_POST_CATEGORY"] = NULL;
2994
- if (!isset($config["DEFAULT_POST_TAGS"]))
 
2995
  $config["DEFAULT_POST_TAGS"] = NULL;
2996
- if (!isset($config["TIME_OFFSET"]))
 
2997
  $config["TIME_OFFSET"] = get_option('gmt_offset');
2998
- if (!isset($config["WRAP_PRE"]))
 
2999
  $config["WRAP_PRE"] = 'no';
3000
- if (!isset($config["CONVERTURLS"]))
 
3001
  $config["CONVERTURLS"] = true;
3002
- if (!isset($config["SHORTCODE"]))
 
3003
  $config["SHORTCODE"] = false;
3004
- if (!isset($config["ADD_META"]))
 
3005
  $config["ADD_META"] = 'no';
 
3006
  $config['ICON_SETS'] = array('silver', 'black', 'white', 'custom', 'none');
3007
- if (!isset($config["ICON_SET"]))
3008
  $config["ICON_SET"] = 'silver';
 
3009
  $config['ICON_SIZES'] = array(32, 48, 64);
3010
- if (!isset($config["ICON_SIZE"]))
3011
  $config["ICON_SIZE"] = 32;
 
3012
 
3013
  //audio
3014
  include('templates/audio_templates.php');
3015
- if (!isset($config["SELECTED_AUDIOTEMPLATE"]))
3016
  $config['SELECTED_AUDIOTEMPLATE'] = 'simple_link';
 
3017
  $config['AUDIOTEMPLATES'] = $audioTemplates;
3018
- if (!isset($config["SELECTED_VIDEO1TEMPLATE"]))
3019
  $config['SELECTED_VIDEO1TEMPLATE'] = 'simple_link';
3020
- if (!isset($config["AUDIOTEMPLATE"]))
 
3021
  $config["AUDIOTEMPLATE"] = $simple_link;
 
3022
 
3023
  //video1
3024
- if (!isset($config["VIDEO1TYPES"]))
3025
  $config['VIDEO1TYPES'] = array('mp4', 'mpeg4', '3gp', '3gpp', '3gpp2', '3gp2', 'mov', 'mpeg', 'quicktime');
3026
- if (!isset($config["AUDIOTYPES"]))
 
3027
  $config['AUDIOTYPES'] = array('m4a', 'mp3', 'ogg', 'wav', 'mpeg');
3028
- if (!isset($config["SELECTED_VIDEO2TEMPLATE"]))
 
3029
  $config['SELECTED_VIDEO2TEMPLATE'] = 'simple_link';
 
3030
  include('templates/video1_templates.php');
3031
  $config['VIDEO1TEMPLATES'] = $video1Templates;
3032
- if (!isset($config["VIDEO1TEMPLATE"]))
3033
  $config["VIDEO1TEMPLATE"] = $simple_link;
 
3034
 
3035
  //video2
3036
- if (!isset($config["VIDEO2TYPES"]))
3037
  $config['VIDEO2TYPES'] = array('x-flv');
3038
- if (!isset($config["POST_STATUS"]))
 
3039
  $config["POST_STATUS"] = 'publish';
3040
- if (!isset($config["IMAGE_NEW_WINDOW"]))
 
3041
  $config["IMAGE_NEW_WINDOW"] = false;
3042
- if (!isset($config["FILTERNEWLINES"]))
 
3043
  $config["FILTERNEWLINES"] = true;
 
3044
  include('templates/video2_templates.php');
3045
  $config['VIDEO2TEMPLATES'] = $video2Templates;
3046
- if (!isset($config["VIDEO2TEMPLATE"]))
3047
  $config["VIDEO2TEMPLATE"] = $simple_link;
 
3048
 
3049
  //image
3050
- if (!isset($config["SELECTED_IMAGETEMPLATE"]))
3051
  $config['SELECTED_IMAGETEMPLATE'] = 'wordpress_default';
3052
- if (!isset($config["SMTP"]))
 
3053
  $config["SMTP"] = array();
 
3054
  include('templates/image_templates.php');
3055
- if (!isset($config["IMAGETEMPLATE"]))
3056
  $config["IMAGETEMPLATE"] = $wordpress_default;
 
3057
  $config['IMAGETEMPLATES'] = $imageTemplates;
3058
 
3059
  //general
3060
  include('templates/general_template.php');
3061
- if (!isset($config["GENERALTEMPLATE"]))
3062
  $config["GENERALTEMPLATE"] = $postie_default;
 
3063
 
3064
- return($config);
3065
  }
3066
 
3067
  /**
@@ -3197,8 +3266,9 @@ function config_ValidateSettings($in) {
3197
 
3198
  foreach ($arrays as $sep => $fields) {
3199
  foreach ($fields as $field) {
3200
- if (!is_array($out[$field]))
3201
  $out[$field] = explode($sep, trim($out[$field]));
 
3202
  foreach ($out[$field] as $key => $val) {
3203
  $tst = trim($val);
3204
  if
@@ -3278,6 +3348,7 @@ function tag_CustomImageField(&$content, &$attachments, $config) {
3278
 
3279
  foreach ($attachments["html"] as $key => $value) {
3280
  //DebugEcho("checking " . htmlentities($value));
 
3281
  if (preg_match("/src\s*=\s*['\"]([^'\"]*)['\"]/i", $value, $matches)) {
3282
  DebugEcho("found custom image: " . $matches[1]);
3283
  array_push($customImages, $matches[1]);
@@ -3290,12 +3361,13 @@ function tag_CustomImageField(&$content, &$attachments, $config) {
3290
  /**
3291
  * Special Vodafone handler - their messages are mostly vendor trash - this strips them down.
3292
  */
3293
- function filter_VodafoneHandler(&$content, &$attachments, $config) {
3294
  if (preg_match('/You have been sent a message from Vodafone mobile/', $content)) {
3295
  DebugEcho("Vodafone message");
3296
  $index = strpos($content, "TEXT:");
3297
  if (strpos !== false) {
3298
  $alt_content = substr($content, $index, strlen($content));
 
3299
  if (preg_match("/<font face=\"verdana,helvetica,arial\" class=\"standard\" color=\"#999999\"><b>(.*)<\/b>/", $alt_content, $matches)) {
3300
  //The content is now just the text of the message
3301
  $content = $matches[1];
@@ -3324,8 +3396,6 @@ function DebugFiltersFor($hook = '') {
3324
  function postie_test_config() {
3325
  $config = config_Read();
3326
  extract($config);
3327
- $title = __("Postie Diagnosis");
3328
- $parent_file = 'options-general.php?page=postie/postie.php';
3329
  get_currentuserinfo();
3330
 
3331
  if (!current_user_can('manage_options')) {
1
  <?php
2
  /*
3
+ $Id: postie-functions.php 1016279 2014-10-29 22:46:52Z WayneAllen $
4
  */
5
 
6
  //to turn on debug output add the following line to wp-config.php
298
  }
299
  }
300
 
301
+ filter_VodafoneHandler($content, $attachments);
302
  if ($fulldebug) {
303
  DebugEcho("post vodafone: $content");
304
  }
972
  DecodeBase64Part($part);
973
 
974
  //look for banned file names
975
+ if (property_exists($part, 'ctype_parameters') && is_array($part->ctype_parameters) && array_key_exists('name', $part->ctype_parameters)) {
976
  if (isBannedFileName($part->ctype_parameters['name'], $banned_files_list)) {
977
  DebugEcho("GetContent: found banned filename");
978
  return NULL;
979
  }
980
+ }
981
 
982
  if (property_exists($part, "ctype_primary") && $part->ctype_primary == "application" && $part->ctype_secondary == "octet-stream") {
983
  if (property_exists($part, 'disposition') && $part->disposition == "attachment") {
1255
  break;
1256
  }
1257
  }
1258
+ DebugEcho("GetContent: meta_return: " . substr($meta_return, 0, 500));
1259
  DebugEcho("GetContent: ==== end");
1260
  return $meta_return;
1261
  }
1363
  function ValidatePoster(&$mimeDecodedEmail, $config) {
1364
  $test_email = '';
1365
  extract($config);
 
1366
  $poster = NULL;
1367
  $from = "";
1368
  if (property_exists($mimeDecodedEmail, "headers") && array_key_exists('from', $mimeDecodedEmail->headers)) {
1396
  if (!empty($from)) {
1397
  DebugEcho("Confirming Access For $from ");
1398
  $user = get_user_by('email', $from);
1399
+ if ($user !== false) {
1400
  $user_ID = $user->ID;
1401
+ }
1402
  } else {
1403
  $user_ID = "";
1404
  }
1449
  }
1450
 
1451
  function isValidSmtpServer($mimeDecodedEmail, $smtpservers) {
1452
+ if (empty($smtpservers)) {
1453
  return true;
1454
+ }
1455
 
1456
  foreach ((array) $mimeDecodedEmail->headers['received'] as $received) {
1457
+ EchoInfo("isValidSmtpServer: checking header $received");
1458
  foreach ($smtpservers as $smtp) {
1459
  if (stristr($received, $smtp) !== false) {
1460
+ DebugEcho("isValidSmtpServer: Sent from valid SMTP server.");
1461
  return true;
1462
  }
1463
  }
1464
  }
1465
 
1466
+ EchoInfo("isValidSmtpServer: Sent from invalid SMTP server.");
1467
  return false;
1468
  }
1469
 
1527
 
1528
  function filter_RemoveSignatureWorker(&$html, $pattern) {
1529
  $found = false;
1530
+ $matches = array();
1531
  if (preg_match($pattern, trim($html->plaintext), $matches)) {
1532
  DebugEcho("filter_RemoveSignatureWorker: signature found in base, removing");
1533
  DebugDump($matches);
1566
  $end = $config['message_end'];
1567
  if ($end) {
1568
  $pos = strpos($content, $end);
1569
+ if ($pos === false) {
1570
  return $content;
1571
+ }
1572
  DebugEcho("end filter: $end");
1573
  $content = substr($content, 0, $pos);
1574
  }
1678
  function tag_AllowCommentsOnPost(&$content) {
1679
  $comments_allowed = get_option('default_comment_status'); // 'open' or 'closed'
1680
 
1681
+ $matches = array();
1682
  if (preg_match("/comments:([0|1|2])/i", $content, $matches)) {
1683
  $content = preg_replace("/comments:$matches[1]/i", "", $content);
1684
  if ($matches[1] == "1") {
1694
 
1695
  function tag_Status(&$content, $currentstatus) {
1696
  $poststatus = $currentstatus;
1697
+ $matches = array();
1698
  if (preg_match("/status:\s*(draft|publish|pending|private)/i", $content, $matches)) {
1699
  DebugEcho("tag_Status: found status $matches[1]");
1700
  DebugDump($matches);
1711
  */
1712
  function filter_Delay(&$content, $message_date = NULL, $offset = 0) {
1713
  $delay = 0;
1714
+ $matches = array();
1715
  if (preg_match("/delay:(-?[0-9dhm]+)/i", $content, $matches) && trim($matches[1])) {
1716
  DebugEcho("found delay: " . $matches[1]);
1717
  $days = 0;
1718
  $hours = 0;
1719
  $minutes = 0;
1720
+ $dayMatches = array();
1721
  if (preg_match("/(-?[0-9]+)d/i", $matches[1], $dayMatches)) {
1722
  $days = $dayMatches[1];
1723
  }
1724
+ $hourMatches = array();
1725
  if (preg_match("/(-?[0-9]+)h/i", $matches[1], $hourMatches)) {
1726
  $hours = $hourMatches[1];
1727
  }
1728
+ $minuteMatches = array();
1729
  if (preg_match("/(-?[0-9]+)m/i", $matches[1], $minuteMatches)) {
1730
  $minutes = $minuteMatches[1];
1731
  }
1751
  * This function takes the content of the message - looks for a subject at the begining surrounded by # and then removes that from the content
1752
  */
1753
  function tag_Subject($content, $defaultTitle) {
1754
+ DebugEcho("tag_Subject: Looking for subject in email body");
1755
  if (substr($content, 0, 1) != "#") {
1756
+ DebugEcho("tag_Subject: No subject found, using default [1]");
1757
  return(array($defaultTitle, $content));
1758
  }
1759
  $subjectEndIndex = strpos($content, "#", 1);
1760
  if (!$subjectEndIndex > 0) {
1761
+ DebugEcho("tag_Subject: No subject found, using default [2]");
1762
  return(array($defaultTitle, $content));
1763
  }
1764
  $subject = substr($content, 1, $subjectEndIndex - 1);
1765
  $content = substr($content, $subjectEndIndex + 1, strlen($content));
1766
+ DebugEcho("tag_Subject: Subject found in body: $subject");
1767
  return array($subject, $content);
1768
  }
1769
 
2036
  function filter_PreferedText($mimeDecodedEmail, $preferTextType) {
2037
  DebugEcho("filter_PreferedText: begin " . count($mimeDecodedEmail->parts));
2038
  $newParts = array();
 
2039
 
2040
  for ($i = 0; $i < count($mimeDecodedEmail->parts); $i++) {
2041
  if (!property_exists($mimeDecodedEmail->parts[$i], "ctype_primary")) {
2081
  * This function can be used to send confirmation or rejection emails
2082
  * It accepts an object containing the entire message
2083
  */
2084
+ function MailToRecipients(&$mail_content, $testEmail = false, $recipients = array(), $returnToSender = false, $reject = true, $postid = null) {
2085
  DebugEcho("MailToRecipients: send mail");
2086
  if ($testEmail) {
2087
  return false;
2088
  }
2089
+
 
2090
  $myemailadd = get_option("admin_email");
2091
  $blogname = get_option("blogname");
 
2092
  $posturl = '';
2093
  if ($postid != null) {
2094
  $posturl = get_permalink($postid);
2144
  }
2145
  foreach ($mailparts as $part) {
2146
  $mailtext .= "--$boundary\r\n";
2147
+ if (array_key_exists('content-type', $part->headers)) {
2148
  $mailtext .= "Content-Type: " . $part->headers["content-type"] . "\n";
2149
+ }
2150
+ if (array_key_exists('content-transfer-encoding', $part->headers)) {
2151
  $mailtext .= "Content-Transfer-Encoding: " . $part->headers["content-transfer-encoding"] . "\n";
2152
+ }
2153
  if (array_key_exists('content-disposition', $part->headers)) {
2154
  $mailtext .= "Content-Disposition: " . $part->headers["content-disposition"] . "\n";
2155
  }
2156
  $mailtext .= "\n";
2157
+ if (property_exists($part, 'body')) {
2158
  $mailtext .= $part->body;
2159
+ }
2160
  }
2161
  } else {
2162
  $alert_subject = "Successfully posted to $blogname";
2255
  * the attachment
2256
  */
2257
  function chooseAttachmentIcon($file, $primary, $secondary, $iconSet = 'silver', $size = '32') {
2258
+ if ($iconSet == 'none') {
2259
  return('');
2260
+ }
2261
  $fileName = basename($file);
2262
  $parts = explode('.', $fileName);
2263
  $ext = $parts[count($parts) - 1];
2310
  $fileType = 'default';
2311
  }
2312
  $fileName = "/icons/$iconSet/$fileType-$size.png";
2313
+ if (!file_exists(POSTIE_ROOT . $fileName)) {
2314
  $fileName = "/icons/$iconSet/default-$size.png";
2315
+ }
2316
  $iconHtml = "<img src='" . POSTIE_URL . $fileName . "' alt='$fileType icon' />";
2317
  DebugEcho("icon: $iconHtml");
2318
  return $iconHtml;
2521
  */
2522
  function GetSubject(&$mimeDecodedEmail, &$content, $config) {
2523
  extract($config);
 
2524
  //assign the default title/subject
2525
  if (!array_key_exists('subject', $mimeDecodedEmail->headers) || empty($mimeDecodedEmail->headers['subject'])) {
2526
  DebugEcho("No subject in email");
2539
  DebugEcho("subject before htmlentities: $subject");
2540
  $subject = htmlentities($subject, ENT_COMPAT, $message_encoding);
2541
  DebugEcho("subject after htmlentities: $subject");
2542
+ } else {
2543
+ list($subject, $content) = tag_Subject($content, $subject);
2544
  }
2545
  }
2546
  //This is for ISO-2022-JP - Can anyone confirm that this is still neeeded?
2582
 
2583
  function tag_TagsWorker(&$content) {
2584
  $post_tags = array();
2585
+ $matches = array();
2586
  if (preg_match('/tags: ?(.*)$/im', $content, $matches)) {
2587
  if (!empty($matches[1])) {
2588
  DebugEcho("Found tags: $matches[1]");
2596
  function tag_Tags2(&$content, $defaultTags) {
2597
  $post_tags = array();
2598
  //try and determine tags
2599
+ $matches = array();
2600
  if (preg_match('/tags: ?(.*)$/im', $content, $matches)) {
2601
  if (!empty($matches[1])) {
2602
  DebugEcho("Found tags: $matches[1]");
2617
  */
2618
  function tag_Excerpt(&$content, $config) {
2619
  $post_excerpt = '';
2620
+ $matches = array();
2621
  if (preg_match('/:excerptstart ?(.*):excerptend/s', $content, $matches)) {
2622
  $content = str_replace($matches[0], "", $content);
2623
  $post_excerpt = $matches[1];
2799
  $newconfig = config_GetDefaults();
2800
  $config = get_option('postie-settings');
2801
  $save_keys = array('mail_password', 'mail_server', 'mail_server_port', 'mail_userid', 'input_protocol');
2802
+ foreach ($save_keys as $key) {
2803
  $newconfig[$key] = $config[$key];
2804
+ }
2805
  update_option('postie-settings', $newconfig);
2806
  config_Update($newconfig);
2807
  return $newconfig;
2946
  */
2947
  function config_UpgradeOld() {
2948
  $config = config_ReadOld();
2949
+ if (!isset($config["ADMIN_USERNAME"])) {
2950
  $config["ADMIN_USERNAME"] = 'admin';
2951
+ }
2952
+ if (!isset($config["PREFER_TEXT_TYPE"])) {
2953
  $config["PREFER_TEXT_TYPE"] = "plain";
2954
+ }
2955
+ if (!isset($config["DEFAULT_TITLE"])) {
2956
  $config["DEFAULT_TITLE"] = "Live From The Field";
2957
+ }
2958
+ if (!isset($config["INPUT_PROTOCOL"])) {
2959
  $config["INPUT_PROTOCOL"] = "pop3";
2960
+ }
2961
+ if (!isset($config["IMAGE_PLACEHOLDER"])) {
2962
  $config["IMAGE_PLACEHOLDER"] = "#img%#";
2963
+ }
2964
+ if (!isset($config["IMAGES_APPEND"])) {
2965
  $config["IMAGES_APPEND"] = true;
2966
+ }
2967
+ if (!isset($config["ALLOW_SUBJECT_IN_MAIL"])) {
2968
  $config["ALLOW_SUBJECT_IN_MAIL"] = true;
2969
+ }
2970
+ if (!isset($config["DROP_SIGNATURE"])) {
2971
  $config["DROP_SIGNATURE"] = true;
2972
+ }
2973
+ if (!isset($config["MESSAGE_START"])) {
2974
  $config["MESSAGE_START"] = ":start";
2975
+ }
2976
+ if (!isset($config["MESSAGE_END"])) {
2977
  $config["MESSAGE_END"] = ":end";
2978
+ }
2979
+ if (!isset($config["FORWARD_REJECTED_MAIL"])) {
2980
  $config["FORWARD_REJECTED_MAIL"] = true;
2981
+ }
2982
+ if (!isset($config["RETURN_TO_SENDER"])) {
2983
  $config["RETURN_TO_SENDER"] = false;
2984
+ }
2985
+ if (!isset($config["CONFIRMATION_EMAIL"])) {
2986
  $config["CONFIRMATION_EMAIL"] = '';
2987
+ }
2988
+ if (!isset($config["ALLOW_HTML_IN_SUBJECT"])) {
2989
  $config["ALLOW_HTML_IN_SUBJECT"] = true;
2990
+ }
2991
+ if (!isset($config["ALLOW_HTML_IN_BODY"])) {
2992
  $config["ALLOW_HTML_IN_BODY"] = true;
2993
+ }
2994
+ if (!isset($config["START_IMAGE_COUNT_AT_ZERO"])) {
2995
  $config["START_IMAGE_COUNT_AT_ZERO"] = false;
2996
+ }
2997
+ if (!isset($config["MESSAGE_ENCODING"])) {
2998
  $config["MESSAGE_ENCODING"] = "UTF-8";
2999
+ }
3000
+ if (!isset($config["MESSAGE_DEQUOTE"])) {
3001
  $config["MESSAGE_DEQUOTE"] = true;
3002
+ }
3003
+ if (!isset($config["TURN_AUTHORIZATION_OFF"])) {
3004
  $config["TURN_AUTHORIZATION_OFF"] = false;
3005
+ }
3006
+ if (!isset($config["CUSTOM_IMAGE_FIELD"])) {
3007
  $config["CUSTOM_IMAGE_FIELD"] = false;
3008
+ }
3009
+ if (!isset($config["CONVERTNEWLINE"])) {
3010
  $config["CONVERTNEWLINE"] = false;
3011
+ }
3012
+ if (!isset($config["SIG_PATTERN_LIST"])) {
3013
  $config["SIG_PATTERN_LIST"] = array('--', '---');
3014
+ }
3015
+ if (!isset($config["BANNED_FILES_LIST"])) {
3016
  $config["BANNED_FILES_LIST"] = array();
3017
+ }
3018
+ if (!isset($config["SUPPORTED_FILE_TYPES"])) {
3019
  $config["SUPPORTED_FILE_TYPES"] = array("application");
3020
+ }
3021
+ if (!isset($config["AUTHORIZED_ADDRESSES"])) {
3022
  $config["AUTHORIZED_ADDRESSES"] = array();
3023
+ }
3024
+ if (!isset($config["MAIL_SERVER"])) {
3025
  $config["MAIL_SERVER"] = NULL;
3026
+ }
3027
+ if (!isset($config["MAIL_SERVER_PORT"])) {
3028
  $config["MAIL_SERVER_PORT"] = NULL;
3029
+ }
3030
+ if (!isset($config["MAIL_USERID"])) {
3031
  $config["MAIL_USERID"] = NULL;
3032
+ }
3033
+ if (!isset($config["MAIL_PASSWORD"])) {
3034
  $config["MAIL_PASSWORD"] = NULL;
3035
+ }
3036
+ if (!isset($config["DEFAULT_POST_CATEGORY"])) {
3037
  $config["DEFAULT_POST_CATEGORY"] = NULL;
3038
+ }
3039
+ if (!isset($config["DEFAULT_POST_TAGS"])) {
3040
  $config["DEFAULT_POST_TAGS"] = NULL;
3041
+ }
3042
+ if (!isset($config["TIME_OFFSET"])) {
3043
  $config["TIME_OFFSET"] = get_option('gmt_offset');
3044
+ }
3045
+ if (!isset($config["WRAP_PRE"])) {
3046
  $config["WRAP_PRE"] = 'no';
3047
+ }
3048
+ if (!isset($config["CONVERTURLS"])) {
3049
  $config["CONVERTURLS"] = true;
3050
+ }
3051
+ if (!isset($config["SHORTCODE"])) {
3052
  $config["SHORTCODE"] = false;
3053
+ }
3054
+ if (!isset($config["ADD_META"])) {
3055
  $config["ADD_META"] = 'no';
3056
+ }
3057
  $config['ICON_SETS'] = array('silver', 'black', 'white', 'custom', 'none');
3058
+ if (!isset($config["ICON_SET"])) {
3059
  $config["ICON_SET"] = 'silver';
3060
+ }
3061
  $config['ICON_SIZES'] = array(32, 48, 64);
3062
+ if (!isset($config["ICON_SIZE"])) {
3063
  $config["ICON_SIZE"] = 32;
3064
+ }
3065
 
3066
  //audio
3067
  include('templates/audio_templates.php');
3068
+ if (!isset($config["SELECTED_AUDIOTEMPLATE"])) {
3069
  $config['SELECTED_AUDIOTEMPLATE'] = 'simple_link';
3070
+ }
3071
  $config['AUDIOTEMPLATES'] = $audioTemplates;
3072
+ if (!isset($config["SELECTED_VIDEO1TEMPLATE"])) {
3073
  $config['SELECTED_VIDEO1TEMPLATE'] = 'simple_link';
3074
+ }
3075
+ if (!isset($config["AUDIOTEMPLATE"])) {
3076
  $config["AUDIOTEMPLATE"] = $simple_link;
3077
+ }
3078
 
3079
  //video1
3080
+ if (!isset($config["VIDEO1TYPES"])) {
3081
  $config['VIDEO1TYPES'] = array('mp4', 'mpeg4', '3gp', '3gpp', '3gpp2', '3gp2', 'mov', 'mpeg', 'quicktime');
3082
+ }
3083
+ if (!isset($config["AUDIOTYPES"])) {
3084
  $config['AUDIOTYPES'] = array('m4a', 'mp3', 'ogg', 'wav', 'mpeg');
3085
+ }
3086
+ if (!isset($config["SELECTED_VIDEO2TEMPLATE"])) {
3087
  $config['SELECTED_VIDEO2TEMPLATE'] = 'simple_link';
3088
+ }
3089
  include('templates/video1_templates.php');
3090
  $config['VIDEO1TEMPLATES'] = $video1Templates;
3091
+ if (!isset($config["VIDEO1TEMPLATE"])) {
3092
  $config["VIDEO1TEMPLATE"] = $simple_link;
3093
+ }
3094
 
3095
  //video2
3096
+ if (!isset($config["VIDEO2TYPES"])) {
3097
  $config['VIDEO2TYPES'] = array('x-flv');
3098
+ }
3099
+ if (!isset($config["POST_STATUS"])) {
3100
  $config["POST_STATUS"] = 'publish';
3101
+ }
3102
+ if (!isset($config["IMAGE_NEW_WINDOW"])) {
3103
  $config["IMAGE_NEW_WINDOW"] = false;
3104
+ }
3105
+ if (!isset($config["FILTERNEWLINES"])) {
3106
  $config["FILTERNEWLINES"] = true;
3107
+ }
3108
  include('templates/video2_templates.php');
3109
  $config['VIDEO2TEMPLATES'] = $video2Templates;
3110
+ if (!isset($config["VIDEO2TEMPLATE"])) {
3111
  $config["VIDEO2TEMPLATE"] = $simple_link;
3112
+ }
3113
 
3114
  //image
3115
+ if (!isset($config["SELECTED_IMAGETEMPLATE"])) {
3116
  $config['SELECTED_IMAGETEMPLATE'] = 'wordpress_default';
3117
+ }
3118
+ if (!isset($config["SMTP"])) {
3119
  $config["SMTP"] = array();
3120
+ }
3121
  include('templates/image_templates.php');
3122
+ if (!isset($config["IMAGETEMPLATE"])) {
3123
  $config["IMAGETEMPLATE"] = $wordpress_default;
3124
+ }
3125
  $config['IMAGETEMPLATES'] = $imageTemplates;
3126
 
3127
  //general
3128
  include('templates/general_template.php');
3129
+ if (!isset($config["GENERALTEMPLATE"])) {
3130
  $config["GENERALTEMPLATE"] = $postie_default;
3131
+ }
3132
 
3133
+ return $config;
3134
  }
3135
 
3136
  /**
3266
 
3267
  foreach ($arrays as $sep => $fields) {
3268
  foreach ($fields as $field) {
3269
+ if (!is_array($out[$field])) {
3270
  $out[$field] = explode($sep, trim($out[$field]));
3271
+ }
3272
  foreach ($out[$field] as $key => $val) {
3273
  $tst = trim($val);
3274
  if
3348
 
3349
  foreach ($attachments["html"] as $key => $value) {
3350
  //DebugEcho("checking " . htmlentities($value));
3351
+ $matches = array();
3352
  if (preg_match("/src\s*=\s*['\"]([^'\"]*)['\"]/i", $value, $matches)) {
3353
  DebugEcho("found custom image: " . $matches[1]);
3354
  array_push($customImages, $matches[1]);
3361
  /**
3362
  * Special Vodafone handler - their messages are mostly vendor trash - this strips them down.
3363
  */
3364
+ function filter_VodafoneHandler(&$content, &$attachments) {
3365
  if (preg_match('/You have been sent a message from Vodafone mobile/', $content)) {
3366
  DebugEcho("Vodafone message");
3367
  $index = strpos($content, "TEXT:");
3368
  if (strpos !== false) {
3369
  $alt_content = substr($content, $index, strlen($content));
3370
+ $matches = array();
3371
  if (preg_match("/<font face=\"verdana,helvetica,arial\" class=\"standard\" color=\"#999999\"><b>(.*)<\/b>/", $alt_content, $matches)) {
3372
  //The content is now just the text of the message
3373
  $content = $matches[1];
3396
  function postie_test_config() {
3397
  $config = config_Read();
3398
  extract($config);
 
 
3399
  get_currentuserinfo();
3400
 
3401
  if (!current_user_can('manage_options')) {
postie.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Signifigantly upgrades the Post by Email features of Word Press.
7
- Version: 1.6.5
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
@@ -27,11 +27,11 @@
27
  */
28
 
29
  /*
30
- $Id: postie.php 1012303 2014-10-22 18:57:48Z WayneAllen $
31
  */
32
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
33
 
34
- define('POSTIE_VERSION', '1.6.5');
35
  define("POSTIE_ROOT", dirname(__FILE__));
36
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
37
 
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Signifigantly upgrades the Post by Email features of Word Press.
7
+ Version: 1.6.6
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
27
  */
28
 
29
  /*
30
+ $Id: postie.php 1016279 2014-10-29 22:46:52Z WayneAllen $
31
  */
32
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
33
 
34
+ define('POSTIE_VERSION', '1.6.6');
35
  define("POSTIE_ROOT", dirname(__FILE__));
36
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
37
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.0
8
  Tested up to: 4.0
9
- Stable tag: 1.6.5
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -58,12 +58,12 @@ More info at http://PostiePlugin.com/
58
  == Installation ==
59
  * Either:
60
  * Put the postie.zip file in wp-content/plugins/ and unzip it
61
- * Goto the Plugins tab in the WordPress Admin Site
62
- * Activate "Postie"
63
  * Or:
64
  * Use the automatic installer (WP 2.7+)
65
  * Login to WordPress as an administrator
66
- * Click "Postie" on the lefthand menu to configure it.
 
 
67
  * Make sure you enter the mailserver information correctly, including the type
68
  of connection and the port number. Common port configurations:
69
  * (Postie ignores the settings under Settings->Writing->Writing-by-Email)
@@ -238,6 +238,11 @@ All script, style and body tags are stripped from html emails.
238
  Attachments are now processed in the order they were attached.
239
 
240
  == CHANGELOG ==
 
 
 
 
 
241
  = 1.6.5 (2014.10.22) =
242
  * Fixed charset encoding bug when there wasn't a content-transfer-encoding header
243
  * Upgraded simple_html_dom
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.0
8
  Tested up to: 4.0
9
+ Stable tag: 1.6.6
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
58
  == Installation ==
59
  * Either:
60
  * Put the postie.zip file in wp-content/plugins/ and unzip it
 
 
61
  * Or:
62
  * Use the automatic installer (WP 2.7+)
63
  * Login to WordPress as an administrator
64
+ * Goto the Plugins tab in the WordPress Admin Site
65
+ * Activate "Postie"
66
+ * Goto to the "Settings" tab and click on the sub-tab "Postie" to configure it.
67
  * Make sure you enter the mailserver information correctly, including the type
68
  of connection and the port number. Common port configurations:
69
  * (Postie ignores the settings under Settings->Writing->Writing-by-Email)
238
  Attachments are now processed in the order they were attached.
239
 
240
  == CHANGELOG ==
241
+ = 1.6.6 (2014.10.29) =
242
+ * Add additional debugging to isValidSmtpServer
243
+ * Add Japanese translation
244
+ * Fixed bug where a subject present in the body is not recognized
245
+
246
  = 1.6.5 (2014.10.22) =
247
  * Fixed charset encoding bug when there wasn't a content-transfer-encoding header
248
  * Upgraded simple_html_dom