Version Description
(2013.01.17) = * Updated sample plugin for extending Postie. * Updated documentation for template variables. * Fixed a bug where text/plain attachments were not being treated as attachments. * Look for and include filterPostie.php in wp-content if it exists. (used for custom filters so they don't get deleted on upgrades) * Cleanup of settings screen layout. * Added additional error logging for mail connections.
Download this release
Release Info
Developer | WayneAllen |
Plugin | Postie |
Version | 1.4.27 |
Comparing to | |
See all releases |
Code changes from version 1.4.26 to 1.4.27
- config_form.php +28 -13
- docs/Changes.txt +8 -0
- docs/FAQ.txt +3 -0
- docs/Postie.txt +1 -1
- docs/TODO.txt +41 -0
- docs/Usage.txt +21 -6
- filterPostie.php.sample +15 -4
- get_mail.php +8 -0
- postie-functions.php +72 -70
- postie.php +3 -29
- postieIMAP.php +9 -1
- readme.html +20 -6
- readme.txt +35 -9
- test/inlineimageTest.php +3 -3
- test/postie-functionsTest.php +0 -1
config_form.php
CHANGED
@@ -284,10 +284,12 @@
|
|
284 |
<?php echo BuildTextArea("Authorized Addresses", "postie-settings[authorized_addresses]", $authorized_addresses, "Put each email address on a single line. Posts from emails in this list will be treated as if they came from the admin. If you would prefer to have users post under their own name - create a WordPress user with the correct access level."); ?>
|
285 |
<tr>
|
286 |
<th width="33%" valign="top" scope="row">
|
287 |
-
<?php _e('Admin username:') ?>
|
|
|
|
|
288 |
<td>
|
289 |
-
<input name='postie-settings[admin_username]' type="text" id='postie-settings-admin_username'
|
290 |
-
|
291 |
</tr>
|
292 |
</table>
|
293 |
</div>
|
@@ -409,6 +411,7 @@
|
|
409 |
<tr>
|
410 |
<th width="33%" valign="top" scope="row"><?php _e('Image Template', 'postie') ?><br />
|
411 |
<span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie'); ?></span><br /><br />
|
|
|
412 |
<span class='recommendation'><?php _e('Sizes for thumbnail, medium, and large images can be chosen in the <a href="options-media.php">Media Settings</a>. The samples here use the default sizes, and will not reflect the sizes you have chosen.', 'postie'); ?></span>
|
413 |
</th>
|
414 |
<td>
|
@@ -456,8 +459,11 @@
|
|
456 |
<div id="simpleTabs-content-5" class="simpleTabs-content">
|
457 |
<table class='form-table'>
|
458 |
|
459 |
-
<tr
|
460 |
-
|
|
|
|
|
|
|
461 |
<?php $templateDir = get_option('siteurl') . '/' . PLUGINDIR . '/postie/templates'; ?>
|
462 |
<td>
|
463 |
<input type='hidden' id='postie-settings-selected_video1template' name='postie-settings[selected_video1template]'
|
@@ -499,8 +505,12 @@
|
|
499 |
<input name='postie-settings[video1types]' type="text" id='postie-settings-video1types'
|
500 |
value="<?php if ($video1types != '') echo $video1types; ?>" size="40" /> </td>
|
501 |
</tr>
|
502 |
-
<tr><
|
503 |
-
|
|
|
|
|
|
|
|
|
504 |
<td>
|
505 |
<input type='hidden' id='postie-settings-selected_video2template' name='postie-settings[selected_video2template]'
|
506 |
value="<?php echo esc_attr($selected_video2template) ?>" />
|
@@ -538,13 +548,19 @@
|
|
538 |
<tr>
|
539 |
<th width="33%" valign="top" scope="row">
|
540 |
<?php _e('Video 2 file types:') ?><br /><span class='recommendation'>
|
541 |
-
<?php _e('Use the video template 2 for these files types (separated by commas)', 'postie') ?></span>
|
|
|
542 |
<td>
|
543 |
<input name='postie-settings[video2types]' type="text" id='postie-settings-video2types'
|
544 |
-
value="<?php if ($video2types != '') echo $video2types; ?>" size="40" />
|
|
|
545 |
</tr>
|
|
|
546 |
<tr><th scope='row'><?php _e('Audio template', 'postie') ?><br />
|
547 |
-
<span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></span
|
|
|
|
|
|
|
548 |
<td>
|
549 |
<input type='hidden' id='postie-settings-selected_audiotemplate' name='postie-settings[selected_audiotemplate]'
|
550 |
value="<?php echo esc_attr($selected_audiotemplate) ?>" />
|
@@ -581,9 +597,8 @@
|
|
581 |
<tr>
|
582 |
<th width="33%" valign="top" scope="row">
|
583 |
<?php _e('Audio file types:') ?><br />
|
584 |
-
<span class='recommendation'>
|
585 |
-
|
586 |
-
</span>
|
587 |
</th>
|
588 |
<td>
|
589 |
<input name='postie-settings[audiotypes]' type="text" id='postie-settings-audiotypes' value="<?php if ($audiotypes != '') echo $audiotypes; ?>" size="40" />
|
284 |
<?php echo BuildTextArea("Authorized Addresses", "postie-settings[authorized_addresses]", $authorized_addresses, "Put each email address on a single line. Posts from emails in this list will be treated as if they came from the admin. If you would prefer to have users post under their own name - create a WordPress user with the correct access level."); ?>
|
285 |
<tr>
|
286 |
<th width="33%" valign="top" scope="row">
|
287 |
+
<?php _e('Admin username:') ?> <br />
|
288 |
+
<span class='recommendation'><?php _e("This must be a valid WordPress user in the Administrator role. This will be the default poster in some cases.", 'postie'); ?></span>
|
289 |
+
</th>
|
290 |
<td>
|
291 |
+
<input name='postie-settings[admin_username]' type="text" id='postie-settings-admin_username' value="<?php echo $admin_username; ?>" size="50" />
|
292 |
+
</td>
|
293 |
</tr>
|
294 |
</table>
|
295 |
</div>
|
411 |
<tr>
|
412 |
<th width="33%" valign="top" scope="row"><?php _e('Image Template', 'postie') ?><br />
|
413 |
<span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie'); ?></span><br /><br />
|
414 |
+
<span class='recommendation'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></span><br /><br />
|
415 |
<span class='recommendation'><?php _e('Sizes for thumbnail, medium, and large images can be chosen in the <a href="options-media.php">Media Settings</a>. The samples here use the default sizes, and will not reflect the sizes you have chosen.', 'postie'); ?></span>
|
416 |
</th>
|
417 |
<td>
|
459 |
<div id="simpleTabs-content-5" class="simpleTabs-content">
|
460 |
<table class='form-table'>
|
461 |
|
462 |
+
<tr>
|
463 |
+
<th scope='row'><?php _e('Video template 1', 'postie') ?><br />
|
464 |
+
<span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></span><br />
|
465 |
+
<span class='recommendation'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></span><br />
|
466 |
+
</th>
|
467 |
<?php $templateDir = get_option('siteurl') . '/' . PLUGINDIR . '/postie/templates'; ?>
|
468 |
<td>
|
469 |
<input type='hidden' id='postie-settings-selected_video1template' name='postie-settings[selected_video1template]'
|
505 |
<input name='postie-settings[video1types]' type="text" id='postie-settings-video1types'
|
506 |
value="<?php if ($video1types != '') echo $video1types; ?>" size="40" /> </td>
|
507 |
</tr>
|
508 |
+
<tr><td colspan="2"><hr /></td></tr>
|
509 |
+
<tr>
|
510 |
+
<th scope='row'><?php _e('Video template 2', 'postie') ?><br />
|
511 |
+
<span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></span><br/>
|
512 |
+
<span class='recommendation'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></span><br />
|
513 |
+
</th>
|
514 |
<td>
|
515 |
<input type='hidden' id='postie-settings-selected_video2template' name='postie-settings[selected_video2template]'
|
516 |
value="<?php echo esc_attr($selected_video2template) ?>" />
|
548 |
<tr>
|
549 |
<th width="33%" valign="top" scope="row">
|
550 |
<?php _e('Video 2 file types:') ?><br /><span class='recommendation'>
|
551 |
+
<?php _e('Use the video template 2 for these files types (separated by commas)', 'postie') ?></span> <br />
|
552 |
+
</th>
|
553 |
<td>
|
554 |
<input name='postie-settings[video2types]' type="text" id='postie-settings-video2types'
|
555 |
+
value="<?php if ($video2types != '') echo $video2types; ?>" size="40" />
|
556 |
+
</td>
|
557 |
</tr>
|
558 |
+
<tr><td colspan="2"><hr /></td></tr>
|
559 |
<tr><th scope='row'><?php _e('Audio template', 'postie') ?><br />
|
560 |
+
<span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></span>
|
561 |
+
<br />
|
562 |
+
<span class='recommendation'><?php _e('Note that this template are only used if the "Preferred Text Type" setting is set to "plain"', 'postie'); ?></span><br />
|
563 |
+
</th>
|
564 |
<td>
|
565 |
<input type='hidden' id='postie-settings-selected_audiotemplate' name='postie-settings[selected_audiotemplate]'
|
566 |
value="<?php echo esc_attr($selected_audiotemplate) ?>" />
|
597 |
<tr>
|
598 |
<th width="33%" valign="top" scope="row">
|
599 |
<?php _e('Audio file types:') ?><br />
|
600 |
+
<span class='recommendation'><?php _e('Use the audio template for these files types (separated by commas)', 'postie') ?></span> <br />
|
601 |
+
|
|
|
602 |
</th>
|
603 |
<td>
|
604 |
<input name='postie-settings[audiotypes]' type="text" id='postie-settings-audiotypes' value="<?php if ($audiotypes != '') echo $audiotypes; ?>" size="40" />
|
docs/Changes.txt
CHANGED
@@ -10,6 +10,14 @@ All script, style and body tags are stripped from html emails.
|
|
10 |
Attachments are now processed in the order they were attached.
|
11 |
|
12 |
== CHANGELOG ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
= 1.4.26 (2013.01.15) =
|
14 |
* Fixed a bug where signatures were not removed in html emails.
|
15 |
* Added support for text attachments such as text/calendar.
|
10 |
Attachments are now processed in the order they were attached.
|
11 |
|
12 |
== CHANGELOG ==
|
13 |
+
= 1.4.27 (2013.01.17) =
|
14 |
+
* Updated sample plugin for extending Postie.
|
15 |
+
* Updated documentation for template variables.
|
16 |
+
* Fixed a bug where text/plain attachments were not being treated as attachments.
|
17 |
+
* Look for and include filterPostie.php in wp-content if it exists. (used for custom filters so they don't get deleted on upgrades)
|
18 |
+
* Cleanup of settings screen layout.
|
19 |
+
* Added additional error logging for mail connections.
|
20 |
+
|
21 |
= 1.4.26 (2013.01.15) =
|
22 |
* Fixed a bug where signatures were not removed in html emails.
|
23 |
* Added support for text attachments such as text/calendar.
|
docs/FAQ.txt
CHANGED
@@ -112,6 +112,9 @@ Simply upload the icons you want to the postie/icons/custom directory. You
|
|
112 |
must name the icons according to the following scheme:
|
113 |
`{filetype}-{size}.png`
|
114 |
|
|
|
|
|
|
|
115 |
For example, for word documents, you could use:
|
116 |
|
117 |
`doc-32.png`
|
112 |
must name the icons according to the following scheme:
|
113 |
`{filetype}-{size}.png`
|
114 |
|
115 |
+
NOTE THAT ANY CUSTOM FILES ADDED TO THE POSTIE DIRECTORY WILL BE DELETED IF YOU
|
116 |
+
USE THE NORMAL WORDPRESS UPGRADE PROCESS.
|
117 |
+
|
118 |
For example, for word documents, you could use:
|
119 |
|
120 |
`doc-32.png`
|
docs/Postie.txt
CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://PostiePlugin.com/
|
|
6 |
Tags: e-mail, email
|
7 |
Requires at least: 3.0
|
8 |
Tested up to: 3.5
|
9 |
-
Stable tag: 1.4.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
6 |
Tags: e-mail, email
|
7 |
Requires at least: 3.0
|
8 |
Tested up to: 3.5
|
9 |
+
Stable tag: 1.4.27
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
docs/TODO.txt
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
provide a location for custom icons. update docs about location.
|
2 |
+
reply logic not adding to comments
|
3 |
+
|
4 |
+
replace native imap with flourish
|
5 |
+
replace MIME parser
|
6 |
+
debug assistance
|
7 |
+
standardize tags
|
8 |
+
fix postie settings http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
|
9 |
+
|
10 |
+
-- old todo --
|
11 |
+
* USE built-in php message decoding to improve speed
|
12 |
+
* Add custom fields
|
13 |
+
* support for flexible upload plugin
|
14 |
+
* iso 8859-2 support
|
15 |
+
* add private post function http://forum.robfelty.com/topic/how-to-private-posts-from-postie?replies=2#post-1515
|
16 |
+
* category per e-mail address
|
17 |
+
* Problem with some mail server
|
18 |
+
* Multiple emails should tie to a single account
|
19 |
+
* Each user should be able to have a default category
|
20 |
+
* WP Switcher not compatible
|
21 |
+
* Setup poll
|
22 |
+
- web server
|
23 |
+
- mail clients
|
24 |
+
- plain/html
|
25 |
+
- phone/computer
|
26 |
+
- os of server
|
27 |
+
- os of client
|
28 |
+
- number of users posting
|
29 |
+
* Test for calling from the command line
|
30 |
+
* Support userid/domain as a valid username
|
31 |
+
* WP-switcher not compatiable http://www.alexking.org/index.php?content=software/wordpress/content.php#wp_120
|
32 |
+
* Test out a remote cron system
|
33 |
+
* Add support for http://unknowngenius.com/wp-plugins/faq.html#one-click
|
34 |
+
* www.cdavies.org/code/3gp-thumb.php.txt
|
35 |
+
* www.cdavies.org/permalink/watchingbrowserembeddedgpvideosinlinux.php
|
36 |
+
* Support private posts
|
37 |
+
* Make it possible to post without a script at all
|
38 |
+
* TODO - fix corruption of rtf attachments
|
39 |
+
* TODO - add port checking in tests
|
40 |
+
* TODO - non-image uploads get ignored in content when using autogallery - see replaceimageplaceholders
|
41 |
+
* TODO - code to set featured image
|
docs/Usage.txt
CHANGED
@@ -88,15 +88,30 @@
|
|
88 |
class="attachment" /></a><div
|
89 |
class='imagecaption'>{CAPTION}</div></div>`
|
90 |
|
91 |
-
* {
|
92 |
-
* {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
* {LARGE} gets replaced with the url to the large-sized image
|
94 |
-
* {
|
95 |
-
* {
|
|
|
|
|
|
|
96 |
* {RELFILENAME} gets replaced with the relative path to the full-size image
|
97 |
-
* {
|
|
|
|
|
|
|
|
|
|
|
98 |
* {WIDTH} gets replaced with width of the photo
|
99 |
-
|
100 |
|
101 |
= Interoperability =
|
102 |
* If your mail client doesn't support setting the subject (nokia) you
|
88 |
class="attachment" /></a><div
|
89 |
class='imagecaption'>{CAPTION}</div></div>`
|
90 |
|
91 |
+
* {CAPTION} gets replaced with the caption you specified (if any)
|
92 |
+
* {FILELINK} gets replaced with the url to the media
|
93 |
+
* {FILENAME} gets replaced with the name of the attachment from the email
|
94 |
+
* {FULL} same as {FILELINK}
|
95 |
+
* {HEIGHT} gets replaced with the height of the photo
|
96 |
+
* {ID} gets replaced with the post id
|
97 |
+
* {IMAGE} same as {FILELINK}
|
98 |
+
* {LARGEHEIGHT} gets replaced with the height of a large image
|
99 |
+
* {LARGEWIDTH} gets replaced with the width of a large image
|
100 |
* {LARGE} gets replaced with the url to the large-sized image
|
101 |
+
* {MEDIUMHEIGHT} gets replaced with the height of a medium image
|
102 |
+
* {MEDIUMWIDTH} gets replaced with the width of a medium image
|
103 |
+
* {MEDIUM} gets replaced with the url to the medium-sized image
|
104 |
+
* {PAGELINK} gets replaced with the URL of the file in WordPress
|
105 |
+
* {POSTTITLE} gets replaced with the post title (subject)
|
106 |
* {RELFILENAME} gets replaced with the relative path to the full-size image
|
107 |
+
* {THUMBHEIGHT} gets replaced with the height of a thumbnail image
|
108 |
+
* {THUMB} gets replaced with the url to the thumbnail image
|
109 |
+
* {THUMBNAIL} same as {THUMB}
|
110 |
+
* {THUMBWIDTH} gets replaced with the width of a thumbnail image
|
111 |
+
* {TITLE} same as {POSTTITLE}
|
112 |
+
* {URL} same as {FILELINK}
|
113 |
* {WIDTH} gets replaced with width of the photo
|
114 |
+
|
115 |
|
116 |
= Interoperability =
|
117 |
* If your mail client doesn't support setting the subject (nokia) you
|
filterPostie.php.sample
CHANGED
@@ -1,11 +1,22 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
/*
|
3 |
Plugin Name: Postie Filter
|
4 |
-
Plugin URI:
|
5 |
Description: Adds my own custom filter to messages posted by postie
|
6 |
-
Version: 1.
|
7 |
-
Author:
|
8 |
-
Author URI:
|
9 |
*/
|
10 |
|
11 |
/*
|
1 |
<?php
|
2 |
+
/*
|
3 |
+
* WARNING - WARNING - WARNING
|
4 |
+
* Do not put any custom filter code in the Postie directory. The standard WordPress
|
5 |
+
* upgrade process will delete your code.
|
6 |
+
*
|
7 |
+
* Instead copy filterPostie.php.sample to the wp-content directory and rename it
|
8 |
+
* to filterPostie.php and edit to your hearts content.
|
9 |
+
*
|
10 |
+
* Another option is to create your own plugin or add this code to your theme.
|
11 |
+
*/
|
12 |
+
|
13 |
/*
|
14 |
Plugin Name: Postie Filter
|
15 |
+
Plugin URI: Your URI
|
16 |
Description: Adds my own custom filter to messages posted by postie
|
17 |
+
Version: 1.0
|
18 |
+
Author: Your Name
|
19 |
+
Author URI: Your URI
|
20 |
*/
|
21 |
|
22 |
/*
|
get_mail.php
CHANGED
@@ -8,6 +8,14 @@ if (file_exists($wp_config_path . DIRECTORY_SEPARATOR . "wp-config.php")) {
|
|
8 |
include_once (dirname($wp_config_path)) . DIRECTORY_SEPARATOR . "wp-config.php";
|
9 |
}
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mimedecode.php');
|
12 |
require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'postie-functions.php');
|
13 |
if (!function_exists('file_get_html'))
|
8 |
include_once (dirname($wp_config_path)) . DIRECTORY_SEPARATOR . "wp-config.php";
|
9 |
}
|
10 |
|
11 |
+
$wp_content_path = dirname(dirname(dirname(__FILE__)));
|
12 |
+
|
13 |
+
DebugEcho("wp_content_path: $wp_content_path");
|
14 |
+
if (file_exists($wp_content_path . DIRECTORY_SEPARATOR . "filterPostie.php")) {
|
15 |
+
DebugEcho("found filterPostie.php in wp-content");
|
16 |
+
include_once ($wp_content_path . DIRECTORY_SEPARATOR . "filterPostie.php");
|
17 |
+
}
|
18 |
+
|
19 |
require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mimedecode.php');
|
20 |
require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'postie-functions.php');
|
21 |
if (!function_exists('file_get_html'))
|
postie-functions.php
CHANGED
@@ -1,18 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
/*
|
4 |
-
$Id: postie-functions.php
|
5 |
-
*/
|
6 |
-
|
7 |
-
/* TODO
|
8 |
-
* html purify
|
9 |
-
* USE built-in php message decoding to improve speed
|
10 |
-
* Add custom fields
|
11 |
-
* support for flexible upload plugin
|
12 |
-
* iso 8859-2 support
|
13 |
-
* add private post function
|
14 |
-
http://forum.robfelty.com/topic/how-to-private-posts-from-postie?replies=2#post-1515
|
15 |
-
* category per e-mail address
|
16 |
*/
|
17 |
|
18 |
//to turn on debug output add the following line to wp-config.php
|
@@ -152,7 +141,7 @@ function tag_Date(&$content, $message_date) {
|
|
152 |
|
153 |
function CreatePost($poster, $mimeDecodedEmail, $post_id, &$is_reply, $config) {
|
154 |
|
155 |
-
$fulldebug =
|
156 |
|
157 |
extract($config);
|
158 |
|
@@ -188,9 +177,8 @@ function CreatePost($poster, $mimeDecodedEmail, $post_id, &$is_reply, $config) {
|
|
188 |
DebugEcho("post sig: $content");
|
189 |
|
190 |
$post_excerpt = tag_Excerpt($content, $filternewlines, $convertnewline);
|
191 |
-
|
192 |
-
|
193 |
-
DebugEcho("post excerpt excerpt: $post_excerpt");
|
194 |
|
195 |
$postAuthorDetails = getPostAuthorDetails($subject, $content, $mimeDecodedEmail);
|
196 |
if ($fulldebug)
|
@@ -820,7 +808,7 @@ function isBannedFileName($filename, $bannedFiles) {
|
|
820 |
function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
821 |
extract($config);
|
822 |
//global $charset, $encoding;
|
823 |
-
|
824 |
$meta_return = '';
|
825 |
DebugEcho("primary= " . $part->ctype_primary . ", secondary = " . $part->ctype_secondary);
|
826 |
|
@@ -902,36 +890,46 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
902 |
}
|
903 |
//DebugDump($part);
|
904 |
}
|
905 |
-
|
906 |
-
//go through each sub-section
|
907 |
-
if ($part->ctype_secondary == 'enriched') {
|
908 |
-
//convert enriched text to HTML
|
909 |
-
DebugEcho("enriched");
|
910 |
-
$meta_return .= filter_etf2HTML($part->body) . "\n";
|
911 |
-
} elseif ($part->ctype_secondary == 'html') {
|
912 |
-
//strip excess HTML
|
913 |
-
DebugEcho("html");
|
914 |
-
$meta_return .= filter_CleanHtml($part->body) . "\n";
|
915 |
-
} elseif ($part->ctype_secondary == 'plain') {
|
916 |
-
DebugEcho("plain text");
|
917 |
-
if ($allow_html_in_body) {
|
918 |
-
DebugEcho("html allowed");
|
919 |
-
$meta_return .= $part->body;
|
920 |
-
//$meta_return = "<div>$meta_return</div>\n";
|
921 |
-
} else {
|
922 |
-
DebugEcho("html not allowed (htmlentities)");
|
923 |
-
$meta_return .= htmlentities($part->body);
|
924 |
-
}
|
925 |
-
$meta_return = filter_StripPGP($meta_return);
|
926 |
-
DebugEcho("meta return: $meta_return");
|
927 |
-
} else {
|
928 |
DebugEcho("text Attachement: $filename");
|
929 |
$file_id = postie_media_handle_upload($part, $post_id, $poster);
|
930 |
$file = wp_get_attachment_url($file_id);
|
931 |
$icon = chooseAttachmentIcon($file, $part->ctype_primary, $part->ctype_secondary, $icon_set, $icon_size);
|
932 |
$attachments["html"][$filename] = "<a href='$file'>" . $icon . $filename . '</a>' . "\n";
|
933 |
-
}
|
934 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
935 |
break;
|
936 |
|
937 |
case 'image':
|
@@ -1017,8 +1015,8 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1017 |
break;
|
1018 |
}
|
1019 |
}
|
1020 |
-
|
1021 |
-
DebugEcho("
|
1022 |
return $meta_return;
|
1023 |
}
|
1024 |
|
@@ -1208,9 +1206,10 @@ function filter_RemoveSignature(&$content, $config) {
|
|
1208 |
if ($config['drop_signature']) {
|
1209 |
if (empty($config['sig_pattern_list']))
|
1210 |
return;
|
1211 |
-
DebugEcho("looking for signature in: $content");
|
1212 |
|
1213 |
-
$pattern = '/^(' . implode('|', $config['sig_pattern_list']) . ')
|
|
|
1214 |
|
1215 |
$html = LoadDOM($content);
|
1216 |
if ($html !== false) {
|
@@ -1236,9 +1235,9 @@ function filter_RemoveSignature(&$content, $config) {
|
|
1236 |
|
1237 |
function filter_RemoveSignatureWorker(&$html, $pattern) {
|
1238 |
$found = false;
|
1239 |
-
DebugEcho("sig count children: " . count($html->children()));
|
1240 |
if (preg_match($pattern, trim($html->plaintext), $matches)) {
|
1241 |
DebugEcho("signature found in base: removing");
|
|
|
1242 |
$found = true;
|
1243 |
$i = stripos($html->innertext, $matches[1]);
|
1244 |
$presig = substr($html->innertext, 0, $i);
|
@@ -1273,7 +1272,7 @@ function filter_End(&$content, $config) {
|
|
1273 |
$pos = strpos($content, $end);
|
1274 |
if ($pos === false)
|
1275 |
return $content;
|
1276 |
-
DebugEcho("end filter $end");
|
1277 |
$content = substr($content, 0, $pos);
|
1278 |
}
|
1279 |
}
|
@@ -1352,7 +1351,7 @@ function HandleMessageEncoding($contenttransferencoding, $charset, $body, $blogE
|
|
1352 |
}
|
1353 |
|
1354 |
DebugEcho("after HandleMessageEncoding");
|
1355 |
-
if (!empty($charset) && strtolower($charset) != 'default') {
|
1356 |
DebugEcho("converting from $charset to $blogEncoding");
|
1357 |
//DebugEcho("before: $body");
|
1358 |
$body = iconv($charset, $blogEncoding . '//TRANSLIT', $body);
|
@@ -1710,30 +1709,31 @@ function filter_PreferedText($mimeDecodedEmail, $preferTextType) {
|
|
1710 |
$found = false;
|
1711 |
|
1712 |
for ($i = 0; $i < count($mimeDecodedEmail->parts); $i++) {
|
1713 |
-
DebugEcho("part: $i " . $mimeDecodedEmail->parts[$i]->ctype_primary);
|
1714 |
-
|
1715 |
-
|
1716 |
-
$
|
1717 |
-
|
1718 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1719 |
$newParts[] = $mimeDecodedEmail->parts[$i];
|
1720 |
}
|
1721 |
} else {
|
|
|
1722 |
$newParts[] = $mimeDecodedEmail->parts[$i];
|
1723 |
}
|
1724 |
-
} else {
|
1725 |
-
$newParts[] = $mimeDecodedEmail->parts[$i];
|
1726 |
}
|
1727 |
-
|
1728 |
-
// if (in_array($mimeDecodedEmail->parts[$i]->ctype_primary, array("text", "multipart"))) {
|
1729 |
-
// if (SearchForMIMEType($mimeDecodedEmail->parts[$i], "text", $preferTextType)) {
|
1730 |
-
// $newParts[] = $mimeDecodedEmail->parts[$i];
|
1731 |
-
// $found = true;
|
1732 |
-
// DebugEcho("found");
|
1733 |
-
// }
|
1734 |
-
// } else {
|
1735 |
-
// $newParts[] = $mimeDecodedEmail->parts[$i];
|
1736 |
-
// }
|
1737 |
}
|
1738 |
if ($newParts) {
|
1739 |
//This is now the filtered list of just the preferred type.
|
@@ -2332,14 +2332,16 @@ function DisplayEmailPost($details) {
|
|
2332 |
*/
|
2333 |
function BuildBooleanSelect($label, $id, $current_value, $recommendation = NULL) {
|
2334 |
$html = "<tr>
|
2335 |
-
<th scope='row'>" . $label . "
|
|
|
|
|
|
|
|
|
2336 |
<td><select name='$id' id='$id'>
|
2337 |
<option value='1'>" . __("Yes", 'postie') . "</option>
|
2338 |
<option value='0' " . (!$current_value ? "selected='selected'" : "") . ">" . __("No", 'postie') . '</option>
|
2339 |
</select>';
|
2340 |
-
|
2341 |
-
$html.='<span class = "recommendation">' . $recommendation . '</span>';
|
2342 |
-
}
|
2343 |
$html.="</td>\n</tr>";
|
2344 |
return $html;
|
2345 |
}
|
1 |
<?php
|
2 |
|
3 |
/*
|
4 |
+
$Id: postie-functions.php 654713 2013-01-18 06:03:56Z WayneAllen $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
*/
|
6 |
|
7 |
//to turn on debug output add the following line to wp-config.php
|
141 |
|
142 |
function CreatePost($poster, $mimeDecodedEmail, $post_id, &$is_reply, $config) {
|
143 |
|
144 |
+
$fulldebug = true;
|
145 |
|
146 |
extract($config);
|
147 |
|
177 |
DebugEcho("post sig: $content");
|
178 |
|
179 |
$post_excerpt = tag_Excerpt($content, $filternewlines, $convertnewline);
|
180 |
+
if ($fulldebug)
|
181 |
+
DebugEcho("post excerpt: $content");
|
|
|
182 |
|
183 |
$postAuthorDetails = getPostAuthorDetails($subject, $content, $mimeDecodedEmail);
|
184 |
if ($fulldebug)
|
808 |
function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
809 |
extract($config);
|
810 |
//global $charset, $encoding;
|
811 |
+
DebugEcho('----');
|
812 |
$meta_return = '';
|
813 |
DebugEcho("primary= " . $part->ctype_primary . ", secondary = " . $part->ctype_secondary);
|
814 |
|
890 |
}
|
891 |
//DebugDump($part);
|
892 |
}
|
893 |
+
if (array_key_exists('disposition', $part) && $part->disposition == 'attachment') {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
894 |
DebugEcho("text Attachement: $filename");
|
895 |
$file_id = postie_media_handle_upload($part, $post_id, $poster);
|
896 |
$file = wp_get_attachment_url($file_id);
|
897 |
$icon = chooseAttachmentIcon($file, $part->ctype_primary, $part->ctype_secondary, $icon_set, $icon_size);
|
898 |
$attachments["html"][$filename] = "<a href='$file'>" . $icon . $filename . '</a>' . "\n";
|
899 |
+
} else {
|
900 |
|
901 |
+
//go through each sub-section
|
902 |
+
if ($part->ctype_secondary == 'enriched') {
|
903 |
+
//convert enriched text to HTML
|
904 |
+
DebugEcho("enriched");
|
905 |
+
$meta_return .= filter_etf2HTML($part->body) . "\n";
|
906 |
+
} elseif ($part->ctype_secondary == 'html') {
|
907 |
+
//strip excess HTML
|
908 |
+
DebugEcho("html");
|
909 |
+
$meta_return .= filter_CleanHtml($part->body) . "\n";
|
910 |
+
} elseif ($part->ctype_secondary == 'plain') {
|
911 |
+
DebugEcho("plain text");
|
912 |
+
//DebugDump($part);
|
913 |
+
|
914 |
+
DebugEcho("body text");
|
915 |
+
if ($allow_html_in_body) {
|
916 |
+
DebugEcho("html allowed");
|
917 |
+
$meta_return .= $part->body;
|
918 |
+
//$meta_return = "<div>$meta_return</div>\n";
|
919 |
+
} else {
|
920 |
+
DebugEcho("html not allowed (htmlentities)");
|
921 |
+
$meta_return .= htmlentities($part->body);
|
922 |
+
}
|
923 |
+
$meta_return = filter_StripPGP($meta_return);
|
924 |
+
//DebugEcho("meta return: $meta_return");
|
925 |
+
} else {
|
926 |
+
DebugEcho("text Attachement wo disposition: $filename");
|
927 |
+
$file_id = postie_media_handle_upload($part, $post_id, $poster);
|
928 |
+
$file = wp_get_attachment_url($file_id);
|
929 |
+
$icon = chooseAttachmentIcon($file, $part->ctype_primary, $part->ctype_secondary, $icon_set, $icon_size);
|
930 |
+
$attachments["html"][$filename] = "<a href='$file'>" . $icon . $filename . '</a>' . "\n";
|
931 |
+
}
|
932 |
+
}
|
933 |
break;
|
934 |
|
935 |
case 'image':
|
1015 |
break;
|
1016 |
}
|
1017 |
}
|
1018 |
+
DebugEcho("meta_return: " . substr($meta_return, 0, 500));
|
1019 |
+
DebugEcho("====");
|
1020 |
return $meta_return;
|
1021 |
}
|
1022 |
|
1206 |
if ($config['drop_signature']) {
|
1207 |
if (empty($config['sig_pattern_list']))
|
1208 |
return;
|
1209 |
+
//DebugEcho("looking for signature in: $content");
|
1210 |
|
1211 |
+
$pattern = '/^(' . implode('|', $config['sig_pattern_list']) . ')\s?$/m';
|
1212 |
+
DebugEcho("sig pattern: $pattern");
|
1213 |
|
1214 |
$html = LoadDOM($content);
|
1215 |
if ($html !== false) {
|
1235 |
|
1236 |
function filter_RemoveSignatureWorker(&$html, $pattern) {
|
1237 |
$found = false;
|
|
|
1238 |
if (preg_match($pattern, trim($html->plaintext), $matches)) {
|
1239 |
DebugEcho("signature found in base: removing");
|
1240 |
+
DebugDump($matches);
|
1241 |
$found = true;
|
1242 |
$i = stripos($html->innertext, $matches[1]);
|
1243 |
$presig = substr($html->innertext, 0, $i);
|
1272 |
$pos = strpos($content, $end);
|
1273 |
if ($pos === false)
|
1274 |
return $content;
|
1275 |
+
DebugEcho("end filter: $end");
|
1276 |
$content = substr($content, 0, $pos);
|
1277 |
}
|
1278 |
}
|
1351 |
}
|
1352 |
|
1353 |
DebugEcho("after HandleMessageEncoding");
|
1354 |
+
if (!empty($charset) && strtolower($charset) != 'default' && strtolower($charset) != strtolower($blogEncoding)) {
|
1355 |
DebugEcho("converting from $charset to $blogEncoding");
|
1356 |
//DebugEcho("before: $body");
|
1357 |
$body = iconv($charset, $blogEncoding . '//TRANSLIT', $body);
|
1709 |
$found = false;
|
1710 |
|
1711 |
for ($i = 0; $i < count($mimeDecodedEmail->parts); $i++) {
|
1712 |
+
DebugEcho("part: $i " . $mimeDecodedEmail->parts[$i]->ctype_primary . "/" . $mimeDecodedEmail->parts[$i]->ctype_secondary);
|
1713 |
+
if (array_key_exists('disposition', $mimeDecodedEmail->parts[$i]) && $mimeDecodedEmail->parts[$i]->disposition == 'attachment') {
|
1714 |
+
DebugEcho("attachment");
|
1715 |
+
$newParts[] = $mimeDecodedEmail->parts[$i];
|
1716 |
+
} else {
|
1717 |
+
if ($mimeDecodedEmail->parts[$i]->ctype_primary == "text") {
|
1718 |
+
$ctype = $mimeDecodedEmail->parts[$i]->ctype_secondary;
|
1719 |
+
if ($ctype == 'html' || $ctype == 'plain') {
|
1720 |
+
DebugEcho("checking prefered type");
|
1721 |
+
if ($ctype == $preferTextType) {
|
1722 |
+
DebugEcho("keeping: $ctype");
|
1723 |
+
DebugEcho(substr($mimeDecodedEmail->parts[$i]->body, 0, 500));
|
1724 |
+
$newParts[] = $mimeDecodedEmail->parts[$i];
|
1725 |
+
} else {
|
1726 |
+
DebugEcho("removing: $ctype");
|
1727 |
+
}
|
1728 |
+
} else {
|
1729 |
+
DebugEcho("keeping: {$mimeDecodedEmail->parts[$i]->ctype_primary}");
|
1730 |
$newParts[] = $mimeDecodedEmail->parts[$i];
|
1731 |
}
|
1732 |
} else {
|
1733 |
+
DebugEcho("keeping: {$mimeDecodedEmail->parts[$i]->ctype_primary}");
|
1734 |
$newParts[] = $mimeDecodedEmail->parts[$i];
|
1735 |
}
|
|
|
|
|
1736 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1737 |
}
|
1738 |
if ($newParts) {
|
1739 |
//This is now the filtered list of just the preferred type.
|
2332 |
*/
|
2333 |
function BuildBooleanSelect($label, $id, $current_value, $recommendation = NULL) {
|
2334 |
$html = "<tr>
|
2335 |
+
<th scope='row'>" . $label . ":";
|
2336 |
+
if (!empty($recommendation)) {
|
2337 |
+
$html.='<br /><span class = "recommendation">' . $recommendation . '</span>';
|
2338 |
+
}
|
2339 |
+
$html.="</th>
|
2340 |
<td><select name='$id' id='$id'>
|
2341 |
<option value='1'>" . __("Yes", 'postie') . "</option>
|
2342 |
<option value='0' " . (!$current_value ? "selected='selected'" : "") . ">" . __("No", 'postie') . '</option>
|
2343 |
</select>';
|
2344 |
+
|
|
|
|
|
2345 |
$html.="</td>\n</tr>";
|
2346 |
return $html;
|
2347 |
}
|
postie.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Postie
|
5 |
Plugin URI: http://PostiePlugin.com/
|
6 |
Description: Signifigantly upgrades the posting by mail features of Word Press (See <a href='options-general.php?page=postie/postie.php'>Settings and options</a>) to configure your e-mail settings. See the <a href='http://wordpress.org/extend/plugins/postie/other_notes'>Readme</a> for usage. Visit the <a href='http://wordpress.org/support/plugin/postie'>postie forum</a> for support.
|
7 |
-
Version: 1.4.
|
8 |
Author: Wayne Allen
|
9 |
Author URI: http://allens-home.com/
|
10 |
License: GPL2
|
@@ -27,33 +27,7 @@
|
|
27 |
*/
|
28 |
|
29 |
/*
|
30 |
-
$Id: postie.php
|
31 |
-
* -= Requests Pending =-
|
32 |
-
* Problem with some mail server
|
33 |
-
* Multiple emails should tie to a single account
|
34 |
-
* Each user should be able to have a default category
|
35 |
-
* WP Switcher not compatible
|
36 |
-
* Setup poll
|
37 |
-
- web server
|
38 |
-
- mail clients
|
39 |
-
- plain/html
|
40 |
-
- phone/computer
|
41 |
-
- os of server
|
42 |
-
- os of client
|
43 |
-
- number of users posting
|
44 |
-
* Test for calling from the command line
|
45 |
-
* Support userid/domain as a valid username
|
46 |
-
* WP-switcher not compatiable http://www.alexking.org/index.php?content=software/wordpress/content.php#wp_120
|
47 |
-
* Test out a remote cron system
|
48 |
-
* Add support for http://unknowngenius.com/wp-plugins/faq.html#one-click
|
49 |
-
* www.cdavies.org/code/3gp-thumb.php.txt
|
50 |
-
* www.cdavies.org/permalink/watchingbrowserembeddedgpvideosinlinux.php
|
51 |
-
* Support private posts
|
52 |
-
* Make it possible to post without a script at all
|
53 |
-
* TODO - fix corruption of rtf attachments
|
54 |
-
* TODO - add port checking in tests
|
55 |
-
* TODO - non-image uploads get ignored in content when using autogallery - see replaceimageplaceholders
|
56 |
-
* TODO - code to set featured image
|
57 |
*/
|
58 |
|
59 |
define("POSTIE_ROOT", dirname(__FILE__));
|
@@ -101,7 +75,7 @@ if (is_admin()) {
|
|
101 |
}
|
102 |
|
103 |
function activate_postie() {
|
104 |
-
LogInfo("
|
105 |
|
106 |
static $init = false;
|
107 |
$options = get_option('postie-settings');
|
4 |
Plugin Name: Postie
|
5 |
Plugin URI: http://PostiePlugin.com/
|
6 |
Description: Signifigantly upgrades the posting by mail features of Word Press (See <a href='options-general.php?page=postie/postie.php'>Settings and options</a>) to configure your e-mail settings. See the <a href='http://wordpress.org/extend/plugins/postie/other_notes'>Readme</a> for usage. Visit the <a href='http://wordpress.org/support/plugin/postie'>postie forum</a> for support.
|
7 |
+
Version: 1.4.27
|
8 |
Author: Wayne Allen
|
9 |
Author URI: http://allens-home.com/
|
10 |
License: GPL2
|
27 |
*/
|
28 |
|
29 |
/*
|
30 |
+
$Id: postie.php 654713 2013-01-18 06:03:56Z WayneAllen $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
*/
|
32 |
|
33 |
define("POSTIE_ROOT", dirname(__FILE__));
|
75 |
}
|
76 |
|
77 |
function activate_postie() {
|
78 |
+
LogInfo("activated");
|
79 |
|
80 |
static $init = false;
|
81 |
$options = get_option('postie-settings');
|
postieIMAP.php
CHANGED
@@ -85,6 +85,8 @@ class PostieIMAP {
|
|
85 |
|
86 |
if ($this->_connection) {
|
87 |
$this->_connected = true;
|
|
|
|
|
88 |
}
|
89 |
return $this->_connected;
|
90 |
}
|
@@ -98,7 +100,13 @@ class PostieIMAP {
|
|
98 |
$status = imap_status($this->_connection, $this->_server_string, SA_ALL); //get all messages in debug mode so we can reprocess them
|
99 |
//DebugEcho($this->_server_string);
|
100 |
//DebugDump($status);
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
} else {
|
103 |
return imap_num_msg($this->_connection);
|
104 |
}
|
85 |
|
86 |
if ($this->_connection) {
|
87 |
$this->_connected = true;
|
88 |
+
} else {
|
89 |
+
LogInfo("imap_open failed: " . imap_last_error());
|
90 |
}
|
91 |
return $this->_connected;
|
92 |
}
|
100 |
$status = imap_status($this->_connection, $this->_server_string, SA_ALL); //get all messages in debug mode so we can reprocess them
|
101 |
//DebugEcho($this->_server_string);
|
102 |
//DebugDump($status);
|
103 |
+
if ($status)
|
104 |
+
return $status->unseen;
|
105 |
+
else {
|
106 |
+
LogInfo("Error imap_status did not return a value");
|
107 |
+
DebugDump($this);
|
108 |
+
return 0;
|
109 |
+
}
|
110 |
} else {
|
111 |
return imap_num_msg($this->_connection);
|
112 |
}
|
readme.html
CHANGED
@@ -195,15 +195,29 @@ class="attachment" /></a><div
|
|
195 |
class='imagecaption'>{CAPTION}</div></div></code></p>
|
196 |
|
197 |
<ul>
|
198 |
-
<li>{
|
199 |
-
<li>{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
<li>{LARGE} gets replaced with the url to the large-sized image</li>
|
201 |
-
<li>{
|
202 |
-
<li>{
|
|
|
|
|
|
|
203 |
<li>{RELFILENAME} gets replaced with the relative path to the full-size image</li>
|
204 |
-
<li>{
|
|
|
|
|
|
|
|
|
|
|
205 |
<li>{WIDTH} gets replaced with width of the photo</li>
|
206 |
-
<li>{HEIGHT} gets replaced with the height of the photo</li>
|
207 |
</ul></li>
|
208 |
</ul>
|
209 |
|
195 |
class='imagecaption'>{CAPTION}</div></div></code></p>
|
196 |
|
197 |
<ul>
|
198 |
+
<li>{CAPTION} gets replaced with the caption you specified (if any)</li>
|
199 |
+
<li>{FILELINK} gets replaced with the url to the media</li>
|
200 |
+
<li>{FILENAME} gets replaced with the name of the attachment from the email</li>
|
201 |
+
<li>{FULL} same as {FILELINK}</li>
|
202 |
+
<li>{HEIGHT} gets replaced with the height of the photo</li>
|
203 |
+
<li>{ID} gets replaced with the post id</li>
|
204 |
+
<li>{IMAGE} same as {FILELINK}</li>
|
205 |
+
<li>{LARGEHEIGHT} gets replaced with the height of a large image</li>
|
206 |
+
<li>{LARGEWIDTH} gets replaced with the width of a large image</li>
|
207 |
<li>{LARGE} gets replaced with the url to the large-sized image</li>
|
208 |
+
<li>{MEDIUMHEIGHT} gets replaced with the height of a medium image</li>
|
209 |
+
<li>{MEDIUMWIDTH} gets replaced with the width of a medium image</li>
|
210 |
+
<li>{MEDIUM} gets replaced with the url to the medium-sized image</li>
|
211 |
+
<li>{PAGELINK} gets replaced with the URL of the file in WordPress</li>
|
212 |
+
<li>{POSTTITLE} gets replaced with the post title (subject)</li>
|
213 |
<li>{RELFILENAME} gets replaced with the relative path to the full-size image</li>
|
214 |
+
<li>{THUMBHEIGHT} gets replaced with the height of a thumbnail image</li>
|
215 |
+
<li>{THUMB} gets replaced with the url to the thumbnail image</li>
|
216 |
+
<li>{THUMBNAIL} same as {THUMB}</li>
|
217 |
+
<li>{THUMBWIDTH} gets replaced with the width of a thumbnail image</li>
|
218 |
+
<li>{TITLE} same as {POSTTITLE}</li>
|
219 |
+
<li>{URL} same as {FILELINK}</li>
|
220 |
<li>{WIDTH} gets replaced with width of the photo</li>
|
|
|
221 |
</ul></li>
|
222 |
</ul>
|
223 |
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://PostiePlugin.com/
|
|
6 |
Tags: e-mail, email
|
7 |
Requires at least: 3.0
|
8 |
Tested up to: 3.5
|
9 |
-
Stable tag: 1.4.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -169,15 +169,30 @@ Then use the Task Scheduler control panel to call wget or cron.
|
|
169 |
class="attachment" /></a><div
|
170 |
class='imagecaption'>{CAPTION}</div></div>`
|
171 |
|
172 |
-
* {
|
173 |
-
* {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
* {LARGE} gets replaced with the url to the large-sized image
|
175 |
-
* {
|
176 |
-
* {
|
|
|
|
|
|
|
177 |
* {RELFILENAME} gets replaced with the relative path to the full-size image
|
178 |
-
* {
|
|
|
|
|
|
|
|
|
|
|
179 |
* {WIDTH} gets replaced with width of the photo
|
180 |
-
|
181 |
|
182 |
= Interoperability =
|
183 |
* If your mail client doesn't support setting the subject (nokia) you
|
@@ -302,6 +317,9 @@ Simply upload the icons you want to the postie/icons/custom directory. You
|
|
302 |
must name the icons according to the following scheme:
|
303 |
`{filetype}-{size}.png`
|
304 |
|
|
|
|
|
|
|
305 |
For example, for word documents, you could use:
|
306 |
|
307 |
`doc-32.png`
|
@@ -398,9 +416,17 @@ All script, style and body tags are stripped from html emails.
|
|
398 |
Attachments are now processed in the order they were attached.
|
399 |
|
400 |
== CHANGELOG ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
= 1.4.26 (2013.01.15) =
|
402 |
-
* Fixed a bug where signatures were not removed in html emails
|
403 |
-
* Added support for text attachments such as text/calendar
|
404 |
|
405 |
= 1.4.25 (2013.01.15) =
|
406 |
* Fixed a bug where newlines were being removed erroneously.
|
6 |
Tags: e-mail, email
|
7 |
Requires at least: 3.0
|
8 |
Tested up to: 3.5
|
9 |
+
Stable tag: 1.4.27
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
169 |
class="attachment" /></a><div
|
170 |
class='imagecaption'>{CAPTION}</div></div>`
|
171 |
|
172 |
+
* {CAPTION} gets replaced with the caption you specified (if any)
|
173 |
+
* {FILELINK} gets replaced with the url to the media
|
174 |
+
* {FILENAME} gets replaced with the name of the attachment from the email
|
175 |
+
* {FULL} same as {FILELINK}
|
176 |
+
* {HEIGHT} gets replaced with the height of the photo
|
177 |
+
* {ID} gets replaced with the post id
|
178 |
+
* {IMAGE} same as {FILELINK}
|
179 |
+
* {LARGEHEIGHT} gets replaced with the height of a large image
|
180 |
+
* {LARGEWIDTH} gets replaced with the width of a large image
|
181 |
* {LARGE} gets replaced with the url to the large-sized image
|
182 |
+
* {MEDIUMHEIGHT} gets replaced with the height of a medium image
|
183 |
+
* {MEDIUMWIDTH} gets replaced with the width of a medium image
|
184 |
+
* {MEDIUM} gets replaced with the url to the medium-sized image
|
185 |
+
* {PAGELINK} gets replaced with the URL of the file in WordPress
|
186 |
+
* {POSTTITLE} gets replaced with the post title (subject)
|
187 |
* {RELFILENAME} gets replaced with the relative path to the full-size image
|
188 |
+
* {THUMBHEIGHT} gets replaced with the height of a thumbnail image
|
189 |
+
* {THUMB} gets replaced with the url to the thumbnail image
|
190 |
+
* {THUMBNAIL} same as {THUMB}
|
191 |
+
* {THUMBWIDTH} gets replaced with the width of a thumbnail image
|
192 |
+
* {TITLE} same as {POSTTITLE}
|
193 |
+
* {URL} same as {FILELINK}
|
194 |
* {WIDTH} gets replaced with width of the photo
|
195 |
+
|
196 |
|
197 |
= Interoperability =
|
198 |
* If your mail client doesn't support setting the subject (nokia) you
|
317 |
must name the icons according to the following scheme:
|
318 |
`{filetype}-{size}.png`
|
319 |
|
320 |
+
NOTE THAT ANY CUSTOM FILES ADDED TO THE POSTIE DIRECTORY WILL BE DELETED IF YOU
|
321 |
+
USE THE NORMAL WORDPRESS UPGRADE PROCESS.
|
322 |
+
|
323 |
For example, for word documents, you could use:
|
324 |
|
325 |
`doc-32.png`
|
416 |
Attachments are now processed in the order they were attached.
|
417 |
|
418 |
== CHANGELOG ==
|
419 |
+
= 1.4.27 (2013.01.17) =
|
420 |
+
* Updated sample plugin for extending Postie.
|
421 |
+
* Updated documentation for template variables.
|
422 |
+
* Fixed a bug where text/plain attachments were not being treated as attachments.
|
423 |
+
* Look for and include filterPostie.php in wp-content if it exists. (used for custom filters so they don't get deleted on upgrades)
|
424 |
+
* Cleanup of settings screen layout.
|
425 |
+
* Added additional error logging for mail connections.
|
426 |
+
|
427 |
= 1.4.26 (2013.01.15) =
|
428 |
+
* Fixed a bug where signatures were not removed in html emails.
|
429 |
+
* Added support for text attachments such as text/calendar.
|
430 |
|
431 |
= 1.4.25 (2013.01.15) =
|
432 |
* Fixed a bug where newlines were being removed erroneously.
|
test/inlineimageTest.php
CHANGED
@@ -57,7 +57,7 @@ class postiefunctions2Test extends PHPUnit_Framework_TestCase {
|
|
57 |
$config['convertnewline'] = true;
|
58 |
|
59 |
$post = $this->process_file("data/linebreaks.var", $config);
|
60 |
-
$this->assertEquals("Test<br />\nEen stuck TekstEen stuck TekstEen stuck TekstEen stuck Tekst<br />\nEen stuck TekstEen stuck Tekst<br />\n<br />\nEen stuck TekstEen stuck Tekst<br />\n
|
61 |
}
|
62 |
|
63 |
function testjapaneseAttachment() {
|
@@ -97,11 +97,11 @@ class postiefunctions2Test extends PHPUnit_Framework_TestCase {
|
|
97 |
$config['prefer_text_type'] = 'html';
|
98 |
|
99 |
$post = $this->process_file("data/signature.var", $config);
|
100 |
-
$this->assertEquals('test content<div><br></div
|
101 |
|
102 |
$config['prefer_text_type'] = 'html';
|
103 |
$post = $this->process_file("data/signature.var", $config);
|
104 |
-
$this->assertEquals('test content<div><br></div
|
105 |
}
|
106 |
|
107 |
function testQuotedPrintable() {
|
57 |
$config['convertnewline'] = true;
|
58 |
|
59 |
$post = $this->process_file("data/linebreaks.var", $config);
|
60 |
+
$this->assertEquals("Test<br />\nEen stuck TekstEen stuck TekstEen stuck TekstEen stuck Tekst<br />\nEen stuck TekstEen stuck Tekst<br />\n<br />\nEen stuck TekstEen stuck Tekst<br />\n", $post['post_content']);
|
61 |
}
|
62 |
|
63 |
function testjapaneseAttachment() {
|
97 |
$config['prefer_text_type'] = 'html';
|
98 |
|
99 |
$post = $this->process_file("data/signature.var", $config);
|
100 |
+
$this->assertEquals('test content<div><br></div> ', $post['post_content']);
|
101 |
|
102 |
$config['prefer_text_type'] = 'html';
|
103 |
$post = $this->process_file("data/signature.var", $config);
|
104 |
+
$this->assertEquals('test content<div><br></div> ', $post['post_content']);
|
105 |
}
|
106 |
|
107 |
function testQuotedPrintable() {
|
test/postie-functionsTest.php
CHANGED
@@ -581,7 +581,6 @@ class postiefunctionsTest extends PHPUnit_Framework_TestCase {
|
|
581 |
$this->assertEquals("", $c);
|
582 |
$this->assertEquals("stuff ", $e);
|
583 |
}
|
584 |
-
|
585 |
}
|
586 |
|
587 |
?>
|
581 |
$this->assertEquals("", $c);
|
582 |
$this->assertEquals("stuff ", $e);
|
583 |
}
|
|
|
584 |
}
|
585 |
|
586 |
?>
|