Postie - Version 1.7.22

Version Description

(2015-11-09) = * Update admin screen to match current WP style * Remove dependence on simple tabs jQuery-UI library and use WP admin tab style * Remove email password from logging

Download this release

Release Info

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

Code changes from version 1.7.21 to 1.7.22

config_form.php CHANGED
@@ -1,15 +1,4 @@
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
@@ -89,814 +78,139 @@
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"><lable for="postie-settings-input_protocol"><?php _e('Mail Protocol', 'postie') ?></lable></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 requires TLS", 'postie')); ?>
148
-
149
- <tr>
150
- <th scope="row"><label for="postie-settings-mail_server_port"><?php _e('Port', 'postie') ?></label></th>
151
- <td valign="top">
152
- <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" />
153
- <p class='description'><?php _e("Standard Ports:", 'postie'); ?><br />
154
- <?php _e("POP3", 'postie'); ?> - 110<br />
155
- <?php _e("IMAP", 'postie'); ?> - 143<br />
156
- <?php _e("IMAP-SSL", 'postie'); ?>- 993 <br />
157
- <?php _e("POP3-SSL", 'postie'); ?> - 995 <br />
158
- </p>
159
- </td>
160
- </tr>
161
- <tr valign="top">
162
- <th scope="row"><?php _e('Mail Server', 'postie') ?></th>
163
- <td><input name='postie-settings[mail_server]' type="text" id='postie-settings-mail_server' value="<?php echo esc_attr($mail_server); ?>" size="40" />
164
- </td>
165
- </tr>
166
- <tr valign="top">
167
- <th scope="row"><?php _e('Mail Userid', 'postie') ?></th>
168
- <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>
169
- </tr>
170
- <tr valign="top">
171
- <th scope="row"><?php _e('Mail Password', 'postie') ?></th>
172
- <td>
173
- <input name='postie-settings[mail_password]' type="password" id='postie-settings-mail_password' autocomplete='off' value="<?php echo esc_attr($mail_password); ?>" size="40" />
174
- </td>
175
- </tr>
176
- <tr>
177
- <th scope="row"><?php _e('Postie Time Correction', 'postie') ?></th>
178
- <td><input style="width: 70px;" name='postie-settings[time_offset]' type="number" step="0.5" id='postie-settings-time_offset' size="2" value="<?php echo esc_attr($time_offset); ?>" />
179
- <?php _e('hours', 'postie') ?>
180
- <p class='description'><?php _e("Should be the same as your normal offset, but this lets you adjust it in cases where that doesn't work.", 'postie'); ?></p>
181
- </td>
182
- </tr>
183
- <tr>
184
- <th>
185
- <?php _e('Check for mail every', 'postie') ?>:
186
- </th>
187
- <td>
188
- <select name='postie-settings[interval]' id='postie-settings-interval'>
189
- <option value="weekly" <?php
190
- if ($interval == "weekly") {
191
- echo "selected='selected'";
192
- }
193
- ?>><?php _e('Once weekly', 'postie') ?>
194
- </option>
195
-
196
- <option value="daily"<?php
197
- if ($interval == "daily") {
198
- echo "selected='selected'";
199
- }
200
- ?>><?php _e('daily', 'postie') ?>
201
- </option>
202
-
203
- <option value="hourly" <?php
204
- if ($interval == "hourly") {
205
- echo "selected='selected'";
206
- }
207
- ?>><?php _e('hourly', 'postie') ?>
208
- </option>
209
-
210
- <option value="twiceperhour" <?php
211
- if ($interval == "twiceperhour") {
212
- echo "selected='selected'";
213
- }
214
- ?>><?php _e('twice per hour', 'postie') ?>
215
- </option>
216
-
217
- <option value="tenminutes" <?php
218
- if ($interval == "tenminutes") {
219
- echo "selected='selected'";
220
- }
221
- ?>><?php _e('every 10 minutes', 'postie') ?>
222
- </option>
223
-
224
- <option value="fiveminutes" <?php
225
- if ($interval == "fiveminutes") {
226
- echo "selected='selected'";
227
- }
228
- ?>><?php _e('every 5 minutes', 'postie') ?>
229
- </option>
230
-
231
- <option value="oneminute" <?php
232
- if ($interval == "oneminute") {
233
- echo "selected='selected'";
234
- }
235
- ?>><?php _e('every 1 minute', 'postie') ?>
236
- </option>
237
-
238
- <option value="thirtyseconds" <?php
239
- if ($interval == "thirtyseconds") {
240
- echo "selected='selected'";
241
- }
242
- ?>><?php _e('every 30 seconds', 'postie') ?>
243
- </option>
244
-
245
- <option value="fifteenseconds" <?php
246
- if ($interval == "fifteenseconds") {
247
- echo "selected='selected'";
248
- }
249
- ?>><?php _e('every 15 seconds', 'postie') ?>
250
- </option>
251
-
252
- <option value="manual" <?php
253
- if ($interval == "manual") {
254
- echo "selected='selected'";
255
- }
256
- ?>><?php _e('check manually', 'postie') ?>
257
- </option>
258
- </select>
259
- </td>
260
- </tr>
261
- <tr>
262
- <th>
263
- <?php _e('Maximum number of emails to process', 'postie'); ?>
264
- </th>
265
- <td>
266
- <select name='postie-settings[maxemails]' id='postie-settings-maxemails'>
267
- <option value="0" <?php if ($maxemails == '0') echo "selected='selected'" ?>><?php _e('All', 'postie'); ?></option>
268
- <option value="1" <?php if ($maxemails == '1') echo "selected='selected'" ?>>1</option>
269
- <option value="2" <?php if ($maxemails == '2') echo "selected='selected'" ?>>2</option>
270
- <option value="5" <?php if ($maxemails == '5') echo "selected='selected'" ?>>5</option>
271
- <option value="10" <?php if ($maxemails == '10') echo "selected='selected'" ?>>10</option>
272
- <option value="25" <?php if ($maxemails == '25') echo "selected='selected'" ?>>25</option>
273
- <option value="50" <?php if ($maxemails == '50') echo "selected='selected'" ?>>50</option>
274
- </select>
275
- </td>
276
- </tr>
277
- <?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')); ?>
278
- <?php echo BuildBooleanSelect(__("Ignore mail state", 'postie'), 'postie-settings[ignore_mail_state]', $ignore_mail_state, __("Ignore whether the mails is 'read' or 'unread' If 'No' then only unread messages are processed.", 'postie')); ?>
279
- <?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 allow any SMTP server.", 'postie')); ?>
280
-
281
- <?php echo BuildBooleanSelect(__("Enable Error Logging", 'postie'), 'postie-settings[postie_log_error]', $postie_log_error, __("Log error messages to the web server error log.", 'postie')); ?>
282
- <?php echo BuildBooleanSelect(__("Enable Debug Logging", 'postie'), 'postie-settings[postie_log_debug]', $postie_log_debug, __("Log debug messages to the web server error log.", 'postie')); ?>
283
-
284
- </table>
285
- </div>
286
-
287
- <div id="simpleTabs-content-2" class="simpleTabs-content">
288
- <table class='form-table'>
289
-
290
- <?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')); ?>
291
- <?php echo BuildBooleanSelect(__("Force User Login", 'postie'), "postie-settings[force_user_login]", $force_user_login, __("Changing this to yes will cause Postie to try and login as the 'from' user if they exist. This should be set to 'Yes' if you use custom taxonomies in the subject line.", 'postie')); ?>
292
- <tr>
293
- <th scope="row">
294
- <?php _e('Roles That Can Post', 'postie') ?><br />
295
- </th>
296
- <td>
297
- <table class="checkbox-table">
298
- <?php
299
- foreach ($wp_roles->role_names as $roleId => $name) {
300
- $name = translate_user_role($name);
301
- $role = $wp_roles->get_role($roleId);
302
- if ($roleId != "administrator") {
303
- ?>
304
- <tr>
305
- <td>
306
- <input type='checkbox' value='1' name='postie-settings[role_access][<?php echo $roleId; ?>]' <?php echo ($role->has_cap("post_via_postie")) ? 'checked="checked"' : "" ?> >
307
- <?php echo $name; ?>
308
- </td>
309
- </tr>
310
- <?php
311
- } else {
312
- ?>
313
- <tr>
314
- <td>
315
- <input type='checkbox' value='1' disabled='disabled' checked='checked' > <?php echo $name; ?>
316
- </td>
317
- </tr>
318
- <?php
319
- }
320
- }
321
- ?>
322
- <p class='description'><?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'); ?></p>
323
-
324
- </table>
325
- </td>
326
- </tr>
327
-
328
- <?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')); ?>
329
- <tr>
330
- <th scope="row"><?php _e('Default Poster', 'postie') ?></th>
331
- <td>
332
- <select name='postie-settings[admin_username]' id='postie-settings[admin_username]'>
333
- <?php
334
- $adminusers = get_users('orderby=nicename&role=administrator');
335
- foreach ($config['role_access'] as $userrole => $value) {
336
- $adminusers = array_merge($adminusers, get_users("orderby=nicename&role=$userrole"));
337
- }
338
- foreach ($adminusers as $user) {
339
- $selected = "";
340
- if ($user->user_login == $admin_username) {
341
- $selected = " selected='selected'";
342
- }
343
- echo "<option value='$user->user_login'$selected>$user->user_nicename ($user->user_login)</option>";
344
- }
345
- ?>
346
- </select>
347
- <p class='description'><?php _e("This will be the poster if you allow posting from emails that are not a registered blog user.", 'postie'); ?></p>
348
- </td>
349
- </tr>
350
- </table>
351
- </div>
352
 
353
- <div id = "simpleTabs-content-3" class = "simpleTabs-content">
354
- <table class = 'form-table'>
355
- <tr>
356
- <th scope="row"><?php _e('Preferred Text Type', 'postie') ?> </th>
357
- <td>
358
- <select name='postie-settings[prefer_text_type]' id='postie-settings-prefer_text_type'>
359
- <?php printf('<option value="plain" %s>plain</option>', ($prefer_text_type == "plain") ? "selected" : "") ?>
360
- <?php printf('<option value="html" %s>html</option>', ($prefer_text_type == "html") ? "selected" : "") ?>
361
- </select>
362
- </td>
363
- </tr>
364
- <tr valign = "top">
365
- <th scope = "row"><?php _e('Default category', 'postie') ?></th>
366
- <td>
367
- <?php
368
- $defaultCat = $default_post_category;
369
- $args = array('name' => 'postie-settings[default_post_category]', 'hierarchical' => 1, 'selected' => $defaultCat, 'hide_empty' => 0);
370
- wp_dropdown_categories($args);
371
- ?>
372
- </tr>
373
- <?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')); ?>
374
 
375
- <tr valign="top">
376
- <th scope="row">
377
- <?php _e('Default tag(s)', 'postie') ?><br />
378
- </th>
379
- <td>
380
- <input type='text' name='postie-settings[default_post_tags]' id='postie-settings-default_post_tags' value='<?php echo esc_attr($default_post_tags) ?>' />
381
- <p class='description'><?php _e('separated by commas', 'postie') ?></p>
382
- </td>
383
- </tr>
384
 
385
- <tr>
386
- <th scope="row"><?php _e('Default Post Status', 'postie') ?> </th>
387
- <td>
388
- <select name='postie-settings[post_status]' id='postie-settings-post_status'>
389
- <?php
390
- $stati = get_post_stati();
391
- //DebugEcho($config['post_status']);
392
- //DebugDump($stati);
393
- foreach ($stati as $status) {
394
- $selected = "";
395
- if ($config['post_status'] == $status) {
396
- $selected = " selected='selected'";
397
- }
398
- echo "<option value='$status'$selected>$status</option>";
399
- }
400
- ?>
401
- </select>
402
- </td>
403
- </tr>
404
 
405
- <tr>
406
- <th scope="row"><?php _e('Default Post Format', 'postie') ?> </th>
407
- <td>
408
- <select name='postie-settings[post_format]' id='postie-settings-post_format'>
409
- <?php
410
- $formats = get_theme_support('post-formats');
411
- if (is_array($formats[0])) {
412
- $formats = $formats[0];
413
- } else {
414
- $formats = array();
415
- }
416
- array_unshift($formats, "standard");
417
- foreach ($formats as $format) {
418
- $selected = "";
419
- if ($config['post_format'] == $format) {
420
- $selected = " selected='selected'";
421
- }
422
- echo "<option value='$format'$selected>$format</option>";
423
- }
424
- ?>
425
- </select>
426
- </td>
427
- </tr>
428
 
429
- <tr>
430
- <th scope="row"><?php _e('Default Post Type', 'postie') ?> </th>
431
- <td>
432
- <select name='postie-settings[post_type]' id='postie-settings-post_type'>
433
- <?php
434
- $types = get_post_types();
435
- //array_unshift($types, "standard");
436
- foreach ($types as $type) {
437
- $selected = "";
438
- if ($config['post_type'] == $type) {
439
- $selected = " selected='selected'";
440
- }
441
- echo "<option value='$type'$selected>$type</option>";
442
- }
443
- ?>
444
- </select>
445
- </td>
446
- </tr>
447
 
448
- <tr>
449
- <th scope="row"><?php _e('Default Title', 'postie') ?> </th>
450
- <td>
451
- <input name='postie-settings[default_title]' type="text" id='postie-settings-default_title' value="<?php echo esc_attr($default_title); ?>" size="50" /><br />
452
- </td>
453
- </tr>
454
 
455
- <?php echo BuildBooleanSelect(__("Treat Replies As", 'postie'), "postie-settings[reply_as_comment]", $reply_as_comment, "", array("comments", "new posts")); ?>
456
- <?php echo BuildBooleanSelect(__("Strip Original Content from Replies", 'postie'), "postie-settings[strip_reply]", $strip_reply, "Only applicable if replies are trated as comments"); ?>
457
 
458
- <?php echo BuildBooleanSelect(__("Forward Rejected Mail", 'postie'), "postie-settings[forward_rejected_mail]", $forward_rejected_mail); ?>
459
- <?php echo BuildBooleanSelect(__("Allow Subject In Mail", 'postie'), "postie-settings[allow_subject_in_mail]", $allow_subject_in_mail, "Enclose the subject between '#' on the very first line. E.g. #this is my subject#"); ?>
460
- <?php echo BuildBooleanSelect(__("Allow HTML In Mail Subject", 'postie'), "postie-settings[allow_html_in_subject]", $allow_html_in_subject); ?>
461
- <?php echo BuildBooleanSelect(__("Allow HTML In Mail Body", 'postie'), "postie-settings[allow_html_in_body]", $allow_html_in_body); ?>
462
- <tr>
463
- <th scope="row"><?php _e('Text for Message Start', 'postie') ?> </th>
464
- <td>
465
- <input name='postie-settings[message_start]' type="text" id='postie-settings-message_start' value="<?php echo esc_attr($message_start); ?>" size="50" /><br />
466
- <p class='description'><?php _e('Remove all text from the beginning of the message up to the point where this is found. Note this works best with "Plain" messages.', 'postie') ?></p>
467
- </td>
468
- </tr>
469
- <tr>
470
- <th scope="row"><?php _e('Text for Message End', 'postie') ?> </th>
471
- <td>
472
- <input name='postie-settings[message_end]' type="text" id='postie-settings-message_end' value="<?php echo esc_attr($message_end); ?>" size="50" /><br />
473
- <p class='description'><?php _e('Remove all text from the point this is found to the end of the message. Note this works best with "Plain" messages.', 'postie') ?></p>
474
- </td>
475
- </tr>
476
-
477
- <?php
478
- echo BuildBooleanSelect(__("Filter newlines", 'postie'), "postie-settings[filternewlines]", $filternewlines, __("Whether to strip newlines from plain text. Set to no if using markdown or textitle syntax", 'postie'));
479
- 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'));
480
- echo BuildBooleanSelect(__("Return rejected mail to sender", 'postie'), "postie-settings[return_to_sender]", $return_to_sender);
481
- ?>
482
- <tr>
483
- <th>
484
- <?php _e("Send post confirmation email to", 'postie') ?>:
485
- </th>
486
- <td>
487
- <select name='postie-settings[confirmation_email]' id='postie-settings-confirmation_email'>
488
- <option value="sender" <?php echo($confirmation_email == "sender") ? "selected" : "" ?>><?php _e('sender', 'postie') ?></option>
489
- <option value="admin" <?php echo ($confirmation_email == "admin") ? "selected" : "" ?>><?php _e('administrator', 'postie') ?></option>
490
- <option value="both" <?php echo ($confirmation_email == "both") ? "selected" : "" ?>><?php _e('sender and administrator', 'postie') ?></option>
491
- <option value="" <?php echo ($confirmation_email == "") ? "selected" : "" ?>><?php _e('none', 'postie') ?></option>
492
- </select>
493
- </td>
494
- </tr>
495
-
496
- <?php
497
- echo BuildBooleanSelect(__("Automatically convert urls to links", 'postie'), "postie-settings[converturls]", $converturls);
498
- ?>
499
- <tr>
500
- <th scope="row"><?php _e('Encoding for pages and feeds', 'postie') ?> </th>
501
- <td>
502
- <input name='postie-settings[message_encoding]' type="text" id='postie-settings-message_encoding' value="<?php echo esc_attr($message_encoding); ?>" size="10" />
503
- <p class='description'><?php _e('The character set for your blog.', 'postie') ?></p>
504
- <p class='description'>UTF-8 <?php _e("should handle ISO-8859-1 as well", 'postie'); ?></p>
505
- </td>
506
- </tr>
507
- <?php echo BuildBooleanSelect(__("Decode Quoted Printable Data", 'postie'), "postie-settings[message_dequote]", $message_dequote); ?>
508
- <?php echo BuildBooleanSelect(__("Drop The Signature From Mail", 'postie'), "postie-settings[drop_signature]", $drop_signature, __("Really only works with 'plain' format.")); ?>
509
- <?php echo BuildTextArea(__("Signature Patterns", 'postie'), "postie-settings[sig_pattern_list]", $sig_pattern_list, __("Really only works with 'plain' format. Put each pattern on a separate line. Patterns are <a href='http://regex101.com/' target='_blank'>regular expressions</a> and are put inside /^{pattern}$/i", 'postie')); ?>
510
- </table>
511
- </div>
512
-
513
- <div id="simpleTabs-content-4" class="simpleTabs-content">
514
- <table class='form-table'>
515
-
516
- <?php
517
- 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'));
518
- echo BuildBooleanSelect(__("Include Featured Image in Post", 'postie'), "postie-settings[include_featured_image]", $include_featured_image, __("Should the featured image be included in the post. This only works if the 'Preferred Text Type' is 'Plain'", 'postie'));
519
- 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'));
520
- echo BuildSelect(__("Gallery Link Type", 'postie'), "postie-settings[auto_gallery_link]", $auto_gallery_link, array('Default', 'Post', 'File', 'None'), "Select the type of link the gallery should use");
521
- 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'));
522
- 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'));
523
- 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'));
524
- ?>
525
- <tr>
526
- <th scope="row"><?php _e('Image Place Holder Tag', 'postie') ?></th>
527
- <td>
528
- <input name='postie-settings[image_placeholder]' type="text" id='postie-settings-image_placeholder' value="<?php echo esc_attr($image_placeholder); ?>" size="50" /><br />
529
- <p class='description'><?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') ?></p>
530
- </td>
531
- </tr>
532
- <tr>
533
- <th scope="row"><?php _e('Image Template', 'postie') ?></th>
534
- <td>
535
- <input type='hidden' id='postie-settings-selected_imagetemplate' name='postie-settings[selected_imagetemplate]'
536
- value="<?php echo esc_attr($selected_imagetemplate) ?>" />
537
- <select name='imagetemplateselect' id='imagetemplateselect'
538
- onchange="changeStyle('imageTemplatePreview', 'postie-settings-imagetemplate',
539
- 'imagetemplateselect', 'postie-settings-selected_imagetemplate', 'smiling.jpg');" >
540
- <?php
541
- include(POSTIE_ROOT . '/templates/image_templates.php');
542
- $styleOptions = $imageTemplates;
543
- $selected = $selected_imagetemplate;
544
- foreach ($styleOptions as $key => $value) {
545
- if ($key != 'selected') {
546
- if ($key == $selected) {
547
- $select = ' selected=selected ';
548
- } else {
549
- $select = ' ';
550
- }
551
- if ($key == 'custom')
552
- $value = $imagetemplate;
553
- echo '<option' . $select . 'value="' .
554
- esc_attr($value) . '" >' . $key . '</option>';
555
- }
556
- }
557
- ?>
558
- </select>
559
- <p class='description'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie'); ?></p>
560
- <p class='description'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></p>
561
- <p class='description'><?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'); ?></p>
562
- <div style="margin-top: 10px; font-weight: bold;"><?php _e('Preview', 'postie'); ?></div>
563
- <div id='imageTemplatePreview'></div>
564
- <textarea onchange='changeStyle("imageTemplatePreview", "postie-settings-imagetemplate", "imagetemplateselect",
565
- "postie-settings-selected_imagetemplate", "smiling.jpg", true);' cols='70' rows='7' id='postie-settings-imagetemplate' name='postie-settings[imagetemplate]'>
566
- <?php echo esc_attr($imagetemplate) ?>
567
- </textarea>
568
- <div class='recommendation'>
569
- <ul>
570
- <li>{CAPTION} gets replaced with the caption you specified (if any)</li>
571
- <li>{FILELINK} gets replaced with the url to the media</li>
572
- <li>{FILENAME} gets replaced with the name of the attachment from the email</li>
573
- <li>{FILEID} gets replaced with the ID of the media</li>
574
- <li>{FULL} same as {FILELINK}</li>
575
- <li>{HEIGHT} gets replaced with the height of the photo</li>
576
- <li>{ID} gets replaced with the post id</li>
577
- <li>{IMAGE} same as {FILELINK}</li>
578
- <li>{LARGEHEIGHT} gets replaced with the height of a large image</li>
579
- <li>{LARGEWIDTH} gets replaced with the width of a large image</li>
580
- <li>{LARGE} gets replaced with the url to the large-sized image</li>
581
- <li>{MEDIUMHEIGHT} gets replaced with the height of a medium image</li>
582
- <li>{MEDIUMWIDTH} gets replaced with the width of a medium image</li>
583
- <li>{MEDIUM} gets replaced with the url to the medium-sized image</li>
584
- <li>{PAGELINK} gets replaced with the URL of the file in WordPress</li>
585
- <li>{RELFILENAME} gets replaced with the relative path to the full-size image</li>
586
- <li>{THUMBHEIGHT} gets replaced with the height of a thumbnail image</li>
587
- <li>{THUMB} gets replaced with the url to the thumbnail image</li>
588
- <li>{THUMBNAIL} same as {THUMB}</li>
589
- <li>{THUMBWIDTH} gets replaced with the width of a thumbnail image</li>
590
- <li>{TITLE} same as {FILENAME}</li>
591
- <li>{URL} same as {FILELINK}</li>
592
- <li>{WIDTH} gets replaced with width of the photo</li>
593
- <li>{ICON} insert the icon for the attachment (for non-audio/image/video attachments only)</li>
594
- </ul>
595
  </div>
596
- </td>
597
- </tr>
598
- </table>
599
- </div>
600
-
601
- <!--
602
- ########## VIDEO AND AUDIO OPTIONS ###################
603
- -->
604
-
605
- <div id="simpleTabs-content-5" class="simpleTabs-content">
606
- <table class='form-table'>
607
- <?php
608
- echo BuildBooleanSelect(__("Use shortcode for embedding video (youtube or vimeo)", 'postie'), "postie-settings[shortcode]", $shortcode, "Only change this value to 'Yes' if you have another plugin that will process the shortcode.");
609
- ?>
610
- <tr>
611
- <th scope='row'><?php _e('Video template 1', 'postie') ?></th>
612
- <?php $templateDir = get_option('siteurl') . '/' . PLUGINDIR . '/postie/templates'; ?>
613
- <td>
614
- <input type='hidden' id='postie-settings-selected_video1template' name='postie-settings[selected_video1template]'
615
- value="<?php echo esc_attr($selected_video1template) ?>" />
616
- <select name='video1templateselect' id='video1templateselect'
617
- onchange="changeStyle('video1TemplatePreview', 'postie-settings-video1template', 'video1templateselect', 'postie-settings-selected_video1template', 'hi.mp4');" />
618
- <?php
619
- include(POSTIE_ROOT . '/templates/video1_templates.php');
620
- $styleOptions = $video1Templates;
621
- $selected = $selected_video1template;
622
- foreach ($styleOptions as $key => $value) {
623
- if ($key != 'selected') {
624
- if ($key == $selected) {
625
- $select = ' selected=selected ';
626
- } else {
627
- $select = ' ';
628
- }
629
- if ($key == 'custom')
630
- $value = $video1template;
631
- echo '<option' . $select . 'value="' .
632
- esc_attr($value) . '" >' . $key . '</option>';
633
- }
634
- }
635
- ?>
636
- </select>
637
- <p class='description'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></p>
638
- <p class='description'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></p>
639
 
640
- <div style="margin-top: 10px; font-weight: bold;"><?php _e('Preview', 'postie'); ?></div>
641
- <div id='video1TemplatePreview'></div>
642
- <textarea onchange="changeStyle('video1TemplatePreview', 'postie-settings-video1template',
643
- 'video1templateselect', 'postie-settings-selected_video1template', 'hi.mp4', true);" cols='70' rows='7' id='postie-settings-video1template'
644
- name='postie-settings[video1template]'><?php echo esc_attr($video1template) ?></textarea>
645
- </td>
646
- </tr>
647
- <tr>
648
- <th scope="row"><?php _e('Video 1 file extensions', 'postie') ?></th>
649
- <td>
650
- <br/><input name='postie-settings[video1types]' type="text" id='postie-settings-video1types'
651
- value="<?php if ($video1types != '') echo esc_attr($video1types); ?>" size="40" />
652
- <p class='description'>
653
- <?php _e('Use video template 1 for files with these extensions (separated by commas)', 'postie') ?></p>
654
- </td>
655
- </tr>
656
- <tr><td colspan="2"><hr /></td></tr>
657
- <tr>
658
- <th scope='row'><?php _e('Video template 2', 'postie') ?></th>
659
- <td>
660
- <input type='hidden' id='postie-settings-selected_video2template' name='postie-settings[selected_video2template]'
661
- value="<?php echo esc_attr($selected_video2template) ?>" />
662
- <select name='video2templateselect' id='video2templateselect'
663
- onchange="changeStyle('video2TemplatePreview', 'postie-settings-video2template',
664
- 'video2templateselect', 'postie-settings-selected_video2template', 'hi.flv');" >
665
- <?php
666
- include(POSTIE_ROOT . '/templates/video2_templates.php');
667
- $styleOptions = $video2Templates;
668
- $selected = $selected_video2template;
669
- foreach ($styleOptions as $key => $value) {
670
- if ($key != 'selected') {
671
- if ($key == $selected) {
672
- $select = ' selected=selected ';
673
- } else {
674
- $select = ' ';
675
- }
676
- if ($key == 'custom')
677
- $value = $video2template;
678
- echo '<option' . $select . 'value="' . esc_attr($value) . '" >' . $key . '</option>';
679
- }
680
- }
681
- ?>
682
- </select>
683
- <p class='description'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></p>
684
- <p class='description'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></p>
685
-
686
- <div style="margin-top: 10px; font-weight: bold;"><?php _e('Preview', 'postie'); ?></div>
687
- <div id='video2TemplatePreview'></div>
688
- <textarea onchange="changeStyle('video2TemplatePreview', 'postie-settings-video2template',
689
- 'video2templateselect', 'postie-settings-selected_video2template', 'hi.flv', true);" cols='70' rows='7' id='postie-settings-video2template'
690
- name='postie-settings[video2template]'>
691
- <?php echo esc_attr($video2template) ?>
692
- </textarea>
693
- </td>
694
- </tr>
695
- <tr>
696
- <th scope="row"><?php _e('Video 2 file extensions', 'postie') ?></th>
697
- <td>
698
- <br/><input name='postie-settings[video2types]' type="text" id='postie-settings-video2types'
699
- value="<?php if ($video2types != '') echo esc_attr($video2types); ?>" size="40" />
700
- <p class='description'>
701
- <?php _e('Use video template 2 for files with these extensions (separated by commas)', 'postie') ?></p>
702
- </td>
703
- </tr>
704
- <tr><td colspan="2"><hr /></td></tr>
705
- <tr>
706
- <th scope='row'><?php _e('Audio template', 'postie') ?></th>
707
- <td>
708
- <input type='hidden' id='postie-settings-selected_audiotemplate' name='postie-settings[selected_audiotemplate]'
709
- value="<?php echo esc_attr($selected_audiotemplate) ?>" />
710
- <select name='audiotemplateselect' id='audiotemplateselect'
711
- onchange="changeStyle('audioTemplatePreview', 'postie-settings-audiotemplate',
712
- 'audiotemplateselect', 'postie-settings-selected_audiotemplate', 'funky.mp3', false);" >
713
- <?php
714
- include(POSTIE_ROOT . '/templates/audio_templates.php');
715
- $styleOptions = $audioTemplates;
716
- $selected = $selected_audiotemplate;
717
- foreach ($styleOptions as $key => $value) {
718
- if ($key != 'selected') {
719
- if ($key == $selected) {
720
- $select = ' selected=selected ';
721
- } else {
722
- $select = ' ';
723
- }
724
- if ($key == 'custom')
725
- $value = $audiotemplate;
726
- echo '<option' . $select . 'value="' .
727
- esc_attr($value) . '" >' . $key . '</option>';
728
- }
729
- }
730
- ?>
731
- </select>
732
- <p class='description'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></p>
733
- <p class='description'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></p>
734
-
735
- <div style="margin-top: 10px; font-weight: bold;"><?php _e('Preview', 'postie'); ?></div>
736
- <div id='audioTemplatePreview'></div>
737
- <textarea onchange="changeStyle('audioTemplatePreview', 'postie-settings-audiotemplate',
738
- 'audiotemplateselect', 'postie-settings-selected_audiotemplate', 'funky.mp3', true);" cols='70' rows='7' id='postie-settings-audiotemplate'
739
- name='postie-settings[audiotemplate]'><?php echo esc_attr($audiotemplate) ?></textarea>
740
- </td>
741
- </tr>
742
- <tr>
743
- <th scope="row"><?php _e('Audio file extensions', 'postie') ?></th>
744
- <td>
745
- <input name='postie-settings[audiotypes]' type="text" id='postie-settings-audiotypes' value="<?php echo esc_attr($audiotypes); ?>" size="40" />
746
- <p class='description'><?php _e('Use the audio template for files with these extensions (separated by commas)', 'postie') ?></p>
747
- </td>
748
- </tr>
749
- </table>
750
  </div>
751
 
752
- <!--
753
- ## Attachments
754
- -->
755
-
756
- <div id="simpleTabs-content-6" class="simpleTabs-content">
757
- <table class='form-table'>
758
- <?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')); ?>
759
- <?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')); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
760
 
761
- <tr>
762
- <th scope='row'><?php _e('Attachment icon set', 'postie') ?></th>
763
- <td>
764
- <input type='hidden' id='postie-settings-icon_set' name='postie-settings[icon_set]'
765
- value="<?php echo esc_attr($icon_set) ?>" />
 
 
766
 
767
- <?php
768
- $icon_sets = array('silver', 'black', 'white', 'custom', 'none');
769
- $icon_sizes = array(32, 48, 64);
770
- ?>
771
- <select name='icon_set_select' id='icon_set_select' onchange="changeIconSet(this);" >
772
- <?php
773
- $styleOptions = $icon_sets;
774
- $selected = $icon_set;
775
- foreach ($styleOptions as $key) {
776
- if ($key != 'selected') {
777
- if ($key == $selected) {
778
- $select = ' selected=selected ';
779
- } else {
780
- $select = ' ';
781
- }
782
- echo '<option' . $select . 'value="' . esc_attr($key) . '" >' . $key . '</option>';
783
- }
784
- }
785
- ?>
786
- </select>
787
- <div id='postie-settings-attachment_preview'></div>
788
- </td>
789
- </tr>
790
- <tr>
791
- <th scope='row'><?php _e('Attachment icon size (in pixels)', 'postie') ?></th>
792
- <td>
793
- <input type='hidden' id='postie-settings-icon_size' name='postie-settings[icon_size]'
794
- value="<?php echo esc_attr($icon_size) ?>" />
795
- <select name='icon_size_select' id='icon_size_select' onchange="changeIconSet(this, true);" >
796
- <?php
797
- $styleOptions = $icon_sizes;
798
- $selected = $icon_size;
799
- foreach ($styleOptions as $key) {
800
- if ($key != 'selected') {
801
- if ($key == $selected) {
802
- $select = ' selected=selected ';
803
- } else {
804
- $select = ' ';
805
- }
806
- echo '<option' . $select . 'value="' . esc_attr($key) . '" >' . $key . '</option>';
807
- }
808
- }
809
- ?>
810
- </select>
811
- </td>
812
- </tr>
813
- <tr>
814
- <th scope='row'><?php _e('Attachment template', 'postie') ?>:<br />
815
- </th>
816
- <td>
817
- <input type='hidden' id='postie-settings-selected_generaltemplate' name='postie-settings[selected_generaltemplate]'
818
- value="<?php echo esc_attr($selected_generaltemplate) ?>" />
819
- <select name='generaltemplateselect' id='generaltemplateselect'
820
- onchange="changeStyle('generalTemplatePreview', 'postie-settings-generaltemplate',
821
- 'generaltemplateselect', 'postie-settings-selected_generaltemplate', 'interesting_document.doc', false);" >
822
- <?php
823
- include(POSTIE_ROOT . '/templates/general_template.php');
824
- $styleOptions = $generalTemplates;
825
- $selected = $selected_generaltemplate;
826
- foreach ($styleOptions as $key => $value) {
827
- if ($key != 'selected') {
828
- if ($key == $selected) {
829
- $select = ' selected="selected" ';
830
- } else {
831
- $select = ' ';
832
- }
833
- if ($key == 'custom')
834
- $value = $generaltemplate;
835
- echo '<option' . $select . 'value="' . esc_attr($value) . '" >' . $key . '</option>';
836
- }
837
- }
838
- ?>
839
- </select>
840
- <p class='description'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></p>
841
- <p class='description'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></p>
842
 
843
- <div style="margin-top: 10px; font-weight: bold;">
844
- <?php _e('Preview', 'postie'); ?>
845
- </div>
846
- <div id='generalTemplatePreview'></div>
847
- <textarea onchange="changeStyle('generalTemplatePreview', 'postie-settings-generaltemplate', 'generaltemplateselect', 'postie-settings-selected_generaltemplate', 'interesting_document.doc', true);"
848
- cols='70' rows='7'
849
- id='postie-settings-generaltemplate'
850
- name='postie-settings[generaltemplate]'><?php echo esc_attr($generaltemplate) ?></textarea>
851
- </td>
852
- </tr>
853
- <?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')); ?>
854
- </table>
855
- </div>
856
- <div id="simpleTabs-content-7" class="simpleTabs-content">
857
- <div style="">
858
- <h3>Postie Support</h3>
859
- <p>Please use the Postie <a href="https://wordpress.org/support/plugin/postie" target="_blank">support forums</a></p>
860
- <h3>More Postie info</h3>
861
- <p>Visit <a href="http://postieplugin.com/" target="_blank">PostiePlugin.com</a> for lots of information and assistance
862
- including information for developers wanting to leverage/extend Postie.</p>
863
- </div>
864
- <div>
865
- <h3>Postie AddOns</h3>
866
- <p>There are a number of different AddOns available to extend Postie's functionality.
867
- See <a href='http://postieplugin.com/add-ons/' target='_blank'>the list</a> for more information.</p>
868
- <div>
869
- <div id='postie-addons'></div>
870
  </div>
 
871
  </div>
872
  </div>
873
-
874
-
875
- <p class="submit" style="clear: both;">
876
- <input type="hidden" name="action" value="update" />
877
- <input type="hidden" name="page_options" value="postie-settings" />
878
- <input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" class="button button-primary" />
879
- </p>
880
- </form>
881
- <form id="postie-options" name="postie-options" method="post">
882
- <input type="hidden" name="action" value="reset" />
883
- <input name="Submit" value="<?php _e("Reset Settings To Defaults", 'postie') ?>" type="submit" class='button'>
884
- <span>&nbsp;<?php _e('(Your Mail server settings will be retained)', 'postie') ?></span>
885
- </form>
886
  </div>
887
 
888
  <?php $iconDir = get_option('siteurl') . '/' . PLUGINDIR . '/postie/icons'; ?>
889
  <script type="text/javascript">
890
  jQuery(document).ready(function () {
891
- jQuery("#simpleTabs").simpleTabs({
892
- fadeSpeed: "medium", // @param : low, medium, fast
893
- defautContent: 1, // @param : number ( simpleTabs-nav-number)
894
- autoNav: "false", // @param : true or false
895
- closeTabs: "false" // @param : true or false;
 
 
 
 
896
  });
 
897
  jQuery("#simpleTabs-nav-7").click(function () {
898
  jQuery.get('http://postieplugin.com/feed/?post_type=download', function (data) {
899
- console.log(data);
900
  var h = '';
901
  jQuery(data).find("item").each(function () {
902
  var t = jQuery(this).find("title").text();
1
  <div class="wrap">
 
 
 
 
 
 
 
 
 
 
 
2
  <h2>
3
  <a style='text-decoration:none' href='admin.php?page=postie-settings'>
4
  <?php
78
  <div class="updated"><p><?php _e($messages[$_GET['message']], 'postie'); ?></p></div>
79
  <?php endif; ?>
80
 
81
+ <div id="poststuff">
82
+ <div id="post-body" class="metabox-holder columns-2">
83
+ <!-- main content -->
84
+ <div id="post-body-content" style="position: relative;">
85
+ <div class="meta-box-sortables ui-sortable">
86
+ <div class="inside">
87
+ <form name="postie-options" method="post" action='options.php' autocomplete="off">
88
+ <!-- fake fields are a workaround for chrome autofill getting the wrong fields -->
89
+ <input style="display:none" type="text" name="fakeusernameremembered"/>
90
+ <input style="display:none" type="password" name="fakepasswordremembered"/>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
+ <?php settings_fields('postie-settings'); ?>
93
+ <input type="hidden" name="action" value="config" />
94
+ <div id="simpleTabs">
95
+ <h2 class="nav-tab-wrapper">
96
+ <a href="#" id="simpleTabs-nav-1" data-tab="1" class="nav-tab nav-tab-active"><?php _e('Mailserver', 'postie') ?></a>
97
+ <a href="#" id="simpleTabs-nav-2" data-tab="2" class="nav-tab"><?php _e('User', 'postie') ?></a>
98
+ <a href="#" id="simpleTabs-nav-3" data-tab="3" class="nav-tab"><?php _e('Message', 'postie') ?></a>
99
+ <a href="#" id="simpleTabs-nav-4" data-tab="4" class="nav-tab"><?php _e('Image', 'postie') ?></a>
100
+ <a href="#" id="simpleTabs-nav-5" data-tab="5" class="nav-tab"><?php _e('Video and Audio', 'postie') ?></a>
101
+ <a href="#" id="simpleTabs-nav-6" data-tab="6" class="nav-tab"><?php _e('Attachments', 'postie') ?></a>
102
+ <a href="#" id="simpleTabs-nav-7" data-tab="7" class="nav-tab"><?php _e('Support', 'postie') ?></a>
103
+ </h2>
 
 
 
 
 
 
 
 
 
104
 
105
+ <?php include 'config_form_server.php'; ?>
 
 
 
 
 
 
 
 
106
 
107
+ <?php include 'config_form_user.php'; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
 
109
+ <?php include 'config_form_message.php'; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
 
111
+ <?php include 'config_form_image.php'; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
 
113
+ <?php include 'config_form_video.php'; ?>
 
 
 
 
 
114
 
115
+ <?php include 'config_form_attachments.php'; ?>
 
116
 
117
+ <?php include 'config_form_support.php'; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
 
120
+ <p class="submit" style="clear: both;">
121
+ <input type="hidden" name="action" value="update" />
122
+ <input type="hidden" name="page_options" value="postie-settings" />
123
+ <input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" class="button button-primary" />
124
+ </p>
125
+ </form>
126
+ </div>
127
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
  </div>
129
 
130
+ <!-- sidebar -->
131
+ <div id="postbox-container-1" class="postbox-container">
132
+ <div class="meta-box-sortables ui-sortable">
133
+
134
+ <div class="postbox">
135
+ <h3 class="hndle ui-sortable-handle"><span>Actions</span></h3>
136
+ <div class="inside">
137
+ <div class="submitbox">
138
+ <p><?php _e("To run the check mail script manually", 'postie'); ?></p>
139
+ <form name="postie-options" method='post'>
140
+ <input type="hidden" name="action" value="runpostie" />
141
+ <input name="Submit" value="<?php _e("Process Email", 'postie'); ?>" type="submit" class='button'>
142
+ </form>
143
+
144
+ <p><?php _e("To run the check mail script manually with full debug output", 'postie'); ?></p>
145
+ <form name="postie-options" method='post'>
146
+ <input type="hidden" name="action" value="runpostie-debug" />
147
+ <input name="Submit" value="<?php _e("Debug", 'postie'); ?>" type="submit" class='button'>
148
+ </form>
149
+
150
+ <p><?php _e("Test your configuration (save first)", 'postie'); ?></p>
151
+ <form name="postie-options" method="post">
152
+ <input type="hidden" name="action" value="test" />
153
+ <input name="Submit" value="<?php _e("Test Config", 'postie'); ?>" type="submit" class='button'>
154
+ </form>
155
+ </div>
156
+ </div>
157
+ </div>
158
 
159
+ <div class="postbox">
160
+ <h3 class="hndle ui-sortable-handle"><span>Getting Started</span></h3>
161
+ <div class="inside">
162
+ <p>Be sure and check out the <a href="http://postieplugin.com/getting-started/" target="_blank">getting started</a> guide.</p>
163
+ <p>Please use the Postie <a href="https://wordpress.org/support/plugin/postie" target="_blank">support forums</a> if you need help.</p>
164
+ </div>
165
+ </div>
166
 
167
+ <div class="postbox">
168
+ <h3 class="hndle ui-sortable-handle"><span>AddOns</span></h3>
169
+ <div class="inside">
170
+ <p>There are a number of different AddOns available to extend Postie's functionality.
171
+ See <a href='http://postieplugin.com/add-ons/' target='_blank'>the list</a> for more information.</p> </div>
172
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
 
174
+ <div class="postbox">
175
+ <h3 class="hndle ui-sortable-handle"><span>Donations</span></h3>
176
+
177
+ <div class="inside">
178
+ <p style="font-weight: bolder; margin-top: 0px; margin-bottom: 2px;"><?php _e("Please Donate, Every $ Helps!", 'postie'); ?></p>
179
+ <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>
180
+ <form style="" action="https://www.paypal.com/cgi-bin/webscr" method="post">
181
+ <input type="hidden" name="cmd" value="_s-xclick">
182
+ <input type="hidden" name="hosted_button_id" value="HPK99BJ88V4C2">
183
+ <div style="text-align:center;">
184
+ <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!">
185
+ </div>
186
+ </form>
187
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  </div>
189
+
190
  </div>
191
  </div>
192
+ <br class="clear">
193
+ </div>
194
+ </div>
 
 
 
 
 
 
 
 
 
 
195
  </div>
196
 
197
  <?php $iconDir = get_option('siteurl') . '/' . PLUGINDIR . '/postie/icons'; ?>
198
  <script type="text/javascript">
199
  jQuery(document).ready(function () {
200
+ jQuery('.simpleTabs-content').hide();
201
+ jQuery("#simpleTabs-content-1").show();
202
+
203
+ jQuery(".nav-tab").click(function (event) {
204
+ jQuery(".nav-tab").removeClass('nav-tab-active');
205
+ jQuery(event.currentTarget).addClass('nav-tab-active');
206
+ jQuery('.simpleTabs-content').hide();
207
+ tab = jQuery(event.currentTarget).data('tab');
208
+ jQuery("#simpleTabs-content-" + tab).show();
209
  });
210
+
211
  jQuery("#simpleTabs-nav-7").click(function () {
212
  jQuery.get('http://postieplugin.com/feed/?post_type=download', function (data) {
213
+ //console.log(data);
214
  var h = '';
215
  jQuery(data).find("item").each(function () {
216
  var t = jQuery(this).find("title").text();
config_form_attachments.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="simpleTabs-content-6" class="simpleTabs-content">
2
+ <table class='form-table'>
3
+ <?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')); ?>
4
+ <?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')); ?>
5
+
6
+ <tr>
7
+ <th scope='row'><?php _e('Attachment icon set', 'postie') ?></th>
8
+ <td>
9
+ <input type='hidden' id='postie-settings-icon_set' name='postie-settings[icon_set]'
10
+ value="<?php echo esc_attr($icon_set) ?>" />
11
+
12
+ <?php
13
+ $icon_sets = array('silver', 'black', 'white', 'custom', 'none');
14
+ $icon_sizes = array(32, 48, 64);
15
+ ?>
16
+ <select name='icon_set_select' id='icon_set_select' onchange="changeIconSet(this);" >
17
+ <?php
18
+ $styleOptions = $icon_sets;
19
+ $selected = $icon_set;
20
+ foreach ($styleOptions as $key) {
21
+ if ($key != 'selected') {
22
+ if ($key == $selected) {
23
+ $select = ' selected=selected ';
24
+ } else {
25
+ $select = ' ';
26
+ }
27
+ echo '<option' . $select . 'value="' . esc_attr($key) . '" >' . $key . '</option>';
28
+ }
29
+ }
30
+ ?>
31
+ </select>
32
+ <div id='postie-settings-attachment_preview'></div>
33
+ </td>
34
+ </tr>
35
+ <tr>
36
+ <th scope='row'><?php _e('Attachment icon size (in pixels)', 'postie') ?></th>
37
+ <td>
38
+ <input type='hidden' id='postie-settings-icon_size' name='postie-settings[icon_size]'
39
+ value="<?php echo esc_attr($icon_size) ?>" />
40
+ <select name='icon_size_select' id='icon_size_select' onchange="changeIconSet(this, true);" >
41
+ <?php
42
+ $styleOptions = $icon_sizes;
43
+ $selected = $icon_size;
44
+ foreach ($styleOptions as $key) {
45
+ if ($key != 'selected') {
46
+ if ($key == $selected) {
47
+ $select = ' selected=selected ';
48
+ } else {
49
+ $select = ' ';
50
+ }
51
+ echo '<option' . $select . 'value="' . esc_attr($key) . '" >' . $key . '</option>';
52
+ }
53
+ }
54
+ ?>
55
+ </select>
56
+ </td>
57
+ </tr>
58
+ <tr>
59
+ <th scope='row'><?php _e('Attachment template', 'postie') ?>:<br />
60
+ </th>
61
+ <td>
62
+ <input type='hidden' id='postie-settings-selected_generaltemplate' name='postie-settings[selected_generaltemplate]'
63
+ value="<?php echo esc_attr($selected_generaltemplate) ?>" />
64
+ <select name='generaltemplateselect' id='generaltemplateselect'
65
+ onchange="changeStyle('generalTemplatePreview', 'postie-settings-generaltemplate',
66
+ 'generaltemplateselect', 'postie-settings-selected_generaltemplate', 'interesting_document.doc', false);" >
67
+ <?php
68
+ include(POSTIE_ROOT . '/templates/general_template.php');
69
+ $styleOptions = $generalTemplates;
70
+ $selected = $selected_generaltemplate;
71
+ foreach ($styleOptions as $key => $value) {
72
+ if ($key != 'selected') {
73
+ if ($key == $selected) {
74
+ $select = ' selected="selected" ';
75
+ } else {
76
+ $select = ' ';
77
+ }
78
+ if ($key == 'custom')
79
+ $value = $generaltemplate;
80
+ echo '<option' . $select . 'value="' . esc_attr($value) . '" >' . $key . '</option>';
81
+ }
82
+ }
83
+ ?>
84
+ </select>
85
+ <p class='description'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></p>
86
+ <p class='description'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></p>
87
+
88
+ <div style="margin-top: 10px; font-weight: bold;">
89
+ <?php _e('Preview', 'postie'); ?>
90
+ </div>
91
+ <div id='generalTemplatePreview'></div>
92
+ <textarea onchange="changeStyle('generalTemplatePreview', 'postie-settings-generaltemplate', 'generaltemplateselect', 'postie-settings-selected_generaltemplate', 'interesting_document.doc', true);"
93
+ cols='70' rows='7'
94
+ id='postie-settings-generaltemplate'
95
+ name='postie-settings[generaltemplate]'><?php echo esc_attr($generaltemplate) ?></textarea>
96
+ </td>
97
+ </tr>
98
+ <?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')); ?>
99
+ </table>
100
+ </div>
config_form_image.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="simpleTabs-content-4" class="simpleTabs-content">
2
+ <table class='form-table'>
3
+
4
+ <?php
5
+ 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'));
6
+ echo BuildBooleanSelect(__("Include Featured Image in Post", 'postie'), "postie-settings[include_featured_image]", $include_featured_image, __("Should the featured image be included in the post. This only works if the 'Preferred Text Type' is 'Plain'", 'postie'));
7
+ 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'));
8
+ echo BuildSelect(__("Gallery Link Type", 'postie'), "postie-settings[auto_gallery_link]", $auto_gallery_link, array('Default', 'Post', 'File', 'None'), "Select the type of link the gallery should use");
9
+ 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'));
10
+ 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'));
11
+ 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'));
12
+ ?>
13
+ <tr>
14
+ <th scope="row"><?php _e('Image Place Holder Tag', 'postie') ?></th>
15
+ <td>
16
+ <input name='postie-settings[image_placeholder]' type="text" id='postie-settings-image_placeholder' value="<?php echo esc_attr($image_placeholder); ?>" size="50" /><br />
17
+ <p class='description'><?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') ?></p>
18
+ </td>
19
+ </tr>
20
+ <tr>
21
+ <th scope="row"><?php _e('Image Template', 'postie') ?></th>
22
+ <td>
23
+ <input type='hidden' id='postie-settings-selected_imagetemplate' name='postie-settings[selected_imagetemplate]'
24
+ value="<?php echo esc_attr($selected_imagetemplate) ?>" />
25
+ <select name='imagetemplateselect' id='imagetemplateselect'
26
+ onchange="changeStyle('imageTemplatePreview', 'postie-settings-imagetemplate',
27
+ 'imagetemplateselect', 'postie-settings-selected_imagetemplate', 'smiling.jpg');" >
28
+ <?php
29
+ include(POSTIE_ROOT . '/templates/image_templates.php');
30
+ $styleOptions = $imageTemplates;
31
+ $selected = $selected_imagetemplate;
32
+ foreach ($styleOptions as $key => $value) {
33
+ if ($key != 'selected') {
34
+ if ($key == $selected) {
35
+ $select = ' selected=selected ';
36
+ } else {
37
+ $select = ' ';
38
+ }
39
+ if ($key == 'custom')
40
+ $value = $imagetemplate;
41
+ echo '<option' . $select . 'value="' .
42
+ esc_attr($value) . '" >' . $key . '</option>';
43
+ }
44
+ }
45
+ ?>
46
+ </select>
47
+ <p class='description'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie'); ?></p>
48
+ <p class='description'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></p>
49
+ <p class='description'><?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'); ?></p>
50
+ <div style="margin-top: 10px; font-weight: bold;"><?php _e('Preview', 'postie'); ?></div>
51
+ <div id='imageTemplatePreview'></div>
52
+ <textarea onchange='changeStyle("imageTemplatePreview", "postie-settings-imagetemplate", "imagetemplateselect",
53
+ "postie-settings-selected_imagetemplate", "smiling.jpg", true);' cols='70' rows='7' id='postie-settings-imagetemplate' name='postie-settings[imagetemplate]'>
54
+ <?php echo esc_attr($imagetemplate) ?>
55
+ </textarea>
56
+ <div class='recommendation'>
57
+ <ul>
58
+ <li>{CAPTION} gets replaced with the caption you specified (if any)</li>
59
+ <li>{FILELINK} gets replaced with the url to the media</li>
60
+ <li>{FILENAME} gets replaced with the name of the attachment from the email</li>
61
+ <li>{FILEID} gets replaced with the ID of the media</li>
62
+ <li>{FULL} same as {FILELINK}</li>
63
+ <li>{HEIGHT} gets replaced with the height of the photo</li>
64
+ <li>{ID} gets replaced with the post id</li>
65
+ <li>{IMAGE} same as {FILELINK}</li>
66
+ <li>{LARGEHEIGHT} gets replaced with the height of a large image</li>
67
+ <li>{LARGEWIDTH} gets replaced with the width of a large image</li>
68
+ <li>{LARGE} gets replaced with the url to the large-sized image</li>
69
+ <li>{MEDIUMHEIGHT} gets replaced with the height of a medium image</li>
70
+ <li>{MEDIUMWIDTH} gets replaced with the width of a medium image</li>
71
+ <li>{MEDIUM} gets replaced with the url to the medium-sized image</li>
72
+ <li>{PAGELINK} gets replaced with the URL of the file in WordPress</li>
73
+ <li>{RELFILENAME} gets replaced with the relative path to the full-size image</li>
74
+ <li>{THUMBHEIGHT} gets replaced with the height of a thumbnail image</li>
75
+ <li>{THUMB} gets replaced with the url to the thumbnail image</li>
76
+ <li>{THUMBNAIL} same as {THUMB}</li>
77
+ <li>{THUMBWIDTH} gets replaced with the width of a thumbnail image</li>
78
+ <li>{TITLE} same as {FILENAME}</li>
79
+ <li>{URL} same as {FILELINK}</li>
80
+ <li>{WIDTH} gets replaced with width of the photo</li>
81
+ <li>{ICON} insert the icon for the attachment (for non-audio/image/video attachments only)</li>
82
+ </ul>
83
+ </div>
84
+ </td>
85
+ </tr>
86
+ </table>
87
+ </div>
config_form_message.php ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id = "simpleTabs-content-3" class = "simpleTabs-content">
2
+ <table class = 'form-table'>
3
+ <tr>
4
+ <th scope="row"><?php _e('Preferred Text Type', 'postie') ?> </th>
5
+ <td>
6
+ <select name='postie-settings[prefer_text_type]' id='postie-settings-prefer_text_type'>
7
+ <?php printf('<option value="plain" %s>plain</option>', ($prefer_text_type == "plain") ? "selected" : "") ?>
8
+ <?php printf('<option value="html" %s>html</option>', ($prefer_text_type == "html") ? "selected" : "") ?>
9
+ </select>
10
+ </td>
11
+ </tr>
12
+ <tr valign = "top">
13
+ <th scope = "row"><?php _e('Default category', 'postie') ?></th>
14
+ <td>
15
+ <?php
16
+ $defaultCat = $default_post_category;
17
+ $args = array('name' => 'postie-settings[default_post_category]', 'hierarchical' => 1, 'selected' => $defaultCat, 'hide_empty' => 0);
18
+ wp_dropdown_categories($args);
19
+ ?>
20
+ </tr>
21
+ <?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')); ?>
22
+
23
+ <tr valign="top">
24
+ <th scope="row">
25
+ <?php _e('Default tag(s)', 'postie') ?><br />
26
+ </th>
27
+ <td>
28
+ <input type='text' name='postie-settings[default_post_tags]' id='postie-settings-default_post_tags' value='<?php echo esc_attr($default_post_tags) ?>' />
29
+ <p class='description'><?php _e('separated by commas', 'postie') ?></p>
30
+ </td>
31
+ </tr>
32
+
33
+ <tr>
34
+ <th scope="row"><?php _e('Default Post Status', 'postie') ?> </th>
35
+ <td>
36
+ <select name='postie-settings[post_status]' id='postie-settings-post_status'>
37
+ <?php
38
+ $stati = get_post_stati();
39
+ //DebugEcho($config['post_status']);
40
+ //DebugDump($stati);
41
+ foreach ($stati as $status) {
42
+ $selected = "";
43
+ if ($config['post_status'] == $status) {
44
+ $selected = " selected='selected'";
45
+ }
46
+ echo "<option value='$status'$selected>$status</option>";
47
+ }
48
+ ?>
49
+ </select>
50
+ </td>
51
+ </tr>
52
+
53
+ <tr>
54
+ <th scope="row"><?php _e('Default Post Format', 'postie') ?> </th>
55
+ <td>
56
+ <select name='postie-settings[post_format]' id='postie-settings-post_format'>
57
+ <?php
58
+ $formats = get_theme_support('post-formats');
59
+ if (is_array($formats[0])) {
60
+ $formats = $formats[0];
61
+ } else {
62
+ $formats = array();
63
+ }
64
+ array_unshift($formats, "standard");
65
+ foreach ($formats as $format) {
66
+ $selected = "";
67
+ if ($config['post_format'] == $format) {
68
+ $selected = " selected='selected'";
69
+ }
70
+ echo "<option value='$format'$selected>$format</option>";
71
+ }
72
+ ?>
73
+ </select>
74
+ </td>
75
+ </tr>
76
+
77
+ <tr>
78
+ <th scope="row"><?php _e('Default Post Type', 'postie') ?> </th>
79
+ <td>
80
+ <select name='postie-settings[post_type]' id='postie-settings-post_type'>
81
+ <?php
82
+ $types = get_post_types();
83
+ //array_unshift($types, "standard");
84
+ foreach ($types as $type) {
85
+ $selected = "";
86
+ if ($config['post_type'] == $type) {
87
+ $selected = " selected='selected'";
88
+ }
89
+ echo "<option value='$type'$selected>$type</option>";
90
+ }
91
+ ?>
92
+ </select>
93
+ </td>
94
+ </tr>
95
+
96
+ <tr>
97
+ <th scope="row"><?php _e('Default Title', 'postie') ?> </th>
98
+ <td>
99
+ <input name='postie-settings[default_title]' type="text" id='postie-settings-default_title' value="<?php echo esc_attr($default_title); ?>" size="50" /><br />
100
+ </td>
101
+ </tr>
102
+
103
+ <?php echo BuildBooleanSelect(__("Treat Replies As", 'postie'), "postie-settings[reply_as_comment]", $reply_as_comment, "", array("comments", "new posts")); ?>
104
+ <?php echo BuildBooleanSelect(__("Strip Original Content from Replies", 'postie'), "postie-settings[strip_reply]", $strip_reply, "Only applicable if replies are trated as comments"); ?>
105
+
106
+ <?php echo BuildBooleanSelect(__("Forward Rejected Mail", 'postie'), "postie-settings[forward_rejected_mail]", $forward_rejected_mail); ?>
107
+ <?php echo BuildBooleanSelect(__("Allow Subject In Mail", 'postie'), "postie-settings[allow_subject_in_mail]", $allow_subject_in_mail, "Enclose the subject between '#' on the very first line. E.g. #this is my subject#"); ?>
108
+ <?php echo BuildBooleanSelect(__("Allow HTML In Mail Subject", 'postie'), "postie-settings[allow_html_in_subject]", $allow_html_in_subject); ?>
109
+ <?php echo BuildBooleanSelect(__("Allow HTML In Mail Body", 'postie'), "postie-settings[allow_html_in_body]", $allow_html_in_body); ?>
110
+ <tr>
111
+ <th scope="row"><?php _e('Text for Message Start', 'postie') ?> </th>
112
+ <td>
113
+ <input name='postie-settings[message_start]' type="text" id='postie-settings-message_start' value="<?php echo esc_attr($message_start); ?>" size="50" /><br />
114
+ <p class='description'><?php _e('Remove all text from the beginning of the message up to the point where this is found. Note this works best with "Plain" messages.', 'postie') ?></p>
115
+ </td>
116
+ </tr>
117
+ <tr>
118
+ <th scope="row"><?php _e('Text for Message End', 'postie') ?> </th>
119
+ <td>
120
+ <input name='postie-settings[message_end]' type="text" id='postie-settings-message_end' value="<?php echo esc_attr($message_end); ?>" size="50" /><br />
121
+ <p class='description'><?php _e('Remove all text from the point this is found to the end of the message. Note this works best with "Plain" messages.', 'postie') ?></p>
122
+ </td>
123
+ </tr>
124
+
125
+ <?php
126
+ echo BuildBooleanSelect(__("Filter newlines", 'postie'), "postie-settings[filternewlines]", $filternewlines, __("Whether to strip newlines from plain text. Set to no if using markdown or textitle syntax", 'postie'));
127
+ 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'));
128
+ echo BuildBooleanSelect(__("Return rejected mail to sender", 'postie'), "postie-settings[return_to_sender]", $return_to_sender);
129
+ ?>
130
+ <tr>
131
+ <th>
132
+ <?php _e("Send post confirmation email to", 'postie') ?>:
133
+ </th>
134
+ <td>
135
+ <select name='postie-settings[confirmation_email]' id='postie-settings-confirmation_email'>
136
+ <option value="sender" <?php echo($confirmation_email == "sender") ? "selected" : "" ?>><?php _e('sender', 'postie') ?></option>
137
+ <option value="admin" <?php echo ($confirmation_email == "admin") ? "selected" : "" ?>><?php _e('administrator', 'postie') ?></option>
138
+ <option value="both" <?php echo ($confirmation_email == "both") ? "selected" : "" ?>><?php _e('sender and administrator', 'postie') ?></option>
139
+ <option value="" <?php echo ($confirmation_email == "") ? "selected" : "" ?>><?php _e('none', 'postie') ?></option>
140
+ </select>
141
+ </td>
142
+ </tr>
143
+
144
+ <?php
145
+ echo BuildBooleanSelect(__("Automatically convert urls to links", 'postie'), "postie-settings[converturls]", $converturls);
146
+ ?>
147
+ <tr>
148
+ <th scope="row"><?php _e('Encoding for pages and feeds', 'postie') ?> </th>
149
+ <td>
150
+ <input name='postie-settings[message_encoding]' type="text" id='postie-settings-message_encoding' value="<?php echo esc_attr($message_encoding); ?>" size="10" />
151
+ <p class='description'><?php _e('The character set for your blog.', 'postie') ?></p>
152
+ <p class='description'>UTF-8 <?php _e("should handle ISO-8859-1 as well", 'postie'); ?></p>
153
+ </td>
154
+ </tr>
155
+ <?php echo BuildBooleanSelect(__("Decode Quoted Printable Data", 'postie'), "postie-settings[message_dequote]", $message_dequote); ?>
156
+ <?php echo BuildBooleanSelect(__("Drop The Signature From Mail", 'postie'), "postie-settings[drop_signature]", $drop_signature, __("Really only works with 'plain' format.")); ?>
157
+ <?php echo BuildTextArea(__("Signature Patterns", 'postie'), "postie-settings[sig_pattern_list]", $sig_pattern_list, __("Really only works with 'plain' format. Put each pattern on a separate line. Patterns are <a href='http://regex101.com/' target='_blank'>regular expressions</a> and are put inside /^{pattern}$/i", 'postie')); ?>
158
+ </table>
159
+ </div>
config_form_server.php ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="simpleTabs-content-1" class="simpleTabs-content">
2
+
3
+ <table class='form-table'>
4
+
5
+ <tr>
6
+ <th scope="row"><lable for="postie-settings-input_protocol"><?php _e('Mail Protocol', 'postie') ?></lable></th>
7
+ <td>
8
+ <select name='postie-settings[input_protocol]' id='postie-settings-input_protocol'>
9
+ <option value="pop3" <?php echo (($input_protocol == "pop3") ? " selected='selected' " : "") ?>>POP3</option>
10
+ <?php if (HasIMAPSupport(false)): ?>
11
+ <option value="imap" <?php echo ($input_protocol == "imap") ? "selected='selected' " : "" ?>>IMAP</option>
12
+ <option value="pop3-ssl" <?php echo ($input_protocol == "pop3-ssl") ? "selected='selected' " : "" ?>>POP3-SSL</option>
13
+ <option value="imap-ssl" <?php echo ($input_protocol == "imap-ssl") ? "selected='selected' " : "" ?>>IMAP-SSL</option>
14
+ <?php endif; ?>
15
+ </select>
16
+ <?php if (!HasIMAPSupport(false)): ?>
17
+ <span class="recommendation">IMAP/IMAP-SSL/POP3-SSL unavailable</span>
18
+ <?php endif; ?>
19
+ </td>
20
+ </tr>
21
+
22
+ <?php echo BuildBooleanSelect(__("Use Transport Layer Security (TLS)", 'postie'), 'postie-settings[email_tls]', $email_tls, __("Choose Yes if your server requires TLS", 'postie')); ?>
23
+
24
+ <tr>
25
+ <th scope="row"><label for="postie-settings-mail_server_port"><?php _e('Port', 'postie') ?></label></th>
26
+ <td valign="top">
27
+ <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" />
28
+ <p class='description'><?php _e("Standard Ports:", 'postie'); ?><br />
29
+ <?php _e("POP3", 'postie'); ?> - 110<br />
30
+ <?php _e("IMAP", 'postie'); ?> - 143<br />
31
+ <?php _e("IMAP-SSL", 'postie'); ?>- 993 <br />
32
+ <?php _e("POP3-SSL", 'postie'); ?> - 995 <br />
33
+ </p>
34
+ </td>
35
+ </tr>
36
+ <tr valign="top">
37
+ <th scope="row"><?php _e('Mail Server', 'postie') ?></th>
38
+ <td><input name='postie-settings[mail_server]' type="text" id='postie-settings-mail_server' value="<?php echo esc_attr($mail_server); ?>" size="40" />
39
+ </td>
40
+ </tr>
41
+ <tr valign="top">
42
+ <th scope="row"><?php _e('Mail Userid', 'postie') ?></th>
43
+ <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>
44
+ </tr>
45
+ <tr valign="top">
46
+ <th scope="row"><?php _e('Mail Password', 'postie') ?></th>
47
+ <td>
48
+ <input name='postie-settings[mail_password]' type="password" id='postie-settings-mail_password' autocomplete='off' value="<?php echo esc_attr($mail_password); ?>" size="40" />
49
+ </td>
50
+ </tr>
51
+ <tr>
52
+ <th scope="row"><?php _e('Postie Time Correction', 'postie') ?></th>
53
+ <td><input style="width: 70px;" name='postie-settings[time_offset]' type="number" step="0.5" id='postie-settings-time_offset' size="2" value="<?php echo esc_attr($time_offset); ?>" />
54
+ <?php _e('hours', 'postie') ?>
55
+ <p class='description'><?php _e("Should be the same as your normal offset, but this lets you adjust it in cases where that doesn't work.", 'postie'); ?></p>
56
+ </td>
57
+ </tr>
58
+ <tr>
59
+ <th>
60
+ <?php _e('Check for mail every', 'postie') ?>:
61
+ </th>
62
+ <td>
63
+ <select name='postie-settings[interval]' id='postie-settings-interval'>
64
+ <option value="weekly" <?php
65
+ if ($interval == "weekly") {
66
+ echo "selected='selected'";
67
+ }
68
+ ?>><?php _e('Once weekly', 'postie') ?>
69
+ </option>
70
+
71
+ <option value="daily"<?php
72
+ if ($interval == "daily") {
73
+ echo "selected='selected'";
74
+ }
75
+ ?>><?php _e('daily', 'postie') ?>
76
+ </option>
77
+
78
+ <option value="hourly" <?php
79
+ if ($interval == "hourly") {
80
+ echo "selected='selected'";
81
+ }
82
+ ?>><?php _e('hourly', 'postie') ?>
83
+ </option>
84
+
85
+ <option value="twiceperhour" <?php
86
+ if ($interval == "twiceperhour") {
87
+ echo "selected='selected'";
88
+ }
89
+ ?>><?php _e('twice per hour', 'postie') ?>
90
+ </option>
91
+
92
+ <option value="tenminutes" <?php
93
+ if ($interval == "tenminutes") {
94
+ echo "selected='selected'";
95
+ }
96
+ ?>><?php _e('every 10 minutes', 'postie') ?>
97
+ </option>
98
+
99
+ <option value="fiveminutes" <?php
100
+ if ($interval == "fiveminutes") {
101
+ echo "selected='selected'";
102
+ }
103
+ ?>><?php _e('every 5 minutes', 'postie') ?>
104
+ </option>
105
+
106
+ <option value="oneminute" <?php
107
+ if ($interval == "oneminute") {
108
+ echo "selected='selected'";
109
+ }
110
+ ?>><?php _e('every 1 minute', 'postie') ?>
111
+ </option>
112
+
113
+ <option value="thirtyseconds" <?php
114
+ if ($interval == "thirtyseconds") {
115
+ echo "selected='selected'";
116
+ }
117
+ ?>><?php _e('every 30 seconds', 'postie') ?>
118
+ </option>
119
+
120
+ <option value="fifteenseconds" <?php
121
+ if ($interval == "fifteenseconds") {
122
+ echo "selected='selected'";
123
+ }
124
+ ?>><?php _e('every 15 seconds', 'postie') ?>
125
+ </option>
126
+
127
+ <option value="manual" <?php
128
+ if ($interval == "manual") {
129
+ echo "selected='selected'";
130
+ }
131
+ ?>><?php _e('check manually', 'postie') ?>
132
+ </option>
133
+ </select>
134
+ </td>
135
+ </tr>
136
+ <tr>
137
+ <th>
138
+ <?php _e('Maximum number of emails to process', 'postie'); ?>
139
+ </th>
140
+ <td>
141
+ <select name='postie-settings[maxemails]' id='postie-settings-maxemails'>
142
+ <option value="0" <?php if ($maxemails == '0') echo "selected='selected'" ?>><?php _e('All', 'postie'); ?></option>
143
+ <option value="1" <?php if ($maxemails == '1') echo "selected='selected'" ?>>1</option>
144
+ <option value="2" <?php if ($maxemails == '2') echo "selected='selected'" ?>>2</option>
145
+ <option value="5" <?php if ($maxemails == '5') echo "selected='selected'" ?>>5</option>
146
+ <option value="10" <?php if ($maxemails == '10') echo "selected='selected'" ?>>10</option>
147
+ <option value="25" <?php if ($maxemails == '25') echo "selected='selected'" ?>>25</option>
148
+ <option value="50" <?php if ($maxemails == '50') echo "selected='selected'" ?>>50</option>
149
+ </select>
150
+ </td>
151
+ </tr>
152
+ <?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')); ?>
153
+ <?php echo BuildBooleanSelect(__("Ignore mail state", 'postie'), 'postie-settings[ignore_mail_state]', $ignore_mail_state, __("Ignore whether the mails is 'read' or 'unread' If 'No' then only unread messages are processed.", 'postie')); ?>
154
+
155
+ <?php echo BuildBooleanSelect(__("Enable Error Logging", 'postie'), 'postie-settings[postie_log_error]', $postie_log_error, __("Log error messages to the web server error log.", 'postie')); ?>
156
+ <?php echo BuildBooleanSelect(__("Enable Debug Logging", 'postie'), 'postie-settings[postie_log_debug]', $postie_log_debug, __("Log debug messages to the web server error log.", 'postie')); ?>
157
+
158
+ </table>
159
+ </div>
config_form_support.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="simpleTabs-content-7" class="simpleTabs-content">
2
+ <div style="">
3
+ <h3>Postie Support</h3>
4
+ <p>Please use the Postie <a href="https://wordpress.org/support/plugin/postie" target="_blank">support forums</a></p>
5
+ <h3>More Postie info</h3>
6
+ <p>Visit <a href="http://postieplugin.com/" target="_blank">PostiePlugin.com</a> for lots of information and assistance
7
+ including information for developers wanting to leverage/extend Postie.</p>
8
+ </div>
9
+ <div>
10
+ <h3>Postie AddOns</h3>
11
+ <p>There are a number of different AddOns available to extend Postie's functionality.
12
+ See <a href='http://postieplugin.com/add-ons/' target='_blank'>the list</a> for more information.</p>
13
+ <div>
14
+ <div id='postie-addons'></div>
15
+ </div>
16
+ </div>
17
+ </div>
config_form_user.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="simpleTabs-content-2" class="simpleTabs-content">
2
+ <table class='form-table'>
3
+
4
+ <tr>
5
+ <th scope="row">
6
+ <?php _e('Roles That Can Post', 'postie') ?><br />
7
+ </th>
8
+ <td>
9
+ <table class="checkbox-table">
10
+ <?php
11
+ foreach ($wp_roles->role_names as $roleId => $name) {
12
+ $name = translate_user_role($name);
13
+ $role = $wp_roles->get_role($roleId);
14
+ if ($roleId != "administrator") {
15
+ ?>
16
+ <tr>
17
+ <td>
18
+ <input type='checkbox' value='1' name='postie-settings[role_access][<?php echo $roleId; ?>]' <?php echo ($role->has_cap("post_via_postie")) ? 'checked="checked"' : "" ?> >
19
+ <?php echo $name; ?>
20
+ </td>
21
+ </tr>
22
+ <?php
23
+ } else {
24
+ ?>
25
+ <tr>
26
+ <td>
27
+ <input type='checkbox' value='1' disabled='disabled' checked='checked' > <?php echo $name; ?>
28
+ </td>
29
+ </tr>
30
+ <?php
31
+ }
32
+ }
33
+ ?>
34
+ <p class='description'><?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'); ?></p>
35
+
36
+ </table>
37
+ </td>
38
+ </tr>
39
+
40
+ <?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')); ?>
41
+ <tr>
42
+ <th scope="row"><?php _e('Default Poster', 'postie') ?></th>
43
+ <td>
44
+ <select name='postie-settings[admin_username]' id='postie-settings[admin_username]'>
45
+ <?php
46
+ $adminusers = get_users('orderby=nicename&role=administrator');
47
+ foreach ($config['role_access'] as $userrole => $value) {
48
+ $adminusers = array_merge($adminusers, get_users("orderby=nicename&role=$userrole"));
49
+ }
50
+ foreach ($adminusers as $user) {
51
+ $selected = "";
52
+ if ($user->user_login == $admin_username) {
53
+ $selected = " selected='selected'";
54
+ }
55
+ echo "<option value='$user->user_login'$selected>$user->user_nicename ($user->user_login)</option>";
56
+ }
57
+ ?>
58
+ </select>
59
+ <p class='description'><?php _e("This will be the poster if you allow posting from emails that are not a registered blog user.", 'postie'); ?></p>
60
+ </td>
61
+ </tr>
62
+ <?php echo BuildBooleanSelect(__("Force User Login", 'postie'), "postie-settings[force_user_login]", $force_user_login, __("Changing this to yes will cause Postie to try and login as the 'from' user if they exist. This should be set to 'Yes' if you use custom taxonomies in the subject line.", 'postie')); ?>
63
+ <?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')); ?>
64
+
65
+ </table>
66
+ </div>
config_form_video.php ADDED
@@ -0,0 +1,146 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="simpleTabs-content-5" class="simpleTabs-content">
2
+ <table class='form-table'>
3
+ <?php
4
+ echo BuildBooleanSelect(__("Use shortcode for embedding video (youtube or vimeo)", 'postie'), "postie-settings[shortcode]", $shortcode, "Only change this value to 'Yes' if you have another plugin that will process the shortcode.");
5
+ ?>
6
+ <tr>
7
+ <th scope='row'><?php _e('Video template 1', 'postie') ?></th>
8
+ <?php $templateDir = get_option('siteurl') . '/' . PLUGINDIR . '/postie/templates'; ?>
9
+ <td>
10
+ <input type='hidden' id='postie-settings-selected_video1template' name='postie-settings[selected_video1template]'
11
+ value="<?php echo esc_attr($selected_video1template) ?>" />
12
+ <select name='video1templateselect' id='video1templateselect'
13
+ onchange="changeStyle('video1TemplatePreview', 'postie-settings-video1template', 'video1templateselect', 'postie-settings-selected_video1template', 'hi.mp4');" />
14
+ <?php
15
+ include(POSTIE_ROOT . '/templates/video1_templates.php');
16
+ $styleOptions = $video1Templates;
17
+ $selected = $selected_video1template;
18
+ foreach ($styleOptions as $key => $value) {
19
+ if ($key != 'selected') {
20
+ if ($key == $selected) {
21
+ $select = ' selected=selected ';
22
+ } else {
23
+ $select = ' ';
24
+ }
25
+ if ($key == 'custom')
26
+ $value = $video1template;
27
+ echo '<option' . $select . 'value="' .
28
+ esc_attr($value) . '" >' . $key . '</option>';
29
+ }
30
+ }
31
+ ?>
32
+ </select>
33
+ <p class='description'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></p>
34
+ <p class='description'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></p>
35
+
36
+ <div style="margin-top: 10px; font-weight: bold;"><?php _e('Preview', 'postie'); ?></div>
37
+ <div id='video1TemplatePreview'></div>
38
+ <textarea onchange="changeStyle('video1TemplatePreview', 'postie-settings-video1template',
39
+ 'video1templateselect', 'postie-settings-selected_video1template', 'hi.mp4', true);" cols='70' rows='7' id='postie-settings-video1template'
40
+ name='postie-settings[video1template]'><?php echo esc_attr($video1template) ?></textarea>
41
+ </td>
42
+ </tr>
43
+ <tr>
44
+ <th scope="row"><?php _e('Video 1 file extensions', 'postie') ?></th>
45
+ <td>
46
+ <br/><input name='postie-settings[video1types]' type="text" id='postie-settings-video1types'
47
+ value="<?php if ($video1types != '') echo esc_attr($video1types); ?>" size="40" />
48
+ <p class='description'>
49
+ <?php _e('Use video template 1 for files with these extensions (separated by commas)', 'postie') ?></p>
50
+ </td>
51
+ </tr>
52
+ <tr><td colspan="2"><hr /></td></tr>
53
+ <tr>
54
+ <th scope='row'><?php _e('Video template 2', 'postie') ?></th>
55
+ <td>
56
+ <input type='hidden' id='postie-settings-selected_video2template' name='postie-settings[selected_video2template]'
57
+ value="<?php echo esc_attr($selected_video2template) ?>" />
58
+ <select name='video2templateselect' id='video2templateselect'
59
+ onchange="changeStyle('video2TemplatePreview', 'postie-settings-video2template',
60
+ 'video2templateselect', 'postie-settings-selected_video2template', 'hi.flv');" >
61
+ <?php
62
+ include(POSTIE_ROOT . '/templates/video2_templates.php');
63
+ $styleOptions = $video2Templates;
64
+ $selected = $selected_video2template;
65
+ foreach ($styleOptions as $key => $value) {
66
+ if ($key != 'selected') {
67
+ if ($key == $selected) {
68
+ $select = ' selected=selected ';
69
+ } else {
70
+ $select = ' ';
71
+ }
72
+ if ($key == 'custom')
73
+ $value = $video2template;
74
+ echo '<option' . $select . 'value="' . esc_attr($value) . '" >' . $key . '</option>';
75
+ }
76
+ }
77
+ ?>
78
+ </select>
79
+ <p class='description'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></p>
80
+ <p class='description'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></p>
81
+
82
+ <div style="margin-top: 10px; font-weight: bold;"><?php _e('Preview', 'postie'); ?></div>
83
+ <div id='video2TemplatePreview'></div>
84
+ <textarea onchange="changeStyle('video2TemplatePreview', 'postie-settings-video2template',
85
+ 'video2templateselect', 'postie-settings-selected_video2template', 'hi.flv', true);" cols='70' rows='7' id='postie-settings-video2template'
86
+ name='postie-settings[video2template]'>
87
+ <?php echo esc_attr($video2template) ?>
88
+ </textarea>
89
+ </td>
90
+ </tr>
91
+ <tr>
92
+ <th scope="row"><?php _e('Video 2 file extensions', 'postie') ?></th>
93
+ <td>
94
+ <br/><input name='postie-settings[video2types]' type="text" id='postie-settings-video2types'
95
+ value="<?php if ($video2types != '') echo esc_attr($video2types); ?>" size="40" />
96
+ <p class='description'>
97
+ <?php _e('Use video template 2 for files with these extensions (separated by commas)', 'postie') ?></p>
98
+ </td>
99
+ </tr>
100
+ <tr><td colspan="2"><hr /></td></tr>
101
+ <tr>
102
+ <th scope='row'><?php _e('Audio template', 'postie') ?></th>
103
+ <td>
104
+ <input type='hidden' id='postie-settings-selected_audiotemplate' name='postie-settings[selected_audiotemplate]'
105
+ value="<?php echo esc_attr($selected_audiotemplate) ?>" />
106
+ <select name='audiotemplateselect' id='audiotemplateselect'
107
+ onchange="changeStyle('audioTemplatePreview', 'postie-settings-audiotemplate',
108
+ 'audiotemplateselect', 'postie-settings-selected_audiotemplate', 'funky.mp3', false);" >
109
+ <?php
110
+ include(POSTIE_ROOT . '/templates/audio_templates.php');
111
+ $styleOptions = $audioTemplates;
112
+ $selected = $selected_audiotemplate;
113
+ foreach ($styleOptions as $key => $value) {
114
+ if ($key != 'selected') {
115
+ if ($key == $selected) {
116
+ $select = ' selected=selected ';
117
+ } else {
118
+ $select = ' ';
119
+ }
120
+ if ($key == 'custom')
121
+ $value = $audiotemplate;
122
+ echo '<option' . $select . 'value="' .
123
+ esc_attr($value) . '" >' . $key . '</option>';
124
+ }
125
+ }
126
+ ?>
127
+ </select>
128
+ <p class='description'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></p>
129
+ <p class='description'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></p>
130
+
131
+ <div style="margin-top: 10px; font-weight: bold;"><?php _e('Preview', 'postie'); ?></div>
132
+ <div id='audioTemplatePreview'></div>
133
+ <textarea onchange="changeStyle('audioTemplatePreview', 'postie-settings-audiotemplate',
134
+ 'audiotemplateselect', 'postie-settings-selected_audiotemplate', 'funky.mp3', true);" cols='70' rows='7' id='postie-settings-audiotemplate'
135
+ name='postie-settings[audiotemplate]'><?php echo esc_attr($audiotemplate) ?></textarea>
136
+ </td>
137
+ </tr>
138
+ <tr>
139
+ <th scope="row"><?php _e('Audio file extensions', 'postie') ?></th>
140
+ <td>
141
+ <input name='postie-settings[audiotypes]' type="text" id='postie-settings-audiotypes' value="<?php echo esc_attr($audiotypes); ?>" size="40" />
142
+ <p class='description'><?php _e('Use the audio template for files with these extensions (separated by commas)', 'postie') ?></p>
143
+ </td>
144
+ </tr>
145
+ </table>
146
+ </div>
css/simpleTabs.css DELETED
@@ -1,37 +0,0 @@
1
- #simpleTabs {
2
- width: 98%;
3
- border: 1px solid lightgrey;
4
- border-top: none;
5
- margin-top: 10px;
6
- margin-bottom: 10px;
7
- }
8
- .simpleTabs-nav ul{
9
- overflow: hidden;
10
- list-style: none;
11
- margin: 0;
12
- padding: 0;
13
- background: lightgrey;
14
- }
15
- .simpleTabs-nav li{
16
- float: left;
17
- padding: 5px 15px;
18
- color: #6d6d6d;
19
- cursor: pointer;
20
- text-align: center;
21
- margin-bottom: 0px;
22
- }
23
- .simpleTabs-nav li:hover{
24
- background: lightgrey;
25
- }
26
- .simpleTabs-nav li.close{
27
- float: right;
28
- }
29
- .simpleTabs-nav li.actif{
30
- color: #fff;
31
- font-weight: bold;
32
- background:#6D6D6D url(../images/menu-bits.gif) repeat-x scroll left top;
33
- }
34
- .simpleTabs-content{
35
- clear: both;
36
- padding: 10px;
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.7.21 (2015-10-27) =
31
  * Refix bug where "Ignore mail state" setting was being ignored
32
 
27
  Attachments are now processed in the order they were attached.
28
 
29
  == CHANGELOG ==
30
+ = 1.7.22 (2015-11-09) =
31
+ * Update admin screen to match current WP style
32
+ * Remove dependence on simple tabs jQuery-UI library and use WP admin tab style
33
+ * Remove email password from logging
34
+
35
  = 1.7.21 (2015-10-27) =
36
  * Refix bug where "Ignore mail state" setting was being ignored
37
 
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.3.0
8
  Tested up to: 4.3.1
9
- Stable tag: 1.7.21
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.3.0
8
  Tested up to: 4.3.1
9
+ Stable tag: 1.7.22
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
js/simpleTabs.jquery.js DELETED
@@ -1,74 +0,0 @@
1
- /**
2
- * simpleTabs ( http://supercanard.phpnet.org/jquery-test/simpleTabs/ )
3
- * plugin jQuery pour afficher des bôites d'onglet.
4
- *
5
- * Version 1.0
6
- *
7
- * Auteur : Jonathan Coulet ( j.coulet@gmail.com )
8
- *
9
- **/
10
- (function($){
11
- $.fn.simpleTabs = function(option){
12
- // Param plugin
13
- var param = jQuery.extend({
14
- fadeSpeed: "medium", // @param : low, medium, fast
15
- defautContent: 1, // @param : number ( simpleTabs-nav-number)
16
- autoNav: "false", // @param : true or false
17
- closeTabs : "true" // @param : true or false;
18
- }, option);
19
- $(this).each(function() {
20
- // Initialisation
21
- var $this = this;
22
- var $thisId = "#"+this.id;
23
- var nbTab = $($thisId+" > div").size();
24
- autoNav();
25
- showCloseTabs();
26
- hideAll();
27
- changeContent(param.defautContent);
28
- // Fonctions
29
- function hideAll(){
30
- // Masque tous les content
31
- $($thisId+" .simpleTabs-content").hide();
32
- }
33
- function changeContent(indice){
34
- // Masque tous les content - Supprime la classe actif de tous les onglets
35
- // Ajoute la classe actif à l'onglet cliqué - Affiche le content ciblé - Execute showCloseTabs
36
- hideAll();
37
- $($thisId+" .simpleTabs-nav li").removeClass("actif");
38
- $($thisId+" #simpleTabs-nav-"+indice).addClass("actif");
39
- $($thisId+" #simpleTabs-content-"+indice).fadeIn(param.fadeSpeed);
40
- showCloseTabs();
41
- }
42
- function autoNav(){
43
- // Génère les onglets automatiquement
44
- if(param.autoNav == "true"){
45
- var listeNav = '';
46
- for(i=1; i!=nbTab; i++){
47
- listeNav = listeNav+'<li id="simpleTabs-nav-'+i+'">'+i+'</li>';
48
- }
49
- $($thisId+" .simpleTabs-nav").append('<ul>'+listeNav+'</ul>');
50
- }
51
- }
52
- function showCloseTabs(){
53
- // Génére un bouton de fermeture générale des content
54
- if(param.closeTabs == "true"){
55
- if($($thisId+" .simpleTabs-nav li.close").size() == 0){
56
- $($thisId+" .simpleTabs-nav ul").append("<li title=\"Fermer tous les onglets\" class=\"close\">x</li>");
57
- }
58
- }
59
- }
60
- // Exec
61
- $($thisId+" .simpleTabs-nav li").click(function(){
62
- var numContent = this.id.substr(this.id.length-1,this.id.length);
63
- changeContent(numContent);
64
- });
65
- // test function closeTabs
66
- $($thisId+" .simpleTabs-nav li.close").click(function(){
67
- hideAll();
68
- $($thisId+" .simpleTabs-nav li").removeClass("actif");
69
- $($thisId+" .simpleTabs-nav li.close").remove();
70
- //alert($($thisId+" .simpleTabs-nav li.close").size());
71
- });
72
- });
73
- }
74
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
postie-functions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- $Id: postie-functions.php 1274225 2015-10-27 19:29:28Z WayneAllen $
4
  */
5
 
6
  class PostiePostModifiers {
@@ -763,7 +763,7 @@ function FetchMail($server = NULL, $port = NULL, $email = NULL, $password = NULL
763
  return $emails;
764
  }
765
  if ($server == "pop.gmail.com") {
766
- EchoError("MAKE SURE POP IS TURNED ON IN SETTING AT Gmail");
767
  }
768
  switch (strtolower($protocol)) {
769
  case 'smtp': //direct
@@ -1443,9 +1443,7 @@ function ValidatePoster(&$mimeDecodedEmail, $config) {
1443
  DebugEcho("ValidatePoster: found user '$poster'");
1444
  }
1445
 
1446
- $validSMTP = isValidSmtpServer($mimeDecodedEmail, $smtp);
1447
-
1448
- if (!$poster || !$validSMTP) {
1449
  EchoError('Invalid sender: ' . htmlentities($from) . "! Not adding email!");
1450
  if ($forward_rejected_mail) {
1451
  $admin_email = get_option("admin_email");
@@ -1471,25 +1469,6 @@ function ValidatePoster(&$mimeDecodedEmail, $config) {
1471
  return $poster;
1472
  }
1473
 
1474
- function isValidSmtpServer($mimeDecodedEmail, $smtpservers) {
1475
- if (empty($smtpservers)) {
1476
- return true;
1477
- }
1478
-
1479
- foreach ((array) $mimeDecodedEmail->headers['received'] as $received) {
1480
- EchoError("isValidSmtpServer: checking header $received");
1481
- foreach ($smtpservers as $smtp) {
1482
- if (stristr($received, $smtp) !== false) {
1483
- DebugEcho("isValidSmtpServer: Sent from valid SMTP server.");
1484
- return true;
1485
- }
1486
- }
1487
- }
1488
-
1489
- EchoError("isValidSmtpServer: Sent from invalid SMTP server.");
1490
- return false;
1491
- }
1492
-
1493
  /**
1494
  * Looks at the content for the start of the message and removes everything before that
1495
  * If the pattern is not found everything is returned
@@ -3643,7 +3622,10 @@ function postie_get_mail() {
3643
  DebugEcho(__("memory at start of email processing:", 'postie') . memory_get_usage());
3644
  }
3645
 
3646
- DebugDump($config);
 
 
 
3647
 
3648
  //loop through messages
3649
  $message_number = 0;
1
  <?php
2
  /*
3
+ $Id: postie-functions.php 1282808 2015-11-09 21:36:41Z WayneAllen $
4
  */
5
 
6
  class PostiePostModifiers {
763
  return $emails;
764
  }
765
  if ($server == "pop.gmail.com") {
766
+ DebugEcho("MAKE SURE POP IS TURNED ON IN SETTING AT Gmail");
767
  }
768
  switch (strtolower($protocol)) {
769
  case 'smtp': //direct
1443
  DebugEcho("ValidatePoster: found user '$poster'");
1444
  }
1445
 
1446
+ if (!$poster) {
 
 
1447
  EchoError('Invalid sender: ' . htmlentities($from) . "! Not adding email!");
1448
  if ($forward_rejected_mail) {
1449
  $admin_email = get_option("admin_email");
1469
  return $poster;
1470
  }
1471
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1472
  /**
1473
  * Looks at the content for the start of the message and removes everything before that
1474
  * If the pattern is not found everything is returned
3622
  DebugEcho(__("memory at start of email processing:", 'postie') . memory_get_usage());
3623
  }
3624
 
3625
+ //don't output the password
3626
+ $tmp_config=$config;
3627
+ unset($tmp_config['mail_password']);
3628
+ DebugDump($tmp_config);
3629
 
3630
  //loop through messages
3631
  $message_number = 0;
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.7.21
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
@@ -28,12 +28,12 @@
28
  */
29
 
30
  /*
31
- $Id: postie.php 1274225 2015-10-27 19:29:28Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib_autolink.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
35
 
36
- define('POSTIE_VERSION', '1.7.21');
37
  define("POSTIE_ROOT", dirname(__FILE__));
38
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
39
 
@@ -127,7 +127,6 @@ function postie_parse_request($wp) {
127
 
128
  function postie_admin_init() {
129
  wp_register_style('postie-style', plugins_url('css/style.css', __FILE__));
130
- wp_register_style('postie-simpleTabs', plugins_url('css/simpleTabs.css', __FILE__));
131
  register_setting('postie-settings', 'postie-settings', 'config_ValidateSettings');
132
  }
133
 
@@ -148,9 +147,7 @@ function postie_admin_page() {
148
  }
149
 
150
  function postie_admin_styles() {
151
- wp_enqueue_script('loadjs', plugins_url('js/simpleTabs.jquery.js', __FILE__));
152
  wp_enqueue_style('postie-style');
153
- wp_enqueue_style('postie-simpleTabs');
154
  }
155
 
156
  /*
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.7.22
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
28
  */
29
 
30
  /*
31
+ $Id: postie.php 1282808 2015-11-09 21:36:41Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib_autolink.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
35
 
36
+ define('POSTIE_VERSION', '1.7.22');
37
  define("POSTIE_ROOT", dirname(__FILE__));
38
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
39
 
127
 
128
  function postie_admin_init() {
129
  wp_register_style('postie-style', plugins_url('css/style.css', __FILE__));
 
130
  register_setting('postie-settings', 'postie-settings', 'config_ValidateSettings');
131
  }
132
 
147
  }
148
 
149
  function postie_admin_styles() {
 
150
  wp_enqueue_style('postie-style');
 
151
  }
152
 
153
  /*
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.3.0
8
  Tested up to: 4.3.1
9
- Stable tag: 1.7.21
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -235,6 +235,11 @@ All script, style and body tags are stripped from html emails.
235
  Attachments are now processed in the order they were attached.
236
 
237
  == CHANGELOG ==
 
 
 
 
 
238
  = 1.7.21 (2015-10-27) =
239
  * Refix bug where "Ignore mail state" setting was being ignored
240
 
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.3.1
9
+ Stable tag: 1.7.22
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
235
  Attachments are now processed in the order they were attached.
236
 
237
  == CHANGELOG ==
238
+ = 1.7.22 (2015-11-09) =
239
+ * Update admin screen to match current WP style
240
+ * Remove dependence on simple tabs jQuery-UI library and use WP admin tab style
241
+ * Remove email password from logging
242
+
243
  = 1.7.21 (2015-10-27) =
244
  * Refix bug where "Ignore mail state" setting was being ignored
245