Postie - Version 1.2

Version Description

Download this release

Release Info

Developer robfelty
Plugin Icon 128x128 Postie
Version 1.2
Comparing to
See all releases

Code changes from version 1.1.5 to 1.2

config_form.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- require_once('admin.php');
3
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'postie-functions.php');
4
  global $wpdb,$wp_roles;
5
 
@@ -8,7 +8,7 @@ global $wpdb,$wp_roles;
8
  <p>Postie only works on on Word Press version 2.0 and above</p>");
9
  exit();
10
  }
11
- $title = __('Postie Options');
12
  $parent_file = 'options-general.php';
13
  $config = GetConfig();
14
  $messages[1] = "Configuration successfully updated!";
@@ -23,36 +23,29 @@ legend {font-weight:bold;
23
  fieldset {border: 1px solid black;}
24
  </style>
25
  <?php if (isset($_GET['message'])) : ?>
26
- <div class="updated"><p><?php _e($messages[$_GET['message']]); ?></p></div>
27
  <?php endif; ?>
28
  <div class="wrap">
29
- <h2><?php _e('Postie Options') ?></h2>
30
- <p>
31
  <form name="postie-options" method="post" action="<?php echo get_option('siteurl') . "/wp-content/plugins/postie/config_handler.php"?>">
32
  <input type="hidden" name="action" value="reset" />
33
- <p align="right"><?php _e("If you would like to start over - you can click the button on the right to reset all configurations to the default.");?></p>
34
  <p class="submit">
35
- <input name="Submit" value="<?php _e("Reset Configs To Default")?> &raquo" type="submit">
36
  </p>
37
  </form>
38
- </p>
39
- <p>
40
  <form name="postie-options" method="get" action="<?php echo get_option('siteurl') . "/wp-content/plugins/postie/get_mail.php"?>">
41
- <p align="right"><?php _e("To run the check mail script manually");?></p>
42
  <p class="submit">
43
- <input name="Submit" value="<?php _e("Run Postie");?> &raquo;" type="submit">
 
44
  </p>
45
  </form>
46
- </p>
47
- <p>
48
  <form name="postie-options" method="post" action="<?php echo get_option('siteurl') . "/wp-content/plugins/postie/config_handler.php"?>">
49
  <input type="hidden" name="action" value="test" />
50
- <p align="right"><?php _e("If you have problems with Postie this will run a special script to test your configuraiton options");?></p>
51
  <p class="submit">
52
- <input name="Submit" value="<?php _e("Test Config");?>&raquo;" type="submit">
 
53
  </p>
54
  </form>
55
- </p>
56
  <form name="postie-options" method="post" action="<?php echo get_option('siteurl') . "/wp-content/plugins/postie/config_handler.php"?>">
57
  <input type="hidden" name="action" value="config" />
58
  <table width="100%" cellspacing="2" cellpadding="5" class="editform">
@@ -62,19 +55,81 @@ fieldset {border: 1px solid black;}
62
 
63
 
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
  <tr><td colspan=2>
67
  <fieldset class="options">
68
- <legend><?php _e('Authorization Settings');?></legend>
69
  <table width="100%" cellspacing="2" cellpadding="5" class="editform">
70
  <?php echo BuildBooleanSelect("Allow Anyone To Post Via Email","TURN_AUTHORIZATION_OFF",$config["TURN_AUTHORIZATION_OFF"],"Changing this to yes is NOT RECOMMEDED - anything that gets sent in will automatically be posted. This could make it easier to compromise your server - YOU HAVE BEEN WARNED.");?>
71
  <tr>
72
- <th scope="row"><?php _e('Roles That Can Post:') ?></th>
73
  <td>
74
  <table>
75
  <tr><th>Administrator role can always post.</th>
76
  <?php
77
  foreach($wp_roles->role_names as $roleId => $name) {
 
78
  $role = &$wp_roles->get_role($roleId);
79
  if ($role->has_cap("post_via_postie")) {
80
  $checked = " CHECKED ";
@@ -89,11 +144,11 @@ fieldset {border: 1px solid black;}
89
  ?>
90
  </table>
91
  <br />
92
- <code><?php _e("This allows you to grant access to other users to post if they have the proper access level");?></code>
93
  </td>
94
  </tr>
95
  <tr>
96
- <th width="33%" valign="top" scope="row"><?php _e('Post status:') ?> </th>
97
  <td>
98
  <select name="POST_STATUS" id="POST_STATUS">
99
  <option value="publish" <?php if($config["POST_STATUS"] == "publish") { echo
@@ -103,7 +158,7 @@ fieldset {border: 1px solid black;}
103
  <option value="pending" <?php if($config["POST_STATUS"] == "pending") { echo
104
  "SELECTED";} ?>>Pending Review</option>
105
  </select><br />
106
- <?php _e("Recommended");?>: <code>plain</code>
107
  <br />
108
  </td>
109
  </tr>
@@ -114,7 +169,7 @@ fieldset {border: 1px solid black;}
114
  <td>
115
  <input name="ADMIN_USERNAME" type="text" id="ADMIN_USERNAME"
116
  value="<?php echo $config["ADMIN_USERNAME"]; ?>" size="50" /><br />
117
- <?php _e("Recommended");?>: <code>admin</code>
118
  <br />
119
  </td>
120
  </tr>
@@ -126,21 +181,21 @@ fieldset {border: 1px solid black;}
126
 
127
  <tr><td colspan=2>
128
  <fieldset class="options">
129
- <legend><?php _e('Directory Settings');?></legend>
130
  <table width="100%" cellspacing="2" cellpadding="5" class="editform">
131
  <tr>
132
- <th width="33%" valign="top" scope="row"><?php _e('Directory For Photos:') ?> </th>
133
  <td>
134
  <input name="PHOTOSDIR" type="text" id="PHOTOSDIR" value="<?php echo $config["PHOTOSDIR"]; ?>" size="50" /><br />
135
- <?php _e("Recommended");?>: <code>/wp-photos/</code>
136
  <br />
137
  </td>
138
  </tr>
139
  <tr>
140
- <th width="33%" valign="top" scope="row"><?php _e('Directory For Files:') ?> </th>
141
  <td>
142
  <input name="FILESDIR" type="text" id="FILESDIR" value="<?php echo $config["FILESDIR"]; ?>" size="50" /><br />
143
- <?php _e("Recommended");?>: <code>/wp-filez/</code>
144
  <br />
145
  </td>
146
  </tr>
@@ -151,10 +206,15 @@ fieldset {border: 1px solid black;}
151
 
152
  <tr><td colspan=2>
153
  <fieldset class="options">
154
- <legend><?php _e('Message Settings');?></legend>
155
  <table width="100%" cellspacing="2" cellpadding="5" class="editform">
156
  <tr valign="top">
157
- <th scope="row"><?php _e('Default post by mail category:') ?></th>
 
 
 
 
 
158
  <td><select name="DEFAULT_POST_CATEGORY" id="DEFAULT_POST_CATEGORY">
159
  <?php
160
  $categories = $wpdb->get_results("SELECT * FROM $wpdb->terms ORDER BY name");
@@ -164,53 +224,54 @@ fieldset {border: 1px solid black;}
164
  }
165
  ?>
166
  </select></td>
 
167
  </tr>
168
  <tr valign="top">
169
  <th scope="row"><?php _e('Default post by mail tag(s):
170
- (separated by commas)') ?></th>
171
  <td><input type='text' name="DEFAULT_POST_TAGS"
172
  id="DEFAULT_POST_TAGS" value='<?php echo
173
  $config["DEFAULT_POST_TAGS"] ?>' />
174
  </td>
175
  </tr>
176
  <tr>
177
- <th width="33%" valign="top" scope="row"><?php _e('Default Title:') ?> </th>
178
  <td>
179
  <input name="DEFAULT_TITLE" type="text" id="DEFAULT_TITLE" value="<?php echo $config["DEFAULT_TITLE"]; ?>" size="50" /><br />
180
- <?php _e("Recommended");?>: <code>Live from the field</code>
181
  <br />
182
  </td>
183
  </tr>
184
  <tr>
185
- <th width="33%" valign="top" scope="row"><?php _e('Prefered Text Type (HTML/plain):') ?> </th>
186
  <td>
187
  <select name="PREFER_TEXT_TYPE" id="PREFER_TEXT_TYPE">
188
  <option value="plain">plain</option>
189
  <option value="html" <?php if($config["PREFER_TEXT_TYPE"] == "html") { echo "SELECTED";} ?>>html</option>
190
  </select><br />
191
- <?php _e("Recommended");?>: <code>plain</code>
192
  <br />
193
  </td>
194
  </tr>
195
  <tr>
196
- <th width="33%" valign="top" scope="row"><?php _e('Wrap content in pre tags:') ?> </th>
197
  <td>
198
  <select name="WRAP_PRE" id="WRAP_PRE">
199
  <option value="no">no</option>
200
  <option value="yes" <?php if($config["WRAP_PRE"] == "yes") { echo "SELECTED";} ?>>yes</option>
201
  </select><br />
202
- <?php _e("Recommended");?>: <code>no</code>
203
  <br />
204
  </td>
205
  </tr>
206
  <tr>
207
- <th width="33%" valign="top" scope="row"><?php _e('Add more meta information right before post:') ?> </th>
208
  <td>
209
  <select name="ADD_META" id="ADD_META">
210
  <option value="no">no</option>
211
  <option value="yes" <?php if($config["ADD_META"] == "yes") { echo "SELECTED";} ?>>yes</option>
212
  </select><br />
213
- <?php _e("Recommended");?>: <code>no</code>
214
  <br />
215
  </td>
216
  </tr>
@@ -221,11 +282,12 @@ fieldset {border: 1px solid black;}
221
  <?php echo BuildBooleanSelect("Allow Subject In Mail","ALLOW_SUBJECT_IN_MAIL",$config["ALLOW_SUBJECT_IN_MAIL"]);?>
222
  <?php echo BuildBooleanSelect("Allow HTML In Mail Subject","ALLOW_HTML_IN_SUBJECT",$config["ALLOW_HTML_IN_SUBJECT"]);?>
223
  <?php echo BuildBooleanSelect("Allow HTML In Mail Body","ALLOW_HTML_IN_BODY",$config["ALLOW_HTML_IN_BODY"]);?>
 
224
  <tr>
225
- <th width="33%" valign="top" scope="row"><?php _e('Encoding for pages and feeds:') ?> </th>
226
  <td>
227
  <input name="MESSAGE_ENCODING" type="text" id="MESSAGE_ENCODING" value="<?php echo $config["MESSAGE_ENCODING"]; ?>" size="50" /><br />
228
- <?php _e("Recommended");?>: <code>UTF-8</code> - it should handle ISO-8859-1 as well
229
  <br />
230
  </td>
231
  </tr>
@@ -233,20 +295,20 @@ fieldset {border: 1px solid black;}
233
  <?php echo BuildTextArea("Supported File Types","SUPPORTED_FILE_TYPES",$config["SUPPORTED_FILE_TYPES"],"Put each type on a single line.");?>
234
  <?php echo BuildTextArea("Banned File Names","BANNED_FILES_LIST",$config["BANNED_FILES_LIST"],"Put each file name on a single line.Files matching this list will never be posted to your blog.");?>
235
  <tr>
236
- <th width="33%" valign="top" scope="row"><?php _e('Tag Of Message Start:') ?> </th>
237
  <td>
238
  <p>This tag can be used to remove any text from a message that the email provider puts at the top of the message</p>
239
  <input name="MESSAGE_START" type="text" id="MESSAGE_START" value="<?php echo $config["MESSAGE_START"]; ?>" size="50" /><br />
240
- <?php _e("Recommended");?>: <code>:start</code>
241
  <br />
242
  </td>
243
  </tr>
244
  <tr>
245
- <th width="33%" valign="top" scope="row"><?php _e('Tag Of Message End:') ?> </th>
246
  <td>
247
  <p>This tag can be used to remove any text from a message that the email provider puts at the bottom of the message</p>
248
  <input name="MESSAGE_END" type="text" id="MESSAGE_END" value="<?php echo $config["MESSAGE_END"]; ?>" size="50" /><br />
249
- <?php _e("Recommended");?>: <code>:end</code>
250
  <br />
251
  </td>
252
  </tr>
@@ -260,7 +322,7 @@ fieldset {border: 1px solid black;}
260
 
261
  <tr><td colspan=2>
262
  <fieldset class="options">
263
- <legend><?php _e('Image Settings');?></legend>
264
  <table width="100%" cellspacing="2" cellpadding="5" class="editform">
265
  <?php if (!HasGDInstalled()):?>
266
  <tr>
@@ -274,93 +336,96 @@ fieldset {border: 1px solid black;}
274
  <?php echo BuildBooleanSelect("Post Images At End","IMAGES_APPEND",$config["IMAGES_APPEND"],"No means they will be put before the text of the message.");?>
275
  <?php echo BuildBooleanSelect("Resize Large Images","RESIZE_LARGE_IMAGES",$config["RESIZE_LARGE_IMAGES"]);?>
276
  <tr>
277
- <th scope="row"><?php _e('Maximum Image Width:') ?> </th>
278
  <td><input name="MAX_IMAGE_WIDTH" type="text" id="MAX_IMAGE_WIDTH" value="<?php echo $config['MAX_IMAGE_WIDTH']; ?>" size="4" />
279
- <?php _e('pixels') ?>
280
- <br /><?php _e("Recommended");?>: <code>400</code><br />
281
  </td>
282
  </tr>
283
  <tr>
284
- <th scope="row"><?php _e('Maximum Image Height:') ?> </th>
285
  <td><input name="MAX_IMAGE_HEIGHT" type="text" id="MAX_IMAGE_HEIGHT" value="<?php echo $config['MAX_IMAGE_HEIGHT']; ?>" size="4" />
286
- <?php _e('pixels') ?>
287
- <br /><?php _e("Recommended");?>: <code>Leave Blank</code><br />
288
  </td>
289
  </tr>
290
  <tr>
291
- <th scope="row"><?php _e('JPEG Compression:') ?> </th>
292
  <td><input name="JPEGQUALITY" type="text" id="JPEGQUALITY" value="<?php echo $config['JPEGQUALITY']; ?>" size="3" />
293
- <?php _e('%') ?>
294
- <br /><?php _e("Recommended");?>: <code>80</code>%
295
  </td>
296
  </tr>
297
  <?php endif;?>
298
  <?php echo BuildBooleanSelect("Use ImageMagick","USE_IMAGEMAGICK",$config["USE_IMAGEMAGICK"]);?>
299
  <tr>
300
- <th scope="row"><?php _e('convert binary location:') ?> </th>
301
  <td><input name="IMAGEMAGICK_CONVERT" type="text" id="IMAGEMAGICK_CONVERT" value="<?php echo $config['IMAGEMAGICK_CONVERT']; ?>" size="30" />
302
- <br /><?php _e("Recommended");?>: <code>only needed if you are using ImageMagick <br /> should be /usr/bin/convert</code>
303
  </td>
304
  </tr>
305
  <?php echo BuildBooleanSelect("Automatic SmartSharp Mask","AUTO_SMART_SHARP",$config["AUTO_SMART_SHARP"],"This automatically smart sharpens the images that are posted. This feature is <b>EXPERIMENTAL</b>. It alsot takes a lot of processing power");?>
306
 
307
  <?php echo BuildBooleanSelect("Start Image Count At 0","START_IMAGE_COUNT_AT_ZERO",$config["START_IMAGE_COUNT_AT_ZERO"]);?>
308
  <tr>
309
- <th width="33%" valign="top" scope="row"><?php _e('Image Place Holder Tag:') ?> </th>
310
  <td>
311
  <input name="IMAGE_PLACEHOLDER" type="text" id="IMAGE_PLACEHOLDER" value="<?php echo $config["IMAGE_PLACEHOLDER"]; ?>" size="50" /><br />
312
- <?php _e("Recommended");?>: <code>#img%#</code>
313
  <br />
314
  </td>
315
  </tr>
316
  <tr>
317
- <th width="33%" valign="top" scope="row"><?php _e('Image CSS Class:') ?> </th>
318
  <td>
319
  <input name="IMAGECLASS" type="text" id="IMAGECLASS" value="<?php echo $config["IMAGECLASS"]; ?>" size="50" /><br />
320
- <?php _e("Recommended");?>: <code>postie-image</code>
321
  <br />
322
  </td>
323
  </tr>
324
  <tr>
325
- <th width="33%" valign="top" scope="row"><?php _e('Image CSS Style:') ?> </th>
326
  <td>
327
  <input name="IMAGESTYLE" type="text" id="IMAGESTYLE" value="<?php echo $config["IMAGESTYLE"]; ?>" size="50" /><br />
328
- <?php _e("Recommended");?>: <code>border: none;</code>
329
  <br />
330
  </td>
331
  </tr>
332
  <tr>
333
- <th width="33%" valign="top" scope="row"><?php _e('Image Div CSS:') ?> </th>
334
  <td>
335
  <input name="IMAGEDIV" type="text" id="IMAGEDIV" value="<?php echo $config["IMAGEDIV"]; ?>" size="50" /><br />
336
- <?php _e("Recommended");?>: <code>postie-image-div</code><p>This is the CSS class of a div that wraps each image. Can be used to style the post</p>
337
  <br />
338
  </td>
339
  </tr>
340
  <?php echo BuildBooleanSelect("Open images in new
341
  window","IMAGE_NEW_WINDOW",$config["IMAGE_NEW_WINDOW"],"Recommended:
342
  no");?>
343
- <tr>
344
  <?php echo BuildBooleanSelect("Use custom image
345
  template","USEIMAGETEMPLATE",$config["USEIMAGETEMPLATE"],"If you
346
  don't like the default html output around images, you can enter
347
- your own below. The default template is already there. See the
348
  readme for more details");?>
 
349
  <th width="33%" valign="top" scope="row"> <td>
350
  <textarea cols="50" rows="6" name="IMAGETEMPLATE"
351
- id="IMAGETEMPLATE"><?php
352
- echo $config["IMAGETEMPLATE"]; ?>
353
- </textarea>
354
  </td>
355
  </tr>
356
  <tr>
357
- <th width="33%" valign="top" scope="row"><?php _e('Attachment Div CSS:') ?> </th>
358
  <td>
359
  <input name="ATTACHMENTDIV" type="text" id="ATTACHMENTDIV" value="<?php echo $config["ATTACHMENTDIV"]; ?>" size="50" /><br />
360
- <?php _e("Recommended");?>: <code>postie-attachment-div</code><p>This is the CSS class of a div that wraps each file attachment. Can be used to style the post</p>
361
  <br />
362
  </td>
363
- </tr>
 
 
 
 
 
364
  </table>
365
  </fieldset>
366
  </td>
@@ -369,31 +434,69 @@ fieldset {border: 1px solid black;}
369
 
370
  <tr><td colspan=2>
371
  <fieldset class="options">
372
- <legend><?php _e('3GP');?></legend>
373
  <table width="100%" cellspacing="2" cellpadding="5" class="editform">
374
  <?php echo BuildBooleanSelect("Embed 3GP videos as QuickTime","3GP_QT",$config["3GP_QT"],"This controls if the video is just a link or embeded in the page using QuickTime");?>
 
 
 
375
  <tr>
376
- <th scope="row"><?php _e('Location of ffmpeg:') ?> </th>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
  <td><input name="3GP_FFMPEG" type="text" id="3GP_FFMPEG" value="<?php echo $config['3GP_FFMPEG']; ?>" size="30" />
378
- <br /><?php _e("Recommended");?>: <code><?php _e("only needed if you are on a Linux server and use 3gp video,and don't embed the video. This allows postie to make thumbnail of the very first frame");?> <br /><?php _e("should be /usr/bin/ffmpeg");?></code>
379
  </td>
380
  </tr>
381
  <tr>
382
- <th width="33%" valign="top" scope="row"><?php _e('3GP CSS Class:') ?> </th>
383
  <td>
384
  <input name="3GPCLASS" type="text" id="3GPCLASS" value="<?php echo $config["3GPCLASS"]; ?>" size="50" /><br />
385
- <?php _e("Recommended");?>: <code>wp-mailvideo</code>
386
  <br />
387
  </td>
388
  </tr>
389
  <tr>
390
- <th width="33%" valign="top" scope="row"><?php _e('3GP Div CSS:') ?> </th>
391
  <td>
392
  <input name="3GPDIV" type="text" id="3GPDIV" value="<?php echo $config["3GPDIV"]; ?>" size="50" /><br />
393
- <?php _e("Recommended");?>: <code>postie-3gp-div</code><p>This is the CSS class of a div that wraps each 3GP video. Can be used to style the post</p>
394
  <br />
395
  </td>
396
  </tr>
 
 
 
 
 
 
 
 
 
 
 
397
  </table>
398
  </fieldset>
399
  </td>
@@ -403,67 +506,6 @@ fieldset {border: 1px solid black;}
403
 
404
 
405
 
406
- <tr><td colspan=2>
407
- <fieldset class="options">
408
- <legend><?php _e('Mailserver Settings');?></legend>
409
-
410
-
411
- <table width="100%" cellspacing="2" cellpadding="5" class="editform">
412
- <tr>
413
- <th scope="row"><?php _e('Mail Protocol:') ?></th>
414
- <td>
415
- <table>
416
- <tr><td>
417
- <select name="INPUT_PROTOCOL" id="INPUT_PROTOCOL">
418
- <option value="pop3">POP3</option>
419
- <?php if (HasIMAPSupport(false)):?>
420
- <option value="imap" <?php if($config["INPUT_PROTOCOL"] == "imap") { echo "SELECTED";} ?>>IMAP</option>
421
- <option value="pop3-ssl" <?php if($config["INPUT_PROTOCOL"] == "pop3-ssl") { echo "SELECTED";} ?>>POP3-SSL</option>
422
- <option value="imap-ssl" <?php if($config["INPUT_PROTOCOL"] == "imap-ssl") { echo "SELECTED";} ?>>IMAP-SSL</option>
423
- <?php else:?>
424
- <option value="pop3" ><?php _e("IMAP/IMAP-SSL/POP3-SSL unavailable");?></option>
425
- <?php endif;?>
426
- </select>
427
- </td><td>
428
- <code><?php _e("Standard Ports:");?><br />
429
- <?php _e("POP3");?> - 110<br />
430
- <?php _e("IMAP");?> - 143<br />
431
- <?php _e("IMAP-SSL");?>- 993 <br />
432
- <?php _e("POP3-SSL");?> - 995 <br />
433
- </code>
434
- </td></tr></table></td>
435
- <tr>
436
- <th scope="row"><?php _e('Postie Time Correction:') ?> </th>
437
- <td><input name="TIME_OFFSET" type="text" id="TIME_OFFSET" size="2" value="<?php echo $config['TIME_OFFSET']; ?>" />
438
- <?php _e('hours') ?>
439
- <br />
440
- <?php _e("Recommended");?>: <code><?php _e("Should be the same as your normal offset - but this lets you adjust it in cases where that doesn't work.");?></code>
441
- <br />
442
-
443
- </td>
444
- </tr>
445
- </tr>
446
- <tr valign="top">
447
- <th scope="row"><?php _e('Mail Server:') ?></th>
448
- <td><input name="MAIL_SERVER" type="text" id="MAIL_SERVER" value="<?php echo $config["MAIL_SERVER"];?>" size="40" />
449
- <?php _e('Port:') ?>
450
- <input name="MAIL_SERVER_PORT" type="text" id="MAIL_SERVER_PORT" value="<?php echo $config["MAIL_SERVER_PORT"];?>" size="6" />
451
- </td>
452
- </tr>
453
- <tr valign="top">
454
- <th width="33%" scope="row"><?php _e('Mail Userid:') ?></th>
455
- <td><input name="MAIL_USERID" type="text" id="MAIL_USERID" value="<?php echo $config["MAIL_USERID"]; ?>" size="40" /></td>
456
- </tr>
457
- <tr valign="top">
458
- <th scope="row"><?php _e('Mail Password:') ?></th>
459
- <td>
460
- <input name="MAIL_PASSWORD" type="text" id="MAIL_PASSWORD" value="<?php echo $config["MAIL_PASSWORD"]; ?>" size="40" />
461
- </td>
462
- </tr>
463
- </table>
464
- </fieldset>
465
- </td>
466
- </tr>
467
 
468
 
469
 
@@ -474,7 +516,10 @@ fieldset {border: 1px solid black;}
474
 
475
  </table>
476
  <p class="submit">
477
- <input type="submit" name="Submit" value="<?php _e('Update Options') ?> &raquo;" />
478
  </p>
479
  </form>
 
 
 
480
  </div>
1
  <?php
2
+ //require_once('admin.php');
3
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'postie-functions.php');
4
  global $wpdb,$wp_roles;
5
 
8
  <p>Postie only works on on Word Press version 2.0 and above</p>");
9
  exit();
10
  }
11
+ $title = __('Postie Options', 'postie');
12
  $parent_file = 'options-general.php';
13
  $config = GetConfig();
14
  $messages[1] = "Configuration successfully updated!";
23
  fieldset {border: 1px solid black;}
24
  </style>
25
  <?php if (isset($_GET['message'])) : ?>
26
+ <div class="updated"><p><?php _e($messages[$_GET['message']], 'postie'); ?></p></div>
27
  <?php endif; ?>
28
  <div class="wrap">
29
+ <h2><?php _e('Postie Options', 'postie') ?></h2>
 
30
  <form name="postie-options" method="post" action="<?php echo get_option('siteurl') . "/wp-content/plugins/postie/config_handler.php"?>">
31
  <input type="hidden" name="action" value="reset" />
 
32
  <p class="submit">
33
+ <input name="Submit" value="<?php _e("Reset Settings To Defaults", 'postie')?> &raquo" type="submit">
34
  </p>
35
  </form>
 
 
36
  <form name="postie-options" method="get" action="<?php echo get_option('siteurl') . "/wp-content/plugins/postie/get_mail.php"?>">
 
37
  <p class="submit">
38
+ <input name="Submit" value="<?php _e("Run Postie", 'postie');?> &raquo;" type="submit">
39
+ <?php _e("(To run the check mail script manually)", 'postie');?>
40
  </p>
41
  </form>
 
 
42
  <form name="postie-options" method="post" action="<?php echo get_option('siteurl') . "/wp-content/plugins/postie/config_handler.php"?>">
43
  <input type="hidden" name="action" value="test" />
 
44
  <p class="submit">
45
+ <input name="Submit" value="<?php _e("Test Config", 'postie');?>&raquo;" type="submit">
46
+ <?php _e("this will run a special script to test your configuraiton options", 'postie');?>
47
  </p>
48
  </form>
 
49
  <form name="postie-options" method="post" action="<?php echo get_option('siteurl') . "/wp-content/plugins/postie/config_handler.php"?>">
50
  <input type="hidden" name="action" value="config" />
51
  <table width="100%" cellspacing="2" cellpadding="5" class="editform">
55
 
56
 
57
 
58
+ <tr><td colspan=2>
59
+ <fieldset class="options">
60
+ <legend><?php _e('E-mail and Mailserver Settings', 'postie');?></legend>
61
+
62
+
63
+ <table width="100%" cellspacing="2" cellpadding="5" class="editform">
64
+ <tr>
65
+ <th scope="row"><?php _e('Mail Protocol:', 'postie') ?></th>
66
+ <td>
67
+ <table>
68
+ <tr><td>
69
+ <select name="INPUT_PROTOCOL" id="INPUT_PROTOCOL">
70
+ <option value="pop3">POP3</option>
71
+ <?php if (HasIMAPSupport(false)):?>
72
+ <option value="imap" <?php if($config["INPUT_PROTOCOL"] == "imap") { echo "SELECTED";} ?>>IMAP</option>
73
+ <option value="pop3-ssl" <?php if($config["INPUT_PROTOCOL"] == "pop3-ssl") { echo "SELECTED";} ?>>POP3-SSL</option>
74
+ <option value="imap-ssl" <?php if($config["INPUT_PROTOCOL"] == "imap-ssl") { echo "SELECTED";} ?>>IMAP-SSL</option>
75
+ <?php else:?>
76
+ <option value="pop3" ><?php _e("IMAP/IMAP-SSL/POP3-SSL unavailable", 'postie');?></option>
77
+ <?php endif;?>
78
+ </select>
79
+ </td><td>
80
+ <code><?php _e("Standard Ports:", 'postie');?><br />
81
+ <?php _e("POP3", 'postie');?> - 110<br />
82
+ <?php _e("IMAP", 'postie');?> - 143<br />
83
+ <?php _e("IMAP-SSL", 'postie');?>- 993 <br />
84
+ <?php _e("POP3-SSL", 'postie');?> - 995 <br />
85
+ </code>
86
+ </td></tr></table></td>
87
+ <tr>
88
+ <th scope="row"><?php _e('Postie Time Correction:', 'postie') ?> </th>
89
+ <td><input name="TIME_OFFSET" type="text" id="TIME_OFFSET" size="2" value="<?php echo $config['TIME_OFFSET']; ?>" />
90
+ <?php _e('hours', 'postie') ?>
91
+ <br />
92
+ <?php _e("Recommended");?>: <code><?php _e("Should be the same as your normal offset - but this lets you adjust it in cases where that doesn't work.", 'postie');?></code>
93
+ <br />
94
+
95
+ </td>
96
+ </tr>
97
+ </tr>
98
+ <tr valign="top">
99
+ <th scope="row"><?php _e('Mail Server:', 'postie') ?></th>
100
+ <td><input name="MAIL_SERVER" type="text" id="MAIL_SERVER" value="<?php echo $config["MAIL_SERVER"];?>" size="40" />
101
+ <?php _e('Port:', 'postie') ?>
102
+ <input name="MAIL_SERVER_PORT" type="text" id="MAIL_SERVER_PORT" value="<?php echo $config["MAIL_SERVER_PORT"];?>" size="6" />
103
+ </td>
104
+ </tr>
105
+ <tr valign="top">
106
+ <th width="33%" scope="row"><?php _e('Mail Userid:', 'postie') ?></th>
107
+ <td><input name="MAIL_USERID" type="text" id="MAIL_USERID" value="<?php echo $config["MAIL_USERID"]; ?>" size="40" /></td>
108
+ </tr>
109
+ <tr valign="top">
110
+ <th scope="row"><?php _e('Mail Password:', 'postie') ?></th>
111
+ <td>
112
+ <input name="MAIL_PASSWORD" type="text" id="MAIL_PASSWORD" value="<?php echo $config["MAIL_PASSWORD"]; ?>" size="40" />
113
+ </td>
114
+ </tr>
115
+ </table>
116
+ </fieldset>
117
+ </td>
118
+ </tr>
119
 
120
  <tr><td colspan=2>
121
  <fieldset class="options">
122
+ <legend><?php _e('Authorization Settings', 'postie');?></legend>
123
  <table width="100%" cellspacing="2" cellpadding="5" class="editform">
124
  <?php echo BuildBooleanSelect("Allow Anyone To Post Via Email","TURN_AUTHORIZATION_OFF",$config["TURN_AUTHORIZATION_OFF"],"Changing this to yes is NOT RECOMMEDED - anything that gets sent in will automatically be posted. This could make it easier to compromise your server - YOU HAVE BEEN WARNED.");?>
125
  <tr>
126
+ <th scope="row"><?php _e('Roles That Can Post:', 'postie') ?></th>
127
  <td>
128
  <table>
129
  <tr><th>Administrator role can always post.</th>
130
  <?php
131
  foreach($wp_roles->role_names as $roleId => $name) {
132
+ $name=translate_with_context($name);
133
  $role = &$wp_roles->get_role($roleId);
134
  if ($role->has_cap("post_via_postie")) {
135
  $checked = " CHECKED ";
144
  ?>
145
  </table>
146
  <br />
147
+ <code><?php _e("This allows you to grant access to other users to post if they have the proper access level", 'postie');?></code>
148
  </td>
149
  </tr>
150
  <tr>
151
+ <th width="33%" valign="top" scope="row"><?php _e('Post status:', 'postie') ?> </th>
152
  <td>
153
  <select name="POST_STATUS" id="POST_STATUS">
154
  <option value="publish" <?php if($config["POST_STATUS"] == "publish") { echo
158
  <option value="pending" <?php if($config["POST_STATUS"] == "pending") { echo
159
  "SELECTED";} ?>>Pending Review</option>
160
  </select><br />
161
+ <?php _e("Recommended", 'postie');?>: <code>plain</code>
162
  <br />
163
  </td>
164
  </tr>
169
  <td>
170
  <input name="ADMIN_USERNAME" type="text" id="ADMIN_USERNAME"
171
  value="<?php echo $config["ADMIN_USERNAME"]; ?>" size="50" /><br />
172
+ <?php _e("Recommended", 'postie');?>: <code>admin</code>
173
  <br />
174
  </td>
175
  </tr>
181
 
182
  <tr><td colspan=2>
183
  <fieldset class="options">
184
+ <legend><?php _e('Directory Settings', 'postie');?></legend>
185
  <table width="100%" cellspacing="2" cellpadding="5" class="editform">
186
  <tr>
187
+ <th width="33%" valign="top" scope="row"><?php _e('Directory For Photos:', 'postie') ?> </th>
188
  <td>
189
  <input name="PHOTOSDIR" type="text" id="PHOTOSDIR" value="<?php echo $config["PHOTOSDIR"]; ?>" size="50" /><br />
190
+ <?php _e("Recommended", 'postie');?>: <code>/wp-photos/</code>
191
  <br />
192
  </td>
193
  </tr>
194
  <tr>
195
+ <th width="33%" valign="top" scope="row"><?php _e('Directory For Files:', 'postie') ?> </th>
196
  <td>
197
  <input name="FILESDIR" type="text" id="FILESDIR" value="<?php echo $config["FILESDIR"]; ?>" size="50" /><br />
198
+ <?php _e("Recommended", 'postie');?>: <code>/wp-filez/</code>
199
  <br />
200
  </td>
201
  </tr>
206
 
207
  <tr><td colspan=2>
208
  <fieldset class="options">
209
+ <legend><?php _e('Message Settings', 'postie');?></legend>
210
  <table width="100%" cellspacing="2" cellpadding="5" class="editform">
211
  <tr valign="top">
212
+ <th scope="row"><?php _e('Default post by mail category:', 'postie') ?></th>
213
+ <td>
214
+ <?php
215
+ $defaultCat=$config['DEFAULT_POST_CATEGORY'];
216
+ wp_dropdown_categories("name=DEFAULT_POST_CATEGORY&hierarchical=1&selected=$defaultCat"); ?>
217
+ <!--
218
  <td><select name="DEFAULT_POST_CATEGORY" id="DEFAULT_POST_CATEGORY">
219
  <?php
220
  $categories = $wpdb->get_results("SELECT * FROM $wpdb->terms ORDER BY name");
224
  }
225
  ?>
226
  </select></td>
227
+ -->
228
  </tr>
229
  <tr valign="top">
230
  <th scope="row"><?php _e('Default post by mail tag(s):
231
+ separated by commas', 'postie') ?></th>
232
  <td><input type='text' name="DEFAULT_POST_TAGS"
233
  id="DEFAULT_POST_TAGS" value='<?php echo
234
  $config["DEFAULT_POST_TAGS"] ?>' />
235
  </td>
236
  </tr>
237
  <tr>
238
+ <th width="33%" valign="top" scope="row"><?php _e('Default Title:', 'postie') ?> </th>
239
  <td>
240
  <input name="DEFAULT_TITLE" type="text" id="DEFAULT_TITLE" value="<?php echo $config["DEFAULT_TITLE"]; ?>" size="50" /><br />
241
+ <?php _e("Recommended", 'postie');?>: <code>Live from the field</code>
242
  <br />
243
  </td>
244
  </tr>
245
  <tr>
246
+ <th width="33%" valign="top" scope="row"><?php _e('Prefered Text Type (HTML/plain):', 'postie') ?> </th>
247
  <td>
248
  <select name="PREFER_TEXT_TYPE" id="PREFER_TEXT_TYPE">
249
  <option value="plain">plain</option>
250
  <option value="html" <?php if($config["PREFER_TEXT_TYPE"] == "html") { echo "SELECTED";} ?>>html</option>
251
  </select><br />
252
+ <?php _e("Recommended", 'postie');?>: <code>plain</code>
253
  <br />
254
  </td>
255
  </tr>
256
  <tr>
257
+ <th width="33%" valign="top" scope="row"><?php _e('Wrap content in pre tags:', 'postie') ?> </th>
258
  <td>
259
  <select name="WRAP_PRE" id="WRAP_PRE">
260
  <option value="no">no</option>
261
  <option value="yes" <?php if($config["WRAP_PRE"] == "yes") { echo "SELECTED";} ?>>yes</option>
262
  </select><br />
263
+ <?php _e("Recommended", 'postie');?>: <code>no</code>
264
  <br />
265
  </td>
266
  </tr>
267
  <tr>
268
+ <th width="33%" valign="top" scope="row"><?php _e('Add more meta information right before post:', 'postie') ?> </th>
269
  <td>
270
  <select name="ADD_META" id="ADD_META">
271
  <option value="no">no</option>
272
  <option value="yes" <?php if($config["ADD_META"] == "yes") { echo "SELECTED";} ?>>yes</option>
273
  </select><br />
274
+ <?php _e("Recommended", 'postie');?>: <code>no</code>
275
  <br />
276
  </td>
277
  </tr>
282
  <?php echo BuildBooleanSelect("Allow Subject In Mail","ALLOW_SUBJECT_IN_MAIL",$config["ALLOW_SUBJECT_IN_MAIL"]);?>
283
  <?php echo BuildBooleanSelect("Allow HTML In Mail Subject","ALLOW_HTML_IN_SUBJECT",$config["ALLOW_HTML_IN_SUBJECT"]);?>
284
  <?php echo BuildBooleanSelect("Allow HTML In Mail Body","ALLOW_HTML_IN_BODY",$config["ALLOW_HTML_IN_BODY"]);?>
285
+ <?php echo BuildBooleanSelect("Automatically convert urls to links","CONVERTURLS",$config["CONVERTURLS"]);?>
286
  <tr>
287
+ <th width="33%" valign="top" scope="row"><?php _e('Encoding for pages and feeds:', 'postie') ?> </th>
288
  <td>
289
  <input name="MESSAGE_ENCODING" type="text" id="MESSAGE_ENCODING" value="<?php echo $config["MESSAGE_ENCODING"]; ?>" size="50" /><br />
290
+ <?php _e("Recommended", 'postie');?>: <code>UTF-8</code> - it should handle ISO-8859-1 as well
291
  <br />
292
  </td>
293
  </tr>
295
  <?php echo BuildTextArea("Supported File Types","SUPPORTED_FILE_TYPES",$config["SUPPORTED_FILE_TYPES"],"Put each type on a single line.");?>
296
  <?php echo BuildTextArea("Banned File Names","BANNED_FILES_LIST",$config["BANNED_FILES_LIST"],"Put each file name on a single line.Files matching this list will never be posted to your blog.");?>
297
  <tr>
298
+ <th width="33%" valign="top" scope="row"><?php _e('Tag Of Message Start:', 'postie') ?> </th>
299
  <td>
300
  <p>This tag can be used to remove any text from a message that the email provider puts at the top of the message</p>
301
  <input name="MESSAGE_START" type="text" id="MESSAGE_START" value="<?php echo $config["MESSAGE_START"]; ?>" size="50" /><br />
302
+ <?php _e("Recommended", 'postie');?>: <code>:start</code>
303
  <br />
304
  </td>
305
  </tr>
306
  <tr>
307
+ <th width="33%" valign="top" scope="row"><?php _e('Tag Of Message End:', 'postie') ?> </th>
308
  <td>
309
  <p>This tag can be used to remove any text from a message that the email provider puts at the bottom of the message</p>
310
  <input name="MESSAGE_END" type="text" id="MESSAGE_END" value="<?php echo $config["MESSAGE_END"]; ?>" size="50" /><br />
311
+ <?php _e("Recommended", 'postie');?>: <code>:end</code>
312
  <br />
313
  </td>
314
  </tr>
322
 
323
  <tr><td colspan=2>
324
  <fieldset class="options">
325
+ <legend><?php _e('Image Settings', 'postie');?></legend>
326
  <table width="100%" cellspacing="2" cellpadding="5" class="editform">
327
  <?php if (!HasGDInstalled()):?>
328
  <tr>
336
  <?php echo BuildBooleanSelect("Post Images At End","IMAGES_APPEND",$config["IMAGES_APPEND"],"No means they will be put before the text of the message.");?>
337
  <?php echo BuildBooleanSelect("Resize Large Images","RESIZE_LARGE_IMAGES",$config["RESIZE_LARGE_IMAGES"]);?>
338
  <tr>
339
+ <th scope="row"><?php _e('Maximum Image Width:', 'postie') ?> </th>
340
  <td><input name="MAX_IMAGE_WIDTH" type="text" id="MAX_IMAGE_WIDTH" value="<?php echo $config['MAX_IMAGE_WIDTH']; ?>" size="4" />
341
+ <?php _e('pixels', 'postie') ?>
342
+ <br /><?php _e("Recommended", 'postie');?>: <code>400</code><br />
343
  </td>
344
  </tr>
345
  <tr>
346
+ <th scope="row"><?php _e('Maximum Image Height:', 'postie') ?> </th>
347
  <td><input name="MAX_IMAGE_HEIGHT" type="text" id="MAX_IMAGE_HEIGHT" value="<?php echo $config['MAX_IMAGE_HEIGHT']; ?>" size="4" />
348
+ <?php _e('pixels', 'postie') ?>
349
+ <br /><?php _e("Recommended", 'postie');?>: <code>Leave Blank</code><br />
350
  </td>
351
  </tr>
352
  <tr>
353
+ <th scope="row"><?php _e('JPEG Compression:', 'postie') ?> </th>
354
  <td><input name="JPEGQUALITY" type="text" id="JPEGQUALITY" value="<?php echo $config['JPEGQUALITY']; ?>" size="3" />
355
+ <?php _e('%', 'postie') ?>
356
+ <br /><?php _e("Recommended", 'postie');?>: <code>80</code>%
357
  </td>
358
  </tr>
359
  <?php endif;?>
360
  <?php echo BuildBooleanSelect("Use ImageMagick","USE_IMAGEMAGICK",$config["USE_IMAGEMAGICK"]);?>
361
  <tr>
362
+ <th scope="row"><?php _e('convert binary location:', 'postie') ?> </th>
363
  <td><input name="IMAGEMAGICK_CONVERT" type="text" id="IMAGEMAGICK_CONVERT" value="<?php echo $config['IMAGEMAGICK_CONVERT']; ?>" size="30" />
364
+ <br /><?php _e("Recommended", 'postie');?>: <code>only needed if you are using ImageMagick <br /> should be /usr/bin/convert</code>
365
  </td>
366
  </tr>
367
  <?php echo BuildBooleanSelect("Automatic SmartSharp Mask","AUTO_SMART_SHARP",$config["AUTO_SMART_SHARP"],"This automatically smart sharpens the images that are posted. This feature is <b>EXPERIMENTAL</b>. It alsot takes a lot of processing power");?>
368
 
369
  <?php echo BuildBooleanSelect("Start Image Count At 0","START_IMAGE_COUNT_AT_ZERO",$config["START_IMAGE_COUNT_AT_ZERO"]);?>
370
  <tr>
371
+ <th width="33%" valign="top" scope="row"><?php _e('Image Place Holder Tag:', 'postie') ?> </th>
372
  <td>
373
  <input name="IMAGE_PLACEHOLDER" type="text" id="IMAGE_PLACEHOLDER" value="<?php echo $config["IMAGE_PLACEHOLDER"]; ?>" size="50" /><br />
374
+ <?php _e("Recommended", 'postie');?>: <code>#img%#</code>
375
  <br />
376
  </td>
377
  </tr>
378
  <tr>
379
+ <th width="33%" valign="top" scope="row"><?php _e('Image CSS Class:', 'postie') ?> </th>
380
  <td>
381
  <input name="IMAGECLASS" type="text" id="IMAGECLASS" value="<?php echo $config["IMAGECLASS"]; ?>" size="50" /><br />
382
+ <?php _e("Recommended", 'postie');?>: <code>postie-image</code>
383
  <br />
384
  </td>
385
  </tr>
386
  <tr>
387
+ <th width="33%" valign="top" scope="row"><?php _e('Image CSS Style:', 'postie') ?> </th>
388
  <td>
389
  <input name="IMAGESTYLE" type="text" id="IMAGESTYLE" value="<?php echo $config["IMAGESTYLE"]; ?>" size="50" /><br />
390
+ <?php _e("Recommended", 'postie');?>: <code>border: none;</code>
391
  <br />
392
  </td>
393
  </tr>
394
  <tr>
395
+ <th width="33%" valign="top" scope="row"><?php _e('Image Div CSS:', 'postie') ?> </th>
396
  <td>
397
  <input name="IMAGEDIV" type="text" id="IMAGEDIV" value="<?php echo $config["IMAGEDIV"]; ?>" size="50" /><br />
398
+ <?php _e("Recommended", 'postie');?>: <code>postie-image-div</code><p>This is the CSS class of a div that wraps each image. Can be used to style the post</p>
399
  <br />
400
  </td>
401
  </tr>
402
  <?php echo BuildBooleanSelect("Open images in new
403
  window","IMAGE_NEW_WINDOW",$config["IMAGE_NEW_WINDOW"],"Recommended:
404
  no");?>
 
405
  <?php echo BuildBooleanSelect("Use custom image
406
  template","USEIMAGETEMPLATE",$config["USEIMAGETEMPLATE"],"If you
407
  don't like the default html output around images, you can enter
408
+ your own below. My personal template is already there. See the
409
  readme for more details");?>
410
+ <tr>
411
  <th width="33%" valign="top" scope="row"> <td>
412
  <textarea cols="50" rows="6" name="IMAGETEMPLATE"
413
+ id="IMAGETEMPLATE"><?php echo $config["IMAGETEMPLATE"]; ?></textarea>
 
 
414
  </td>
415
  </tr>
416
  <tr>
417
+ <th width="33%" valign="top" scope="row"><?php _e('Attachment Div CSS:', 'postie') ?> </th>
418
  <td>
419
  <input name="ATTACHMENTDIV" type="text" id="ATTACHMENTDIV" value="<?php echo $config["ATTACHMENTDIV"]; ?>" size="50" /><br />
420
+ <?php _e("Recommended", 'postie');?>: <code>postie-attachment-div</code><p>This is the CSS class of a div that wraps each file attachment. Can be used to style the post</p>
421
  <br />
422
  </td>
423
+ <?php echo BuildBooleanSelect("Use custom image
424
+ field","CUSTOM_IMAGE_FIELD",$config["CUSTOM_IMAGE_FIELD"],"When this option is set, images will not appear in the
425
+ post. Instead the url to the image will be input into a custom
426
+ field named 'image'.
427
+ Recommended:
428
+ no");?> </tr>
429
  </table>
430
  </fieldset>
431
  </td>
434
 
435
  <tr><td colspan=2>
436
  <fieldset class="options">
437
+ <legend><?php _e('Video options', 'postie');?></legend>
438
  <table width="100%" cellspacing="2" cellpadding="5" class="editform">
439
  <?php echo BuildBooleanSelect("Embed 3GP videos as QuickTime","3GP_QT",$config["3GP_QT"],"This controls if the video is just a link or embeded in the page using QuickTime");?>
440
+ <?php echo BuildBooleanSelect("Autoplay embedded
441
+ videos?","VIDEO_AUTOPLAY",$config["VIDEO_AUTOPLAY"],"When this is
442
+ set to yes, videos will start to play automatically.");?>
443
  <tr>
444
+ <th scope="row"><?php _e('Video width:', 'postie') ?> </th>
445
+ <td><input name="VIDEO_WIDTH" type="text" id="VIDEO_WIDTH"
446
+ value="<?php echo $config['VIDEO_WIDTH']; ?>" size="5" />
447
+ </td>
448
+ </tr>
449
+ <tr>
450
+ <th scope="row"><?php _e('Video height:', 'postie') ?> </th>
451
+ <td><input name="VIDEO_HEIGHT" type="text" id="VIDEO_HEIGHT"
452
+ value="<?php echo $config['VIDEO_HEIGHT']; ?>" size="5" />
453
+ </td>
454
+ </tr>
455
+ <tr>
456
+ <th scope="row"><?php _e('Video player width:', 'postie') ?> </th>
457
+ <td><input name="PLAYER_WIDTH" type="text" id="PLAYER_WIDTH"
458
+ value="<?php echo $config['PLAYER_WIDTH']; ?>" size="5" />
459
+ </td>
460
+ </tr>
461
+ <tr>
462
+ <th scope="row"><?php _e('Video player height:', 'postie') ?> </th>
463
+ <td><input name="PLAYER_HEIGHT" type="text" id="PLAYER_HEIGHT"
464
+ value="<?php echo $config['PLAYER_HEIGHT']; ?>" size="5" />
465
+ </td>
466
+ </tr>
467
+ <tr>
468
+ <th scope="row"><?php _e('Location of ffmpeg:', 'postie') ?> </th>
469
  <td><input name="3GP_FFMPEG" type="text" id="3GP_FFMPEG" value="<?php echo $config['3GP_FFMPEG']; ?>" size="30" />
470
+ <br /><?php _e("Recommended");?>: <code><?php _e("only needed if you are on a Linux server and use 3gp video,and don't embed the video. This allows postie to make thumbnail of the very first frame");?> <br /><?php _e("should be /usr/bin/ffmpeg", 'postie');?></code>
471
  </td>
472
  </tr>
473
  <tr>
474
+ <th width="33%" valign="top" scope="row"><?php _e('3GP CSS Class:', 'postie') ?> </th>
475
  <td>
476
  <input name="3GPCLASS" type="text" id="3GPCLASS" value="<?php echo $config["3GPCLASS"]; ?>" size="50" /><br />
477
+ <?php _e("Recommended", 'postie');?>: <code>wp-mailvideo</code>
478
  <br />
479
  </td>
480
  </tr>
481
  <tr>
482
+ <th width="33%" valign="top" scope="row"><?php _e('3GP Div CSS:', 'postie') ?> </th>
483
  <td>
484
  <input name="3GPDIV" type="text" id="3GPDIV" value="<?php echo $config["3GPDIV"]; ?>" size="50" /><br />
485
+ <?php _e("Recommended", 'postie');?>: <code>postie-3gp-div</code><p>This is the CSS class of a div that wraps each 3GP video. Can be used to style the post</p>
486
  <br />
487
  </td>
488
  </tr>
489
+ <?php echo BuildBooleanSelect("Use custom video
490
+ template","USEVIDEOTEMPLATE",$config["USEVIDEOTEMPLATE"],"If you
491
+ don't like the default html output around videos, you can enter
492
+ your own below. The default template is already there. See the
493
+ readme for more details");?>
494
+ <tr>
495
+ <th width="33%" valign="top" scope="row"> <td>
496
+ <textarea cols="50" rows="6" name="VIDEOTEMPLATE"
497
+ id="VIDEOTEMPLATE"><?php echo $config["VIDEOTEMPLATE"]; ?></textarea>
498
+ </td>
499
+ </tr>
500
  </table>
501
  </fieldset>
502
  </td>
506
 
507
 
508
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
509
 
510
 
511
 
516
 
517
  </table>
518
  <p class="submit">
519
+ <input type="submit" name="Submit" value="<?php _e('Update Options', 'postie') ?> &raquo;" />
520
  </p>
521
  </form>
522
+
523
+ <a href="http://validator.w3.org/check?uri=referer"><img src="images/valid-xhtml11.png" alt="Valid XHTML 1.0!" style="height:20px; width:65px; border:0;" /></a>
524
+ <a href="http://jigsaw.w3.org/css-validator/check/referer"><img style="border:0;width:65px;height:20px;" src="images/vcss.gif" alt="Valid CSS!" /></a><br />
525
  </div>
cronless_postie.php CHANGED
@@ -4,11 +4,12 @@ Plugin Name: Cronless Postie
4
  Plugin URI: http://www.economysizegeek.com/?page_id=395
5
  Description: This plugin allows you to setup your rss feeds to trigger postie (See <a href="../wp-content/plugins/postie/cronless_postie.php?cronless_postie_read_me=1">Quick Readme</a>)
6
  Author: Dirk Elmendorf
7
- Version: 1.1.5
8
  Author URI: http://www.economysizegeek.com/
9
  */
10
 
11
  include_once (dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR. "wp-config.php");
 
12
  function check_postie() {
13
  $host = get_option('siteurl');
14
  preg_match("/http:\/\/(.[^\/]*)(.*)/",$host,$matches);
@@ -45,19 +46,25 @@ if (isset($_GET["cronless_postie_read_me"])) {
45
  }
46
 
47
 
48
- add_action('init','postie_cron');
 
 
49
  function postie_cron() {
50
- if (!wp_next_scheduled('check_postie')) {
51
- wp_schedule_event(time(),'hourly','check_postie');
52
- }
 
 
 
53
  }
54
- add_action('check_postie', 'check_postie');
55
- /**
56
- * Now just add the following line to all of the rss/atom pages
57
- * Just make sure it is after the opening if statement
58
-
59
- do_action('check_postie');
60
-
61
- */
62
 
 
 
 
 
 
 
 
 
 
63
  ?>
4
  Plugin URI: http://www.economysizegeek.com/?page_id=395
5
  Description: This plugin allows you to setup your rss feeds to trigger postie (See <a href="../wp-content/plugins/postie/cronless_postie.php?cronless_postie_read_me=1">Quick Readme</a>)
6
  Author: Dirk Elmendorf
7
+ Version: 1.2
8
  Author URI: http://www.economysizegeek.com/
9
  */
10
 
11
  include_once (dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR. "wp-config.php");
12
+ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR ."postie-functions.php");
13
  function check_postie() {
14
  $host = get_option('siteurl');
15
  preg_match("/http:\/\/(.[^\/]*)(.*)/",$host,$matches);
46
  }
47
 
48
 
49
+ //add_action('init','postie_cron');
50
+ register_activation_hook(__FILE__,'postie_cron');
51
+ add_action('check_postie_hook', 'check_postie');
52
  function postie_cron() {
53
+ $config=GetConfig();
54
+ wp_schedule_event(time(),$config['CRONLESS'],'check_postie_hook');
55
+ }
56
+ register_deactivation_hook(__FILE__,'postie_decron');
57
+ function postie_decron() {
58
+ wp_clear_scheduled_hook('check_postie_hook');
59
  }
 
 
 
 
 
 
 
 
60
 
61
+ /* here we add some more options for how often to check for e-mail */
62
+ function more_reccurences() {
63
+ return array(
64
+ 'weekly' => array('interval' => 604800, 'display' => 'Once Weekly'),
65
+ 'twiceperhour' => array('interval' => 1800, 'display' => 'Twice per hour
66
+ '), 'tenminutes' =>array('interval' => 600, 'display' => 'Every 10 minutes')
67
+ );
68
+ }
69
+ add_filter('cron_schedules', 'more_reccurences');
70
  ?>
cronless_read_me.php DELETED
@@ -1,6 +0,0 @@
1
-
2
- <div class="wrap">
3
- <h1>Cronless Postie</h1>
4
- <p>First off - this is a bit of a hack. I would love feedback on this since I don't use this - I have cron on my server :(</p>
5
- <p>I'm trying to use the new Psuedo Cron that is part of WP2.1. It's not documented very well so I'm hoping this works </p>
6
- </div>
 
 
 
 
 
 
languages/postie-de_DE.mo ADDED
Binary file
languages/postie-de_DE.po ADDED
@@ -0,0 +1,362 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Postie Translation File
2
+ # Copyright (C) 2005 Dirk Elmendorf <headgeek@economysizegeek.com>
3
+ # This file is distributed under the same license as Postie.
4
+ # Dirk Elmendorf <headgeek@economysizegeek.com>, 2005
5
+ #
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: Postie\n"
9
+ "Report-Msgid-Bugs-To: \n"
10
+ "POT-Creation-Date: 2005-11-10 11:48-0600\n"
11
+ "PO-Revision-Date: 2009-03-16 12:20-0700\n"
12
+ "Last-Translator: Robert Felty <robfelty@gmail.com>\n"
13
+ "Language-Team: Robert Felty <robfelty@gmail.com>\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=utf-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "X-Poedit-Language: German\n"
18
+ "X-Poedit-Country: UNITED STATES\n"
19
+ "X-Poedit-SourceCharset: utf-8\n"
20
+
21
+ #: config_form.php:18
22
+ msgid "Postie Options"
23
+ msgstr "Optionen für Postie"
24
+
25
+ #: config_form.php:18
26
+ msgid "Reset Configs To Default"
27
+ msgstr "Reset Configs To Default"
28
+
29
+ #: config_form.php:2
30
+ msgid "If you would like to start over - you can click the button on the right to reset all configurations to the default."
31
+ msgstr "If you would like to start over - you can click the button on the right to reset all configurations to the default."
32
+
33
+ #: config_form.php:30
34
+ msgid "To run the check mail script manually"
35
+ msgstr "To run the check mail script manually"
36
+
37
+ #: config_form.php:32
38
+ msgid "Run Postie"
39
+ msgstr "Run Postie"
40
+
41
+ #: config_form.php:39
42
+ msgid "If you have problems with Postie this will run a special script to test your configuraiton options"
43
+ msgstr "If you have problems with Postie this will run a special script to test your configuraiton options"
44
+
45
+ #: config_form.php:41
46
+ msgid "Test Config"
47
+ msgstr "Test Config"
48
+
49
+ msgid "Yes"
50
+ msgstr "Ja"
51
+
52
+ msgid "No"
53
+ msgstr "Nein"
54
+
55
+ #: config_form.php
56
+ msgid "Authorization Settings"
57
+ msgstr "Authorization Settings"
58
+
59
+ #: config_form.php
60
+ msgid "Allow Anyone To Post Via Email"
61
+ msgstr "Allow Anyone To Post Via Email"
62
+
63
+ #: config_form.php
64
+ msgid "Changing this to yes is NOT RECOMMEDED - anything that gets sent in will automatically be posted. This could make it easier to compromise your server - YOU HAVE BEEN WARNED."
65
+ msgstr "Changing this to yes is NOT RECOMMEDED - anything that gets sent in will automatically be posted. This could make it easier to compromise your server - YOU HAVE BEEN WARNED."
66
+
67
+ #: config_form.php
68
+ msgid "Minimum Access Level Required To Post:"
69
+ msgstr "Minimum Access Level Required To Post:"
70
+
71
+ #: config_form.php
72
+ msgid "This allows you to grant access to other users to post if they have the proper access level"
73
+ msgstr "This allows you to grant access to other users to post if they have the proper access level"
74
+
75
+ #: config_form.php
76
+ msgid "Authorized Addresses"
77
+ msgstr "Authorized Addresses"
78
+
79
+ #: config_form.php
80
+ msgid "Put each email address on a single line. Posts from emails in this list will be treated as if they came from the admin. If you would prefer to have users post under their own name - create a WordPress user with the correct access level."
81
+ msgstr "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."
82
+
83
+ #: config_form.php
84
+ msgid "Directory Settings"
85
+ msgstr "Directory Settings"
86
+
87
+ #: config_form.php
88
+ msgid "Directory For Photos:"
89
+ msgstr "Directory For Photos:"
90
+
91
+ #: config_form.php
92
+ msgid "Recommended"
93
+ msgstr "Recommended"
94
+
95
+ #: config_form.php
96
+ msgid "Directory For Files:"
97
+ msgstr "Directory For Files:"
98
+
99
+ #: config_form.php
100
+ msgid "Message Settings"
101
+ msgstr "Message Settings"
102
+
103
+ #: config_form.php
104
+ msgid "Default post by mail category:"
105
+ msgstr "Default post by mail category:"
106
+
107
+ #: config_form.php
108
+ msgid "Default Title:"
109
+ msgstr "Default Title:"
110
+
111
+ #: config_form.php
112
+ msgid "Live from the field"
113
+ msgstr "Live from the field"
114
+
115
+ #: config_form.php
116
+ msgid "Prefered Text Type (HTML/plain):"
117
+ msgstr "Prefered Text Type (HTML/plain):"
118
+
119
+ #: config_form.php
120
+ msgid "plain"
121
+ msgstr "plain"
122
+
123
+ #: config_form.php
124
+ msgid "html"
125
+ msgstr "html"
126
+
127
+ #: config_form.php
128
+ msgid "Forward Rejected Mail"
129
+ msgstr "Forward Rejected Mail"
130
+
131
+ #: config_form.php
132
+ msgid "Allow Subject In Mail"
133
+ msgstr "Allow Subject In Mail"
134
+
135
+ #: config_form.php
136
+ msgid "Allow HTML In Mail Subject"
137
+ msgstr "Allow HTML In Mail Subject"
138
+
139
+ #: config_form.php
140
+ msgid "Allow HTML In Mail Body"
141
+ msgstr "Allow HTML In Mail Body"
142
+
143
+ #: config_form.php
144
+ msgid "Encoding for pages and feeds:"
145
+ msgstr "Encoding for pages and feeds:"
146
+
147
+ #: config_form.php
148
+ msgid "UTF-8"
149
+ msgstr "UTF-8"
150
+
151
+ #: config_form.php
152
+ msgid "it should handle ISO-8859-1 as well"
153
+ msgstr "it should handle ISO-8859-1 as well"
154
+
155
+ #: config_form.php
156
+ msgid "Decode Quoted Printable Data"
157
+ msgstr "Decode Quoted Printable Data"
158
+
159
+ #: config_form.php
160
+ msgid "Should be yes in most cases."
161
+ msgstr "Should be yes in most cases."
162
+
163
+ #: config_form.php
164
+ msgid "Supported File Types"
165
+ msgstr "Supported File Types"
166
+
167
+ #: config_form.php
168
+ msgid "Put each type on a single line."
169
+ msgstr "Put each type on a single line."
170
+
171
+ #: config_form.php
172
+ msgid "Banned File Names"
173
+ msgstr "Banned File Names"
174
+
175
+ #: config_form.php
176
+ msgid "Put each file name on a single line.Files matching this list will never be posted to your blog."
177
+ msgstr "Put each file name on a single line.Files matching this list will never be posted to your blog."
178
+
179
+ #: config_form.php
180
+ msgid "Drop The Signature From Mail"
181
+ msgstr "Drop The Signature From Mail"
182
+
183
+ #: config_form.php
184
+ msgid "Signature Patterns"
185
+ msgstr "Signature Patterns"
186
+
187
+ #: config_form.php
188
+ msgid "Put each pattern on a seperate line and make sure to escape any special characters."
189
+ msgstr "Put each pattern on a seperate line and make sure to escape any special characters."
190
+
191
+ #: config_form.php
192
+ msgid "Image Settings"
193
+ msgstr "Image Settings"
194
+
195
+ #: config_form.php
196
+ msgid "No GD Support"
197
+ msgstr "No GD Support"
198
+
199
+ #: config_form.php
200
+ msgid "Currently your installation of PHP does not have GD installed so no image resizing can occur."
201
+ msgstr "Currently your installation of PHP does not have GD installed so no image resizing can occur."
202
+
203
+ #: config_form.php
204
+ msgid "Post Images At End"
205
+ msgstr "Post Images At End"
206
+
207
+ #: config_form.php
208
+ msgid "No means they will be put before the text of the message."
209
+ msgstr "No means they will be put before the text of the message."
210
+
211
+ #: config_form.php
212
+ msgid "Resize Large Images"
213
+ msgstr "Resize Large Images"
214
+
215
+ #: config_form.php
216
+ msgid "Maximum Image Width:"
217
+ msgstr "Maximum Image Width:"
218
+
219
+ #: config_form.php
220
+ msgid "pixels"
221
+ msgstr "pixels"
222
+
223
+ #: config_form.php
224
+ msgid "JPEG Compression:"
225
+ msgstr "JPEG Compression:"
226
+
227
+ #: config_form.php
228
+ msgid "%"
229
+ msgstr "%"
230
+
231
+ #: config_form.php
232
+ msgid "Use ImageMagick"
233
+ msgstr "Use ImageMagick"
234
+
235
+ #: config_form.php
236
+ msgid "convert binary location:"
237
+ msgstr "convert binary location:"
238
+
239
+ #: config_form.php
240
+ msgid "only needed if you are using ImageMagick"
241
+ msgstr "only needed if you are using ImageMagick"
242
+
243
+ #: config_form.php
244
+ msgid "should be /usr/bin/convert"
245
+ msgstr "should be /usr/bin/convert"
246
+
247
+ #: config_form.php
248
+ msgid "identify binary location:"
249
+ msgstr "identify binary location:"
250
+
251
+ #: config_form.php
252
+ msgid "should be /usr/bin/identify"
253
+ msgstr "should be /usr/bin/identify"
254
+
255
+ #: config_form.php
256
+ msgid "Start Image Count At 0"
257
+ msgstr "Start Image Count At 0"
258
+
259
+ #: config_form.php
260
+ msgid "Image Place Holder Tag:"
261
+ msgstr "Image Place Holder Tag:"
262
+
263
+ #: config_form.php
264
+ msgid "Image CSS Class:"
265
+ msgstr "Image CSS Class:"
266
+
267
+ #: config_form.php
268
+ msgid "Image CSS Style:"
269
+ msgstr "Image CSS Style:"
270
+
271
+ #: config_form.php
272
+ msgid "3GP"
273
+ msgstr "3GP"
274
+
275
+ #: config_form.php
276
+ msgid "Embed 3GP videos as QuickTime"
277
+ msgstr "Embed 3GP videos as QuickTime"
278
+
279
+ #: config_form.php
280
+ msgid "This controls if the video is just a link or embeded in the page using QuickTime"
281
+ msgstr "This controls if the video is just a link or embeded in the page using QuickTime"
282
+
283
+ #: config_form.php
284
+ msgid "Location of ffmpeg:"
285
+ msgstr "Location of ffmpeg:"
286
+
287
+ #: config_form.php
288
+ msgid "only needed if you are on a Linux server and use 3gp video,and don't embed the video. This allows postie to make thumbnail of the very first frame"
289
+ msgstr "only needed if you are on a Linux server and use 3gp video,and don't embed the video. This allows postie to make thumbnail of the very first frame"
290
+
291
+ #: config_form.php
292
+ msgid "should be /usr/bin/ffmpeg"
293
+ msgstr "should be /usr/bin/ffmpeg"
294
+
295
+ #: config_form.php
296
+ msgid "3GP CSS Class:"
297
+ msgstr "3GP CSS Class:"
298
+
299
+ #: config_form.php
300
+ msgid "Mailserver Settings"
301
+ msgstr "Mailserver Settings"
302
+
303
+ #: config_form.php
304
+ msgid "Mail Protocol:"
305
+ msgstr "Mail Protocol:"
306
+
307
+ #: config_form.php
308
+ msgid "IMAP/IMAP-SSL/POP3-SSL unavailable"
309
+ msgstr "IMAP/IMAP-SSL/POP3-SSL unavailable"
310
+
311
+ #: config_form.php
312
+ msgid "Standard Ports:"
313
+ msgstr "Standard Ports:"
314
+
315
+ #: config_form.php
316
+ msgid "POP3"
317
+ msgstr "POP3"
318
+
319
+ #: config_form.php
320
+ msgid "IMAP"
321
+ msgstr "IMAP"
322
+
323
+ #: config_form.php
324
+ msgid "IMAP-SSL"
325
+ msgstr "IMAP-SSL"
326
+
327
+ #: config_form.php
328
+ msgid "POP3-SSL"
329
+ msgstr "POP3-SSL"
330
+
331
+ #: config_form.php
332
+ msgid "Postie Time Correction:"
333
+ msgstr "Postie Time Correction:"
334
+
335
+ #: config_form.php
336
+ msgid "hours"
337
+ msgstr "hours"
338
+
339
+ #: config_form.php
340
+ msgid "Should be the same as your normal offset - but this lets you adjust it in cases where that doesn't work."
341
+ msgstr "Should be the same as your normal offset - but this lets you adjust it in cases where that doesn't work."
342
+
343
+ #: config_form.php
344
+ msgid "Mail Server:"
345
+ msgstr "Mail Server:"
346
+
347
+ #: config_form.php
348
+ msgid "Port:"
349
+ msgstr "Port:"
350
+
351
+ #: config_form.php
352
+ msgid "Mail Userid:"
353
+ msgstr "Mail Userid:"
354
+
355
+ #: config_form.php
356
+ msgid "Mail Password:"
357
+ msgstr "Mail Password:"
358
+
359
+ #: config_form.php
360
+ msgid "Update Options"
361
+ msgstr "Aktualisiere Optionen"
362
+
languages/postie-nb_NO.mo ADDED
Binary file
languages/postie-nb_NO.po ADDED
@@ -0,0 +1,815 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2009-02-12 14:36+0100\n"
6
+ "PO-Revision-Date: 2009-02-19 10:14+0100\n"
7
+ "Last-Translator: HB <nanablag@nanablag.com>\n"
8
+ "Language-Team: Håvard Broberg <nanablag@nanablag.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-Language: Norwegian Bokmal\n"
13
+ "X-Poedit-Country: NORWAY\n"
14
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+
17
+ #: config_form.php:73
18
+ msgid "Changing this to yes is NOT RECOMMEDED - anything that gets sent in will automatically be posted. This could make it easier to compromise your server - YOU HAVE BEEN WARNED."
19
+ msgstr "Å sette dette til ja er IKKE ANBEFALT - alt som blir sendt inn vil automatisk bli publisert. Dette kan gjøre det enklere å kompromittere serveren din - DU ER HERVED ADVART."
20
+
21
+ #: config_form.php:99
22
+ msgid "Put each email address on a single line. Posts from emails in this list will be treated as if they came from the admin. If you would prefer to have users post under their own name - create a WordPress user with the correct access level."
23
+ msgstr "Sett hver e-post-adresse på hver sin linje. Innlegg fra e-post-adresser i denne lista vil behandles som om de kommer fra administrator. Dersom du foretrekker at brukerne publiserer under eget navn, kan du opprette en WordPress-bruker med det riktige tilgangsnivået."
24
+
25
+ #: config_form.php:192
26
+ msgid "Should be yes in most cases."
27
+ msgstr "Skal i de fleste tilfeller være ja."
28
+
29
+ #: config_form.php:193
30
+ msgid "Put each type on a single line."
31
+ msgstr "Skriv hver type på egen linje."
32
+
33
+ #: config_form.php:194
34
+ msgid "Put each file name on a single line.Files matching this list will never be posted to your blog."
35
+ msgstr "Skriv hvert filnavn på egen linje. Filer som står på denne lista vil aldri bli publisert i bloggen din."
36
+
37
+ #: config_form.php:214
38
+ msgid "Put each pattern on a seperate line and make sure to escape any special characters."
39
+ msgstr "Skriv hvert mønster på egen linje og forsikre deg om at du escaper eventuelle spesialtegn."
40
+
41
+ #: config_form.php:235
42
+ msgid "No means they will be put before the text of the message."
43
+ msgstr "Nei betyr at bildene vil settes inn før meldingsteksten."
44
+
45
+ #: config_form.php:272
46
+ msgid "This automatically smart sharpens the images that are posted. This feature is <b>EXPERIMENTAL</b>. It also takes a lot of processing power"
47
+ msgstr "Dette autokorrigerer bildene du publiserer. Denne funksjonen er <b>EKSPERIMENTELL</b> og bruker mye prosessorkraft."
48
+
49
+ #: config_form.php:326
50
+ msgid "This controls if the video is just a link or embeded in the page using QuickTime"
51
+ msgstr "Dette bestemmer om videoen bare er ei lenke eller inkludert på sida ved hjelp av QuickTime"
52
+
53
+ #: config_form.php:7
54
+ #: get_mail.php:10
55
+ #: postie_test.php:36
56
+ msgid "Postie only works on WordPress version 2.0 and above"
57
+ msgstr "Postie virker bare under WordPress 2.0 og høyere"
58
+
59
+ #: config_form.php:7
60
+ #: postie_test.php:26
61
+ #: postie_test.php:35
62
+ #: postie_test.php:45
63
+ msgid "Warning!"
64
+ msgstr "Advarsel!"
65
+
66
+ #: config_form.php:10
67
+ #: config_form.php:22
68
+ msgid "Postie Options"
69
+ msgstr "Postie-innstillinger"
70
+
71
+ #: config_form.php:13
72
+ msgid "Configuration successfully updated!"
73
+ msgstr "Konfigurasjon oppdatert!"
74
+
75
+ #: config_form.php:14
76
+ msgid "Error - unable to save configuration"
77
+ msgstr "Feil - kan ikke lagre konfigurasjon"
78
+
79
+ #: config_form.php:27
80
+ msgid "If you would like to start over - you can click the button below to reset all configurations to the default."
81
+ msgstr "Hvis du ønsker å starte på nytt, kan du trykke på knappen nedenfor for å sette alle innstillingene tilbake til standardverdiene."
82
+
83
+ #: config_form.php:29
84
+ msgid "Reset Configs To Default"
85
+ msgstr "Tilbakestiller innstillingene til standardverdiene"
86
+
87
+ #: config_form.php:35
88
+ msgid "To run the check mail script manually"
89
+ msgstr "For å kjøre skriptet som sjekker mail manuelt"
90
+
91
+ #: config_form.php:37
92
+ msgid "Run Postie"
93
+ msgstr "Kjør Postie"
94
+
95
+ #: config_form.php:44
96
+ msgid "If you have problems with Postie this will run a special script to test your configuraiton options"
97
+ msgstr "Hvis du har problemer med Postie vil dette kjøre et spesielt skript som tester opsettet ditt"
98
+
99
+ #: config_form.php:46
100
+ msgid "Test Config"
101
+ msgstr "Test oppsett"
102
+
103
+ #: config_form.php:60
104
+ #: config_form.php:107
105
+ #: config_form.php:109
106
+ msgid "Directory Settings"
107
+ msgstr "Kataloginnstillinger"
108
+
109
+ #: config_form.php:69
110
+ #: config_form.php:71
111
+ msgid "Authorization Settings"
112
+ msgstr "Autorisasjonsinnstillinger"
113
+
114
+ #: config_form.php:73
115
+ msgid "Allow Anyone To Post Via Email"
116
+ msgstr "Tillat hvem som helst å publisere innlegg via e-post"
117
+
118
+ #: config_form.php:75
119
+ msgid "Roles That Can Post:"
120
+ msgstr "Roller som kan publisere:"
121
+
122
+ #: config_form.php:77
123
+ msgid "Administrator role can always post."
124
+ msgstr "Administrator kan alltid publisere."
125
+
126
+ #: config_form.php:96
127
+ msgid "This allows you to grant access to other users to post if they have the proper access level"
128
+ msgstr "Dette gir deg muligheten til å gi andre brukere tilgang til å publisere hvis de har riktig tilgangsnivå"
129
+
130
+ #: config_form.php:99
131
+ msgid "Authorized Addresses"
132
+ msgstr "Autoriserte adresser"
133
+
134
+ #: config_form.php:112
135
+ msgid "Directory For Photos:"
136
+ msgstr "Katalog for bilder:"
137
+
138
+ #: config_form.php:115
139
+ #: config_form.php:123
140
+ #: config_form.php:156
141
+ #: config_form.php:167
142
+ #: config_form.php:200
143
+ #: config_form.php:209
144
+ #: config_form.php:241
145
+ #: config_form.php:248
146
+ #: config_form.php:255
147
+ #: config_form.php:263
148
+ #: config_form.php:269
149
+ #: config_form.php:279
150
+ #: config_form.php:287
151
+ #: config_form.php:295
152
+ #: config_form.php:303
153
+ #: config_form.php:311
154
+ #: config_form.php:330
155
+ #: config_form.php:337
156
+ #: config_form.php:345
157
+ #: config_form.php:391
158
+ msgid "Recommended"
159
+ msgstr "Anbefalt"
160
+
161
+ #: config_form.php:120
162
+ msgid "Directory For Files:"
163
+ msgstr "Katalog for filer:"
164
+
165
+ #: config_form.php:133
166
+ #: config_form.php:135
167
+ msgid "Message Settings"
168
+ msgstr "Meldingsinnstillinger"
169
+
170
+ #: config_form.php:138
171
+ msgid "Default post by mail category:"
172
+ msgstr "Standardkategori for e-post-innlegg:"
173
+
174
+ #: config_form.php:153
175
+ msgid "Default Title:"
176
+ msgstr "Standardtittel:"
177
+
178
+ #: config_form.php:156
179
+ msgid "Live from the field"
180
+ msgstr "Direkte fra felten"
181
+
182
+ #: config_form.php:161
183
+ msgid "Prefered Text Type (HTML/plain):"
184
+ msgstr "Foretrukket teksttype (HTML/ren tekst):"
185
+
186
+ #: config_form.php:164
187
+ #: config_form.php:167
188
+ msgid "plain"
189
+ msgstr "ren tekst"
190
+
191
+ #: config_form.php:171
192
+ msgid "Forward Rejected Mail"
193
+ msgstr "Videresend forkastet e-post"
194
+
195
+ #: config_form.php:172
196
+ msgid "Allow Subject In Mail"
197
+ msgstr "Tillat emne i e-post"
198
+
199
+ #: config_form.php:172
200
+ msgid "If this is set to yes you can set the title of the post in the beginning of the mail body like this: #Your title here#."
201
+ msgstr "Hvis denne er satt til ja, kan du sette tittelen til blogginnlegget i begynnelsen av e-post-meldingen slik: #Din tittel#."
202
+
203
+ #: config_form.php:173
204
+ msgid "Allow HTML In Mail Subject"
205
+ msgstr "Tillat HTML i e-post-emne"
206
+
207
+ #: config_form.php:174
208
+ msgid "Allow HTML In Mail Body"
209
+ msgstr "Tillat HTML i meldingstekst"
210
+
211
+ #: config_form.php:176
212
+ msgid "Encoding for pages and feeds:"
213
+ msgstr "Tegnsett for sider og strømmer:"
214
+
215
+ #: config_form.php:179
216
+ #, php-format
217
+ msgid "Your blog uses %s encoding which postie supports."
218
+ msgstr "Bloggen din bruker %s tegnkoding som postie støtter."
219
+
220
+ #: config_form.php:182
221
+ #: config_form.php:187
222
+ msgid "UTF-8 is recommended by WordPress. This can be changed under \"Options->Reading->Encoding for pages and feeds:\""
223
+ msgstr "UTF-8 er anbefalt av WordPress. Dette kan endres under \"Innstillinger->Lesing->Tegnkoding for sider og strømmer\""
224
+
225
+ #: config_form.php:185
226
+ #, php-format
227
+ msgid "Warning! Your blog uses %s encoding which postie does not support."
228
+ msgstr "Advarsel! Bloggen din bruker %s tegnkoding som postie ikke støtter."
229
+
230
+ #: config_form.php:192
231
+ msgid "Decode Quoted Printable Data"
232
+ msgstr "Dekod \"Quoted Printable\"-data"
233
+
234
+ #: config_form.php:193
235
+ msgid "Supported File Types"
236
+ msgstr "Støttede filtyper"
237
+
238
+ #: config_form.php:194
239
+ msgid "Banned File Names"
240
+ msgstr "Forbudte filnavn"
241
+
242
+ #: config_form.php:196
243
+ msgid "Tag Of Message Start:"
244
+ msgstr "Merkelapp for meldingsslutt:"
245
+
246
+ #: config_form.php:198
247
+ msgid "This tag can be used to remove any text from a message that the email provider puts at the top of the message"
248
+ msgstr "Denne merkelappen kan bruker til å fjerne all uønsket tekst på starten av en e-post-melding, f.eks tekst satt inn av e-post-leverandøren."
249
+
250
+ #: config_form.php:205
251
+ msgid "Tag Of Message End:"
252
+ msgstr "Merkelapp for meldingsstart:"
253
+
254
+ #: config_form.php:207
255
+ msgid "This tag can be used to remove any text from a message that the email provider puts at the bottom of the message"
256
+ msgstr "Denne merkelappen kan bruker til å fjerne all uønsket tekst på slutten av en e-post-melding, f.eks tekst satt inn av e-post-leverandøren."
257
+
258
+ #: config_form.php:213
259
+ msgid "Drop The Signature From Mail"
260
+ msgstr "Fjern signatur fra e-post"
261
+
262
+ #: config_form.php:214
263
+ msgid "Signature Patterns"
264
+ msgstr "Signaturmønstre"
265
+
266
+ #: config_form.php:222
267
+ #: config_form.php:224
268
+ msgid "Image Settings"
269
+ msgstr "Bildeinnstillinger"
270
+
271
+ #: config_form.php:228
272
+ msgid "No GD Support"
273
+ msgstr "Ingen GD-støtte"
274
+
275
+ #: config_form.php:229
276
+ msgid "Currently your installation of PHP does not have GD installed so no image resizing can occur."
277
+ msgstr "For øyeblikket har ikke din PHP-installasjon GD installert, så endring av bildestørrelse kan ikke utføres."
278
+
279
+ #: config_form.php:235
280
+ msgid "Post Images At End"
281
+ msgstr "Legg inn bilder på slutten"
282
+
283
+ #: config_form.php:236
284
+ msgid "Resize Large Images"
285
+ msgstr "Endre størrelse på store bilder"
286
+
287
+ #: config_form.php:238
288
+ msgid "Maximum Image Width:"
289
+ msgstr "Maksimal bildebredde:"
290
+
291
+ #: config_form.php:240
292
+ #: config_form.php:247
293
+ msgid "pixels"
294
+ msgstr "piksler"
295
+
296
+ #: config_form.php:245
297
+ msgid "Maximum Image Height:"
298
+ msgstr "Maksimal bildehøyde:"
299
+
300
+ #: config_form.php:248
301
+ msgid "Leave Blank"
302
+ msgstr "La den stå tom"
303
+
304
+ #: config_form.php:252
305
+ msgid "JPEG quality:"
306
+ msgstr "JPEG-kvalitet:"
307
+
308
+ #: config_form.php:254
309
+ msgid "%"
310
+ msgstr ""
311
+
312
+ #: config_form.php:259
313
+ msgid "Use ImageMagick"
314
+ msgstr "Bruk ImageMagick"
315
+
316
+ #: config_form.php:261
317
+ msgid "convert binary location:"
318
+ msgstr "Plassering av convert:"
319
+
320
+ #: config_form.php:263
321
+ #: config_form.php:269
322
+ msgid "only needed if you are using ImageMagick"
323
+ msgstr "Behøves bare hvis du vil bruke ImageMagick"
324
+
325
+ #: config_form.php:263
326
+ #: config_form.php:269
327
+ #: config_form.php:330
328
+ #, php-format
329
+ msgid "should be %s"
330
+ msgstr "Skal normalt være %s"
331
+
332
+ #: config_form.php:267
333
+ msgid "identify binary location:"
334
+ msgstr "Plassering av identify si binærfil:"
335
+
336
+ #: config_form.php:272
337
+ msgid "Automatic SmartSharp Mask"
338
+ msgstr "Automatisk bildekorreksjon"
339
+
340
+ #: config_form.php:274
341
+ msgid "Start Image Count At 0"
342
+ msgstr "Start bildenummerering på 0"
343
+
344
+ #: config_form.php:276
345
+ msgid "Image Place Holder Tag:"
346
+ msgstr "Plassholder-tag for bilder"
347
+
348
+ #: config_form.php:284
349
+ msgid "Image CSS Class:"
350
+ msgstr "CSS-klasse for bilder:"
351
+
352
+ #: config_form.php:292
353
+ msgid "Image CSS Style:"
354
+ msgstr "CSS-stil for bilder:"
355
+
356
+ #: config_form.php:300
357
+ msgid "Image Div CSS Class:"
358
+ msgstr "CSS-klasse for bildediv:"
359
+
360
+ #: config_form.php:303
361
+ msgid "This is the CSS class of a div that wraps each image. Can be used to style the post"
362
+ msgstr "Dette er CSS-klassen til en div som omgir hvert bilde. Kan brukes til å endre innleggets stil."
363
+
364
+ #: config_form.php:308
365
+ msgid "Attachment Div CSS Class:"
366
+ msgstr "CSS-klasse for vedleggsdiv:"
367
+
368
+ #: config_form.php:311
369
+ msgid "This is the CSS class of a div that wraps each file attachment. Can be used to style the post"
370
+ msgstr "Dette er CSS-klassen til en div som omgir hvert vedlegg. Kan brukes til å endre innleggets stil."
371
+
372
+ #: config_form.php:322
373
+ #: config_form.php:324
374
+ msgid "3GP settings"
375
+ msgstr "Innstillinger for 3GP"
376
+
377
+ #: config_form.php:326
378
+ msgid "Embed 3GP videos as QuickTime"
379
+ msgstr "Inkluder 3GP-videoer som QuickTime"
380
+
381
+ #: config_form.php:328
382
+ msgid "Location of ffmpeg:"
383
+ msgstr "Plassering av ffmpeg:"
384
+
385
+ #: config_form.php:330
386
+ msgid "only needed if you are on a Linux server and use 3gp video,and don't embed the video. This allows postie to make thumbnail of the very first frame"
387
+ msgstr "Behøves bare dersom du holder til på en Linux-server, bruker 3gp-video og ikke inkluderer videoen i innlegget. Dette tillater postie å lage en miniatyr av videoens første bilde."
388
+
389
+ #: config_form.php:334
390
+ msgid "3GP CSS Class:"
391
+ msgstr "CSS-klasse for 3GP:"
392
+
393
+ #: config_form.php:342
394
+ msgid "3GP Div CSS:"
395
+ msgstr "CSS-stil for 3GP-div:"
396
+
397
+ #: config_form.php:345
398
+ msgid "This is the CSS class of a div that wraps each 3GP video. Can be used to style the post"
399
+ msgstr "Dette er CSS-klassen til en div som omgir hver 3GP-video. Kan brukes til å endre innleggets stil."
400
+
401
+ #: config_form.php:359
402
+ #: config_form.php:361
403
+ msgid "Mailserver Settings"
404
+ msgstr "Innstillinger for e-post-server"
405
+
406
+ #: config_form.php:366
407
+ msgid "Mail Protocol:"
408
+ msgstr "E-post-protokoll:"
409
+
410
+ #: config_form.php:375
411
+ msgid "IMAP/IMAP-SSL/POP3-SSL unavailable"
412
+ msgstr "IMAP/IMAP-SSL/POP3-SSL ikke tilgjengelig"
413
+
414
+ #: config_form.php:379
415
+ msgid "Standard Ports:"
416
+ msgstr "Standardporter:"
417
+
418
+ #: config_form.php:387
419
+ msgid "Postie Time Correction:"
420
+ msgstr "Postie-tidskorreksjon:"
421
+
422
+ #: config_form.php:389
423
+ msgid "hours"
424
+ msgstr "timer"
425
+
426
+ #: config_form.php:391
427
+ msgid "Should be the same as your normal offset - but this lets you adjust it in cases where that doesn't work."
428
+ msgstr "Bør være det samme som din vanlige tidsforskyving, men dette lar deg justere i de tilfeller det ikke fungerer."
429
+
430
+ #: config_form.php:398
431
+ #: postie_test.php:102
432
+ #: postie_test.php:130
433
+ msgid "Mail Server:"
434
+ msgstr "E-post-server:"
435
+
436
+ #: config_form.php:400
437
+ #: postie_test.php:105
438
+ #: postie_test.php:133
439
+ msgid "Port:"
440
+ msgstr ""
441
+
442
+ #: config_form.php:405
443
+ #: postie_test.php:107
444
+ msgid "Mail Userid:"
445
+ msgstr "E-post-brukernavn:"
446
+
447
+ #: config_form.php:409
448
+ #: postie_test.php:110
449
+ msgid "Mail Password:"
450
+ msgstr "E-post-passord:"
451
+
452
+ #: config_form.php:428
453
+ msgid "Update Options"
454
+ msgstr "Oppdater innstillinger"
455
+
456
+ #: cronless_postie.php:39
457
+ #: postie.php:53
458
+ msgid "Edit Plugins"
459
+ msgstr "Redigere innstikk"
460
+
461
+ #: get_mail.php:28
462
+ msgid "Dang, message is empty!"
463
+ msgstr "Oisann, meldingen er tom!"
464
+
465
+ #: get_mail.php:45
466
+ msgid "Ignoring email - not authorized."
467
+ msgstr "Ignorerer e-post da den er sendt fra en adresse som ikke er autorisert."
468
+
469
+ #: postie-functions.php:17
470
+ #, php-format
471
+ msgid "Message Id is : %s"
472
+ msgstr "Meldings-id er : %s"
473
+
474
+ #: postie-functions.php:18
475
+ msgid "Email has following attachments:"
476
+ msgstr "E-posten har følgende vedlegg:"
477
+
478
+ #: postie-functions.php:78
479
+ msgid "Configure Postie"
480
+ msgstr "Konfigurer Postie"
481
+
482
+ #: postie-functions.php:106
483
+ msgid "Missing Configuration For Mail Server"
484
+ msgstr "Konfigurasjon for e-postserver mangler"
485
+
486
+ #: postie-functions.php:109
487
+ msgid "MAKE SURE POP IS TURNED ON IN SETTING AT Gmail"
488
+ msgstr "Du bruker Gmail, forsikre deg om at POP er aktivert under innstillinger."
489
+
490
+ #: postie-functions.php:142
491
+ msgid "There does not seem to be any new mail."
492
+ msgstr "Det ser ikke ut til å være noe nye post."
493
+
494
+ #: postie-functions.php:150
495
+ #: postie-functions.php:197
496
+ msgid "*************RUNING IN TESTING MODE*************"
497
+ msgstr "*************KJØRER I TESTMODUS*************"
498
+
499
+ #: postie-functions.php:169
500
+ #: postie-functions.php:214
501
+ #, php-format
502
+ msgid "Connecting to %1$s : %2$s (%3$s)"
503
+ msgstr "Kobler til %1$s : %2$s (%3$s)"
504
+
505
+ #: postie-functions.php:172
506
+ #: postie-functions.php:219
507
+ msgid ""
508
+ "Mail Connection Time Out\n"
509
+ "Common Reasons:\n"
510
+ "Server Down\n"
511
+ "Network Issue\n"
512
+ "Port/Protocol MisMatch"
513
+ msgstr ""
514
+ "Tidsavbrudd ved tilkobling til e-postserver\n"
515
+ "Vanlige årsaker:\n"
516
+ "Server nede\n"
517
+ "Nettverksproblemer\n"
518
+ "Uoverenstemmelse mellom port og protokoll"
519
+
520
+ #: postie-functions.php:174
521
+ #: postie-functions.php:221
522
+ #, php-format
523
+ msgid "The Server said: %s"
524
+ msgstr "Serveren sa: %s"
525
+
526
+ #: postie-functions.php:185
527
+ #: postie-functions.php:246
528
+ msgid "Not deleting messages!"
529
+ msgstr "Sletter ikke meldinger!"
530
+
531
+ #: postie-functions.php:237
532
+ #, php-format
533
+ msgid "An error occured. The server said : %s"
534
+ msgstr "En feil oppsto. Serveren sa: %s"
535
+
536
+ #: postie-functions.php:241
537
+ #, php-format
538
+ msgid "Mission complete, message %d deleted."
539
+ msgstr "Oppdrag utført, melding %d slettet."
540
+
541
+ #: postie-functions.php:259
542
+ #, php-format
543
+ msgid "Sorry but %s is not a valid directory."
544
+ msgstr "Beklager, men %s er ikke en gyldig katalog."
545
+
546
+ #: postie-functions.php:262
547
+ #, php-format
548
+ msgid "The web server cannot write to %s please correct the permissions"
549
+ msgstr "Webserveren kan ikke skrive til %s, korriger rettighetene"
550
+
551
+ #: postie-functions.php:292
552
+ #, php-format
553
+ msgid "Ignoring %s - it is on the banned files list."
554
+ msgstr "Ignorerer %s - den er på listen over forbudte filnavn."
555
+
556
+ #: postie-functions.php:380
557
+ msgid "Unable to find a name for images that does not collide"
558
+ msgstr "Klarer ikke å finne et filnavn som ikke finnes fra før."
559
+
560
+ #: postie-functions.php:641
561
+ msgid "Invalid Sender - Emtpy!"
562
+ msgstr "Ugyldig avsender - tom!"
563
+
564
+ #: postie-functions.php:652
565
+ #, php-format
566
+ msgid "%s is authorized to post as the administrator"
567
+ msgstr "%s er autorisert til å publisere som administrator"
568
+
569
+ #: postie-functions.php:665
570
+ #, php-format
571
+ msgid "Invalid sender: %s! Not adding email!"
572
+ msgstr "Ugyldig avsender: %s! Legger ikke til e-post!"
573
+
574
+ #: postie-functions.php:669
575
+ msgid "A copy of the message has been forwarded to the administrator."
576
+ msgstr "En kopi av meldingen har blitt videresendt til administrator."
577
+
578
+ #: postie-functions.php:672
579
+ msgid "The message was unable to be forwarded to the adminstrator."
580
+ msgstr "Meldingen kunne ikke videresendes til administrator."
581
+
582
+ #: postie-functions.php:1407
583
+ #, php-format
584
+ msgid "%s : Unauthorized Post Attempt"
585
+ msgstr "%s : Uautorisert publiseringsforsøk"
586
+
587
+ #: postie-functions.php:1416
588
+ #, php-format
589
+ msgid ""
590
+ "An unauthorized message has been sent to %1$s from %2$s. The subject of this message was: %3$s.\n"
591
+ "If you wish to allow posts from this address, please add %2$s to the authorised users list and manually add the content of the e-mail found below.\n"
592
+ "Otherwise, the e-mail has already been deleted from the server and you can ignore this message.\n"
593
+ "If you would like to prevent postie from forwarding mail in the future, please change FORWARD_REJECTED_MAIL to false in postie.\n"
594
+ "The original content of the e-mail has been attached."
595
+ msgstr ""
596
+ "En uatorisert melding har blitt sendt til %1$s fra %2$s. Meldingens emne var: %3$s.\n"
597
+ "Hvis du ønsker å tillate at det publiseres fra denne adressen, legg til %2$s i listen over autoriserte adresser og publiser innholdet i den vedlagte e-posten manuelt.\n"
598
+ "Ellers er e-posten er allerede slettet fra server og du kan se bort fra denne meldingen.\n"
599
+ "Hvos du ikke ønsker at postie skal videresende post i framtiden endrer du FORWARD_REJECTED_MAIL til nei i postie.\n"
600
+ "E-postens originale innhold er vedlagt."
601
+
602
+ #: postie-functions.php:1680
603
+ msgid "Postie should be in its own directory in wp-content/plugins/postie"
604
+ msgstr "Postie skal være i sin egen katalog (wp-content/plugins/postie)"
605
+
606
+ #: postie-functions.php:1694
607
+ #: postie_test.php:117
608
+ #: postie_test.php:143
609
+ #: postie_test.php:163
610
+ #: postie_test.php:167
611
+ #: postie_test.php:171
612
+ #: postie_test.php:175
613
+ #: postie_test.php:181
614
+ #: postie_test.php:185
615
+ msgid "Yes"
616
+ msgstr "Ja"
617
+
618
+ #: postie-functions.php:1695
619
+ #: postie_test.php:163
620
+ #: postie_test.php:167
621
+ #: postie_test.php:171
622
+ #: postie_test.php:175
623
+ #: postie_test.php:181
624
+ #: postie_test.php:185
625
+ msgid "No"
626
+ msgstr "Nei"
627
+
628
+ #: postie-functions.php:1984
629
+ #, php-format
630
+ msgid "Missing %s"
631
+ msgstr "%s mangler"
632
+
633
+ #: postie_test.php:8
634
+ msgid "Postie Diagnosis"
635
+ msgstr "Postie-diagnose"
636
+
637
+ #: postie_test.php:13
638
+ msgid "Sorry only admin can run this file"
639
+ msgstr "Beklager, bare admin kan kjøre denne filen"
640
+
641
+ #: postie_test.php:23
642
+ msgid "Postie Configuration Test"
643
+ msgstr "Test av postie-innstillinger"
644
+
645
+ #: postie_test.php:27
646
+ msgid "You currently have the Markdown plugin installed. It will cause problems if you send in HTML email. Please turn it off if you intend to send email using HTML."
647
+ msgstr "Du har \"Markdown\"-innstikket innstallert. Det vil føre til problemer hvis du sender e-post med HTML-koder. Deaktiver den hvis du har tenkt å sende slike e-poster."
648
+
649
+ #: postie_test.php:46
650
+ msgid "Postie expects to be in its own directory named postie."
651
+ msgstr "Postie forventer å være i sin egen katalog ved navn postie"
652
+
653
+ #: postie_test.php:50
654
+ #, php-format
655
+ msgid "Postie is in %s"
656
+ msgstr "Postie er i %s"
657
+
658
+ #: postie_test.php:56
659
+ msgid "GD Library Test"
660
+ msgstr "Test av GD-bibliotek"
661
+
662
+ #: postie_test.php:58
663
+ msgid "GD is installed"
664
+ msgstr "GD er installert"
665
+
666
+ #: postie_test.php:60
667
+ msgid "Iconv Library Test"
668
+ msgstr "Test av iconv-bibliotek"
669
+
670
+ #: postie_test.php:61
671
+ msgid "Only required if you want to support ISO-2022-JP"
672
+ msgstr "Bare nødvendig dersom du ønsker å støtte ISO-2022-JP"
673
+
674
+ #: postie_test.php:63
675
+ msgid "Iconv is installed"
676
+ msgstr "Iconv er installert"
677
+
678
+ #: postie_test.php:66
679
+ msgid "Clock Tests"
680
+ msgstr "Klokketester"
681
+
682
+ #: postie_test.php:67
683
+ msgid "This shows what time it would be if you posted right now"
684
+ msgstr "Dette viser hvilken tid det vil stå på innlegget dersom du publiserer akkurat nå."
685
+
686
+ #: postie_test.php:73
687
+ msgid "GMT:"
688
+ msgstr ""
689
+
690
+ #: postie_test.php:74
691
+ msgid "Current:"
692
+ msgstr "Lokal tid:"
693
+
694
+ #: postie_test.php:75
695
+ msgid "Mail Tests"
696
+ msgstr "E-post-tester"
697
+
698
+ #: postie_test.php:76
699
+ msgid "These try to confirm that the email configuration is correct."
700
+ msgstr "Disse prøver å bekrefte at e-postkonfigurasjonen er korrekt"
701
+
702
+ #: postie_test.php:80
703
+ #: postie_test.php:158
704
+ msgid "Test"
705
+ msgstr "Test"
706
+
707
+ #: postie_test.php:81
708
+ #: postie_test.php:159
709
+ msgid "Result"
710
+ msgstr "Resultat"
711
+
712
+ #: postie_test.php:84
713
+ msgid "Connect to Mail Host"
714
+ msgstr "Kobler til e-postserver"
715
+
716
+ #: postie_test.php:92
717
+ msgid "Sorry - you do not have IMAP php module installed - it is required for this mail setting."
718
+ msgstr "Beklager, du har ikke php-modulen for IMAP installert, den er nødvendig for denne innstillingen."
719
+
720
+ #: postie_test.php:98
721
+ #: postie_test.php:126
722
+ #, php-format
723
+ msgid "Unable to connect. The server said - %s"
724
+ msgstr "Kan ikke koble til. Serveren sa: %s"
725
+
726
+ #: postie_test.php:100
727
+ #: postie_test.php:128
728
+ msgid "Some of the following settings are probably wrong:"
729
+ msgstr "Sannsynlig er en av følgende innstillinger gale:"
730
+
731
+ #: postie_test.php:114
732
+ #: postie_test.php:140
733
+ msgid "Try putting in your full email address as a userid and try again."
734
+ msgstr "Prøv å fylle inn hele e-postadressen din som brukernavn og prøv igjen."
735
+
736
+ #: postie_test.php:138
737
+ #, php-format
738
+ msgid "Unable to log in. The server said - %s"
739
+ msgstr "Kan ikke logge innl. Serveren sa: %s"
740
+
741
+ #: postie_test.php:154
742
+ msgid "File Tests"
743
+ msgstr "Filtester"
744
+
745
+ #: postie_test.php:162
746
+ msgid "Photos Directory Exists"
747
+ msgstr "Katalogen for bilder eksisterer"
748
+
749
+ #: postie_test.php:166
750
+ msgid "Files Directory Exists"
751
+ msgstr "Katalogen for filer eksisterer"
752
+
753
+ #: postie_test.php:170
754
+ msgid "Photos Directory Writable"
755
+ msgstr "Katalogen for bilder er skrivbar"
756
+
757
+ #: postie_test.php:174
758
+ msgid "Files Directory Writable"
759
+ msgstr "Katalogen for filer er skrivbar"
760
+
761
+ #: postie_test.php:180
762
+ msgid "Convert exists"
763
+ msgstr "Convert eksisterer"
764
+
765
+ #: postie_test.php:184
766
+ msgid "Identify exists"
767
+ msgstr "Identify eksisterer"
768
+
769
+ #: postie_test.php:194
770
+ msgid "Image Tests"
771
+ msgstr "Bildetester"
772
+
773
+ #: postie_test.php:195
774
+ msgid "Three images should be here - they are the test files"
775
+ msgstr "Her skal det være tre bilder, de er testfilene"
776
+
777
+ #: postie_test.php:204
778
+ msgid "Plain Images"
779
+ msgstr "Ubehandlede bilder"
780
+
781
+ #: postie_test.php:215
782
+ msgid "AutoSharpened"
783
+ msgstr "Autokorrigert"
784
+
785
+ #: postie_test.php:215
786
+ msgid "WARNING-This feature takes a lot of processing power."
787
+ msgstr "Advarsel! Denne funksjonen bruker mye prosessorkraft"
788
+
789
+ #: postie_test.php:230
790
+ msgid "Scaled & Rotated"
791
+ msgstr "Skalert og rotert"
792
+
793
+ #~ msgid "it should handle ISO-8859-1 as well"
794
+ #~ msgstr "skal også kunne håndtere ISO-8859-1"
795
+ #~ msgid "JPEG Compression:"
796
+ #~ msgstr "JPEG-komprimering:"
797
+ #~ msgid "Image Div CSS:"
798
+ #~ msgstr "CSS-stil for bilde-div:"
799
+ #~ msgid "Postie only works on on Word Press version 2.0 and above"
800
+ #~ msgstr "Postie virker bare under WordPress 2.0 og høyere"
801
+
802
+ #, fuzzy
803
+ #~ msgid "Postie only works on Word Press 2.0 and above."
804
+ #~ msgstr "Postie virker bare under WordPress 2.0 og høyere"
805
+ #~ msgid "Minimum Access Level Required To Post:"
806
+ #~ msgstr "Minimum tilgangsnivå for å få lov til å poste:"
807
+ #~ msgid "html"
808
+ #~ msgstr "HTML"
809
+ #~ msgid "should be /usr/bin/convert"
810
+ #~ msgstr "burde være /usr/bin/convert"
811
+ #~ msgid "should be /usr/bin/ffmpeg"
812
+ #~ msgstr "burde være /usr/bin/ffmpeg"
813
+ #~ msgid "should be /usr/bin/identify"
814
+ #~ msgstr "burde være /usr/bin/identify"
815
+
makepot ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ find . -iname '*php' >files.tmp
3
+ xgettext --language=PHP --keyword=__ --keyword=_e --keyword=__ngettext:1,2 --keyword=BuildBooleanSelect:1 --keyword=BuildTextArea:1 -F -n --from-code=UTF8 -o languages/postie.pot -f files.tmp
4
+ xgettext --language=PHP --keyword=BuildBooleanSelect:4 --keyword=BuildTextArea:4 -F -n --from-code=UTF8 -j -o languages/postie.pot -f files.tmp
5
+ rm files.tmp
6
+
postie-functions.php CHANGED
@@ -1,5 +1,9 @@
1
  <?php
2
- //TODO option to set posts for review (not publish immediately)
 
 
 
 
3
  include_once (dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . "wp-config.php");
4
  define("POSTIE_ROOT",dirname(__FILE__));
5
  define("POSTIE_TABLE",$GLOBALS["table_prefix"]. "postie_config");
@@ -27,13 +31,16 @@ function PostEmail($poster,$mimeDecodedEmail) {
27
  # }
28
  $content = GetContent($mimeDecodedEmail,$attachments);
29
  $subject = GetSubject($mimeDecodedEmail,$content);
30
- echo "the subject is $subject, right after calling GetSubject\n";
 
 
31
  $rotation = GetRotation($mimeDecodedEmail,$content);
32
  if ($rotation != "0"
33
  && count($attachments["image_files"])) {
34
  RotateImages($rotation,$attachments["image_files"]);
35
  }
36
- SpecialMessageParsing($content,$attachments);
 
37
  $postAuthorDetails=getPostAuthorDetails($subject,$content,
38
  $mimeDecodedEmail);
39
  $message_date = NULL;
@@ -54,7 +61,6 @@ function PostEmail($poster,$mimeDecodedEmail) {
54
  $id=checkReply($subject);
55
  $post_categories = GetPostCategories($subject);
56
  $post_tags = GetPostTags($content);
57
- echo "the subject is $subject, right after calling GetPostCategories\n";
58
  $comment_status = AllowCommentsOnPost($content);
59
 
60
  if ((empty($id) || is_null($id)) &&
@@ -68,12 +74,16 @@ function PostEmail($poster,$mimeDecodedEmail) {
68
  //$content = $postAuthorDetails['content'] . $content;
69
  $content = $content;
70
  }
71
- echo "id is empty\n";
72
  } else {
73
  if ($config['WRAP_PRE']=='yes') {
74
  $content = "<pre>\n" . $content . "</pre>\n";
75
  }
76
  }
 
 
 
 
 
77
  $post_status=$config['POST_STATUS'];
78
  $details = array(
79
  'post_author' => $poster,
@@ -90,7 +100,9 @@ function PostEmail($poster,$mimeDecodedEmail) {
90
  'tags_input' => $post_tags,
91
  'comment_status' => $comment_status,
92
  'post_name' => sanitize_title($subject),
 
93
  'ID' => $id,
 
94
  'post_status' => $post_status
95
  );
96
  DisplayEmailPost($details);
@@ -98,6 +110,39 @@ function PostEmail($poster,$mimeDecodedEmail) {
98
  }
99
  /** FUNCTIONS **/
100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  function getPostAuthorDetails(&$subject,&$content,&$mimeDecodedEmail) {
102
  /* we check whether or not the e-mail is a forwards or a redirect. If it is
103
  * a fwd, then we glean the author details from the body of the post.
@@ -133,7 +178,6 @@ function getPostAuthorDetails(&$subject,&$content,&$mimeDecodedEmail) {
133
  }
134
  }
135
  $content=$newContents;
136
- echo $newContents;
137
  $theDetails=array(
138
  'content' =>"<div class='postmetadata alt'>On $theDate, $theAuthor" .
139
  " posted:</div>",
@@ -172,9 +216,7 @@ function checkReply(&$subject) {
172
  }
173
  $checkExistingPostQuery= "SELECT ID FROM $wpdb->posts WHERE
174
  '$tmpSubject' = post_title";
175
- echo "query = $checkExistingPostQuery\n";
176
  if ($id=$wpdb->get_var($checkExistingPostQuery)) {
177
- echo "results = $id\n";
178
  if (is_array($id)) {
179
  $id=$id[count($id)-1];
180
  }
@@ -192,11 +234,12 @@ function postie_read_me() {
192
  * This sets up the configuration menu
193
  */
194
  function PostieMenu() {
195
- add_options_page("Configure Postie",
196
- "Configure Postie" ,
197
- 0,
198
- POSTIE_ROOT . "/postie.php",
199
- "ConfigurePostie");
 
200
  }
201
  /**
202
  * This handles actually showing the form
@@ -385,51 +428,53 @@ function IsWritableDirectory($directory) {
385
  * @param array - details of the post
386
  */
387
  function PostToDB($details) {
388
- $config = GetConfig();
389
- if ($config["POST_TO_DB"]) {
390
- //generate sql for insertion
391
- $_POST['publish'] = true; //Added to make subscribe2 work - it will only handle it if the global varilable _POST is set
392
- if ($details['ID']==NULL) {
393
- $post_ID = wp_insert_post($details);
394
- } else {
395
- // strip out quoted content
396
- $lines=preg_split("/[\r\n]/",$details['post_content']);
397
- print_r($lines);
398
- $newContents='';
399
- foreach ($lines as $line) {
400
- //$match=preg_match("/^>.*/i",$line);
401
- //echo "line=$line, match=$match";
402
- if (preg_match("/^>.*/i",$line)==0 &&
403
- preg_match("/^(from|subject|to|date):.*?/i",$line)==0 &&
404
- preg_match("/^-+.*?(from|subject|to|date).*?/i",$line)==0 &&
405
- preg_match("/^on.*?wrote:$/i",$line)==0 &&
406
- preg_match("/^-+\s*forwarded\s*message\s*-+/i",$line)==0) {
407
- $newContents.="$line\n";
408
- }
409
- }
410
- $comment = array(
411
- 'comment_author'=>$details['comment_author'],
412
- 'comment_post_ID' =>$details['ID'],
413
- 'comment_author_email' => $details['email_author'],
414
- 'comment_date' =>$details['post_date'],
415
- 'comment_date_gmt' =>$details['post_date_gmt'],
416
- 'comment_content' =>$newContents,
417
- 'comment_author_url' =>'',
418
- 'comment_author_IP' =>'',
419
- 'comment_approved' =>1,
420
- 'comment_agent' =>'',
421
- 'comment_type' =>'',
422
- 'comment_parent' => 0
423
- );
424
-
425
- echo "the comment is:\n";
426
- print_r($comment);
427
- $post_ID = wp_insert_comment($comment);
428
  }
429
- //do_action('publish_post', $post_ID); - no longer needed
430
- //do_action('publish_phone', $post_ID); -- seems to triger a double
431
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
432
  }
 
433
  }
434
 
435
  /**
@@ -448,274 +493,256 @@ function BannedFileName($filename) {
448
 
449
  //tear apart the meta part for useful information
450
  function GetContent ($part,&$attachments) {
451
- $config = GetConfig();
452
- $meta_return = NULL;
453
 
454
- DecodeBase64Part($part);
455
- if (BannedFileName($part->ctype_parameters['name'])
456
- || BannedFileName($part->ctype_parameters['name'])) {
457
- return(NULL);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
458
  }
459
-
460
- if ($part->ctype_primary == "application"
461
- && $part->ctype_secondary == "octet-stream") {
462
- if ($part->disposition == "attachment") {
463
- $image_endings = array("jpg","png","gif","jpeg","pjpeg");
464
- foreach ($image_endings as $type) {
465
- if (eregi(".$type\$",$part->d_parameters["filename"])) {
466
- $part->ctype_primary = "image";
467
- $part->ctype_secondary = $type;
468
- break;
469
- }
470
- }
 
 
 
471
  }
472
- else {
473
- $mimeDecodedEmail = DecodeMIMEMail($part->body);
474
- FilterTextParts($mimeDecodedEmail);
475
- foreach($mimeDecodedEmail->parts as $section) {
476
- $meta_return .= GetContent($section,$attachments);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
477
  }
 
 
 
 
 
 
 
 
 
 
 
478
  }
479
- }
480
- if ($part->ctype_primary == "multipart"
481
- && $part->ctype_secondary == "appledouble") {
482
- $mimeDecodedEmail = DecodeMIMEMail("Content-Type: multipart/mixed; boundary=".$part->ctype_parameters["boundary"]."\n".$part->body);
483
- FilterTextParts($mimeDecodedEmail);
484
- FilterAppleFile($mimeDecodedEmail);
485
- foreach($mimeDecodedEmail->parts as $section) {
486
- $meta_return .= GetContent($section,$attachments);
487
  }
488
- }
489
- else {
490
- switch ( strtolower($part->ctype_primary) ) {
491
- case 'multipart':
492
- FilterTextParts($part);
493
- foreach ($part->parts as $section) {
494
- $meta_return .= GetContent($section,$attachments);
495
- }
496
- break;
497
- case 'text':
498
-
499
- HandleMessageEncoding($part->headers["content-transfer-encoding"],
500
- $part->ctype_parameters["charset"],
501
- $part->body);
502
-
503
- //go through each sub-section
504
- if ($part->ctype_secondary=='enriched') {
505
- //convert enriched text to HTML
506
- $meta_return .= etf2HTML($part->body ) . "\n";
507
- } elseif ($part->ctype_secondary=='html') {
508
- //strip excess HTML
509
- $meta_return .= HTML2HTML($part->body ) . "\n";
510
- } else {
511
- //regular text, so just strip the pgp signature
512
- if (ALLOW_HTML_IN_BODY) {
513
- $meta_return .= $part->body . "\n";
514
- }
515
- else {
516
- $meta_return .= htmlentities( $part->body ) . "\n";
517
- }
518
- $meta_return = StripPGP($meta_return);
519
- }
520
- break;
521
-
522
- case 'image':
523
- $file = GenerateImageFileName($config["REALPHOTOSDIR"], $part->ctype_secondary);
524
- //This makes sure there is no collision
525
- $ctr = 0;
526
- while(file_exists($file) && $ctr < 1000) {
527
- $file = GenerateImageFileName($config["REALPHOTOSDIR"], $part->ctype_secondary);
528
- $ctr++;
529
- }
530
- if ($ctr >= 1000) {
531
- die("Unable to find a name for images that does not collide\n");
532
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
533
  $fileName = basename($file);
534
- $fp = fopen($file, 'w');
535
- fwrite($fp, $part->body);
536
- fclose($fp);
537
- @exec ('chmod 755 ' . $file);
538
- if ($config["USE_IMAGEMAGICK"] && $config["AUTO_SMART_SHARP"]) {
539
- ImageMagickSharpen($file);
540
- }
541
- $mimeTag = '<!--Mime Type of File is '.$part->ctype_primary."/".$part->ctype_secondary.' -->';
542
- $thumbImage = NULL;
543
- $cid = trim($part->headers["content-id"],"<>");; //cids are in <cid>
544
- if ($config["RESIZE_LARGE_IMAGES"]) {
545
- echo "going to resize now \n<br />";
546
- list($thumbImage, $fullImage, $caption) = ResizeImage($file,strtolower($part->ctype_secondary));
547
- echo "caption=$caption\n<br />";
548
- echo "thumbImage=$thumbImage\n<br />";
549
- }
550
- $attachments["image_files"][] = array(($thumbImage ? $config["REALPHOTOSDIR"] . $thumbImage:NULL),
551
- $config["REALPHOTOSDIR"] . $fileName,
552
- $part->ctype_secondary);
553
- $onclick='';
554
- if ($config['IMAGE_NEW_WINDOW']) {
555
- $onclick='" onclick="window.open(' . "'"
556
- . $config["URLPHOTOSDIR"] . $fullImage . "','"
557
- . "full_size_image" . "','"
558
- . "toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=1,height=" . $marimey . ",width=" . $marimex . "');" . "return false;";
559
- }
560
- if ($thumbImage) {
561
- //TODO image template
562
- list($marime,$tmpcaption)=DetermineImageSize($file);
563
- $marimex=$marime[0]+20;
564
- $marimey=$marime[1]+20;
565
- if ($config['USEIMAGETEMPLATE']) {
566
- $imageTemplate=str_replace('{THUMBNAIL}',
567
- $config['URLPHOTOSDIR'] . $thumbImage,
568
- $config['IMAGETEMPLATE']);
569
- $imageTemplate=str_replace('{IMAGE}',
570
- $config['URLPHOTOSDIR'] . $fullImage,
571
- $imageTemplate);
572
- $imageTemplate=str_replace('{FILENAME}',
573
- $config['REALPHOTOSDIR'] . $fullImage,
574
- $imageTemplate);
575
- if ($caption!='') {
576
- $imageTemplate=str_replace('{CAPTION}',
577
- $caption, $imageTemplate);
578
- }
579
- $attachments["html"][] .=$imageTemplate;
580
- } else {
581
- $attachments["html"][] .= $mimeTag.'<div class="' . $config["IMAGEDIV"].'"><a href="' . $config["URLPHOTOSDIR"] . $fullImage .
582
- $onclick . '"><img src="' . $config["URLPHOTOSDIR"] . $thumbImage . '" alt="'
583
- . $part->ctype_parameters['name'] . '" title="' . $part->ctype_parameters['name'] . '" style="'.$config["IMAGESTYLE"].'" class="'.$config["IMAGECLASS"].'" /></a></div>' . "\n";
584
- }
585
- if ($cid) {
586
- $attachments["cids"][$cid] = array($config["URLPHOTOSDIR"] . $fullImage,count($attachments["html"]) - 1);
587
- }
588
- }
589
- else {
590
- $attachments["html"][] .= $mimeTag .'<div class="' . $config["IMAGEDIV"].'"><img src="' . $config["URLPHOTOSDIR"] . $fileName
591
- . '" alt="' . $part->ctype_parameters['name'] . '" style="'
592
- . $config["IMAGESTYLE"] . '" class="' . $config["IMAGECLASS"] . '" /></div>' . "\n";
593
- if ($cid) {
594
- $attachments["cids"][$cid] = array($config["URLPHOTOSDIR"] . $fileName,count($attachments["html"]) - 1);
595
- }
596
- }
597
- break;
598
- default:
599
- if (in_array(strtolower($part->ctype_primary),$config["SUPPORTED_FILE_TYPES"])) {
600
- //pgp signature - then forget it
601
- if ( $part->ctype_secondary == 'pgp-signature' ) {break;}
602
- //other attachments save to FILESDIR
603
- $filename = $part->ctype_parameters['name'];
604
- $file = $config["REALFILESDIR"] . $filename;
605
- $fp = fopen($file, 'w');
606
- fwrite($fp, $part->body );
607
- fclose($fp);
608
- @exec ('chmod 755 ' . $file);
609
- $cid = trim($part->headers["content-id"],"<>");; //cids are in <cid>
610
-
611
- if ($part->ctype_secondary == "3gpp"
612
- || $part->ctype_secondary == "3gp"
613
- || $part->ctype_secondary == "3g2"
614
- || $part->ctype_secondary == "3gpp2") {
615
- if ($config["3GP_QT"]) {
616
- //Shamelessly borrowed from http://www.postneo.com/2003/12/19/embedding-3gpp-in-html
617
- $attachments["html"][] = '<!--Mime Type of File is '.$part->ctype_primary."/".$part->ctype_secondary.' -->' .
618
- '<a href="'.$config["URLFILESDIR"] . $filename.'">Video'.
619
- '<object '.
620
- 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '.
621
- 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" '.
622
- 'width="128" '.
623
- 'height="112"> '.
624
- '<param name="src" VALUE="'. $config["URLFILESDIR"] . $filename .'"> '.
625
- '<param name="autoplay" VALUE="false"> '.
626
- '<param name="controller" VALUE="true"> '.
627
- '<embed '.
628
- 'src="'. $config["URLFILESDIR"] . $filename .'" '.
629
- 'width="128" '.
630
- 'height="112" '.
631
- 'autoplay="true" '.
632
- 'controller="true" '.
633
- 'type="video/quicktime" '.
634
- 'pluginspage="http://www.apple.com/quicktime/download/" '.
635
- 'width="128" '.
636
- 'height="150"></embed> '.
637
- '</object></a>';
638
- }
639
- else {
640
- if (file_exists($config["3GP_FFMPEG"])) {
641
- $fileName = basename($file);
642
- //options from http://www.getid3.org/phpBB2/viewtopic.php?p=1290&
643
- $scaledFileName = "thumb.".$fileName;
644
- $scaledFile = $config["REALPHOTOSDIR"] . $scaledFileName;
645
-
646
- @exec (escapeshellcmd($config["3GP_FFMPEG"]) .
647
- " -i " .
648
- escapeshellarg($file) .
649
- " -y -ss 00:00:01 -vframes 1 -an -sameq -f gif " .
650
- escapeshellarg($scaledFile) );
651
- @exec ('chmod 755 ' . escapeshellarg($scaledFile));
652
-
653
- $attachments["html"][] .= '<!--Mime Type of File is '.$part->ctype_primary."/".$part->ctype_secondary.' --><div class="' . $config["3GPDIV"].'"><a href="' . $config["URLPHOTOSDIR"] . $fileName. '"><img src="' . $config["URLPHOTOSDIR"] . $scaledFileName . '" alt="' . $part->ctype_parameters['name'] . '" style="'.$config["IMAGESTYLE"].'" class="'.$config["IMAGECLASS"].'" /></a></div>' . "\n";
654
- }
655
- else {
656
- $attachments["html"][] = '<!--Mime Type of File is '.$part->ctype_primary."/".$part->ctype_secondary.' --><div class="' . $config["ATTACHMENTDIV"].'"><a href="' . $config["URLFILESDIR"] . $filename . '" class="' . $config["3GPCLASS"].'">' . $part->ctype_parameters['name'] . '</a></div>' . "\n";
657
- }
658
-
659
- }
660
- }
661
- elseif ($part->ctype_secondary == "x-shockwave-flash") {
662
- $attachments["html"][] = '<!--Mime Type of File is '.$part->ctype_primary."/".$part->ctype_secondary.' -->'.
663
- '<object '.
664
- 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '.
665
- 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" '.
666
- 'width="" '.
667
- 'height=""> '.
668
- '<param name="movie" value="'. $config["URLFILESDIR"] . $filename .'"> '.
669
- '<param name="quality" value="high"> '.
670
- '<embed '.
671
- 'src="'. $config["URLFILESDIR"] . $filename .'" '.
672
- 'width="" '.
673
- 'height="" '.
674
- 'quality="high" '.
675
- 'pluginspage="http://www.macromedia.com/go/getflashplayer" '.
676
- 'type="application/x-shockwave-flash" '.
677
- 'width="" '.
678
- 'height=""></embed> '.
679
- '</object>';
680
- }
681
- else {
682
- $attachments["html"][] = '<!--Mime Type of File is '.$part->ctype_primary."/".$part->ctype_secondary.' --><a href="' . $config["URLFILESDIR"] . $filename . '">' . $part->ctype_parameters['name'] . '</a>' . "\n";
683
- }
684
- if ($cid) {
685
- $attachments["cids"][$cid] = array($config["URLFILESDIR"] . $filename,count($attachments["html"]) - 1);
686
- }
687
- }
688
- break;
689
- }
690
- }
691
- return $meta_return;
692
  }
693
 
694
  function ubb2HTML(&$text) {
695
- // Array of tags with opening and closing
696
- $tagArray['img'] = array('open'=>'<img src="','close'=>'">');
697
- $tagArray['b'] = array('open'=>'<b>','close'=>'</b>');
698
- $tagArray['i'] = array('open'=>'<i>','close'=>'</i>');
699
- $tagArray['u'] = array('open'=>'<u>','close'=>'</u>');
700
- $tagArray['url'] = array('open'=>'<a href="','close'=>'">\\1</a>');
701
- $tagArray['email'] = array('open'=>'<a href="mailto:','close'=>'">\\1</a>');
702
- $tagArray['url=(.*)'] = array('open'=>'<a href="','close'=>'">\\2</a>');
703
- $tagArray['email=(.*)'] = array('open'=>'<a href="mailto:','close'=>'">\\2</a>');
704
- $tagArray['color=(.*)'] = array('open'=>'<font color="','close'=>'">\\2</font>');
705
- $tagArray['size=(.*)'] = array('open'=>'<font size="','close'=>'">\\2</font>');
706
- $tagArray['font=(.*)'] = array('open'=>'<font face="','close'=>'">\\2</font>');
707
- // Array of tags with only one part
708
- $sTagArray['br'] = array('tag'=>'<br>');
709
- $sTagArray['hr'] = array('tag'=>'<hr>');
710
-
711
- foreach($tagArray as $tagName=>$replace) {
712
- $tagEnd = preg_replace('/\W/Ui','',$tagName);
713
- $text = preg_replace("|\[$tagName\](.*)\[/$tagEnd\]|Ui","$replace[open]\\1$replace[close]",$text);
714
- }
715
- foreach($sTagArray as $tagName=>$replace) {
716
- $text = preg_replace("|\[$tagName\]|Ui","$replace[tag]",$text);
717
- }
718
- return $text;
719
  }
720
 
721
 
@@ -724,276 +751,281 @@ function ubb2HTML(&$text) {
724
  // FIXME: fix colours: <color><param>FFFF,C2FE,0374</param>some text </color>
725
  function etf2HTML ( $content ) {
726
 
727
- $search = array(
728
- '/<bold>/',
729
- '/<\/bold>/',
730
- '/<underline>/',
731
- '/<\/underline>/',
732
- '/<italic>/',
733
- '/<\/italic>/',
734
- '/<fontfamily><param>.*<\/param>/',
735
- '/<\/fontfamily>/',
736
- '/<x-tad-bigger>/',
737
- '/<\/x-tad-bigger>/',
738
- '/<bigger>/',
739
- '</bigger>/',
740
- '/<color>/',
741
- '/<\/color>/',
742
- '/<param>.+<\/param>/'
743
- );
744
-
745
- $replace = array (
746
- '<b>',
747
- '</b>',
748
- '<u>',
749
- '</u>',
750
- '<i>',
751
- '</i>',
752
- '',
753
- '',
754
- '',
755
- '',
756
- '',
757
- '',
758
- '',
759
- '',
760
- ''
761
- );
762
- // strip extra line breaks
763
- $content = preg_replace($search,$replace,$content);
764
- return trim($content);
765
  }
766
 
767
 
768
  // This function cleans up HTML in the e-mail
769
  function HTML2HTML ( $content ) {
770
- $search = array(
771
- '/<html>/',
772
- '/<\/html>/',
773
- '/<title>/',
774
- '/<\/title>/',
775
- '/<body.*>/',
776
- '/<\/body>/',
777
- '/<head>/',
778
- '/<\/head>/',
779
- '/<meta content=.*>/',
780
- '/<!DOCTYPE.*>/',
781
- '/<img src=".*>/'
782
  // '/<img src="cid:(.*)" .*>/'
783
- );
784
-
785
- $replace = array (
786
- '',
787
- '',
788
- '',
789
- '',
790
- '',
791
- '',
792
- '',
793
- '',
794
- '',
795
- '',
796
- '',
797
- ''
798
- );
799
- // strip extra line breaks
800
- $content = preg_replace($search,$replace,trim($content));
801
- return ($content);
802
  }
803
 
804
 
805
 
806
  /**
807
- * Determines if the sender is a valid user.
808
- * @return integer|NULL
809
- */
810
  function ValidatePoster( &$mimeDecodedEmail ) {
811
- global $wpdb;
812
- $config = GetConfig();
813
- $poster = NULL;
814
- $from = RemoveExtraCharactersInEmailAddress(trim($mimeDecodedEmail->headers["from"]));
815
- $resentFrom = RemoveExtraCharactersInEmailAddress(trim($mimeDecodedEmail->headers["resent-from"]));
816
 
817
- if ( empty($from) ) {
818
- echo 'Invalid Sender - Emtpy! ';
819
- return;
820
- }
821
 
822
- //See if the email address is one of the special authorized ones
823
- print("Confirming Access For $from \n");
824
- $sql = 'SELECT id FROM '. $wpdb->users.' WHERE user_email=\'' . addslashes($from) . "' LIMIT 1;";
825
- $user_ID= $wpdb->get_var($sql);
826
- $user = new WP_User($user_ID);
827
- if ($config["TURN_AUTHORIZATION_OFF"] || CheckEmailAddress($from) || CheckEmailAddress($resentFrom)) {
828
- if (empty($user_ID)){
829
- print("$from is authorized to post as the administrator\n");
830
- $from = get_option("admin_email");
831
- $adminUser=$config['ADMIN_USERNAME'];
832
- echo "adminUser='$adminUser'";
833
- $poster = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE
834
- user_login = '$adminUser'");
835
- }
836
- else {
837
- $poster = $user_ID;
838
- }
839
- }
840
- else if ($user->has_cap("post_via_postie")) {
841
- $poster = $user_ID;
842
- }
843
- if (!$poster) {
844
- echo 'Invalid sender: ' . htmlentities($from) . "! Not adding email!\n";
845
- if ($config["FORWARD_REJECTED_MAIL"]) {
846
- if (ForwardRejectedMailToAdmin($mimeDecodedEmail)) {
847
- echo "A copy of the message has been forwarded to the administrator.\n";
848
- } else {
849
- echo "The message was unable to be forwarded to the adminstrator.\n";
850
- }
851
- }
852
- return;
853
- }
854
- return $poster;
855
  }
856
 
857
  /**
858
- * Looks at the content for the start of the message and removes everything before that
859
- * If the pattern is not found everything is returned
860
- * @param string
861
- * @param string
862
- */
863
  function StartFilter(&$content,$start) {
864
- $pos = strpos($content,$start);
865
- if ( $pos === false) {
866
- return($content);
867
- }
868
- $content = substr($content, $pos + strlen($start), strlen($content));
869
  }
870
 
871
  /**
872
- * Looks at the content for the start of the signature and removes all text
873
- * after that point
874
- * @param string
875
- * @param array - a list of patterns to determine if it is a sig block
876
- */
877
  function RemoveSignature( &$content,$filterList = array('--','- --' )) {
878
- $arrcontent = explode("\n", $content);
879
- $i = 0;
880
- for ($i = 0; $i<=count($arrcontent); $i++) {
881
- $line = $arrcontent[$i];
882
- $nextline = $arrcontent[$i+1];
883
- foreach ($filterList as $pattern) {
884
- if (preg_match("/^$pattern/",trim($line))) {
885
- //print("<p>Found in $line");
886
- break 2;
887
- }
888
- }
889
- $strcontent .= $line ."\n";
890
- }
891
- $content = $strcontent;
892
  }
893
  /**
894
- * Looks at the content for the given tag and removes all text
895
- * after that point
896
- * @param string
897
- * @param filter
898
- */
899
  function EndFilter( &$content,$filter) {
900
- $arrcontent = explode("\n", $content);
901
- $i = 0;
902
- for ($i = 0; $i<=count($arrcontent); $i++) {
903
- $line = $arrcontent[$i];
904
- $nextline = $arrcontent[$i+1];
905
- if (preg_match("/^$filter/",trim($line))) {
906
- //print("<p>Found in $line");
907
- break;
908
- }
909
- $strcontent .= $line ."\n";
910
- }
911
- $content = $strcontent;
912
  }
913
 
914
  //filter content for new lines
915
  function FilterNewLines ( $content ) {
916
- $config=GetConfig();
917
- $search = array (
918
- "/\r\n/",
919
- "/\r/",
920
- "/\n\n/",
921
- "/\n/"
922
- );
923
- $replace = array (
924
- "\n",
925
- "\n",
926
- 'ACTUAL_NEW_LINE',
927
- 'LINEBREAK'
928
- );
929
- // strip extra line breaks, and replace double line breaks with paragraph
930
- // tags
931
- $result = preg_replace($search,$replace,$content);
932
- $newContent='<p>' . preg_replace('/ACTUAL_NEW_LINE/',"</p>\n<p>",$result);
933
- $newContent=preg_replace('/<p>LINEBREAK$/', '', $newContent);
934
- if ($config['CONVERTNEWLINE']) {
935
- $newContent= preg_replace('/LINEBREAK/',"<br />\n",$newContent);
 
 
936
  echo "converting newlines\n";
937
- } else {
938
- $newContent= preg_replace('/LINEBREAK/'," ",$newContent);
 
 
939
  echo "not converting newlines\n";
940
  }
941
- return($newContent);
 
942
  }
943
  function FixEmailQuotes ( $content ) {
944
- # place e-mails quotes (indicated with >) in blockquote and pre tags
945
- $search = array (
946
- "/^>/"
947
- );
948
- $replace = array (
949
- '<br />&gt;'
950
- );
951
- // strip extra line breaks, and replace double line breaks with paragraph
952
- // tags
953
- $result = preg_replace($search,$replace,$content);
954
- //return('<p>' . preg_replace('/ACTUAL_NEW_LINE/',"<\/p>\n<p>",$result)
955
- //. '</p>');
956
- return($result);
957
  }
958
 
959
  //strip pgp stuff
960
  function StripPGP ( $content ) {
961
- $search = array (
962
- '/-----BEGIN PGP SIGNED MESSAGE-----/',
963
- '/Hash: SHA1/'
964
- );
965
- $replace = array (
966
- ' ',
967
- ''
968
- );
969
- // strip extra line breaks
970
- $return = preg_replace($search,$replace,$content);
971
- return $return;
972
  }
973
 
974
  function ConvertToISO_8859_1($encoding,$charset, &$body ) {
975
- $config = GetConfig();
976
- $charset = strtolower($charset);
977
- $encoding = strtolower($encoding);
978
- if( (strtolower($config["MESSAGE_ENCODING"]) == "iso-8859-1") && (strtolower($charset) != 'iso-8859-1')) {
979
- if( $encoding == 'base64' || $encoding == 'quoted-printable' ) {
980
- $body = utf8_decode($body);
981
- }
982
  }
 
983
  }
984
  function IsISO88591Blog() {
985
- $config = GetConfig();
986
- if( (strtolower($config["MESSAGE_ENCODING"]) == "iso-8859-1")) {
987
- return(true);
988
- }
989
- return(false);
990
  }
991
  function IsUTF8Blog() {
992
- $config = GetConfig();
993
- if( (strtolower($config["MESSAGE_ENCODING"]) == "utf-8")) {
994
- return(true);
995
- }
996
- return(false);
997
  }
998
  function HandleMessageEncoding($encoding, $charset,&$body) {
999
  $charset = strtolower($charset);
@@ -1073,7 +1105,6 @@ function DetermineImageSize($file) {
1073
  list($size,$caption)=DetermineImageSizeWithImageMagick($file);
1074
  }
1075
  else {
1076
- echo "determining image size with GD\n<br />";
1077
  list($size,$caption)=DetermineImageSizeWithGD($file);
1078
  }
1079
  return(array($size,$caption));
@@ -1128,7 +1159,6 @@ function ResizeImage($file,$type) {
1128
  if ($config["USE_IMAGEMAGICK"]) {
1129
  list($scaledFileName, $fileName,$caption)=ResizeImageWithImageMagick($file,$type);
1130
  } else {
1131
- echo "using GD to resize\n";
1132
  list($scaledFileName, $fileName,$caption)=ResizeImageWithGD($file,$type);
1133
  }
1134
  }
@@ -1315,7 +1345,7 @@ function ResizeImageWithImageMagick($file,$type) {
1315
  $fileName = basename($file);
1316
  $scaledFileName = "";
1317
  $scale = DetermineScale($sizeInfo[0],$sizeInfo[1],$config["MAX_IMAGE_WIDTH"], $config["MAX_IMAGE_HEIGHT"]);
1318
- if ($scale != 1) {
1319
  $scaledH = round($sizeInfo[1] * $scale );
1320
  $scaledW = round($sizeInfo[0] * $scale );
1321
  $scaledFileName = "thumb.".$fileName;
@@ -1343,8 +1373,7 @@ function ResizeImageWithGD($file,$type) {
1343
  $fileName = basename($file);
1344
  $scaledFileName = "";
1345
  $scale = DetermineScale($sizeInfo[0],$sizeInfo[1],$config["MAX_IMAGE_WIDTH"], $config["MAX_IMAGE_HEIGHT"]);
1346
- if ($scale != 1) {
1347
- echo "scale=$scale, width=". $sizeInfo[0] . "height=". $sizeInfo[1] . "\n<br />";
1348
  $sourceImage = NULL;
1349
  switch($type) {
1350
  case "jpeg":
@@ -1376,7 +1405,6 @@ function ResizeImageWithGD($file,$type) {
1376
  }
1377
  // Revert to original limit
1378
  ini_set('memory_limit', $original_mem_limit);
1379
- echo "inside ResizeImageWithGD - scaledFileName=$scaledFileName\n";
1380
  return(array($scaledFileName,$fileName,$caption));
1381
 
1382
  }
@@ -1419,7 +1447,9 @@ function GetRotation(&$mimeDecodedEmail,&$content) {
1419
  function DeterminePostDate(&$content, $message_date = NULL) {
1420
  $config = GetConfig();
1421
  $delay = 0;
1422
- echo "inside Determine Post Date, message_date = $message_date\n";
 
 
1423
  if (eregi("delay:(-?[0-9dhm]+)",$content,$matches)
1424
  && trim($matches[1])) {
1425
  if (eregi("(-?[0-9]+)d",$matches[1],$dayMatches)) {
@@ -1574,7 +1604,9 @@ function ForwardRejectedMailToAdmin( &$mail_content) {
1574
  $message = "An unauthorized message has been sent to " . $blogname . " from " . $from. ". The subject of this message was: '" . $subject . "'.";
1575
  $message .= "\n\nIf you wish to allow posts from this address, please add " . $from. " to the registered users list and manually add the content of the e-mail found below.";
1576
  $message .= "\n\nOtherwise, the e-mail has already been deleted from the server and you can ignore this message.";
1577
- $message .= "\n\nIf you would like to prevent wp-mail from forwarding mail in the future, please change FORWARD_REJECTED_MAIL to false in wp-mail.php.";
 
 
1578
  $message .= "\n\nThe original content of the e-mail has been attached.\n\n";
1579
  $boundary = "--".$mail_content->ctype_parameters["boundary"] ."\n";
1580
 
@@ -1669,6 +1701,36 @@ function GetNameFromEmail($address) {
1669
  return($name);
1670
  }
1671
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1672
  /**
1673
  * When sending in HTML email the html refers to the content-id(CID) of the image - this replaces
1674
  * the cid place holder with the actual url of the image sent in
@@ -1704,22 +1766,28 @@ function ReplaceImagePlaceHolders(&$content,$attachments) {
1704
  foreach ( $attachments as $i => $value ) {
1705
  // looks for ' #img1# ' etc... and replaces with image
1706
  $img_placeholder_temp = str_replace("%", intval($startIndex + $i), $config["IMAGE_PLACEHOLDER"]);
 
 
1707
  $img_placeholder_temp=rtrim($img_placeholder_temp,'#');
1708
- echo "------------- IMG REPLACEMENT ----------------------\n";
1709
- echo "<pre>value=$value</pre>\n\n";
1710
- echo "img_placeholder_temp=$img_placeholder_temp\n";
1711
- if ( stristr($content, $img_placeholder_temp) ) {
1712
  // look for caption
 
1713
  if ( preg_match("/caption=['\"](.*)['\"]/", $content, $matches)) {
1714
  $caption =$matches[1];
1715
- $value = str_replace('{CAPTION}', $caption, $value);
1716
- echo "caption=$caption----\n";
1717
  $img_placeholder_temp.=' ' . $matches[0];
 
1718
  }
1719
- $img_placeholder_temp.='#';
1720
- echo "img_placeholder_temp=$img_placeholder_temp\n";
 
1721
  $content = str_replace($img_placeholder_temp, $value, $content);
 
 
 
1722
  } else {
 
1723
  if ($config["IMAGES_APPEND"]) {
1724
  $content .= $value;
1725
  } else {
@@ -1769,16 +1837,41 @@ function GetPostTags(&$content) {
1769
  global $wpdb;
1770
  $post_tags = array();
1771
  //try and determine tags
1772
- if ( preg_match('/tags: (.*)\n/', $content, $matches)) {
1773
- $content = preg_replace("/$matches[0]/", "", $content);
1774
  $post_tags = preg_split("/,\s*/", $matches[1]);
1775
  }
1776
  if (!count($post_tags)) {
1777
- echo "using default tags" . $config["DEFAULT_POST_TAGS"]. "\n";
1778
  $post_tags = $config["DEFAULT_POST_TAGS"];
1779
  }
1780
  return($post_tags);
1781
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1782
  /**
1783
  * This function determines categories for the post
1784
  * @return array
@@ -1830,7 +1923,6 @@ function GetPostCategories(&$subject) {
1830
  }
1831
  }
1832
  if (!count($post_categories)) {
1833
- echo "using default category" . $config["DEFAULT_POST_CATEGORY"]. "\n";
1834
  $post_categories[] = $config["DEFAULT_POST_CATEGORY"];
1835
  }
1836
  return($post_categories);
@@ -1839,23 +1931,24 @@ function GetPostCategories(&$subject) {
1839
  *This function just outputs a simple html report about what is being posted in
1840
  */
1841
  function DisplayEmailPost($details) {
1842
- $config = GetConfig();
1843
- print_r($config);
1844
- print_r($details);
1845
- $theFinalContent=$details['post_content'];
1846
- echo "-----------the final content is:\n '$theFinalContent'\n";
1847
- // Report
1848
- print '</pre><p><b>Post Author</b>: ' . $details["post_author"]. '<br />' . "\n";
1849
- print '<b>Date</b>: ' . $details["post_date"] . '<br />' . "\n";
1850
- print '<b>Date GMT</b>: ' . $details["post_date_gmt"] . '<br />' . "\n";
1851
- foreach($details["post_category"] as $category) {
1852
- print '<b>Category</b>: ' . $category . '<br />' . "\n";
1853
- }
1854
- print '<b>Ping Status</b>: ' . $details["ping_status"] . '<br />' . "\n";
1855
- print '<b>Comment Status</b>: ' . $details["comment_status"] . '<br />' . "\n";
1856
- print '<b>Subject</b>: ' . $details["post_title"]. '<br />' . "\n";
1857
- print '<b>Postname</b>: ' . $details["post_name"] . '<br />' . "\n";
1858
- print '<b>Posted content:</b></p><hr />' . $details["post_content"] . '<hr /><pre>';
 
1859
  }
1860
  /**
1861
  * This function confirms that everything is setup correctly
@@ -1877,14 +1970,15 @@ function TestWPMailInstallation() {
1877
  */
1878
  function BuildBooleanSelect($label,$id,$current_value,$recommendation = NULL) {
1879
  $string="<tr>
1880
- <th scope=\"row\">". __($label).":</th>
1881
  <td><select name=\"$id\" id=\"$id\">
1882
- <option value=\"1\">".__("Yes")."</option>
1883
- <option value=\"0\" ". (!$current_value ? "SELECTED" : NULL) . ">".__("No").'</option>
 
1884
  </select>
1885
  <br />';
1886
  if ($recommendation!=NULL) {
1887
- $string.='<code>'.__($recommendation).'</code><br/>';
1888
  }
1889
  $string.="</td>\n</tr>";
1890
  return($string);
@@ -1898,10 +1992,11 @@ function BuildBooleanSelect($label,$id,$current_value,$recommendation = NULL) {
1898
  */
1899
  function BuildTextArea($label,$id,$current_value,$recommendation = NULL) {
1900
  $string = "<tr>
1901
- <th scope=\"row\">".__($label).":</th></tr>";
1902
 
1903
  if ($recommendation) {
1904
- $string .= "<tr><td>&nbsp;</td><td><code>".__($recommendation)."</code></td></tr>";
 
1905
  }
1906
  $string .=" <tr>
1907
  <td>&nbsp;</td>
@@ -2040,6 +2135,11 @@ function GetDBConfig() {
2040
  if (!isset($config["3GPDIV"])) { $config["3GPDIV"] = "postie-3gp-div";}
2041
  if (!isset($config["ATTACHMENTDIV"])) { $config["ATTACHMENTDIV"] = "postie-attachment-div";}
2042
  if (!isset($config["3GPCLASS"])) { $config["3GPCLASS"] = "postie-video";}
 
 
 
 
 
2043
  if (!isset($config["IMAGESTYLE"])) { $config["IMAGESTYLE"] = "border: none;";}
2044
  if (!isset($config["JPEGQUALITY"])) { $config["JPEGQUALITY"] = 80;}
2045
  if (!isset($config["AUTO_SMART_SHARP"])) { $config["AUTO_SMART_SHARP"] = false;}
@@ -2055,6 +2155,7 @@ function GetDBConfig() {
2055
  if (!isset($config["MESSAGE_DEQUOTE"])) { $config["MESSAGE_DEQUOTE"] = true; }
2056
  if (!isset($config["TURN_AUTHORIZATION_OFF"])) { $config["TURN_AUTHORIZATION_OFF"] = false;}
2057
  if (!isset($config["USE_IMAGEMAGICK"])) { $config["USE_IMAGEMAGICK"] = false;}
 
2058
  if (!isset($config["CONVERTNEWLINE"])) { $config["CONVERTNEWLINE"] = false;}
2059
  if (!isset($config["IMAGEMAGICK_CONVERT"])) { $config["IMAGEMAGICK_CONVERT"] = "/usr/bin/convert";}
2060
  if (!isset($config["IMAGEMAGICK_IDENTIFY"])) { $config["IMAGEMAGICK_IDENTIFY"] = "/usr/bin/identify";}
@@ -2074,26 +2175,41 @@ function GetDBConfig() {
2074
  if (!isset($config["3GP_QT"])) { $config["3GP_QT"] = true; }
2075
  if (!isset($config["3GP_FFMPEG"])) { $config["3GP_FFMPEG"] = "/usr/bin/ffmpeg";}
2076
  if (!isset($config["WRAP_PRE"])) { $config["WRAP_PRE"] = 'no'; }
 
2077
  if (!isset($config["ADD_META"])) { $config["ADD_META"] = 'no'; }
2078
- if (!isset($config["USEIMAGETEMPLATE"])) { $config["USEIMAGETEMPLATE"] =
2079
- false; }
2080
- if (!isset($config["POST_STATUS"])) { $config["POST_STATUS"] =
2081
- 'publish'; }
2082
- if (!isset($config["IMAGE_NEW_WINDOW"])) { $config["IMAGE_NEW_WINDOW"] =
2083
- false; }
 
 
2084
  if (!isset($config["IMAGETEMPLATE"])) { $config["IMAGETEMPLATE"] =
2085
-
2086
- $mimeTag."<div class='" . '{CONFIG-IMAGEDIV}'."'><a
2087
- href='" . 'CONFIG-URLPHOTOSDIR' . '{IMAGE}' . "'
2088
- onclick=\"window.open(' . '"
2089
- . 'CONFIG-URLPHOTOSDIR' . '{IMAGE}' . '","'
2090
- . "full_size_image" . "','"
2091
- . "toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=1,height=" . $marimey . ",width=" . $marimex . "');" . "return false;"
2092
- . '"><img src="' . 'CONFIG-URLPHOTOSDIR' .
2093
- '{THUMBNAIL}'. '" alt="'
2094
- . $part->ctype_parameters['name'] . '" title="' .
2095
- $part->ctype_parameters['name'] . '"
2096
- style="'.'CONFIG-IMAGESTYLE'.'" class="'.'CONFIG-IMAGECLASS'.'" /></a></div>' . "\n";
 
 
 
 
 
 
 
 
 
 
 
 
2097
  }
2098
  return($config);
2099
  }
@@ -2102,42 +2218,43 @@ function GetDBConfig() {
2102
  * @return array
2103
  */
2104
  function GetConfig() {
2105
- $config = GetDBConfig();
2106
- if (!ConfirmTrailingDirectorySeperator($config["PHOTOSDIR"])) {
2107
- $config["PHOTOSDIR"] .= DIRECTORY_SEPARATOR;
2108
- }
2109
- if (!ConfirmTrailingDirectorySeperator($config["FILESDIR"])) {
2110
- $config["FILESDIR"] .= DIRECTORY_SEPARATOR;
2111
- }
2112
- //These should only be modified if you are testing
2113
- $config["DELETE_MAIL_AFTER_PROCESSING"] = true;
2114
- $config["POST_TO_DB"] = true;
2115
- $config["TEST_EMAIL"] = false;
2116
- $config["TEST_EMAIL_ACCOUNT"] = "blog.test";
2117
- $config["TEST_EMAIL_PASSWORD"] = "";
2118
- //include(POSTIE_ROOT . "/../postie-test.php");
2119
- // These are computed
2120
- #$config["TIME_OFFSET"] = get_option('gmt_offset');
2121
- if ($config["USE_IMAGEMAGICK"]) {
2122
- if (!file_exists($config["IMAGEMAGICK_IDENTIFY"])
2123
  ||!file_exists($config["IMAGEMAGICK_CONVERT"])) {
2124
- $config["RESIZE_LARGE_IMAGES"] = false;
2125
- }
2126
- }
2127
- else {
2128
- if (!HasGDInstalled(false)) {
2129
- $config["RESIZE_LARGE_IMAGES"] = false;
2130
- }
2131
- }
2132
- $config["POSTIE_ROOT"] = POSTIE_ROOT;
2133
- $config["URLPHOTOSDIR"] = get_option('siteurl') . ConvertFilePathToUrl($config["PHOTOSDIR"]);
2134
- $config["REALPHOTOSDIR"] = realpath(ABSPATH . $config["PHOTOSDIR"]). DIRECTORY_SEPARATOR;
2135
- $config["URLFILESDIR"] = get_option('siteurl') . ConvertFilePathToUrl($config["FILESDIR"]);
2136
- $config["REALFILESDIR"] = realpath(ABSPATH . $config["FILESDIR"]) . DIRECTORY_SEPARATOR;
2137
- for ($i = 0; $i < count($config["AUTHORIZED_ADDRESSES"]); $i++) {
2138
- $config["AUTHORIZED_ADDRESSES"][$i] = strtolower($config["AUTHORIZED_ADDRESSES"][$i]);
2139
  }
2140
- return $config;
 
 
 
 
 
 
 
 
 
 
2141
  }
2142
  /**
2143
  * Converts from one directory structure to url
@@ -2278,25 +2395,36 @@ function DebugEmailOutput(&$email,&$mimeDecodedEmail) {
2278
  * If you want to extend this functionality - write a new function and call it from here
2279
  */
2280
  function SpecialMessageParsing(&$content, &$attachments){
2281
- $config = GetConfig();
2282
- if ( preg_match('/You have been sent a message from Vodafone mobile/',$content)) {
2283
- VodafoneHandler($content, $attachments); //Everything for this type of message is handled below
2284
- return;
2285
- }
2286
- if ( $config["MESSAGE_START"] ) {
2287
- StartFilter($content,$config["MESSAGE_START"]);
2288
- }
2289
- if ( $config["MESSAGE_END"] ) {
2290
- EndFilter($content,$config["MESSAGE_END"]);
2291
- }
2292
- if ( $config["DROP_SIGNATURE"] ) {
2293
- RemoveSignature($content,$config["SIG_PATTERN_LIST"]);
2294
- }
2295
- if ($config["PREFER_TEXT_TYPE"] == "html"
2296
- && count($attachments["cids"])) {
2297
- ReplaceImageCIDs($content,$attachments);
2298
- }
 
2299
  ReplaceImagePlaceHolders($content,$attachments["html"]);
 
 
 
 
 
 
 
 
 
 
2300
  }
2301
  /**
2302
  * Special Vodafone handler - their messages are mostly vendor trash - this strips them down.
1
  <?php
2
+ #global $config,$debug;
3
+ #$debug=true;
4
+ #$config=GetConfig();
5
+
6
+ //TODO excerpt option
7
  include_once (dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . "wp-config.php");
8
  define("POSTIE_ROOT",dirname(__FILE__));
9
  define("POSTIE_TABLE",$GLOBALS["table_prefix"]. "postie_config");
31
  # }
32
  $content = GetContent($mimeDecodedEmail,$attachments);
33
  $subject = GetSubject($mimeDecodedEmail,$content);
34
+ if ($debug) {
35
+ echo "the subject is $subject, right after calling GetSubject\n";
36
+ }
37
  $rotation = GetRotation($mimeDecodedEmail,$content);
38
  if ($rotation != "0"
39
  && count($attachments["image_files"])) {
40
  RotateImages($rotation,$attachments["image_files"]);
41
  }
42
+ $customImages = SpecialMessageParsing($content,$attachments);
43
+ $post_excerpt = GetPostExcerpt($content);
44
  $postAuthorDetails=getPostAuthorDetails($subject,$content,
45
  $mimeDecodedEmail);
46
  $message_date = NULL;
61
  $id=checkReply($subject);
62
  $post_categories = GetPostCategories($subject);
63
  $post_tags = GetPostTags($content);
 
64
  $comment_status = AllowCommentsOnPost($content);
65
 
66
  if ((empty($id) || is_null($id)) &&
74
  //$content = $postAuthorDetails['content'] . $content;
75
  $content = $content;
76
  }
 
77
  } else {
78
  if ($config['WRAP_PRE']=='yes') {
79
  $content = "<pre>\n" . $content . "</pre>\n";
80
  }
81
  }
82
+ if ($config['CONVERTURLS']) {
83
+ $content=clickableLink($content);
84
+ }
85
+
86
+
87
  $post_status=$config['POST_STATUS'];
88
  $details = array(
89
  'post_author' => $poster,
100
  'tags_input' => $post_tags,
101
  'comment_status' => $comment_status,
102
  'post_name' => sanitize_title($subject),
103
+ 'post_excerpt' => $post_excerpt,
104
  'ID' => $id,
105
+ 'customImages' => $customImages,
106
  'post_status' => $post_status
107
  );
108
  DisplayEmailPost($details);
110
  }
111
  /** FUNCTIONS **/
112
 
113
+
114
+ function clickableLink($text) {
115
+ # this functions deserves credit to the fine folks at phpbb.com
116
+
117
+ $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:",
118
+ $text);
119
+
120
+ // pad it with a space so we can match things at the start of the 1st line.
121
+ $ret = ' ' . $text;
122
+
123
+ // matches an "xxxx://yyyy" URL at the start of a line, or after a space.
124
+ // xxxx can only be alpha characters.
125
+ // yyyy is anything up to the first space, newline, comma, double quote or <
126
+ $ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is",
127
+ "\\1<a href=\"\\2\" >\\2</a>", $ret);
128
+
129
+ // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
130
+ // Must contain at least 2 dots. xxxx contains either alphanum, or "-"
131
+ // zzzz is optional.. will contain everything up to the first space, newline,
132
+ // comma, double quote or <.
133
+ $ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is",
134
+ "\\1<a href=\"http://\\2\" >\\2</a>", $ret);
135
+
136
+ // matches an email@domain type address at the start of a line, or after a space.
137
+ // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".
138
+ $ret = preg_replace("#(^|[\n
139
+ ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a
140
+ href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);
141
+
142
+ // Remove our padding..
143
+ $ret = substr($ret, 1);
144
+ return $ret;
145
+ }
146
  function getPostAuthorDetails(&$subject,&$content,&$mimeDecodedEmail) {
147
  /* we check whether or not the e-mail is a forwards or a redirect. If it is
148
  * a fwd, then we glean the author details from the body of the post.
178
  }
179
  }
180
  $content=$newContents;
 
181
  $theDetails=array(
182
  'content' =>"<div class='postmetadata alt'>On $theDate, $theAuthor" .
183
  " posted:</div>",
216
  }
217
  $checkExistingPostQuery= "SELECT ID FROM $wpdb->posts WHERE
218
  '$tmpSubject' = post_title";
 
219
  if ($id=$wpdb->get_var($checkExistingPostQuery)) {
 
220
  if (is_array($id)) {
221
  $id=$id[count($id)-1];
222
  }
234
  * This sets up the configuration menu
235
  */
236
  function PostieMenu() {
237
+ if( function_exists('add_options_page') ) {
238
+ if (current_user_can('manage_options')) {
239
+ add_options_page("Postie", "Postie" ,
240
+ 0, POSTIE_ROOT . "/postie.php", "ConfigurePostie");
241
+ }
242
+ }
243
  }
244
  /**
245
  * This handles actually showing the form
428
  * @param array - details of the post
429
  */
430
  function PostToDB($details) {
431
+ $config = GetConfig();
432
+ if ($config["POST_TO_DB"]) {
433
+ //generate sql for insertion
434
+ $_POST['publish'] = true; //Added to make subscribe2 work - it will only handle it if the global varilable _POST is set
435
+ if ($details['ID']==NULL) {
436
+ $post_ID = wp_insert_post($details);
437
+ } else {
438
+ // strip out quoted content
439
+ $lines=preg_split("/[\r\n]/",$details['post_content']);
440
+ print_r($lines);
441
+ $newContents='';
442
+ foreach ($lines as $line) {
443
+ //$match=preg_match("/^>.*/i",$line);
444
+ //echo "line=$line, match=$match";
445
+ if (preg_match("/^>.*/i",$line)==0 &&
446
+ preg_match("/^(from|subject|to|date):.*?/i",$line)==0 &&
447
+ preg_match("/^-+.*?(from|subject|to|date).*?/i",$line)==0 &&
448
+ preg_match("/^on.*?wrote:$/i",$line)==0 &&
449
+ preg_match("/^-+\s*forwarded\s*message\s*-+/i",$line)==0) {
450
+ $newContents.="$line\n";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
451
  }
452
+ }
453
+ $comment = array(
454
+ 'comment_author'=>$details['comment_author'],
455
+ 'comment_post_ID' =>$details['ID'],
456
+ 'comment_author_email' => $details['email_author'],
457
+ 'comment_date' =>$details['post_date'],
458
+ 'comment_date_gmt' =>$details['post_date_gmt'],
459
+ 'comment_content' =>$newContents,
460
+ 'comment_author_url' =>'',
461
+ 'comment_author_IP' =>'',
462
+ 'comment_approved' =>1,
463
+ 'comment_agent' =>'',
464
+ 'comment_type' =>'',
465
+ 'comment_parent' => 0
466
+ );
467
+
468
+ echo "the comment is:\n";
469
+ print_r($comment);
470
+ $post_ID = wp_insert_comment($comment);
471
+ }
472
+ if ($config["CUSTOM_IMAGE_FIELD"]) {
473
+ foreach ($details['customImages'] as $image) {
474
+ add_post_meta($post_ID, 'image', $image);
475
+ }
476
  }
477
+ }
478
  }
479
 
480
  /**
493
 
494
  //tear apart the meta part for useful information
495
  function GetContent ($part,&$attachments) {
496
+ $config = GetConfig();
497
+ $meta_return = NULL;
498
 
499
+ DecodeBase64Part($part);
500
+ if (BannedFileName($part->ctype_parameters['name'])
501
+ || BannedFileName($part->ctype_parameters['name'])) {
502
+ return(NULL);
503
+ }
504
+
505
+ if ($part->ctype_primary == "application"
506
+ && $part->ctype_secondary == "octet-stream") {
507
+ if ($part->disposition == "attachment") {
508
+ $image_endings = array("jpg","png","gif","jpeg","pjpeg");
509
+ foreach ($image_endings as $type) {
510
+ if (eregi(".$type\$",$part->d_parameters["filename"])) {
511
+ $part->ctype_primary = "image";
512
+ $part->ctype_secondary = $type;
513
+ break;
514
+ }
515
+ }
516
+ } else {
517
+ $mimeDecodedEmail = DecodeMIMEMail($part->body);
518
+ FilterTextParts($mimeDecodedEmail);
519
+ foreach($mimeDecodedEmail->parts as $section) {
520
+ $meta_return .= GetContent($section,$attachments);
521
+ }
522
  }
523
+ }
524
+ if ($part->ctype_primary == "multipart"
525
+ && $part->ctype_secondary == "appledouble") {
526
+ $mimeDecodedEmail = DecodeMIMEMail("Content-Type: multipart/mixed; boundary=".$part->ctype_parameters["boundary"]."\n".$part->body);
527
+ FilterTextParts($mimeDecodedEmail);
528
+ FilterAppleFile($mimeDecodedEmail);
529
+ foreach($mimeDecodedEmail->parts as $section) {
530
+ $meta_return .= GetContent($section,$attachments);
531
+ }
532
+ } else {
533
+ switch ( strtolower($part->ctype_primary) ) {
534
+ case 'multipart':
535
+ FilterTextParts($part);
536
+ foreach ($part->parts as $section) {
537
+ $meta_return .= GetContent($section,$attachments);
538
  }
539
+ break;
540
+ case 'text':
541
+ HandleMessageEncoding($part->headers["content-transfer-encoding"],
542
+ $part->ctype_parameters["charset"],
543
+ $part->body);
544
+
545
+ //go through each sub-section
546
+ if ($part->ctype_secondary=='enriched') {
547
+ //convert enriched text to HTML
548
+ $meta_return .= etf2HTML($part->body ) . "\n";
549
+ } elseif ($part->ctype_secondary=='html') {
550
+ //strip excess HTML
551
+ $meta_return .= HTML2HTML($part->body ) . "\n";
552
+ } else {
553
+ //regular text, so just strip the pgp signature
554
+ if (ALLOW_HTML_IN_BODY) {
555
+ $meta_return .= $part->body . "\n";
556
+ }
557
+ else {
558
+ $meta_return .= htmlentities( $part->body ) . "\n";
559
  }
560
+ $meta_return = StripPGP($meta_return);
561
+ }
562
+ break;
563
+
564
+ case 'image':
565
+ $file = GenerateImageFileName($config["REALPHOTOSDIR"], $part->ctype_secondary);
566
+ //This makes sure there is no collision
567
+ $ctr = 0;
568
+ while(file_exists($file) && $ctr < 1000) {
569
+ $file = GenerateImageFileName($config["REALPHOTOSDIR"], $part->ctype_secondary);
570
+ $ctr++;
571
  }
572
+ if ($ctr >= 1000) {
573
+ die("Unable to find a name for images that does not collide\n");
 
 
 
 
 
 
574
  }
575
+ $fileName = basename($file);
576
+ $fp = fopen($file, 'w');
577
+ fwrite($fp, $part->body);
578
+ fclose($fp);
579
+ @exec ('chmod 755 ' . $file);
580
+ if ($config["USE_IMAGEMAGICK"] && $config["AUTO_SMART_SHARP"]) {
581
+ ImageMagickSharpen($file);
582
+ }
583
+ $mimeTag = '<!--Mime Type of File is '.$part->ctype_primary."/".$part->ctype_secondary.' -->';
584
+ $thumbImage = NULL;
585
+ $cid = trim($part->headers["content-id"],"<>");; //cids are in <cid>
586
+ if ($config["RESIZE_LARGE_IMAGES"]) {
587
+ list($thumbImage, $fullImage, $caption) = ResizeImage($file,strtolower($part->ctype_secondary));
588
+ }
589
+ $attachments["image_files"][] = array(($thumbImage ? $config["REALPHOTOSDIR"] . $thumbImage:NULL),
590
+ $config["REALPHOTOSDIR"] . $fileName,
591
+ $part->ctype_secondary);
592
+ list($marime,$caption)=DetermineImageSize($file);
593
+ $marimex=$marime[0]+20;
594
+ $marimey=$marime[1]+20;
595
+ $onclick='';
596
+ if ($config['IMAGE_NEW_WINDOW']) {
597
+ $onclick='" onclick="window.open(' . "'"
598
+ . $config["URLPHOTOSDIR"] . $fullImage . "','"
599
+ . "full_size_image" . "','"
600
+ . "toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=1,height=" . $marimey . ",width=" . $marimex . "');" . "return false;";
601
+ }
602
+ if ($thumbImage) {
603
+ if ($config['USEIMAGETEMPLATE']) {
604
+ $attachments["html"][]
605
+ .=parseImageTemplate($thumbImage,$fullImage,$caption);
606
+ } else {
607
+ $attachments["html"][] .= $mimeTag.'<div class="' . $config["IMAGEDIV"].'"><a href="' . $config["URLPHOTOSDIR"] . $fullImage .
608
+ $onclick . '"><img src="' . $config["URLPHOTOSDIR"] . $thumbImage . '" alt="'
609
+ . $part->ctype_parameters['name'] . '" title="' . $part->ctype_parameters['name'] . '" style="'.$config["IMAGESTYLE"].'" class="'.$config["IMAGECLASS"].'" /></a></div>' . "\n";
610
+ }
611
+ if ($cid) {
612
+ $attachments["cids"][$cid] = array($config["URLPHOTOSDIR"] . $fullImage,count($attachments["html"]) - 1);
613
+ }
614
+ } else {
615
+ if ($config['USEIMAGETEMPLATE']) {
616
+ $attachments["html"][]
617
+ .=parseImageTemplate('',$fileName,$caption);
618
+ } else {
619
+ $attachments["html"][] .= $mimeTag .'<div class="' . $config["IMAGEDIV"].'"><img src="' . $config["URLPHOTOSDIR"] . $fileName
620
+ . '" alt="' . $part->ctype_parameters['name'] . '" style="'
621
+ . $config["IMAGESTYLE"] . '" class="' . $config["IMAGECLASS"] . '" /></div>' . "\n";
622
+ if ($cid) {
623
+ $attachments["cids"][$cid] = array($config["URLPHOTOSDIR"] . $fileName,count($attachments["html"]) - 1);
624
+ }
625
+ }
626
+ }
627
+
628
+ break;
629
+ default:
630
+ if (in_array(strtolower($part->ctype_primary),$config["SUPPORTED_FILE_TYPES"])) {
631
+ //pgp signature - then forget it
632
+ if ( $part->ctype_secondary == 'pgp-signature' ) {break;}
633
+ //other attachments save to FILESDIR
634
+ $filename = $part->ctype_parameters['name'];
635
+ $file = $config["REALFILESDIR"] . $filename;
636
+ $fp = fopen($file, 'w');
637
+ fwrite($fp, $part->body );
638
+ fclose($fp);
639
+ @exec ('chmod 755 ' . $file);
640
+ $cid = trim($part->headers["content-id"],"<>");; //cids are in <cid>
641
+
642
+ if ($part->ctype_secondary == "3gpp"
643
+ || $part->ctype_secondary == "octet-stream"
644
+ || $part->ctype_secondary == "3g2"
645
+ || $part->ctype_secondary == "3gp"
646
+ || $part->ctype_secondary == "mp4"
647
+ || $part->ctype_secondary == "quicktime"
648
+ || $part->ctype_secondary == "3gpp2") {
649
+ if ($config["3GP_QT"]) {
650
+ //Shamelessly borrowed from http://www.postneo.com/2003/12/19/embedding-3gpp-in-html
651
+ $autoplay='false';
652
+ if ($config['AUTOPLAY']) {
653
+ $autoplay='true';
654
+ }
655
+ $attachments["html"][] = '<!--Mime Type of File is '.$part->ctype_primary."/".$part->ctype_secondary.' -->' .
656
+ '<object '.
657
+ 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '.
658
+ 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" '.
659
+ 'width="' . $config['VIDEO_WIDTH'] . '" '.
660
+ 'height="' . $config['VIDEO_HEIGHT'] . '"> '.
661
+ '<param name="src" VALUE="'. $config["URLFILESDIR"] . $filename .'"> '.
662
+ '<param name="autoplay" VALUE="$autoplay"> '.
663
+ '<param name="controller" VALUE="true"> '.
664
+ '<embed '.
665
+ 'src="'. $config["URLFILESDIR"] . $filename .'" '.
666
+ 'width="' . $config['VIDEO_WIDTH'] . '" '.
667
+ 'height="' . $config['VIDEO_HEIGHT'] . '"'.
668
+ 'autoplay="$autoplay" '.
669
+ 'controller="true" '.
670
+ 'type="video/quicktime" '.
671
+ 'pluginspage="http://www.apple.com/quicktime/download/" '.
672
+ 'width="' . $config['PLAYER_WIDTH'] . '" '.
673
+ 'height="' . $config['PLAYER_HEIGHT'] . '">'.
674
+ '</embed> '.
675
+ '</object>';
676
+ } else {
677
+ if (file_exists($config["3GP_FFMPEG"])) {
678
  $fileName = basename($file);
679
+ //options from http://www.getid3.org/phpBB2/viewtopic.php?p=1290&
680
+ $scaledFileName = "thumb.".$fileName;
681
+ $scaledFile = $config["REALPHOTOSDIR"] . $scaledFileName;
682
+
683
+ @exec (escapeshellcmd($config["3GP_FFMPEG"]) .
684
+ " -i " . escapeshellarg($file) .
685
+ " -y -ss 00:00:01 -vframes 1 -an -sameq -f gif " .
686
+ escapeshellarg($scaledFile) );
687
+ @exec ('chmod 755 ' . escapeshellarg($scaledFile));
688
+
689
+ $attachments["html"][] .= '<!--Mime Type of File is '.$part->ctype_primary."/".$part->ctype_secondary.' --><div class="' . $config["3GPDIV"].'"><a href="' . $config["URLPHOTOSDIR"] . $fileName. '"><img src="' . $config["URLPHOTOSDIR"] . $scaledFileName . '" alt="' . $part->ctype_parameters['name'] . '" style="'.$config["IMAGESTYLE"].'" class="'.$config["IMAGECLASS"].'" /></a></div>' . "\n";
690
+ } else {
691
+ $attachments["html"][] = '<!--Mime Type of File is '.$part->ctype_primary."/".$part->ctype_secondary.' --><div class="' . $config["ATTACHMENTDIV"].'"><a href="' . $config["URLFILESDIR"] . $filename . '" class="' . $config["3GPCLASS"].'">' . $part->ctype_parameters['name'] . '</a></div>' . "\n";
692
+ }
693
+ }
694
+ } elseif ($part->ctype_secondary == "x-shockwave-flash") {
695
+ $attachments["html"][] = '<!--Mime Type of File is '.$part->ctype_primary."/".$part->ctype_secondary.' -->'.
696
+ '<object '.
697
+ 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '.
698
+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" '.
699
+ 'width="" '. 'height=""> '.
700
+ '<param name="movie" value="'. $config["URLFILESDIR"] .
701
+ $filename .'"> '.
702
+ '<param name="quality" value="high"> '.
703
+ '<embed '. 'src="'. $config["URLFILESDIR"] . $filename .'" '.
704
+ 'width="" '. 'height="" '. 'quality="high" '.
705
+ 'pluginspage="http://www.macromedia.com/go/getflashplayer" '.
706
+ 'type="application/x-shockwave-flash" '.
707
+ 'width="" '. 'height=""></embed> '. '</object>';
708
+ } else {
709
+ $attachments["html"][] = '<!--Mime Type of File is '.$part->ctype_primary."/".$part->ctype_secondary.' --><a href="' . $config["URLFILESDIR"] . $filename . '">' . $part->ctype_parameters['name'] . '</a>' . "\n";
710
+ }
711
+ if ($cid) {
712
+ $attachments["cids"][$cid] = array($config["URLFILESDIR"] . $filename,count($attachments["html"]) - 1);
713
+ }
714
+ }
715
+ break;
716
+ }
717
+ }
718
+ return $meta_return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
719
  }
720
 
721
  function ubb2HTML(&$text) {
722
+ // Array of tags with opening and closing
723
+ $tagArray['img'] = array('open'=>'<img src="','close'=>'">');
724
+ $tagArray['b'] = array('open'=>'<b>','close'=>'</b>');
725
+ $tagArray['i'] = array('open'=>'<i>','close'=>'</i>');
726
+ $tagArray['u'] = array('open'=>'<u>','close'=>'</u>');
727
+ $tagArray['url'] = array('open'=>'<a href="','close'=>'">\\1</a>');
728
+ $tagArray['email'] = array('open'=>'<a href="mailto:','close'=>'">\\1</a>');
729
+ $tagArray['url=(.*)'] = array('open'=>'<a href="','close'=>'">\\2</a>');
730
+ $tagArray['email=(.*)'] = array('open'=>'<a href="mailto:','close'=>'">\\2</a>');
731
+ $tagArray['color=(.*)'] = array('open'=>'<font color="','close'=>'">\\2</font>');
732
+ $tagArray['size=(.*)'] = array('open'=>'<font size="','close'=>'">\\2</font>');
733
+ $tagArray['font=(.*)'] = array('open'=>'<font face="','close'=>'">\\2</font>');
734
+ // Array of tags with only one part
735
+ $sTagArray['br'] = array('tag'=>'<br>');
736
+ $sTagArray['hr'] = array('tag'=>'<hr>');
737
+
738
+ foreach($tagArray as $tagName=>$replace) {
739
+ $tagEnd = preg_replace('/\W/Ui','',$tagName);
740
+ $text = preg_replace("|\[$tagName\](.*)\[/$tagEnd\]|Ui","$replace[open]\\1$replace[close]",$text);
741
+ }
742
+ foreach($sTagArray as $tagName=>$replace) {
743
+ $text = preg_replace("|\[$tagName\]|Ui","$replace[tag]",$text);
744
+ }
745
+ return $text;
746
  }
747
 
748
 
751
  // FIXME: fix colours: <color><param>FFFF,C2FE,0374</param>some text </color>
752
  function etf2HTML ( $content ) {
753
 
754
+ $search = array(
755
+ '/<bold>/',
756
+ '/<\/bold>/',
757
+ '/<underline>/',
758
+ '/<\/underline>/',
759
+ '/<italic>/',
760
+ '/<\/italic>/',
761
+ '/<fontfamily><param>.*<\/param>/',
762
+ '/<\/fontfamily>/',
763
+ '/<x-tad-bigger>/',
764
+ '/<\/x-tad-bigger>/',
765
+ '/<bigger>/',
766
+ '</bigger>/',
767
+ '/<color>/',
768
+ '/<\/color>/',
769
+ '/<param>.+<\/param>/'
770
+ );
771
+
772
+ $replace = array (
773
+ '<b>',
774
+ '</b>',
775
+ '<u>',
776
+ '</u>',
777
+ '<i>',
778
+ '</i>',
779
+ '',
780
+ '',
781
+ '',
782
+ '',
783
+ '',
784
+ '',
785
+ '',
786
+ '',
787
+ ''
788
+ );
789
+ // strip extra line breaks
790
+ $content = preg_replace($search,$replace,$content);
791
+ return trim($content);
792
  }
793
 
794
 
795
  // This function cleans up HTML in the e-mail
796
  function HTML2HTML ( $content ) {
797
+ $search = array(
798
+ '/<html>/',
799
+ '/<\/html>/',
800
+ '/<title>/',
801
+ '/<\/title>/',
802
+ '/<body.*>/',
803
+ '/<\/body>/',
804
+ '/<head>/',
805
+ '/<\/head>/',
806
+ '/<meta content=.*>/',
807
+ '/<!DOCTYPE.*>/',
808
+ '/<img src=".*>/'
809
  // '/<img src="cid:(.*)" .*>/'
810
+ );
811
+
812
+ $replace = array (
813
+ '',
814
+ '',
815
+ '',
816
+ '',
817
+ '',
818
+ '',
819
+ '',
820
+ '',
821
+ '',
822
+ '',
823
+ '',
824
+ ''
825
+ );
826
+ // strip extra line breaks
827
+ $content = preg_replace($search,$replace,trim($content));
828
+ return ($content);
829
  }
830
 
831
 
832
 
833
  /**
834
+ * Determines if the sender is a valid user.
835
+ * @return integer|NULL
836
+ */
837
  function ValidatePoster( &$mimeDecodedEmail ) {
838
+ global $wpdb;
839
+ $config = GetConfig();
840
+ $poster = NULL;
841
+ $from = RemoveExtraCharactersInEmailAddress(trim($mimeDecodedEmail->headers["from"]));
842
+ $resentFrom = RemoveExtraCharactersInEmailAddress(trim($mimeDecodedEmail->headers["resent-from"]));
843
 
844
+ if ( empty($from) ) {
845
+ echo 'Invalid Sender - Emtpy! ';
846
+ return;
847
+ }
848
 
849
+ //See if the email address is one of the special authorized ones
850
+ print("Confirming Access For $from \n");
851
+ $sql = 'SELECT id FROM '. $wpdb->users.' WHERE user_email=\'' . addslashes($from) . "' LIMIT 1;";
852
+ $user_ID= $wpdb->get_var($sql);
853
+ $user = new WP_User($user_ID);
854
+ if ($config["TURN_AUTHORIZATION_OFF"] || CheckEmailAddress($from) || CheckEmailAddress($resentFrom)) {
855
+ if (empty($user_ID)){
856
+ print("$from is authorized to post as the administrator\n");
857
+ $from = get_option("admin_email");
858
+ $adminUser=$config['ADMIN_USERNAME'];
859
+ echo "adminUser='$adminUser'";
860
+ $poster = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE
861
+ user_login = '$adminUser'");
862
+ }
863
+ else {
864
+ $poster = $user_ID;
865
+ }
866
+ }
867
+ else if ($user->has_cap("post_via_postie")) {
868
+ $poster = $user_ID;
869
+ }
870
+ if (!$poster) {
871
+ echo 'Invalid sender: ' . htmlentities($from) . "! Not adding email!\n";
872
+ if ($config["FORWARD_REJECTED_MAIL"]) {
873
+ if (ForwardRejectedMailToAdmin($mimeDecodedEmail)) {
874
+ echo "A copy of the message has been forwarded to the administrator.\n";
875
+ } else {
876
+ echo "The message was unable to be forwarded to the adminstrator.\n";
877
+ }
878
+ }
879
+ return;
880
+ }
881
+ return $poster;
882
  }
883
 
884
  /**
885
+ * Looks at the content for the start of the message and removes everything before that
886
+ * If the pattern is not found everything is returned
887
+ * @param string
888
+ * @param string
889
+ */
890
  function StartFilter(&$content,$start) {
891
+ $pos = strpos($content,$start);
892
+ if ( $pos === false) {
893
+ return($content);
894
+ }
895
+ $content = substr($content, $pos + strlen($start), strlen($content));
896
  }
897
 
898
  /**
899
+ * Looks at the content for the start of the signature and removes all text
900
+ * after that point
901
+ * @param string
902
+ * @param array - a list of patterns to determine if it is a sig block
903
+ */
904
  function RemoveSignature( &$content,$filterList = array('--','- --' )) {
905
+ $arrcontent = explode("\n", $content);
906
+ $i = 0;
907
+ for ($i = 0; $i<=count($arrcontent); $i++) {
908
+ $line = $arrcontent[$i];
909
+ $nextline = $arrcontent[$i+1];
910
+ foreach ($filterList as $pattern) {
911
+ if (preg_match("/^$pattern/",trim($line))) {
912
+ //print("<p>Found in $line");
913
+ break 2;
914
+ }
915
+ }
916
+ $strcontent .= $line ."\n";
917
+ }
918
+ $content = $strcontent;
919
  }
920
  /**
921
+ * Looks at the content for the given tag and removes all text
922
+ * after that point
923
+ * @param string
924
+ * @param filter
925
+ */
926
  function EndFilter( &$content,$filter) {
927
+ $arrcontent = explode("\n", $content);
928
+ $i = 0;
929
+ for ($i = 0; $i<=count($arrcontent); $i++) {
930
+ $line = $arrcontent[$i];
931
+ $nextline = $arrcontent[$i+1];
932
+ if (preg_match("/^$filter/",trim($line))) {
933
+ //print("<p>Found in $line");
934
+ break;
935
+ }
936
+ $strcontent .= $line ."\n";
937
+ }
938
+ $content = $strcontent;
939
  }
940
 
941
  //filter content for new lines
942
  function FilterNewLines ( $content ) {
943
+ $config=GetConfig();
944
+ $search = array (
945
+ "/\r\n/",
946
+ "/\r/",
947
+ "/\n\n/",
948
+ "/\n/"
949
+ );
950
+ $replace = array (
951
+ "\n",
952
+ "\n",
953
+ 'ACTUAL_NEW_LINE',
954
+ 'LINEBREAK'
955
+ );
956
+ // strip extra line breaks, and replace double line breaks with paragraph
957
+ // tags
958
+ $result = preg_replace($search,$replace,$content);
959
+ //$newContent='<p>' . preg_replace('/ACTUAL_NEW_LINE/',"</p>\n<p>",$result);
960
+ $newContent=preg_replace('/ACTUAL_NEW_LINE/',"\n\n",$result);
961
+ //$newContent=preg_replace('/<p>LINEBREAK$/', '', $newContent);
962
+ if ($config['CONVERTNEWLINE']) {
963
+ $newContent= preg_replace('/LINEBREAK/',"<br />\n",$newContent);
964
+ if ($debug) {
965
  echo "converting newlines\n";
966
+ }
967
+ } else {
968
+ $newContent= preg_replace('/LINEBREAK/'," ",$newContent);
969
+ if ($debug) {
970
  echo "not converting newlines\n";
971
  }
972
+ }
973
+ return($newContent);
974
  }
975
  function FixEmailQuotes ( $content ) {
976
+ # place e-mails quotes (indicated with >) in blockquote and pre tags
977
+ $search = array (
978
+ "/^>/"
979
+ );
980
+ $replace = array (
981
+ '<br />&gt;'
982
+ );
983
+ // strip extra line breaks, and replace double line breaks with paragraph
984
+ // tags
985
+ $result = preg_replace($search,$replace,$content);
986
+ //return('<p>' . preg_replace('/ACTUAL_NEW_LINE/',"<\/p>\n<p>",$result)
987
+ //. '</p>');
988
+ return($result);
989
  }
990
 
991
  //strip pgp stuff
992
  function StripPGP ( $content ) {
993
+ $search = array (
994
+ '/-----BEGIN PGP SIGNED MESSAGE-----/',
995
+ '/Hash: SHA1/'
996
+ );
997
+ $replace = array (
998
+ ' ',
999
+ ''
1000
+ );
1001
+ // strip extra line breaks
1002
+ $return = preg_replace($search,$replace,$content);
1003
+ return $return;
1004
  }
1005
 
1006
  function ConvertToISO_8859_1($encoding,$charset, &$body ) {
1007
+ $config = GetConfig();
1008
+ $charset = strtolower($charset);
1009
+ $encoding = strtolower($encoding);
1010
+ if( (strtolower($config["MESSAGE_ENCODING"]) == "iso-8859-1") && (strtolower($charset) != 'iso-8859-1')) {
1011
+ if( $encoding == 'base64' || $encoding == 'quoted-printable' ) {
1012
+ $body = utf8_decode($body);
 
1013
  }
1014
+ }
1015
  }
1016
  function IsISO88591Blog() {
1017
+ $config = GetConfig();
1018
+ if( (strtolower($config["MESSAGE_ENCODING"]) == "iso-8859-1")) {
1019
+ return(true);
1020
+ }
1021
+ return(false);
1022
  }
1023
  function IsUTF8Blog() {
1024
+ $config = GetConfig();
1025
+ if( (strtolower($config["MESSAGE_ENCODING"]) == "utf-8")) {
1026
+ return(true);
1027
+ }
1028
+ return(false);
1029
  }
1030
  function HandleMessageEncoding($encoding, $charset,&$body) {
1031
  $charset = strtolower($charset);
1105
  list($size,$caption)=DetermineImageSizeWithImageMagick($file);
1106
  }
1107
  else {
 
1108
  list($size,$caption)=DetermineImageSizeWithGD($file);
1109
  }
1110
  return(array($size,$caption));
1159
  if ($config["USE_IMAGEMAGICK"]) {
1160
  list($scaledFileName, $fileName,$caption)=ResizeImageWithImageMagick($file,$type);
1161
  } else {
 
1162
  list($scaledFileName, $fileName,$caption)=ResizeImageWithGD($file,$type);
1163
  }
1164
  }
1345
  $fileName = basename($file);
1346
  $scaledFileName = "";
1347
  $scale = DetermineScale($sizeInfo[0],$sizeInfo[1],$config["MAX_IMAGE_WIDTH"], $config["MAX_IMAGE_HEIGHT"]);
1348
+ if ($scale < 1) {
1349
  $scaledH = round($sizeInfo[1] * $scale );
1350
  $scaledW = round($sizeInfo[0] * $scale );
1351
  $scaledFileName = "thumb.".$fileName;
1373
  $fileName = basename($file);
1374
  $scaledFileName = "";
1375
  $scale = DetermineScale($sizeInfo[0],$sizeInfo[1],$config["MAX_IMAGE_WIDTH"], $config["MAX_IMAGE_HEIGHT"]);
1376
+ if ($scale < 1) {
 
1377
  $sourceImage = NULL;
1378
  switch($type) {
1379
  case "jpeg":
1405
  }
1406
  // Revert to original limit
1407
  ini_set('memory_limit', $original_mem_limit);
 
1408
  return(array($scaledFileName,$fileName,$caption));
1409
 
1410
  }
1447
  function DeterminePostDate(&$content, $message_date = NULL) {
1448
  $config = GetConfig();
1449
  $delay = 0;
1450
+ if ($debug) {
1451
+ echo "inside Determine Post Date, message_date = $message_date\n";
1452
+ }
1453
  if (eregi("delay:(-?[0-9dhm]+)",$content,$matches)
1454
  && trim($matches[1])) {
1455
  if (eregi("(-?[0-9]+)d",$matches[1],$dayMatches)) {
1604
  $message = "An unauthorized message has been sent to " . $blogname . " from " . $from. ". The subject of this message was: '" . $subject . "'.";
1605
  $message .= "\n\nIf you wish to allow posts from this address, please add " . $from. " to the registered users list and manually add the content of the e-mail found below.";
1606
  $message .= "\n\nOtherwise, the e-mail has already been deleted from the server and you can ignore this message.";
1607
+ $message .= "\n\nIf you would like to prevent posstie from forwarding mail
1608
+ in the future, please change the FORWARD_REJECTED_MAIL setting in the Postie
1609
+ settings panel";
1610
  $message .= "\n\nThe original content of the e-mail has been attached.\n\n";
1611
  $boundary = "--".$mail_content->ctype_parameters["boundary"] ."\n";
1612
 
1701
  return($name);
1702
  }
1703
 
1704
+ function parseImageTemplate($thumbImage,$fullImage,$caption) {
1705
+ $config=GetConfig();
1706
+ echo "using custom image template\n";
1707
+ if ($thumbImage=='') {
1708
+ $imageTemplate=str_replace('{THUMBNAIL}',
1709
+ $config['URLPHOTOSDIR'] . $fullImage,
1710
+ $config['IMAGETEMPLATE']);
1711
+ $imageTemplate=str_replace("<a href='{IMAGE}'>",
1712
+ '', $imageTemplate);
1713
+ $imageTemplate=str_replace("</a>",
1714
+ '', $imageTemplate);
1715
+ } else {
1716
+ $imageTemplate=str_replace('{THUMBNAIL}',
1717
+ $config['URLPHOTOSDIR'] . $thumbImage, $config['IMAGETEMPLATE']);
1718
+ $imageTemplate=str_replace('{IMAGE}',
1719
+ $config['URLPHOTOSDIR'] . $fullImage, $imageTemplate);
1720
+ }
1721
+ $imageTemplate=str_replace('{FILENAME}',
1722
+ $config['REALPHOTOSDIR'] . $fullImage, $imageTemplate);
1723
+ $imageTemplate=str_replace('{RELFILENAME}',
1724
+ $config['RELPHOTOSDIR'] . $fullImage, $imageTemplate);
1725
+ $imageTemplate=str_replace('{WIDTH}',
1726
+ $config['MAX_IMAGE_WIDTH']. 'px' ,$imageTemplate);
1727
+ $imageTemplate=str_replace('{HEIGHT}',
1728
+ $config['MAX_IMAGE_HEIGHT']. 'px' ,$imageTemplate);
1729
+ if ($caption!='') {
1730
+ $imageTemplate=str_replace('{CAPTION}', $caption, $imageTemplate);
1731
+ }
1732
+ return($imageTemplate);
1733
+ }
1734
  /**
1735
  * When sending in HTML email the html refers to the content-id(CID) of the image - this replaces
1736
  * the cid place holder with the actual url of the image sent in
1766
  foreach ( $attachments as $i => $value ) {
1767
  // looks for ' #img1# ' etc... and replaces with image
1768
  $img_placeholder_temp = str_replace("%", intval($startIndex + $i), $config["IMAGE_PLACEHOLDER"]);
1769
+ $eimg_placeholder_temp = str_replace("%", intval($startIndex + $i),
1770
+ "#eimg%#");
1771
  $img_placeholder_temp=rtrim($img_placeholder_temp,'#');
1772
+ $eimg_placeholder_temp=rtrim($eimg_placeholder_temp,'#');
1773
+ if ( stristr($content, $img_placeholder_temp) ||
1774
+ stristr($content, $eimg_placeholder_temp) ) {
 
1775
  // look for caption
1776
+ $caption='';
1777
  if ( preg_match("/caption=['\"](.*)['\"]/", $content, $matches)) {
1778
  $caption =$matches[1];
 
 
1779
  $img_placeholder_temp.=' ' . $matches[0];
1780
+ $eimg_placeholder_temp.=' ' . $matches[0];
1781
  }
1782
+ $value = str_replace('{CAPTION}', $caption, $value);
1783
+ $img_placeholder_temp.='#';
1784
+ $eimg_placeholder_temp.='#';
1785
  $content = str_replace($img_placeholder_temp, $value, $content);
1786
+ $content = str_replace($eimg_placeholder_temp, $value, $content);
1787
+ print(htmlspecialchars("value=$value",ENT_QUOTES));
1788
+ print(htmlspecialchars("content=$content",ENT_QUOTES));
1789
  } else {
1790
+ $value = str_replace('{CAPTION}', '', $value);
1791
  if ($config["IMAGES_APPEND"]) {
1792
  $content .= $value;
1793
  } else {
1837
  global $wpdb;
1838
  $post_tags = array();
1839
  //try and determine tags
1840
+ if ( preg_match('/tags: ?(.*)\n/', $content, $matches)) {
1841
+ $content = str_replace($matches[0], "", $content);
1842
  $post_tags = preg_split("/,\s*/", $matches[1]);
1843
  }
1844
  if (!count($post_tags)) {
1845
+ echo "using default tags " . $config["DEFAULT_POST_TAGS"]. "\n";
1846
  $post_tags = $config["DEFAULT_POST_TAGS"];
1847
  }
1848
  return($post_tags);
1849
  }
1850
+ /**
1851
+ * this function determines excerpt for the post
1852
+ *
1853
+ */
1854
+ function GetPostExcerpt(&$content) {
1855
+ $config = GetConfig();
1856
+ global $wpdb;
1857
+ $post_excerpt = '';
1858
+ //try and determine excerpt
1859
+ echo "CONTENT ------
1860
+ $content
1861
+ -------";
1862
+ if ( preg_match('/:excerptstart ?(.*):excerptend/s', $content, $matches)) {
1863
+ $content = str_replace($matches[0], "", $content);
1864
+ $post_excerpt = $matches[1];
1865
+ print_r($matches);
1866
+ echo "NOW CONTENT ------
1867
+ $content
1868
+ -------";
1869
+ echo "excerpt ------
1870
+ $post_excerpt
1871
+ -------";
1872
+ }
1873
+ return($post_excerpt);
1874
+ }
1875
  /**
1876
  * This function determines categories for the post
1877
  * @return array
1923
  }
1924
  }
1925
  if (!count($post_categories)) {
 
1926
  $post_categories[] = $config["DEFAULT_POST_CATEGORY"];
1927
  }
1928
  return($post_categories);
1931
  *This function just outputs a simple html report about what is being posted in
1932
  */
1933
  function DisplayEmailPost($details) {
1934
+ $config = GetConfig();
1935
+ if ($debug) {
1936
+ print_r($config);
1937
+ print_r($details);
1938
+ }
1939
+ $theFinalContent=$details['post_content'];
1940
+ // Report
1941
+ print '</pre><p><b>Post Author</b>: ' . $details["post_author"]. '<br />' . "\n";
1942
+ print '<b>Date</b>: ' . $details["post_date"] . '<br />' . "\n";
1943
+ print '<b>Date GMT</b>: ' . $details["post_date_gmt"] . '<br />' . "\n";
1944
+ foreach($details["post_category"] as $category) {
1945
+ print '<b>Category</b>: ' . $category . '<br />' . "\n";
1946
+ }
1947
+ print '<b>Ping Status</b>: ' . $details["ping_status"] . '<br />' . "\n";
1948
+ print '<b>Comment Status</b>: ' . $details["comment_status"] . '<br />' . "\n";
1949
+ print '<b>Subject</b>: ' . $details["post_title"]. '<br />' . "\n";
1950
+ print '<b>Postname</b>: ' . $details["post_name"] . '<br />' . "\n";
1951
+ print '<b>Posted content:</b></p><hr />' . $details["post_content"] . '<hr /><pre>';
1952
  }
1953
  /**
1954
  * This function confirms that everything is setup correctly
1970
  */
1971
  function BuildBooleanSelect($label,$id,$current_value,$recommendation = NULL) {
1972
  $string="<tr>
1973
+ <th scope=\"row\">". __($label, 'postie').":</th>
1974
  <td><select name=\"$id\" id=\"$id\">
1975
+ <option value=\"1\">".__("Yes", 'postie')."</option>
1976
+ <option value=\"0\" ". (!$current_value ? "SELECTED" : NULL) .
1977
+ ">".__("No", 'postie').'</option>
1978
  </select>
1979
  <br />';
1980
  if ($recommendation!=NULL) {
1981
+ $string.='<code>'.__($recommendation, 'postie').'</code><br/>';
1982
  }
1983
  $string.="</td>\n</tr>";
1984
  return($string);
1992
  */
1993
  function BuildTextArea($label,$id,$current_value,$recommendation = NULL) {
1994
  $string = "<tr>
1995
+ <th scope=\"row\">".__($label, 'postie').":</th></tr>";
1996
 
1997
  if ($recommendation) {
1998
+ $string .= "<tr><td>&nbsp;</td><td><code>".__($recommendation,
1999
+ 'postie')."</code></td></tr>";
2000
  }
2001
  $string .=" <tr>
2002
  <td>&nbsp;</td>
2135
  if (!isset($config["3GPDIV"])) { $config["3GPDIV"] = "postie-3gp-div";}
2136
  if (!isset($config["ATTACHMENTDIV"])) { $config["ATTACHMENTDIV"] = "postie-attachment-div";}
2137
  if (!isset($config["3GPCLASS"])) { $config["3GPCLASS"] = "postie-video";}
2138
+ if (!isset($config["VIDEO_WIDTH"])) { $config["VIDEO_WIDTH"] = 128;}
2139
+ if (!isset($config["PLAYER_WIDTH"])) { $config["PLAYER_WIDTH"] = 128;}
2140
+ if (!isset($config["VIDEO_HEIGHT"])) { $config["VIDEO_HEIGHT"] = 112;}
2141
+ if (!isset($config["PLAYER_HEIGHT"])) { $config["PLAYER_HEIGHT"] = 150;}
2142
+ if (!isset($config["VIDEO_AUTOPLAY"])) { $config["VIDEO_AUTOPLAY"] = false;}
2143
  if (!isset($config["IMAGESTYLE"])) { $config["IMAGESTYLE"] = "border: none;";}
2144
  if (!isset($config["JPEGQUALITY"])) { $config["JPEGQUALITY"] = 80;}
2145
  if (!isset($config["AUTO_SMART_SHARP"])) { $config["AUTO_SMART_SHARP"] = false;}
2155
  if (!isset($config["MESSAGE_DEQUOTE"])) { $config["MESSAGE_DEQUOTE"] = true; }
2156
  if (!isset($config["TURN_AUTHORIZATION_OFF"])) { $config["TURN_AUTHORIZATION_OFF"] = false;}
2157
  if (!isset($config["USE_IMAGEMAGICK"])) { $config["USE_IMAGEMAGICK"] = false;}
2158
+ if (!isset($config["CUSTOM_IMAGE_FIELD"])) { $config["CUSTOM_IMAGE_FIELD"] = false;}
2159
  if (!isset($config["CONVERTNEWLINE"])) { $config["CONVERTNEWLINE"] = false;}
2160
  if (!isset($config["IMAGEMAGICK_CONVERT"])) { $config["IMAGEMAGICK_CONVERT"] = "/usr/bin/convert";}
2161
  if (!isset($config["IMAGEMAGICK_IDENTIFY"])) { $config["IMAGEMAGICK_IDENTIFY"] = "/usr/bin/identify";}
2175
  if (!isset($config["3GP_QT"])) { $config["3GP_QT"] = true; }
2176
  if (!isset($config["3GP_FFMPEG"])) { $config["3GP_FFMPEG"] = "/usr/bin/ffmpeg";}
2177
  if (!isset($config["WRAP_PRE"])) { $config["WRAP_PRE"] = 'no'; }
2178
+ if (!isset($config["CONVERTURLS"])) { $config["CONVERTURLS"] = true; }
2179
  if (!isset($config["ADD_META"])) { $config["ADD_META"] = 'no'; }
2180
+ if (!isset($config["USEIMAGETEMPLATE"]))
2181
+ $config["USEIMAGETEMPLATE"] = false;
2182
+ if (!isset($config["USEVIDEOTEMPLATE"]))
2183
+ $config["USEVIDEOTEMPLATE"] = false;
2184
+ if (!isset($config["POST_STATUS"]))
2185
+ $config["POST_STATUS"] = 'publish';
2186
+ if (!isset($config["IMAGE_NEW_WINDOW"]))
2187
+ $config["IMAGE_NEW_WINDOW"] = false;
2188
  if (!isset($config["IMAGETEMPLATE"])) { $config["IMAGETEMPLATE"] =
2189
+ "<div class='imageframe alignleft'><a href='{IMAGE}'><img src='{THUMBNAIL}' alt='{CAPTION}' title='{CAPTION}' class='attachment' /></a><div class='imagecaption'>{CAPTION}</div></div>";
2190
+ }
2191
+ if (!isset($config["VIDEOTEMPLATE"])) { $config["VIDEOTEMPLATE"] =
2192
+ '<object '.
2193
+ 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '.
2194
+ 'codebase="http://www.apple.com/qtactivex/qtplugin.cab" '.
2195
+ 'width="' . $config['VIDEO_WIDTH'] . '" '.
2196
+ 'height="' . $config['VIDEO_HEIGHT'] . '"> '.
2197
+ '<param name="src" VALUE="'.
2198
+ $config["URLFILESDIR"] . $filename .'"> '.
2199
+ '<param name="autoplay" VALUE="no"> '.
2200
+ '<param name="controller" VALUE="true"> '.
2201
+ '<embed '.
2202
+ 'src="'. $config["URLFILESDIR"] . $filename .'" '.
2203
+ 'width="' . $config['VIDEO_WIDTH'] . '" '.
2204
+ 'height="' . $config['VIDEO_HEIGHT'] . '"'.
2205
+ 'autoplay="no" '.
2206
+ 'controller="true" '.
2207
+ 'type="video/quicktime" '.
2208
+ 'pluginspage="http://www.apple.com/quicktime/download/" '.
2209
+ 'width="' . $config['PLAYER_WIDTH'] . '" '.
2210
+ 'height="' . $config['PLAYER_HEIGHT'] . '">'.
2211
+ '</embed> '.
2212
+ '</object>';
2213
  }
2214
  return($config);
2215
  }
2218
  * @return array
2219
  */
2220
  function GetConfig() {
2221
+ $config = GetDBConfig();
2222
+ if (!ConfirmTrailingDirectorySeperator($config["PHOTOSDIR"])) {
2223
+ $config["PHOTOSDIR"] .= DIRECTORY_SEPARATOR;
2224
+ }
2225
+ if (!ConfirmTrailingDirectorySeperator($config["FILESDIR"])) {
2226
+ $config["FILESDIR"] .= DIRECTORY_SEPARATOR;
2227
+ }
2228
+ //These should only be modified if you are testing
2229
+ $config["DELETE_MAIL_AFTER_PROCESSING"] = true;
2230
+ $config["POST_TO_DB"] = true;
2231
+ $config["TEST_EMAIL"] = false;
2232
+ $config["TEST_EMAIL_ACCOUNT"] = "blogtest";
2233
+ $config["TEST_EMAIL_PASSWORD"] = "yourpassword";
2234
+ //include(POSTIE_ROOT . "/../postie-test.php");
2235
+ // These are computed
2236
+ #$config["TIME_OFFSET"] = get_option('gmt_offset');
2237
+ if ($config["USE_IMAGEMAGICK"]) {
2238
+ if (!file_exists($config["IMAGEMAGICK_IDENTIFY"])
2239
  ||!file_exists($config["IMAGEMAGICK_CONVERT"])) {
2240
+ $config["RESIZE_LARGE_IMAGES"] = false;
2241
+ }
2242
+ }
2243
+ else {
2244
+ if (!HasGDInstalled(false)) {
2245
+ $config["RESIZE_LARGE_IMAGES"] = false;
 
 
 
 
 
 
 
 
 
2246
  }
2247
+ }
2248
+ $config["POSTIE_ROOT"] = POSTIE_ROOT;
2249
+ $config["URLPHOTOSDIR"] = get_option('siteurl') . ConvertFilePathToUrl($config["PHOTOSDIR"]);
2250
+ $config["REALPHOTOSDIR"] = realpath(ABSPATH . $config["PHOTOSDIR"]). DIRECTORY_SEPARATOR;
2251
+ $config["RELPHOTOSDIR"] = $config["PHOTOSDIR"]. DIRECTORY_SEPARATOR;
2252
+ $config["URLFILESDIR"] = get_option('siteurl') . ConvertFilePathToUrl($config["FILESDIR"]);
2253
+ $config["REALFILESDIR"] = realpath(ABSPATH . $config["FILESDIR"]) . DIRECTORY_SEPARATOR;
2254
+ for ($i = 0; $i < count($config["AUTHORIZED_ADDRESSES"]); $i++) {
2255
+ $config["AUTHORIZED_ADDRESSES"][$i] = strtolower($config["AUTHORIZED_ADDRESSES"][$i]);
2256
+ }
2257
+ return $config;
2258
  }
2259
  /**
2260
  * Converts from one directory structure to url
2395
  * If you want to extend this functionality - write a new function and call it from here
2396
  */
2397
  function SpecialMessageParsing(&$content, &$attachments){
2398
+ $config = GetConfig();
2399
+ if ( preg_match('/You have been sent a message from Vodafone mobile/',$content)) {
2400
+ VodafoneHandler($content, $attachments); //Everything for this type of message is handled below
2401
+ return;
2402
+ }
2403
+ if ( $config["MESSAGE_START"] ) {
2404
+ StartFilter($content,$config["MESSAGE_START"]);
2405
+ }
2406
+ if ( $config["MESSAGE_END"] ) {
2407
+ EndFilter($content,$config["MESSAGE_END"]);
2408
+ }
2409
+ if ( $config["DROP_SIGNATURE"] ) {
2410
+ RemoveSignature($content,$config["SIG_PATTERN_LIST"]);
2411
+ }
2412
+ if ($config["PREFER_TEXT_TYPE"] == "html"
2413
+ && count($attachments["cids"])) {
2414
+ ReplaceImageCIDs($content,$attachments);
2415
+ }
2416
+ if (!$config['CUSTOM_IMAGE_FIELD']) {
2417
  ReplaceImagePlaceHolders($content,$attachments["html"]);
2418
+ } else {
2419
+ $customImages=array();
2420
+ foreach ($attachments["html"] as $value) {
2421
+ preg_match('/<img src="([^"]*)"/', $value, $matches);
2422
+ array_push($customImages,$matches[1]);
2423
+ }
2424
+
2425
+ return($customImages);
2426
+ }
2427
+ return(NULL);
2428
  }
2429
  /**
2430
  * Special Vodafone handler - their messages are mostly vendor trash - this strips them down.
postie.php CHANGED
@@ -2,18 +2,18 @@
2
  /*
3
  Plugin Name: Postie
4
  Plugin URI: http://blog.robfelty.com/plugins/postie
5
- Description: Signifigantly upgrades the posting by mail features of Word Press (See <a href="../wp-content/plugins/postie/postie.php?postie_read_me=1">Quick Readme</a>)
6
- Version: 1.1.5
7
  Author: Robert Felty
8
  Author URI: http://blog.robfelty.com/
9
  */
10
 
11
  /*
 
12
  * -= Requests Pending =-
13
  * German Umlats don't work
14
  * Problems under PHP5
15
  * Problem with some mail server
16
- * Config Form freaks out in some cases
17
  * Multiple emails should tie to a single account
18
  * Each user should be able to have a default category
19
  * WP Switcher not compatible
@@ -25,26 +25,25 @@ Author URI: http://blog.robfelty.com/
25
  - os of server
26
  - os of client
27
  - number of users posting
28
- * make sure it handles the case where the url is http://www.site.com/wordpress/ instead of just http://www.site.com/
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 ability to post to an existing page
34
- * Add a download counter
35
  * Add support for http://unknowngenius.com/wp-plugins/faq.html#one-click
36
  * www.cdavies.org/code/3gp-thumb.php.txt
37
  * www.cdavies.org/permalink/watchingbrowserembeddedgpvideosinlinux.php
38
- * Support draft/private posts
39
  * Make it possible to post without a script at all
40
  */
41
 
42
  //Older Version History is in the HISTORY file
43
 
44
- include_once (dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR. "wp-config.php");
45
- include_once (dirname(dirname(dirname(dirname(__FILE__)))) .
46
- DIRECTORY_SEPARATOR . 'wp-includes' . DIRECTORY_SEPARATOR . "pluggable.php");
47
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR ."postie-functions.php");
 
 
48
  if (isset($_GET["postie_read_me"])) {
49
  include_once(ABSPATH . "wp-admin/admin.php");
50
  $title = __("Edit Plugins");
@@ -55,10 +54,13 @@ if (isset($_GET["postie_read_me"])) {
55
  }
56
  //Add Menu Configuration
57
  if (is_admin()) {
58
- global $userdata;
59
- get_currentuserinfo();
60
- if ($userdata->user_level>9) {
61
- add_action("admin_menu","PostieMenu");
62
- }
 
 
 
63
  }
64
  ?>
2
  /*
3
  Plugin Name: Postie
4
  Plugin URI: http://blog.robfelty.com/plugins/postie
5
+ 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://wordpres.org/extend/plugins/postie/other_notes'>Readme</a> for usage. Visit the <a href='http://forum.robfelty.com/forum/postie'>postie forum</a> for support.
6
+ Version: 1.2
7
  Author: Robert Felty
8
  Author URI: http://blog.robfelty.com/
9
  */
10
 
11
  /*
12
+ $Id: postie.php 112555 2009-04-22 14:31:22Z robfelty $
13
  * -= Requests Pending =-
14
  * German Umlats don't work
15
  * Problems under PHP5
16
  * Problem with some mail server
 
17
  * Multiple emails should tie to a single account
18
  * Each user should be able to have a default category
19
  * WP Switcher not compatible
25
  - os of server
26
  - os of client
27
  - number of users posting
 
28
  * Test for calling from the command line
29
  * Support userid/domain as a valid username
30
  * WP-switcher not compatiable http://www.alexking.org/index.php?content=software/wordpress/content.php#wp_120
31
  * Test out a remote cron system
 
 
32
  * Add support for http://unknowngenius.com/wp-plugins/faq.html#one-click
33
  * www.cdavies.org/code/3gp-thumb.php.txt
34
  * www.cdavies.org/permalink/watchingbrowserembeddedgpvideosinlinux.php
35
+ * Support private posts
36
  * Make it possible to post without a script at all
37
  */
38
 
39
  //Older Version History is in the HISTORY file
40
 
41
+
42
+ if (!is_admin()) {
43
+ //include_once (dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR. "wp-config.php");
44
+ //include_once (dirname(dirname(dirname(dirname(__FILE__)))) .
45
+ //DIRECTORY_SEPARATOR . 'wp-includes' . DIRECTORY_SEPARATOR . "pluggable.php");
46
+ }
47
  if (isset($_GET["postie_read_me"])) {
48
  include_once(ABSPATH . "wp-admin/admin.php");
49
  $title = __("Edit Plugins");
54
  }
55
  //Add Menu Configuration
56
  if (is_admin()) {
57
+ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR ."postie-functions.php");
58
+ add_action("admin_menu","PostieMenu");
59
+ if(function_exists('load_plugin_textdomain')){
60
+ //load_plugin_textdomain('postie', false, dirname( plugin_basename(__FILE__)) .
61
+ //'/languages');
62
+ $plugin_dir = basename(dirname(__FILE__)) . '/languages';
63
+ load_plugin_textdomain( 'postie', 'wp-content/plugins/' . $plugin_dir, $plugin_dir );
64
+ }
65
  }
66
  ?>
postie_read_me.php CHANGED
@@ -1,9 +1,5 @@
1
  <div class="wrap">
2
  <h1>Postie</h1>
3
- <?php if (!current_user_can("config_postie")) :?>
4
- <h2>WARNING! - You must be logged in as "admin" to configure Postie.</h2>
5
-
6
- <?php endif;?>
7
  <p>I'm working on some more detailed instructions, but for now this will have to do.</p>
8
  <pre>
9
  <?php include("readme.txt");?>
1
  <div class="wrap">
2
  <h1>Postie</h1>
 
 
 
 
3
  <p>I'm working on some more detailed instructions, but for now this will have to do.</p>
4
  <pre>
5
  <?php include("readme.txt");?>
postie_test.php CHANGED
@@ -2,17 +2,19 @@
2
  // try to connect to server with different protocols/ and userids
3
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR ."postie-functions.php");
4
  include_once (dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR. "wp-config.php");
5
- require_once('admin.php');
6
  require_once("postie-functions.php");
7
  $config = GetConfig();
8
  $title = __("Postie Diagnosis");
9
  $parent_file = 'options-general.php?page=postie/postie.php';
10
  get_currentuserinfo();
11
  ?>
12
- <?php if ($GLOBALS["user_level"] != 10 ) :?>
13
- <h2> Sorry only admin can run this file</h2>
14
- <?php exit();?>
15
- <?php endif;?>
 
 
16
 
17
  <?
18
  $images = array("Test.png",
2
  // try to connect to server with different protocols/ and userids
3
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR ."postie-functions.php");
4
  include_once (dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR. "wp-config.php");
5
+ //require_once('admin.php');
6
  require_once("postie-functions.php");
7
  $config = GetConfig();
8
  $title = __("Postie Diagnosis");
9
  $parent_file = 'options-general.php?page=postie/postie.php';
10
  get_currentuserinfo();
11
  ?>
12
+ <?php
13
+ if (!current_user_can('manage_options')) {
14
+ echo "<h2> Sorry only admin can run this file</h2>";
15
+ exit();
16
+ }
17
+ ?>
18
 
19
  <?
20
  $images = array("Test.png",
readme.txt CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://blog.robfelty.com/plugins/postie
5
  Tags: e-mail
6
  Requires at least: 2.3
7
  Tested up to: 2.7.1
8
- Stable tag: 1.1.5
9
 
10
  The Postie plugin allows you to blog via e-mail, including many advanced
11
  features not found in wordpress's default post by e-mail feature.
@@ -17,15 +17,34 @@ videos, and automatically strip off signatures. It also has support for both
17
  imap and pop3, with the option for ssl with both. For usage notes, see the
18
  [other notes](other_notes) page
19
 
20
- = What's new in 1.1.5 =
21
- * Added option to have postie posts be pending review, published, or draft
22
- * Settings panel only shows up for administrators
23
- * Need not be user "admin" to modify settings or to post from non-registered
24
- users
25
- * Can now set administrator name. Authorized e-mail addresses which don't
26
- have a user get posted under this name
27
- * Will use IPTC captions if available
28
- * Added option to replace newline characters with &lt;br /&gt;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  == Installation ==
31
  * Make sure all postie code is its own directory inside of wp-content/plugins/postie
@@ -35,19 +54,44 @@ imap and pop3, with the option for ssl with both. For usage notes, see the
35
  * Login to WordPress as an administrator
36
  * Goto the Plugins tab in the WordPress Admin Site
37
  * Activate "Postie"
38
- * Goto to the "Options" tab and click on the sub-tab "Configure Postie" to configure it.
39
- * (Postie ignores the settings under Options->Writing->Writing-by-Email)
 
 
 
 
 
 
40
 
 
41
 
42
- Setup a cronjob to pull down the get_mail.php
43
- Example:
44
- */5 * * * * /usr/bin/lynx --source http://www.economysizegeek.com/wp-content/plugins/postie/get_mail.php >/dev/null 2>&1
45
 
46
- This fetches the mail every five mintues.
 
47
 
48
- If you don't have access to cron - check out "Cronless Postie"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
- == Options ==
51
  * You can set the starting characters for you signature so that it
52
  is removed from the posting message
53
  * You can set a list of banned file names so if you provider adds
@@ -77,6 +121,11 @@ If you don't have access to cron - check out "Cronless Postie"
77
  get posted as a comment to the "foo" post. This works by the subject
78
  line, so if you have two posts with titles "foo", then the comment
79
  will get placed in the more recent post.
 
 
 
 
 
80
 
81
  = Category and tag handling =
82
  * If you put a category name in the subject with a : it will be used
@@ -139,7 +188,10 @@ class='imagecaption'&gt;{CAPTION}&lt;/div&gt;&lt;/div&gt;
139
  * {IMAGE} gets replaced with the url to the full-size image
140
  * {THUMBNAIL} gets replaced with the url to the thumbnail image
141
  * {FILENAME} gets replaced with the absolute path to the full-size image
 
142
  * {CAPTION} gets replaced with the caption you specified (if any)
 
 
143
 
144
  * Rotation - if you include the text
145
 
@@ -164,6 +216,36 @@ class='imagecaption'&gt;{CAPTION}&lt;/div&gt;&lt;/div&gt;
164
 
165
 
166
  == History ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  * 1.1.5 (2009.03.10)
168
  * Added option to have postie posts be pending review, published, or draft
169
  * Settings panel only shows up for administrators
@@ -190,7 +272,7 @@ class='imagecaption'&gt;{CAPTION}&lt;/div&gt;&lt;/div&gt;
190
  * replying to an e*mail adds a comment to a post
191
  * fixed category handling to work with taxonomy
192
  * fixed one syntax error
193
- * added option to wrap posts and comments in <pre> tags
194
 
195
  Below is all the of the version information. As far as I can tell there once was a guy named John Blade. He took some of the orignal wp-mail.php code and started hacking away on it. He actually got pretty far. About the time I discovered WordPress and his little hack - called WP-Mail at the time - he went on a vacation or something. There were some problems with the script, and it was missing some features I wanted. I hacked away at it and got it into a place where it did what I wanted. I started posting about it since I figured other people might want the features.
196
 
@@ -253,7 +335,7 @@ So I decided to make an offical fork. I put up an article on my blog asking for
253
  BUGFIX: Posting updates the category counts.
254
 
255
  Version 0.9.8.6
256
- BUGFIX: Fixed problems with config page <%php became <?php
257
 
258
  Version 0.9.8.5
259
  BUGFIX: onClick changed to onclick
5
  Tags: e-mail
6
  Requires at least: 2.3
7
  Tested up to: 2.7.1
8
+ Stable tag: 1.2
9
 
10
  The Postie plugin allows you to blog via e-mail, including many advanced
11
  features not found in wordpress's default post by e-mail feature.
17
  imap and pop3, with the option for ssl with both. For usage notes, see the
18
  [other notes](other_notes) page
19
 
20
+ = What's new in 1.2 =
21
+ * More video options:
22
+ * Can embed 3gp, mp4, mov videos
23
+ * Can specify video width, video height, player width, and player height
24
+ in the settings page
25
+ * Can specify custom image template
26
+ * Image handling improvements:
27
+ * Only downscale images, not up-scale (thanks Jarven)
28
+ * More custom image template options
29
+ * IPTC captions now also work when not resizing images
30
+ * Added option to use custom field for images (for Datapusher)
31
+ * Fixed some issues with image templates and line break handling
32
+ * Custom image template now works even when not resizing images
33
+ * Documentation improvements:
34
+ * Added links to settings, forum, and readme in plugin description
35
+ * Updated readme (thanks to Venkatraman Dhamodaran)
36
+ * Added better instructions on how to use cronless postie
37
+ * Text processing improvements:
38
+ * Added option to automatically convert urls into links
39
+ * Added feature to include a custom excerpt
40
+ * Miscellaneous improvements
41
+ * Improved internationalization (thanks to Håvard Broberg
42
+ (nanablag@nanablag.com))
43
+ * Bug Fixes
44
+ * Removed debugging info in get_mail.php (security issue) thanks to
45
+ [Jens]( http://svalgaard.net/jens/)
46
+ * No longer directly including pluggable.php (should
47
+ prevent conflicts with other plugins such as registerplus
48
 
49
  == Installation ==
50
  * Make sure all postie code is its own directory inside of wp-content/plugins/postie
54
  * Login to WordPress as an administrator
55
  * Goto the Plugins tab in the WordPress Admin Site
56
  * Activate "Postie"
57
+ * Goto to the "Settings" tab and click on the sub-tab "Configure Postie" to configure it.
58
+ * Make sure you enter the mailserver information correctly, including the type
59
+ of connection and the port number. Common port configurations:
60
+ * pop3: 110
61
+ * pop3-ssl: 995
62
+ * imap: 143
63
+ * imap-ssl: 993
64
+ * (Postie ignores the settings under Settings->Writing->Writing-by-Email)
65
 
66
+ = Automating checking e-mail =
67
 
68
+ If your site runs on a UNIX/linux server, and you have shell access, you can
69
+ enable mail checking using cron; if you don't know anything about cron, skip
70
+ to the cronless postie section.
71
 
72
+ Setup a cronjob to pull down the get\_mail.php
73
+ Examples:
74
 
75
+ */5 * * * * /usr/bin/lynx --source http://blog.robfelty.com/wp-content/plugins/postie/get\_mail.php >/dev/null 2>&1
76
+
77
+ This fetches the mail every five minutes with lynx
78
+
79
+ */10 * * * * /usr/bin/wget -O /dev/null http://blog.robfelty.com/wp-content/plugins/postie/get\_mail.php >/dev/null 2>&1
80
+
81
+ This fetches the mail every ten minutes with wget
82
+
83
+ = Cronless Postie =
84
+
85
+ If you don't have access to cron, you can run postie without it.
86
+ * Activate the cronless postie plugin (it is included with the postie plugin,
87
+ so if you have downloaded postie, you don't need to download anything else
88
+ * By default, cronless postie checks for new e-mail once every hour. Currently
89
+ * the only other option currently is daily. If you wish to change this, edit
90
+ * the line in postie_cronless.php to:
91
+
92
+
93
+ == Options and Settings ==
94
 
 
95
  * You can set the starting characters for you signature so that it
96
  is removed from the posting message
97
  * You can set a list of banned file names so if you provider adds
121
  get posted as a comment to the "foo" post. This works by the subject
122
  line, so if you have two posts with titles "foo", then the comment
123
  will get placed in the more recent post.
124
+ * Custom excerpt
125
+ * You can include a custom excerpt of an e-mail by putting it between
126
+ :excerptstart and :excerptend
127
+ * You can include images in the excerpt by using the shortcode #eimg1#,
128
+ #eimg2# etc.
129
 
130
  = Category and tag handling =
131
  * If you put a category name in the subject with a : it will be used
188
  * {IMAGE} gets replaced with the url to the full-size image
189
  * {THUMBNAIL} gets replaced with the url to the thumbnail image
190
  * {FILENAME} gets replaced with the absolute path to the full-size image
191
+ * {RELFILENAME} gets replaced with the relative path to the full-size image
192
  * {CAPTION} gets replaced with the caption you specified (if any)
193
+ * {WIDTH} gets replaced with the maximum width for resized photos
194
+ * {HEIGHT} gets replaced with the maximum height for resized photos
195
 
196
  * Rotation - if you include the text
197
 
216
 
217
 
218
  == History ==
219
+ * 1.2 (2009.04.22)
220
+ * More video options:
221
+ * Can embed 3gp, mp4, mov videos
222
+ * Can specify video width, video height, player width, and player height
223
+ in the settings page
224
+ * Can specify custom image template
225
+ * Image handling improvements:
226
+ * Only downscale images, not up-scale (thanks Jarven)
227
+ * More custom image template options
228
+ * IPTC captions now also work when not resizing images
229
+ * Added option to use custom field for images (for Datapusher)
230
+ * Fixed some issues with image templates and line break handling
231
+ * Custom image template now works even when not resizing images
232
+ * Documentation improvements:
233
+ * Added links to settings, forum, and readme in plugin description
234
+ * Updated readme (thanks to Venkatraman Dhamodaran)
235
+ * Added better instructions on how to use cronless postie
236
+ * Text processing improvements:
237
+ * Added option to automatically convert urls into links
238
+ * Added feature to include a custom excerpt
239
+ * Miscellaneous improvements
240
+ * Improved internationalization (thanks to Håvard Broberg
241
+ (nanablag@nanablag.com))
242
+ * Bug Fixes
243
+ * Removed debugging info in get_mail.php (security issue) thanks to
244
+ [Jens]( http://svalgaard.net/jens/)
245
+ * No longer directly including pluggable.php (should
246
+ prevent conflicts with other plugins such as registerplus
247
+
248
+
249
  * 1.1.5 (2009.03.10)
250
  * Added option to have postie posts be pending review, published, or draft
251
  * Settings panel only shows up for administrators
272
  * replying to an e*mail adds a comment to a post
273
  * fixed category handling to work with taxonomy
274
  * fixed one syntax error
275
+ * added option to wrap posts and comments in &lt;pre%gt; tags
276
 
277
  Below is all the of the version information. As far as I can tell there once was a guy named John Blade. He took some of the orignal wp-mail.php code and started hacking away on it. He actually got pretty far. About the time I discovered WordPress and his little hack - called WP-Mail at the time - he went on a vacation or something. There were some problems with the script, and it was missing some features I wanted. I hacked away at it and got it into a place where it did what I wanted. I started posting about it since I figured other people might want the features.
278
 
335
  BUGFIX: Posting updates the category counts.
336
 
337
  Version 0.9.8.6
338
+ BUGFIX: Fixed problems with config page &lt;%php became &lt;?php
339
 
340
  Version 0.9.8.5
341
  BUGFIX: onClick changed to onclick