Version Description
(2015-12-09) = * Fix bug where emails inside shortcodes were being linkified * Lookup categories by slug as well as by name * WordPress 4.4 testing * Added new video template for using video shortcode * Added new template variable - FILETYPE which is the file extension
Download this release
Release Info
Developer | WayneAllen |
Plugin | Postie |
Version | 1.7.23 |
Comparing to | |
See all releases |
Code changes from version 1.7.22 to 1.7.23
- config_form.php +4 -2
- config_form_image.php +1 -0
- config_form_video.php +6 -6
- docs/Changes.txt +7 -0
- docs/Postie.txt +2 -2
- lib_autolink.php +69 -49
- postie-functions.php +13 -3
- postie.php +3 -3
- readme.txt +9 -2
- templates/video1_templates.php +3 -1
config_form.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<h2>
|
3 |
<a style='text-decoration:none' href='admin.php?page=postie-settings'>
|
4 |
<?php
|
5 |
-
echo '<img src="' . plugins_url('images/mail.png', __FILE__) . '" alt="postie" />';
|
6 |
_e('Postie Settings', 'postie');
|
7 |
?>
|
8 |
</a>
|
@@ -194,7 +194,7 @@
|
|
194 |
</div>
|
195 |
</div>
|
196 |
|
197 |
-
<?php $iconDir =
|
198 |
<script type="text/javascript">
|
199 |
jQuery(document).ready(function () {
|
200 |
jQuery('.simpleTabs-content').hide();
|
@@ -280,10 +280,12 @@
|
|
280 |
var medium = '<?php echo $templateDir ?>/' + sample.replace(/\.jpg/, '-300x200.jpg');
|
281 |
var large = '<?php echo $templateDir ?>/' + sample.replace(/\.jpg/, '-1024x682.jpg');
|
282 |
var pagelink = '<?php echo get_option("siteurl") ?>' + '/?attachment_id=9999';
|
|
|
283 |
previewHTML = previewHTML.replace(/{FILELINK}/g, fileLink);
|
284 |
previewHTML = previewHTML.replace(/{FULL}/g, fileLink);
|
285 |
previewHTML = previewHTML.replace(/{IMAGE}/g, fileLink);
|
286 |
previewHTML = previewHTML.replace(/{FILENAME}/, sample);
|
|
|
287 |
previewHTML = previewHTML.replace(/{PAGELINK}/, pagelink);
|
288 |
previewHTML = previewHTML.replace(/{RELFILENAME}/, sample);
|
289 |
previewHTML = previewHTML.replace(/{THUMB(NAIL|)}/, thumb);
|
2 |
<h2>
|
3 |
<a style='text-decoration:none' href='admin.php?page=postie-settings'>
|
4 |
<?php
|
5 |
+
echo '<img src="' . esc_url(plugins_url('images/mail.png', __FILE__)) . '" alt="postie" />';
|
6 |
_e('Postie Settings', 'postie');
|
7 |
?>
|
8 |
</a>
|
194 |
</div>
|
195 |
</div>
|
196 |
|
197 |
+
<?php $iconDir = esc_url(plugins_url() . '/postie/icons'); ?>
|
198 |
<script type="text/javascript">
|
199 |
jQuery(document).ready(function () {
|
200 |
jQuery('.simpleTabs-content').hide();
|
280 |
var medium = '<?php echo $templateDir ?>/' + sample.replace(/\.jpg/, '-300x200.jpg');
|
281 |
var large = '<?php echo $templateDir ?>/' + sample.replace(/\.jpg/, '-1024x682.jpg');
|
282 |
var pagelink = '<?php echo get_option("siteurl") ?>' + '/?attachment_id=9999';
|
283 |
+
var fileType='mp4';
|
284 |
previewHTML = previewHTML.replace(/{FILELINK}/g, fileLink);
|
285 |
previewHTML = previewHTML.replace(/{FULL}/g, fileLink);
|
286 |
previewHTML = previewHTML.replace(/{IMAGE}/g, fileLink);
|
287 |
previewHTML = previewHTML.replace(/{FILENAME}/, sample);
|
288 |
+
previewHTML = previewHTML.replace(/{FILETYPE}/, fileType);
|
289 |
previewHTML = previewHTML.replace(/{PAGELINK}/, pagelink);
|
290 |
previewHTML = previewHTML.replace(/{RELFILENAME}/, sample);
|
291 |
previewHTML = previewHTML.replace(/{THUMB(NAIL|)}/, thumb);
|
config_form_image.php
CHANGED
@@ -59,6 +59,7 @@
|
|
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>
|
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>{FILETYPE} The file extension (jpg, png, doc, pdf, etc)</li>
|
63 |
<li>{FULL} same as {FILELINK}</li>
|
64 |
<li>{HEIGHT} gets replaced with the height of the photo</li>
|
65 |
<li>{ID} gets replaced with the post id</li>
|
config_form_video.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
?>
|
6 |
<tr>
|
7 |
<th scope='row'><?php _e('Video template 1', 'postie') ?></th>
|
8 |
-
<?php $templateDir =
|
9 |
<td>
|
10 |
<input type='hidden' id='postie-settings-selected_video1template' name='postie-settings[selected_video1template]'
|
11 |
value="<?php echo esc_attr($selected_video1template) ?>" />
|
@@ -36,7 +36,7 @@
|
|
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 |
-
|
40 |
name='postie-settings[video1template]'><?php echo esc_attr($video1template) ?></textarea>
|
41 |
</td>
|
42 |
</tr>
|
@@ -57,7 +57,7 @@
|
|
57 |
value="<?php echo esc_attr($selected_video2template) ?>" />
|
58 |
<select name='video2templateselect' id='video2templateselect'
|
59 |
onchange="changeStyle('video2TemplatePreview', 'postie-settings-video2template',
|
60 |
-
|
61 |
<?php
|
62 |
include(POSTIE_ROOT . '/templates/video2_templates.php');
|
63 |
$styleOptions = $video2Templates;
|
@@ -82,7 +82,7 @@
|
|
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 |
-
|
86 |
name='postie-settings[video2template]'>
|
87 |
<?php echo esc_attr($video2template) ?>
|
88 |
</textarea>
|
@@ -105,7 +105,7 @@
|
|
105 |
value="<?php echo esc_attr($selected_audiotemplate) ?>" />
|
106 |
<select name='audiotemplateselect' id='audiotemplateselect'
|
107 |
onchange="changeStyle('audioTemplatePreview', 'postie-settings-audiotemplate',
|
108 |
-
|
109 |
<?php
|
110 |
include(POSTIE_ROOT . '/templates/audio_templates.php');
|
111 |
$styleOptions = $audioTemplates;
|
@@ -131,7 +131,7 @@
|
|
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 |
-
|
135 |
name='postie-settings[audiotemplate]'><?php echo esc_attr($audiotemplate) ?></textarea>
|
136 |
</td>
|
137 |
</tr>
|
5 |
?>
|
6 |
<tr>
|
7 |
<th scope='row'><?php _e('Video template 1', 'postie') ?></th>
|
8 |
+
<?php $templateDir = esc_url(plugins_url() . '/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) ?>" />
|
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>
|
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;
|
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>
|
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;
|
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>
|
docs/Changes.txt
CHANGED
@@ -27,6 +27,13 @@ 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.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
|
27 |
Attachments are now processed in the order they were attached.
|
28 |
|
29 |
== CHANGELOG ==
|
30 |
+
= 1.7.23 (2015-12-09) =
|
31 |
+
* Fix bug where emails inside shortcodes were being linkified
|
32 |
+
* Lookup categories by slug as well as by name
|
33 |
+
* WordPress 4.4 testing
|
34 |
+
* Added new video template for using video shortcode
|
35 |
+
* Added new template variable - FILETYPE which is the file extension
|
36 |
+
|
37 |
= 1.7.22 (2015-11-09) =
|
38 |
* Update admin screen to match current WP style
|
39 |
* Remove dependence on simple tabs jQuery-UI library and use WP admin tab style
|
docs/Postie.txt
CHANGED
@@ -5,8 +5,8 @@ Author URI: http://allens-home.com/
|
|
5 |
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.
|
9 |
-
Stable tag: 1.7.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
5 |
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.4
|
9 |
+
Stable tag: 1.7.23
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
lib_autolink.php
CHANGED
@@ -52,15 +52,15 @@ class PostieAutolink {
|
|
52 |
$fail_text = $pre_hit . $hit;
|
53 |
$fail_len = strlen($fail_text);
|
54 |
|
55 |
-
#
|
56 |
-
# substring found - first check to see if we're inside a link tag already...
|
57 |
-
#
|
58 |
|
59 |
$bits = preg_split("!</a>!i", $pre);
|
60 |
$last_bit = array_pop($bits);
|
61 |
if (preg_match("!<a\s!i", $last_bit)) {
|
62 |
|
63 |
-
#echo "fail 1 at $cursor<br />\n";
|
64 |
|
65 |
$ok = 0;
|
66 |
$cursor += $fail_len;
|
@@ -68,17 +68,17 @@ class PostieAutolink {
|
|
68 |
}
|
69 |
}
|
70 |
|
71 |
-
#
|
72 |
-
# looks like a nice spot to autolink from - check the pre
|
73 |
-
# to see if there was whitespace before this match
|
74 |
-
#
|
75 |
|
76 |
if ($ok) {
|
77 |
|
78 |
if ($pre) {
|
79 |
if (!preg_match('![\s\(\[\{>]$!s', $pre)) {
|
80 |
|
81 |
-
#echo "fail 2 at $cursor ($pre)<br />\n";
|
82 |
|
83 |
$ok = 0;
|
84 |
$cursor += $fail_len;
|
@@ -87,9 +87,9 @@ class PostieAutolink {
|
|
87 |
}
|
88 |
}
|
89 |
|
90 |
-
#
|
91 |
-
# we want to autolink here - find the extent of the url
|
92 |
-
#
|
93 |
|
94 |
if ($ok) {
|
95 |
if (preg_match('/^([a-z0-9\-\.\/\-_%~!?=,:;&+*#@\(\)\$]+)/i', $post, $matches)) {
|
@@ -102,9 +102,9 @@ class PostieAutolink {
|
|
102 |
$url = html_entity_decode($url);
|
103 |
|
104 |
|
105 |
-
#
|
106 |
-
# remove trailing punctuation from url
|
107 |
-
#
|
108 |
|
109 |
while (preg_match('|[.,!;:?]$|', $url)) {
|
110 |
$url = substr($url, 0, strlen($url) - 1);
|
@@ -120,9 +120,9 @@ class PostieAutolink {
|
|
120 |
}
|
121 |
|
122 |
|
123 |
-
#
|
124 |
-
# nice-i-fy url here
|
125 |
-
#
|
126 |
|
127 |
$link_url = $url;
|
128 |
$display_url = $url;
|
@@ -140,9 +140,9 @@ class PostieAutolink {
|
|
140 |
$display_url = $this->autolink_label($display_url, $limit);
|
141 |
|
142 |
|
143 |
-
#
|
144 |
-
# add the url
|
145 |
-
#
|
146 |
|
147 |
$currentTagfill = $tagfill;
|
148 |
if ($display_url != $link_url && !preg_match('@title=@msi', $currentTagfill) && $auto_title) {
|
@@ -160,7 +160,7 @@ class PostieAutolink {
|
|
160 |
|
161 |
$buffer .= "<a href=\"{$link_url_enc}\"$currentTagfill>{$display_url_enc}</a>";
|
162 |
} else {
|
163 |
-
#echo "fail 3 at $cursor<br />\n";
|
164 |
|
165 |
$ok = 0;
|
166 |
$cursor += $fail_len;
|
@@ -169,9 +169,9 @@ class PostieAutolink {
|
|
169 |
}
|
170 |
}
|
171 |
|
172 |
-
#
|
173 |
-
# add everything from the cursor to the end onto the buffer.
|
174 |
-
#
|
175 |
|
176 |
$buffer .= substr($text, $cursor);
|
177 |
|
@@ -198,7 +198,7 @@ class PostieAutolink {
|
|
198 |
function autolink_email($text, $tagfill = '') {
|
199 |
|
200 |
$atom = '[^()<>@,;:\\\\".\\[\\]\\x00-\\x20\\x7f]+'; # from RFC822
|
201 |
-
#die($atom);
|
202 |
|
203 |
$text_l = StrToLower($text);
|
204 |
$cursor = 0;
|
@@ -207,9 +207,9 @@ class PostieAutolink {
|
|
207 |
|
208 |
while (($cursor < strlen($text)) && $loop) {
|
209 |
|
210 |
-
#
|
211 |
-
# find an '@' symbol
|
212 |
-
#
|
213 |
|
214 |
$ok = 1;
|
215 |
$pos = strpos($text_l, '@', $cursor);
|
@@ -227,16 +227,36 @@ class PostieAutolink {
|
|
227 |
$fail_text = $pre . $hit;
|
228 |
$fail_len = strlen($fail_text);
|
229 |
|
230 |
-
|
231 |
-
|
|
|
|
|
|
|
232 |
# substring found - first check to see if we're inside a link tag already...
|
233 |
-
#
|
234 |
|
235 |
$bits = preg_split("!</a>!i", $pre);
|
236 |
$last_bit = array_pop($bits);
|
|
|
|
|
237 |
if (preg_match("!<a\s!i", $last_bit)) {
|
238 |
|
239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
|
241 |
$ok = 0;
|
242 |
$cursor += $fail_len;
|
@@ -244,14 +264,14 @@ class PostieAutolink {
|
|
244 |
}
|
245 |
}
|
246 |
|
247 |
-
#
|
248 |
-
# check backwards
|
249 |
-
#
|
250 |
|
251 |
if ($ok) {
|
252 |
if (preg_match("!($atom(\.$atom)*)\$!", $pre, $matches)) {
|
253 |
|
254 |
-
# move matched part of address into $hit
|
255 |
|
256 |
$len = strlen($matches[1]);
|
257 |
$plen = strlen($pre);
|
@@ -260,7 +280,7 @@ class PostieAutolink {
|
|
260 |
$pre = substr($pre, 0, $plen - $len);
|
261 |
} else {
|
262 |
|
263 |
-
#echo "fail 2 at $cursor ($pre)<br />\n";
|
264 |
|
265 |
$ok = 0;
|
266 |
$cursor += $fail_len;
|
@@ -268,21 +288,21 @@ class PostieAutolink {
|
|
268 |
}
|
269 |
}
|
270 |
|
271 |
-
#
|
272 |
-
# check forwards
|
273 |
-
#
|
274 |
|
275 |
if ($ok) {
|
276 |
if (preg_match("!^($atom(\.$atom)*)!", $post, $matches)) {
|
277 |
|
278 |
-
# move matched part of address into $hit
|
279 |
|
280 |
$len = strlen($matches[1]);
|
281 |
|
282 |
$hit .= substr($post, 0, $len);
|
283 |
$post = substr($post, $len);
|
284 |
} else {
|
285 |
-
#echo "fail 3 at $cursor ($post)<br />\n";
|
286 |
|
287 |
$ok = 0;
|
288 |
$cursor += $fail_len;
|
@@ -290,9 +310,9 @@ class PostieAutolink {
|
|
290 |
}
|
291 |
}
|
292 |
|
293 |
-
#
|
294 |
-
# commit
|
295 |
-
#
|
296 |
|
297 |
if ($ok) {
|
298 |
|
@@ -302,9 +322,9 @@ class PostieAutolink {
|
|
302 |
}
|
303 |
}
|
304 |
|
305 |
-
#
|
306 |
-
# add everything from the cursor to the end onto the buffer.
|
307 |
-
#
|
308 |
|
309 |
$buffer .= substr($text, $cursor);
|
310 |
|
52 |
$fail_text = $pre_hit . $hit;
|
53 |
$fail_len = strlen($fail_text);
|
54 |
|
55 |
+
#
|
56 |
+
# substring found - first check to see if we're inside a link tag already...
|
57 |
+
#
|
58 |
|
59 |
$bits = preg_split("!</a>!i", $pre);
|
60 |
$last_bit = array_pop($bits);
|
61 |
if (preg_match("!<a\s!i", $last_bit)) {
|
62 |
|
63 |
+
#echo "fail 1 at $cursor<br />\n";
|
64 |
|
65 |
$ok = 0;
|
66 |
$cursor += $fail_len;
|
68 |
}
|
69 |
}
|
70 |
|
71 |
+
#
|
72 |
+
# looks like a nice spot to autolink from - check the pre
|
73 |
+
# to see if there was whitespace before this match
|
74 |
+
#
|
75 |
|
76 |
if ($ok) {
|
77 |
|
78 |
if ($pre) {
|
79 |
if (!preg_match('![\s\(\[\{>]$!s', $pre)) {
|
80 |
|
81 |
+
#echo "fail 2 at $cursor ($pre)<br />\n";
|
82 |
|
83 |
$ok = 0;
|
84 |
$cursor += $fail_len;
|
87 |
}
|
88 |
}
|
89 |
|
90 |
+
#
|
91 |
+
# we want to autolink here - find the extent of the url
|
92 |
+
#
|
93 |
|
94 |
if ($ok) {
|
95 |
if (preg_match('/^([a-z0-9\-\.\/\-_%~!?=,:;&+*#@\(\)\$]+)/i', $post, $matches)) {
|
102 |
$url = html_entity_decode($url);
|
103 |
|
104 |
|
105 |
+
#
|
106 |
+
# remove trailing punctuation from url
|
107 |
+
#
|
108 |
|
109 |
while (preg_match('|[.,!;:?]$|', $url)) {
|
110 |
$url = substr($url, 0, strlen($url) - 1);
|
120 |
}
|
121 |
|
122 |
|
123 |
+
#
|
124 |
+
# nice-i-fy url here
|
125 |
+
#
|
126 |
|
127 |
$link_url = $url;
|
128 |
$display_url = $url;
|
140 |
$display_url = $this->autolink_label($display_url, $limit);
|
141 |
|
142 |
|
143 |
+
#
|
144 |
+
# add the url
|
145 |
+
#
|
146 |
|
147 |
$currentTagfill = $tagfill;
|
148 |
if ($display_url != $link_url && !preg_match('@title=@msi', $currentTagfill) && $auto_title) {
|
160 |
|
161 |
$buffer .= "<a href=\"{$link_url_enc}\"$currentTagfill>{$display_url_enc}</a>";
|
162 |
} else {
|
163 |
+
#echo "fail 3 at $cursor<br />\n";
|
164 |
|
165 |
$ok = 0;
|
166 |
$cursor += $fail_len;
|
169 |
}
|
170 |
}
|
171 |
|
172 |
+
#
|
173 |
+
# add everything from the cursor to the end onto the buffer.
|
174 |
+
#
|
175 |
|
176 |
$buffer .= substr($text, $cursor);
|
177 |
|
198 |
function autolink_email($text, $tagfill = '') {
|
199 |
|
200 |
$atom = '[^()<>@,;:\\\\".\\[\\]\\x00-\\x20\\x7f]+'; # from RFC822
|
201 |
+
#die($atom);
|
202 |
|
203 |
$text_l = StrToLower($text);
|
204 |
$cursor = 0;
|
207 |
|
208 |
while (($cursor < strlen($text)) && $loop) {
|
209 |
|
210 |
+
#
|
211 |
+
# find an '@' symbol
|
212 |
+
#
|
213 |
|
214 |
$ok = 1;
|
215 |
$pos = strpos($text_l, '@', $cursor);
|
227 |
$fail_text = $pre . $hit;
|
228 |
$fail_len = strlen($fail_text);
|
229 |
|
230 |
+
DebugEcho("autolink_email: Pre: $pre");
|
231 |
+
DebugEcho("autolink_email: Hit: $hit");
|
232 |
+
DebugEcho("autolink_email: Post: $post");
|
233 |
+
DebugEcho("autolink_email: Fail: $fail_text");
|
234 |
+
#
|
235 |
# substring found - first check to see if we're inside a link tag already...
|
236 |
+
#
|
237 |
|
238 |
$bits = preg_split("!</a>!i", $pre);
|
239 |
$last_bit = array_pop($bits);
|
240 |
+
DebugEcho("autolink_email: link? $last_bit");
|
241 |
+
|
242 |
if (preg_match("!<a\s!i", $last_bit)) {
|
243 |
|
244 |
+
DebugEcho("autolink_email: link fail 1 at $cursor");
|
245 |
+
|
246 |
+
$ok = 0;
|
247 |
+
$cursor += $fail_len;
|
248 |
+
$buffer .= $fail_text;
|
249 |
+
}
|
250 |
+
|
251 |
+
#
|
252 |
+
# check to see if we're inside a shortcode
|
253 |
+
#
|
254 |
+
$bits = preg_split("!\]!i", $pre);
|
255 |
+
$last_bit = array_pop($bits);
|
256 |
+
DebugEcho("autolink_email: shortcode? $last_bit");
|
257 |
+
if (preg_match("!\[!i", $last_bit)) {
|
258 |
+
|
259 |
+
DebugEcho("autolink_email: shortcode fail 1 at $cursor");
|
260 |
|
261 |
$ok = 0;
|
262 |
$cursor += $fail_len;
|
264 |
}
|
265 |
}
|
266 |
|
267 |
+
#
|
268 |
+
# check backwards
|
269 |
+
#
|
270 |
|
271 |
if ($ok) {
|
272 |
if (preg_match("!($atom(\.$atom)*)\$!", $pre, $matches)) {
|
273 |
|
274 |
+
# move matched part of address into $hit
|
275 |
|
276 |
$len = strlen($matches[1]);
|
277 |
$plen = strlen($pre);
|
280 |
$pre = substr($pre, 0, $plen - $len);
|
281 |
} else {
|
282 |
|
283 |
+
#echo "fail 2 at $cursor ($pre)<br />\n";
|
284 |
|
285 |
$ok = 0;
|
286 |
$cursor += $fail_len;
|
288 |
}
|
289 |
}
|
290 |
|
291 |
+
#
|
292 |
+
# check forwards
|
293 |
+
#
|
294 |
|
295 |
if ($ok) {
|
296 |
if (preg_match("!^($atom(\.$atom)*)!", $post, $matches)) {
|
297 |
|
298 |
+
# move matched part of address into $hit
|
299 |
|
300 |
$len = strlen($matches[1]);
|
301 |
|
302 |
$hit .= substr($post, 0, $len);
|
303 |
$post = substr($post, $len);
|
304 |
} else {
|
305 |
+
#echo "fail 3 at $cursor ($post)<br />\n";
|
306 |
|
307 |
$ok = 0;
|
308 |
$cursor += $fail_len;
|
310 |
}
|
311 |
}
|
312 |
|
313 |
+
#
|
314 |
+
# commit
|
315 |
+
#
|
316 |
|
317 |
if ($ok) {
|
318 |
|
322 |
}
|
323 |
}
|
324 |
|
325 |
+
#
|
326 |
+
# add everything from the cursor to the end onto the buffer.
|
327 |
+
#
|
328 |
|
329 |
$buffer .= substr($text, $cursor);
|
330 |
|
postie-functions.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
$Id: postie-functions.php
|
4 |
*/
|
5 |
|
6 |
class PostiePostModifiers {
|
@@ -1262,7 +1262,8 @@ function GetContent($part, &$attachments, $post_id, $poster, $config) {
|
|
1262 |
EchoError($file_id->get_error_message());
|
1263 |
}
|
1264 |
} else {
|
1265 |
-
|
|
|
1266 |
DebugDump($config['supported_file_types']);
|
1267 |
}
|
1268 |
break;
|
@@ -2380,6 +2381,7 @@ function parseTemplate($fileid, $type, $template, $orig_filename, $icon = "") {
|
|
2380 |
$the_parent = get_post($attachment->post_parent);
|
2381 |
$uploadDir = wp_upload_dir();
|
2382 |
$fileName = basename($attachment->guid);
|
|
|
2383 |
$absFileName = $uploadDir['path'] . '/' . $fileName;
|
2384 |
$relFileName = str_replace(ABSPATH, '', $absFileName);
|
2385 |
$fileLink = wp_get_attachment_url($fileid);
|
@@ -2401,6 +2403,7 @@ function parseTemplate($fileid, $type, $template, $orig_filename, $icon = "") {
|
|
2401 |
}
|
2402 |
$template = str_replace('{FULL}', $fileLink, $template);
|
2403 |
$template = str_replace('{FILELINK}', $fileLink, $template);
|
|
|
2404 |
$template = str_replace('{PAGELINK}', $pageLink, $template);
|
2405 |
$template = str_replace('{FILENAME}', $orig_filename, $template);
|
2406 |
$template = str_replace('{IMAGE}', $fileLink, $template);
|
@@ -2718,6 +2721,7 @@ function tag_Categories(&$subject, $defaultCategoryId, $category_match, $post_id
|
|
2718 |
}
|
2719 |
}
|
2720 |
if (!$found) {
|
|
|
2721 |
$post_categories[] = $defaultCategoryId;
|
2722 |
$subject = $original_subject;
|
2723 |
}
|
@@ -2747,6 +2751,12 @@ function lookup_category($trial_category, $category_match) {
|
|
2747 |
return $term->term_id;
|
2748 |
}
|
2749 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2750 |
if (is_numeric($trial_category)) {
|
2751 |
DebugEcho("category: looking for id '$trial_category'");
|
2752 |
$cat_id = intval($trial_category);
|
@@ -3623,7 +3633,7 @@ function postie_get_mail() {
|
|
3623 |
}
|
3624 |
|
3625 |
//don't output the password
|
3626 |
-
$tmp_config
|
3627 |
unset($tmp_config['mail_password']);
|
3628 |
DebugDump($tmp_config);
|
3629 |
|
1 |
<?php
|
2 |
/*
|
3 |
+
$Id: postie-functions.php 1304718 2015-12-09 21:40:56Z WayneAllen $
|
4 |
*/
|
5 |
|
6 |
class PostiePostModifiers {
|
1262 |
EchoError($file_id->get_error_message());
|
1263 |
}
|
1264 |
} else {
|
1265 |
+
EchoError("$filename has an unsupported MIME type $mimetype_primary and was not added.");
|
1266 |
+
DebugEcho("GetContent: Not in supported filetype list: '$mimetype_primary'");
|
1267 |
DebugDump($config['supported_file_types']);
|
1268 |
}
|
1269 |
break;
|
2381 |
$the_parent = get_post($attachment->post_parent);
|
2382 |
$uploadDir = wp_upload_dir();
|
2383 |
$fileName = basename($attachment->guid);
|
2384 |
+
$fileType = pathinfo($fileName, PATHINFO_EXTENSION);
|
2385 |
$absFileName = $uploadDir['path'] . '/' . $fileName;
|
2386 |
$relFileName = str_replace(ABSPATH, '', $absFileName);
|
2387 |
$fileLink = wp_get_attachment_url($fileid);
|
2403 |
}
|
2404 |
$template = str_replace('{FULL}', $fileLink, $template);
|
2405 |
$template = str_replace('{FILELINK}', $fileLink, $template);
|
2406 |
+
$template = str_replace('{FILETYPE}', $fileType, $template);
|
2407 |
$template = str_replace('{PAGELINK}', $pageLink, $template);
|
2408 |
$template = str_replace('{FILENAME}', $orig_filename, $template);
|
2409 |
$template = str_replace('{IMAGE}', $fileLink, $template);
|
2721 |
}
|
2722 |
}
|
2723 |
if (!$found) {
|
2724 |
+
DebugEcho("tag_Categories: using default: $defaultCategoryId");
|
2725 |
$post_categories[] = $defaultCategoryId;
|
2726 |
$subject = $original_subject;
|
2727 |
}
|
2751 |
return $term->term_id;
|
2752 |
}
|
2753 |
|
2754 |
+
$term = get_term_by('slug', esc_attr($trial_category), 'category');
|
2755 |
+
if (!empty($term)) {
|
2756 |
+
DebugEcho("category: found by slug $trial_category");
|
2757 |
+
return $term->term_id;
|
2758 |
+
}
|
2759 |
+
|
2760 |
if (is_numeric($trial_category)) {
|
2761 |
DebugEcho("category: looking for id '$trial_category'");
|
2762 |
$cat_id = intval($trial_category);
|
3633 |
}
|
3634 |
|
3635 |
//don't output the password
|
3636 |
+
$tmp_config = $config;
|
3637 |
unset($tmp_config['mail_password']);
|
3638 |
DebugDump($tmp_config);
|
3639 |
|
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.
|
8 |
Author: Wayne Allen
|
9 |
Author URI: http://PostiePlugin.com/
|
10 |
License: GPL2
|
@@ -28,12 +28,12 @@
|
|
28 |
*/
|
29 |
|
30 |
/*
|
31 |
-
$Id: postie.php
|
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.
|
37 |
define("POSTIE_ROOT", dirname(__FILE__));
|
38 |
define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
|
39 |
|
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.23
|
8 |
Author: Wayne Allen
|
9 |
Author URI: http://PostiePlugin.com/
|
10 |
License: GPL2
|
28 |
*/
|
29 |
|
30 |
/*
|
31 |
+
$Id: postie.php 1304718 2015-12-09 21:40:56Z 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.23');
|
37 |
define("POSTIE_ROOT", dirname(__FILE__));
|
38 |
define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
|
39 |
|
readme.txt
CHANGED
@@ -5,8 +5,8 @@ Author URI: http://allens-home.com/
|
|
5 |
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.
|
9 |
-
Stable tag: 1.7.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -235,6 +235,13 @@ 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.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
|
5 |
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.4
|
9 |
+
Stable tag: 1.7.23
|
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.23 (2015-12-09) =
|
239 |
+
* Fix bug where emails inside shortcodes were being linkified
|
240 |
+
* Lookup categories by slug as well as by name
|
241 |
+
* WordPress 4.4 testing
|
242 |
+
* Added new video template for using video shortcode
|
243 |
+
* Added new template variable - FILETYPE which is the file extension
|
244 |
+
|
245 |
= 1.7.22 (2015-11-09) =
|
246 |
* Update admin screen to match current WP style
|
247 |
* Remove dependence on simple tabs jQuery-UI library and use WP admin tab style
|
templates/video1_templates.php
CHANGED
@@ -76,7 +76,9 @@ $large_widescreen = '<object ' .
|
|
76 |
'</embed> ' .
|
77 |
'</object>';
|
78 |
|
|
|
|
|
79 |
$simple_link = '<a href="{FILELINK}">{FILENAME}</a>';
|
80 |
|
81 |
$custom = isset($config) ? (array_key_exists('VIDEO1TEMPLATE', $config) ? $config['VIDEO1TEMPLATE'] : "") : "";
|
82 |
-
$video1Templates = compact('simple_link', 'small', 'medium', 'medium_widescreen', 'large', 'large_widescreen', 'custom');
|
76 |
'</embed> ' .
|
77 |
'</object>';
|
78 |
|
79 |
+
$vshortcode = '[video width="568" height="320" {FILETYPE}="{FILELINK}"][/video]';
|
80 |
+
|
81 |
$simple_link = '<a href="{FILELINK}">{FILENAME}</a>';
|
82 |
|
83 |
$custom = isset($config) ? (array_key_exists('VIDEO1TEMPLATE', $config) ? $config['VIDEO1TEMPLATE'] : "") : "";
|
84 |
+
$video1Templates = compact('simple_link', 'small', 'medium', 'medium_widescreen', 'large', 'large_widescreen', 'vshortcode', 'custom');
|