Version Description
(2009.08.24) = * Changed GetContent filter to postie_post * Added database upgrade hook on activation * Fixed bug where content would be empty if trying to remove signature, and signature list was emtpy * Updated FAQ and readme
Download this release
Release Info
Developer | robfelty |
Plugin | Postie |
Version | 1.3.1 |
Comparing to | |
See all releases |
Code changes from version 1.2.3 to 1.3.1
- HISTORY +0 -300
- PEAR.php +222 -68
- PEAR5.php +33 -0
- Revision +2 -0
- config_form.php +520 -400
- config_handler.php +0 -39
- cronless_postie.php +3 -3
- css/Thumbs.db +0 -0
- css/menu-bits.gif +0 -0
- css/simpleTabs.css +36 -0
- css/style.css +28 -0
- faq.html +141 -0
- filterPostie.php +60 -0
- get_mail.php +21 -14
- icons/black/aac-32.png +0 -0
- icons/black/aac-48.png +0 -0
- icons/black/aac-64.png +0 -0
- icons/black/avi-32.png +0 -0
- icons/black/avi-48.png +0 -0
- icons/black/avi-64.png +0 -0
- icons/black/default-32.png +0 -0
- icons/black/default-48.png +0 -0
- icons/black/default-64.png +0 -0
- icons/black/divx-32.png +0 -0
- icons/black/divx-48.png +0 -0
- icons/black/divx-64.png +0 -0
- icons/black/doc-32.png +0 -0
- icons/black/doc-48.png +0 -0
- icons/black/doc-64.png +0 -0
- icons/black/m4a-32.png +0 -0
- icons/black/m4a-48.png +0 -0
- icons/black/m4a-64.png +0 -0
- icons/black/midi-32.png +0 -0
- icons/black/midi-48.png +0 -0
- icons/black/midi-64.png +0 -0
- icons/black/mov-32.png +0 -0
- icons/black/mov-48.png +0 -0
- icons/black/mov-64.png +0 -0
- icons/black/mp3-32.png +0 -0
- icons/black/mp3-48.png +0 -0
- icons/black/mp3-64.png +0 -0
- icons/black/mp4-32.png +0 -0
- icons/black/mp4-48.png +0 -0
- icons/black/mp4-64.png +0 -0
- icons/black/mpc-32.png +0 -0
- icons/black/mpc-48.png +0 -0
- icons/black/mpc-64.png +0 -0
- icons/black/mpg-32.png +0 -0
- icons/black/mpg-48.png +0 -0
- icons/black/mpg-64.png +0 -0
- icons/black/ogg-32.png +0 -0
- icons/black/ogg-48.png +0 -0
- icons/black/ogg-64.png +0 -0
- icons/black/pdf-32.png +0 -0
- icons/black/pdf-48.png +0 -0
- icons/black/pdf-64.png +0 -0
- icons/black/ppt-32.png +0 -0
- icons/black/ppt-48.png +0 -0
- icons/black/ppt-64.png +0 -0
- icons/black/ra-32.png +0 -0
- icons/black/ra-48.png +0 -0
- icons/black/ra-64.png +0 -0
- icons/black/rm-32.png +0 -0
- icons/black/rm-48.png +0 -0
- icons/black/rm-64.png +0 -0
- icons/black/rtf-32.png +0 -0
- icons/black/rtf-48.png +0 -0
- icons/black/rtf-64.png +0 -0
- icons/black/tex-32.png +0 -0
- icons/black/tex-48.png +0 -0
- icons/black/tex-64.png +0 -0
- icons/black/text-32.png +0 -0
- icons/black/text-48.png +0 -0
- icons/black/text-64.png +0 -0
- icons/black/wav-32.png +0 -0
- icons/black/wav-48.png +0 -0
- icons/black/wav-64.png +0 -0
- icons/black/wma-32.png +0 -0
- icons/black/wma-48.png +0 -0
- icons/black/wma-64.png +0 -0
- icons/black/wmv-32.png +0 -0
- icons/black/wmv-48.png +0 -0
- icons/black/wmv-64.png +0 -0
- icons/black/xls-32.png +0 -0
- icons/black/xls-48.png +0 -0
- icons/black/xls-64.png +0 -0
- icons/silver/SilverFileText-001.png +0 -0
- icons/silver/aac-32.png +0 -0
- icons/silver/aac-48.png +0 -0
- icons/silver/aac-64.png +0 -0
- icons/silver/ai-32.png +0 -0
- icons/silver/ai-48.png +0 -0
- icons/silver/ai-64.png +0 -0
- icons/silver/avi-32.png +0 -0
- icons/silver/avi-48.png +0 -0
- icons/silver/avi-64.png +0 -0
- icons/silver/bmp-32.png +0 -0
- icons/silver/bmp-48.png +0 -0
- icons/silver/bmp-64.png +0 -0
- icons/silver/default-32.png +0 -0
- icons/silver/default-48.png +0 -0
- icons/silver/default-64.png +0 -0
- icons/silver/divx-32.png +0 -0
- icons/silver/divx-48.png +0 -0
- icons/silver/divx-64.png +0 -0
- icons/silver/doc-32.png +0 -0
- icons/silver/doc-48.png +0 -0
- icons/silver/doc-64.png +0 -0
- icons/silver/gif-32.png +0 -0
- icons/silver/gif-48.png +0 -0
- icons/silver/gif-64.png +0 -0
- icons/silver/jpg-32.png +0 -0
- icons/silver/jpg-48.png +0 -0
- icons/silver/jpg-64.png +0 -0
- icons/silver/m4a-32.png +0 -0
- icons/silver/m4a-48.png +0 -0
- icons/silver/m4a-64.png +0 -0
- icons/silver/midi-32.png +0 -0
- icons/silver/midi-48.png +0 -0
- icons/silver/midi-64.png +0 -0
- icons/silver/mov-32.png +0 -0
- icons/silver/mov-48.png +0 -0
- icons/silver/mov-64.png +0 -0
- icons/silver/mp3-32.png +0 -0
- icons/silver/mp3-48.png +0 -0
- icons/silver/mp3-64.png +0 -0
- icons/silver/mp4-32.png +0 -0
- icons/silver/mp4-48.png +0 -0
- icons/silver/mp4-64.png +0 -0
- icons/silver/mpc-32.png +0 -0
- icons/silver/mpc-48.png +0 -0
- icons/silver/mpc-64.png +0 -0
- icons/silver/mpg-32.png +0 -0
- icons/silver/mpg-48.png +0 -0
- icons/silver/mpg-64.png +0 -0
- icons/silver/ogg-32.png +0 -0
- icons/silver/ogg-48.png +0 -0
- icons/silver/ogg-64.png +0 -0
- icons/silver/pdf-32.png +0 -0
- icons/silver/pdf-48.png +0 -0
- icons/silver/pdf-64.png +0 -0
- icons/silver/png-32.png +0 -0
- icons/silver/png-48.png +0 -0
- icons/silver/png-64.png +0 -0
- icons/silver/ppt-32.png +0 -0
- icons/silver/ppt-48.png +0 -0
- icons/silver/ppt-64.png +0 -0
- icons/silver/psd-32.png +0 -0
- icons/silver/psd-48.png +0 -0
- icons/silver/psd-64.png +0 -0
- icons/silver/ra-32.png +0 -0
- icons/silver/ra-48.png +0 -0
- icons/silver/ra-64.png +0 -0
- icons/silver/rm-32.png +0 -0
- icons/silver/rm-48.png +0 -0
- icons/silver/rm-64.png +0 -0
- icons/silver/rtf-32.png +0 -0
- icons/silver/rtf-48.png +0 -0
- icons/silver/rtf-64.png +0 -0
- icons/silver/svg-32.png +0 -0
- icons/silver/svg-48.png +0 -0
- icons/silver/svg-64.png +0 -0
- icons/silver/tex-32.png +0 -0
- icons/silver/tex-48.png +0 -0
- icons/silver/tex-64.png +0 -0
- icons/silver/text-32.png +0 -0
- icons/silver/text-48.png +0 -0
- icons/silver/text-64.png +0 -0
- icons/silver/tga-32.png +0 -0
- icons/silver/tga-48.png +0 -0
- icons/silver/tga-64.png +0 -0
- icons/silver/tiff-32.png +0 -0
- icons/silver/tiff-48.png +0 -0
- icons/silver/tiff-64.png +0 -0
- icons/silver/wav-32.png +0 -0
- icons/silver/wav-48.png +0 -0
- icons/silver/wav-64.png +0 -0
- icons/silver/wma-32.png +0 -0
- icons/silver/wma-48.png +0 -0
- icons/silver/wma-64.png +0 -0
- icons/silver/wmv-32.png +0 -0
- icons/silver/wmv-48.png +0 -0
- icons/silver/wmv-64.png +0 -0
- icons/silver/xls-32.png +0 -0
- icons/silver/xls-48.png +0 -0
- icons/silver/xls-64.png +0 -0
- icons/white/default-32.png +0 -0
- icons/white/default-48.png +0 -0
- icons/white/default-64.png +0 -0
- icons/white/doc-32.png +0 -0
- icons/white/doc-48.png +0 -0
- icons/white/doc-64.png +0 -0
- icons/white/pdf-32.png +0 -0
- icons/white/pdf-48.png +0 -0
- icons/white/pdf-64.png +0 -0
- icons/white/tmp-32.png +0 -0
- icons/white/tmp-48.png +0 -0
- icons/white/tmp-64.png +0 -0
- icons/white/txt-32.png +0 -0
- icons/white/txt-48.png +0 -0
- icons/white/txt-64.png +0 -0
- icons/white/xls-32.png +0 -0
- icons/white/xls-48.png +0 -0
- icons/white/xls-64.png +0 -0
- icons/white/xml-32.png +0 -0
- icons/white/xml-48.png +0 -0
- icons/white/xml-64.png +0 -0
- images/Thumbs.db +0 -0
- images/mail.png +0 -0
- images/menu-bits.gif +0 -0
- images/valid-xhtml10-blue.png +0 -0
- images/vcss-blue.gif +0 -0
- js/simpleTabs.jquery.js +74 -0
- mimedecode.php +133 -115
- postie-functions.php +1177 -1188
- postie.php +39 -5
- postieIMAP.php +15 -7
- postie_read_me.php +0 -7
- postie_test.php +1 -110
- readme.html +182 -0
- readme.txt +480 -355
- screenshot-1.png +0 -0
- templates/audio_templates.php +12 -0
- templates/funky.mp3 +0 -0
- templates/hi.flv +0 -0
- templates/hi.mp4 +0 -0
- templates/image_templates.php +14 -0
- templates/smiling-1024x682.jpg +0 -0
- templates/smiling-150x150.jpg +0 -0
- templates/smiling-300x200.jpg +0 -0
- templates/smiling.jpg +0 -0
- templates/video1_templates.php +83 -0
- templates/video2_templates.php +84 -0
- test_files/Test.gif +0 -0
- test_files/Test.jpg +0 -0
- test_files/Test.png +0 -0
HISTORY
DELETED
@@ -1,300 +0,0 @@
|
|
1 |
-
-= History =-
|
2 |
-
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.
|
3 |
-
|
4 |
-
John didn't release any more versions at least up til July 2005. So I started accepting submissions and feature requests from people to help make the code better. In June/July 2005 I discovered a little plugin by Chris J Davis (http://www.chrisjdavis.org/cjd-notepad/) called notepad. I added a small feature to it (basically a bookmarklet). In the process I started looking at his code and realized how much you could do with the plugin system available in Word Press.
|
5 |
-
|
6 |
-
So I decided to make an offical fork. I put up an article on my blog asking for new names. I picked Postie. I then modified the code to be a proper plugin. And the rest is history :)
|
7 |
-
|
8 |
-
Version 1.1.2 (robfelty@gmail.com) 2008.07.12
|
9 |
-
- allow negative delays
|
10 |
-
- will glean author information from forwarded or redirected e-mails
|
11 |
-
- replying to an e-mail adds a comment to a post
|
12 |
-
- fixed category handling to work with taxonomy
|
13 |
-
- fixed one syntax error
|
14 |
-
- added option to wrap posts and comments in <pre> tags
|
15 |
-
|
16 |
-
Version 1.1.1
|
17 |
-
BUGFIX -problem with subject
|
18 |
-
BUGFIX -cronless postie typo
|
19 |
-
|
20 |
-
Version 1.1
|
21 |
-
FEATURE: Updated and tested with WordPress 2.1
|
22 |
-
BUGFIX:Removed deprecated functions
|
23 |
-
FEATURE: Cronless Postie now uses the WordPress native Psuedo Cron.
|
24 |
-
|
25 |
-
Version 1.0
|
26 |
-
BUGFIX: TestWPVersion broke with 2.1
|
27 |
-
FEATURE: end: now marks the end of a message (Dan Cunningham)
|
28 |
-
FEATURE: Better Readme (Michael Rasmussen)
|
29 |
-
FEATURE: Smart Sharpen Option -EXPERIMENTAL- (Jonas Rhodin)
|
30 |
-
BUGFIX: Issue with google imap fixed (Jim Hodgson)
|
31 |
-
BUGFIX: Fixed espacing issue in subjects (Paul Clip)
|
32 |
-
BUGFIX: Typo in Div fixed (phil)
|
33 |
-
|
34 |
-
Version 0.9.9.3.2
|
35 |
-
BUGFIX: Typo
|
36 |
-
Version 0.9.9.3.1
|
37 |
-
BUGFIX: Removed debugging code
|
38 |
-
|
39 |
-
Version 0.9.9.3
|
40 |
-
BUGFIX: If your email address matches an existing user - then it will post as that user - even if you allow anyone to post.
|
41 |
-
BUGFIX: Replaced get_settings('home') with get_settings('siteurl')
|
42 |
-
BUGFIX: Better handling for Japanese charactersets - Thanks to http://www.souzouzone.jp/blog/archives/009531.html
|
43 |
-
BUGFIX: Better thumbnail window opening code - thanks to Gabi & Duntello!
|
44 |
-
FEATURE: Added an option to set the MAX Height of an image - idea from Duntello
|
45 |
-
BUGFIX: Modified the FilterNewLines for better flowed text handling - You now HAVE TO PUT TWO NEW LINES to end a paragraph.
|
46 |
-
FEATURE: Added new CSS tags to support positioning images/attachments/3gp videos
|
47 |
-
BUGFIX: Tries to use the date in the message (Thanks Ravan) I tried this once before and it never worked - hopefully this time it will.
|
48 |
-
BUGFIX: Added a workaround to fix the problem with Subscribe2 - it will now notify on posts that are not set to show up in the future.
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
Version 0.9.9.2
|
53 |
-
BUGFIX: Looks for the NOOP error and disgards it
|
54 |
-
FEATURE: Postie now detects the version of WordPress being used
|
55 |
-
FEATURE: Smarter Parsing of VodaPhone
|
56 |
-
FEATURE: Easy place to add new code to handle other brain-dead mail clients
|
57 |
-
BUGFIX: Handles insertion of single quotes properly
|
58 |
-
BUGFIX: Thumbnails should now link properly
|
59 |
-
|
60 |
-
Version 0.9.9.1
|
61 |
-
BUGFIX: Needed a strtolower in places to catch all iso-8859 - thx to Gitte Wange for the catch
|
62 |
-
BUGFIX: Fixed issue with the category not being posted properly
|
63 |
-
|
64 |
-
Version 0.9.9
|
65 |
-
UPDATE TO WP 2.0
|
66 |
-
BUGFIX: Config Page now works
|
67 |
-
FEATURES: Supports role based posting
|
68 |
-
BUGFIX: Posting updates the category counts.
|
69 |
-
|
70 |
-
Version 0.9.8.6
|
71 |
-
BUGFIX: Fixed problems with config page <%php became <?php
|
72 |
-
|
73 |
-
Version 0.9.8.5
|
74 |
-
BUGFIX: onClick changed to onclick
|
75 |
-
BUGFIX: strolower added to test for iso - thanks daniele
|
76 |
-
BUGFIX: Added a class to the 3gp video tags
|
77 |
-
FEATURE: Added the option to put the images before the article
|
78 |
-
BUGFIX: Added in selection for charsets - thanks Psykotik - this may cause problems for other encodings
|
79 |
-
FEATURE: Added option to turn of quoted printable decoding
|
80 |
-
FEATURE: :start tag - now postie looks for this tag before looking for you message - handy if your service provider prepends a message
|
81 |
-
FEATURE: Template for translation now included
|
82 |
-
Version 0.9.8.4
|
83 |
-
BUGFIX: Fixed problem with config_form.php - select had "NULL" instead of ""
|
84 |
-
BUGFIX: 3g2 now supported
|
85 |
-
BUGFIX: More line break issues addressed
|
86 |
-
BUGFIX: QuickTime controls are now visible even if the movie is done playing
|
87 |
-
BUGFIX: Email addresses in the format <some@domain.com> (Full Name) supported
|
88 |
-
BUGFIX: Some images that were not being resized - are now
|
89 |
-
BUGFIX: HTML problems - if you posted plain text with HTML on it ignored all images
|
90 |
-
BUGFIX: The test system blew up on the thumbnails
|
91 |
-
BUGFIX: Selected HTML for preferred text is now shown in the config form properly
|
92 |
-
BUGFIX: Postie now complains if it is not in its own directory
|
93 |
-
BUGFIX: Postie doesn't include PEAR if it is already available
|
94 |
-
BUGFIX: In Test mode rejected emails are simply dropped
|
95 |
-
BUGFIX: Markdown messes up Postie - it will warn you if you turn it on.
|
96 |
-
|
97 |
-
Version 0.9.8.3
|
98 |
-
BUGFIX: Fixed issue with the line feed replacement
|
99 |
-
BUGFIX: Added Banned File Config back in
|
100 |
-
FEATURE: Added in a link around 3gp video embedded via QT
|
101 |
-
BUGFIX: Email that has both Plain and HTML content will show the HTML content and not the plain if html is preferred
|
102 |
-
|
103 |
-
Version 0.9.8.2
|
104 |
-
BUGFIX: Fixed an extra new line after attachin non-image files.
|
105 |
-
BUGFIX: The Test system now displays any missing gd functions
|
106 |
-
BUGFIX: The test system was only using ImageMagick
|
107 |
-
|
108 |
-
Version 0.9.8.1
|
109 |
-
BUGFIX: The test images are now included in the zip
|
110 |
-
|
111 |
-
Version 0.9.8
|
112 |
-
BUGFIX: New Lines detected and handled properly in cases where the mail client doesn't put a space before the new line (Miss Distance)
|
113 |
-
BUGFIX: 3gp mime type added (Paco Cotera)
|
114 |
-
BUGFIX: Authorized Email Addresses are not case-insensitive
|
115 |
-
FEATURE: The larger image now does a proper pop up
|
116 |
-
BUGFIX: Fixed Timeing Issue - turns out it wasn't reading the db at all
|
117 |
-
FEATURE: New Test Screen - to help track down problems
|
118 |
-
|
119 |
-
Version 0.9.7
|
120 |
-
BUGFIX: removed all short tags
|
121 |
-
BUGFIX: There were spacing issues in the way I wrote the QT embed statements
|
122 |
-
FEATURE: Added calls to WP-Cron - should work with that properly now if you activate Cronless Postie
|
123 |
-
FEATURE: ImageMagick version works without any calls to GD
|
124 |
-
BUGFIX: Postie now correctly handles cases wjere tjere are multiple blogs in one db
|
125 |
-
BUGFIX: Turned off warnings when using without GD
|
126 |
-
FEATURE: add the rotate:X to your message to rotate all images
|
127 |
-
FEATURE: new filter_postie_thumbnail_with_full which makes it easy to show a thumbnail on the front page but full image on the single page - see FAQ
|
128 |
-
|
129 |
-
Version 0.9.6
|
130 |
-
BUGFIX: handles email addresses that are no name and just <email@email.com> (Steve Cooley Reported)
|
131 |
-
FEATURE: Basic support for embedding flash files
|
132 |
-
BUGFIX: Postie now handles creating the correct URL on non Unix platforms
|
133 |
-
BUGFIX: Fixed problem with file attachments not being put in the right place.
|
134 |
-
FEATURE: You can now choose to use imagemagick convert to handle making thumbnails
|
135 |
-
BUGFIX: Rewrote Cronless Postie to use direct sockets
|
136 |
-
BUGFIX: Time offset is now settable just for Postie - hopefully this will fix problems for cases where the normal time offset doesn't work properly.
|
137 |
-
FEATURE: First draft of frame for a 3GP video
|
138 |
-
FEATURE: Option to embed 3GP in QuickTime Controller.
|
139 |
-
|
140 |
-
Version 0.9.5.2
|
141 |
-
BUGFIX: gmt varialble not being set correctly
|
142 |
-
BUGFIX: Changed the name of the Check Mail button to fix an issue with mod_security
|
143 |
-
BUGFIX: Fixed issue with Cronless-Postie
|
144 |
-
BUGFIX: There was an argument passed by reference incorrectly
|
145 |
-
FEATURE: Added in Cronless Postie Readme
|
146 |
-
FEATURE: Added in Postie Readme
|
147 |
-
|
148 |
-
Version 0.9.5.1
|
149 |
-
BUGFIX: Confirmed POP3-SSL on debian-3.0
|
150 |
-
BUGFIX: Updated the plugin version
|
151 |
-
BUGFIX: Stopped displaying the email account
|
152 |
-
|
153 |
-
Version 0.9.5
|
154 |
-
BUGFIX: Postie handles cases where you do not have GD
|
155 |
-
FEATURE: You can now set the access level for posting - so other people can use the gate way
|
156 |
-
BUGFIX: Fixed issue when admininstrator email is not tied to a user account.
|
157 |
-
FEATURE: Can now reset all Postie configurations back to defaults
|
158 |
-
BUGFIX: HTML Emails with embedded images are now handled properly.
|
159 |
-
BUGFIX: The time difference should work correctly now
|
160 |
-
BUGFIX: Postie's configs are completely seperate from Writing-By-Mail
|
161 |
-
FEATURE: Warning if you use Gmail to make sure you turn on POP support
|
162 |
-
BUGFIX: Manual Check Mail Button in interface
|
163 |
-
BUGFIX: fixed issue of compatability with cjd-notepad
|
164 |
-
BUGFIX: Windows Works Now
|
165 |
-
|
166 |
-
|
167 |
-
Version 0.9.4
|
168 |
-
BUGFIX: Cronless Postie - fixed the include statement
|
169 |
-
BUGFIX: Authorized Addresses now supports a single address
|
170 |
-
FEATURE: All configuration in Postie done in a single screen
|
171 |
-
FEATURE: AUTHORIZATION can be completely overridden
|
172 |
-
BUGFIX: line 1159 - didn't handle cases where the table didn't exist already very well
|
173 |
-
FEATURE: Detects if you can do IMAP
|
174 |
-
FEATURE: Added IMAP Support
|
175 |
-
FEATURE: Added IMAP-SSL Support
|
176 |
-
FEATURE: Added POP3-SSL Support
|
177 |
-
|
178 |
-
Version 0.9.3
|
179 |
-
Bug fixes for IIS
|
180 |
-
Version 0.9.2
|
181 |
-
Moved to more of a DIRECTORY_SEPARATOR structure
|
182 |
-
Version 0.9.1
|
183 |
-
Added a define to fix a problem with over including
|
184 |
-
Version 0.9
|
185 |
-
Converted to an honest to god plugin
|
186 |
-
BUGFIX: If you put a single category:subject it now works
|
187 |
-
BUGFIX: ? Special characters may be supported? The test post now shows a lot of umlats and accents?
|
188 |
-
BUGFIX: The last ] in a subject with categories is now filtered out
|
189 |
-
FEATURE: -1- subject - will put the post in category 1
|
190 |
-
Version 0.312.13
|
191 |
-
Code clean up - The main loop is finally readable by even non programmers
|
192 |
-
FEATURE - You can now post to multiple categories at one time by using the [#],[Category Name], [Cat] in the subject
|
193 |
-
FEATURE - You can now select a category by just including the begining characters [G] will select General
|
194 |
-
if you don't have any other categories that start with g
|
195 |
-
FEATURE - Jay Talbot - added a new feature so you can have multiple email addresses be allowed in
|
196 |
-
Make multi category posting more obvious
|
197 |
-
BUG FIX: Timezones of GMT+? should now work properly
|
198 |
-
BUG FIX: Able to handle mis-mime typed images as long as they are named with .jpg/.gif/.png
|
199 |
-
|
200 |
-
Version 0.312.12
|
201 |
-
Code clean up - slowing shrinking the main to make it easiery to fix things
|
202 |
-
FEATURE: Be able to turn on/off allowing comments in an email
|
203 |
-
BUG FIX: AppleDouble now mostly supported
|
204 |
-
BUG FIX: MIME handling improved.
|
205 |
-
BUG FIX: Fix issue with timing delay
|
206 |
-
Version 0.312.11
|
207 |
-
FEATURE: Patterns to define where a sig starts are user configurable
|
208 |
-
FEATURE: Add filter options for banned file names
|
209 |
-
BUG FIX: Made it possible to turn off posting to the db for testing purposes
|
210 |
-
Version 0.312.10
|
211 |
-
FEATURE: Added in code to diplay the mime type of the file being linked to
|
212 |
-
BUG FIX: It now tests for the existance of the directories and makes sure
|
213 |
-
that the web server can write to them
|
214 |
-
Version 0.312.9
|
215 |
-
FEATURE:Should handle jpg as well as jpeg as the file type
|
216 |
-
BUG FIX: Now correctly handles the subject in the message
|
217 |
-
BUG FIX: Should handle Text preferences correctly
|
218 |
-
Version 0.312.8
|
219 |
-
Some general code tidying.
|
220 |
-
FEATURE: Can now have email from invalid email addresses automatically forwared
|
221 |
-
to the admin's email account. This forward includes all attachments.
|
222 |
-
Props to David Luden for getting this started.
|
223 |
-
Minor change: The system will continue if it runs into a message that doesn't have
|
224 |
-
any content - it will also continue to process if it gets an email from
|
225 |
-
someone not in the system. In the past this could result in deleted mail
|
226 |
-
if your cron job didn't run often enough.
|
227 |
-
Version 0.312.7
|
228 |
-
Confirm the handling of 3gp video for cell phones o
|
229 |
-
Added in new directive SUPPORTED_FILE_TYPES -if the mime type is listed here then the system will try to make a link to it without making a thumb nail.
|
230 |
-
Version 0.312.6
|
231 |
-
Bug Fix: Ok the last bug I fixed - actually caused another bug - man I should set up some unit tests. Now it handles mail from the nokia mail client correctly.
|
232 |
-
Version 0.312.5
|
233 |
-
Bug Fix : The system was accepting all test/* types. Now you can set a preference (defaults to text/plain)
|
234 |
-
to use as the main text for the post.
|
235 |
-
Version 0.312.4
|
236 |
-
Added in sanitize_title call suggested by Jemima
|
237 |
-
Added in ability to provide a subject in an mms - by using #Subject#
|
238 |
-
Fixed an issue with the time stamp system so it now automatically uses the gmt_offset from WordPress
|
239 |
-
Fixed issue with the delay:1d1h tag that prevented it from being removed from the body.
|
240 |
-
Fixed issue with the delay tag that caused problems if it was the last thing before an image.
|
241 |
-
|
242 |
-
Version 0.312.3-HEY (2005-05)
|
243 |
-
-> Some changes and Bugfixes by Adrian Heydecker
|
244 |
-
-> Not (yet) in main development branch.
|
245 |
-
Fixed bug: JPEG-thumbnails had a bigger filesize than full images caused by bad hardcoded compression value.
|
246 |
-
Fixed bug: If images and signatures were present but no placeholder tags, the images were deleted together with the signature.
|
247 |
-
Fixed bug: Generates valid postnames for users of mod_rewrite. Permalinks to posts should now work even when whitespaces are present in the subject line.
|
248 |
-
Added support for Quoted Printable encoded mail.
|
249 |
-
Added ability to encode Wordpress-posts in charset ISO-8859-1 instead of UTF-8.
|
250 |
-
Added ability to choose JPEG-compression value for thumbnails.
|
251 |
-
Added ability to add class="" and style="" to images.
|
252 |
-
Added ability to use a different mailadress (eg. mobile) without setting up a new Wordpress-account.
|
253 |
-
|
254 |
-
Version 0.312.2
|
255 |
-
BUGFIX: It now removes the delay tag from the message
|
256 |
-
Version 0.312.1
|
257 |
-
Added modification for placeholder support for images (David Luden)
|
258 |
-
Added in support to automatically scale down big images (Dirk Elmendorf)
|
259 |
-
Fixed bug with multiple emails all getting the contents of the first image tag (Dirk Elmendorf)
|
260 |
-
Added option to allow HTML in the body and subject of the email (Dirk Elmendorf)
|
261 |
-
Switch config options to defines to reduce the number of global variables (Dirk Elmendorf)
|
262 |
-
Added tests to make sure there is a trailing slash on the DIR definitions (Dirk Elmendorf)
|
263 |
-
Add tests to see if they have gd installed (Dirk Elmendorf)
|
264 |
-
Seperate the scaling out to a function for easier usage (Dirk Elmendorf)
|
265 |
-
Add delay feature for future posting. (Dirk Elmendorf)
|
266 |
-
Added in ability to use strtotime if it is available (Dirk ELmendorf)
|
267 |
-
|
268 |
-
Todo
|
269 |
-
Have option to have the email that is rejected forwarded on to another address.
|
270 |
-
Fix bug that id still diplays the delay tag in the body
|
271 |
-
Version 0.312 - 2005-03
|
272 |
-
- CHANGE FOR DEFAULT E-mail Categories, instead of [General] Subject you can now use General: Subject in the subject line. Less typing, and there must be a space after the colon.
|
273 |
-
- Fixed bugs with no default posting for categories and user
|
274 |
-
Version 0.311 - 2005-01
|
275 |
-
- eep, major bug for pop3 server. Next time I test my code more before I released, fixed so that pop3 now works.`
|
276 |
-
Version 0.31 - 2004-12 & 2005-01
|
277 |
-
(Has it been this long, best get back into the swing of things... did most of this coding on my holiday as I didn't have a machine to play WoW on :)
|
278 |
-
- moved the deletion of pop3 emails into a check so that e-mails aren't deleted without proper checking.
|
279 |
-
- added HTML 'decoding' (basic support for Thunderbird & Outlook)
|
280 |
-
- updated the Category search so that it matches words as well as numbers (i.e. [General] Subjectname will work instead of just [1] Subjectname)
|
281 |
-
- Changed time function from time to strtotime (as per Senior Pez's suggestion), but found out that strtotime isn't in default php distro so removed...
|
282 |
-
|
283 |
-
Vesion 0.3 - 2004-09
|
284 |
-
- Added UBB decoding support
|
285 |
-
- Added default title (when there is no subject assigned)
|
286 |
-
- Started doing a little code cleanup, been reading Advanced PHP Book :)
|
287 |
-
|
288 |
-
Version 0.2 - 2004-08
|
289 |
-
- Stopped using pear body decoding in favour of own decoding (may be slower but more modifiable) because of enriched text decoding
|
290 |
-
- Added base64_decode checking (may help mobile phone users)
|
291 |
-
- Fixed Subject line for non-english users (htmlentities instead of just trim)
|
292 |
-
- Fixed error in some pop hanging -> more graceful exit on event on no emails in inbox ($pop3->quit)
|
293 |
-
- Added work around for email addresses with exta <> in field (ie: <blade@lansmash.com> instead of blade@lasmash.com
|
294 |
-
- Added some ===basic=== enriched text support
|
295 |
-
- Updated readme file for easier install
|
296 |
-
- Easy modify of globals (such as PHOTOSDIR and FILESDIR)
|
297 |
-
- Cleaned up some pear stuff in install
|
298 |
-
|
299 |
-
Version 0.1 - 2004-06
|
300 |
-
First release
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PEAR.php
CHANGED
@@ -1,26 +1,27 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
// $Id: PEAR.php,v 1.1 2005/01/28 02:20:39 johnhewitt Exp $
|
22 |
-
//
|
23 |
|
|
|
|
|
|
|
24 |
define('PEAR_ERROR_RETURN', 1);
|
25 |
define('PEAR_ERROR_PRINT', 2);
|
26 |
define('PEAR_ERROR_TRIGGER', 4);
|
@@ -31,6 +32,7 @@ define('PEAR_ERROR_CALLBACK', 16);
|
|
31 |
* @deprecated
|
32 |
*/
|
33 |
define('PEAR_ERROR_EXCEPTION', 32);
|
|
|
34 |
define('PEAR_ZE2', (function_exists('version_compare') &&
|
35 |
version_compare(zend_version(), "2-dev", "ge")));
|
36 |
|
@@ -44,22 +46,13 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
|
|
44 |
define('PEAR_OS', 'Unix'); // blatant assumption
|
45 |
}
|
46 |
|
47 |
-
// instant backwards compatibility
|
48 |
-
if (!defined('PATH_SEPARATOR')) {
|
49 |
-
if (OS_WINDOWS) {
|
50 |
-
define('PATH_SEPARATOR', ';');
|
51 |
-
} else {
|
52 |
-
define('PATH_SEPARATOR', ':');
|
53 |
-
}
|
54 |
-
}
|
55 |
-
|
56 |
$GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN;
|
57 |
$GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE;
|
58 |
$GLOBALS['_PEAR_destructor_object_list'] = array();
|
59 |
$GLOBALS['_PEAR_shutdown_funcs'] = array();
|
60 |
$GLOBALS['_PEAR_error_handler_stack'] = array();
|
61 |
|
62 |
-
ini_set('track_errors', true);
|
63 |
|
64 |
/**
|
65 |
* Base class for other PEAR classes. Provides rudimentary
|
@@ -78,9 +71,18 @@ ini_set('track_errors', true);
|
|
78 |
* IMPORTANT! To use the emulated destructors you need to create the
|
79 |
* objects by reference: $obj =& new PEAR_child;
|
80 |
*
|
81 |
-
* @
|
82 |
-
* @
|
83 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
*/
|
85 |
class PEAR
|
86 |
{
|
@@ -152,18 +154,22 @@ class PEAR
|
|
152 |
*/
|
153 |
function PEAR($error_class = null)
|
154 |
{
|
155 |
-
$classname = get_class($this);
|
156 |
if ($this->_debug) {
|
157 |
print "PEAR constructor called, class=$classname\n";
|
158 |
}
|
159 |
if ($error_class !== null) {
|
160 |
$this->_error_class = $error_class;
|
161 |
}
|
162 |
-
while ($classname) {
|
163 |
$destructor = "_$classname";
|
164 |
if (method_exists($this, $destructor)) {
|
165 |
global $_PEAR_destructor_object_list;
|
166 |
$_PEAR_destructor_object_list[] = &$this;
|
|
|
|
|
|
|
|
|
167 |
break;
|
168 |
} else {
|
169 |
$classname = get_parent_class($classname);
|
@@ -187,7 +193,7 @@ class PEAR
|
|
187 |
*/
|
188 |
function _PEAR() {
|
189 |
if ($this->_debug) {
|
190 |
-
printf("PEAR destructor called, class=%s\n", get_class($this));
|
191 |
}
|
192 |
}
|
193 |
|
@@ -209,6 +215,14 @@ class PEAR
|
|
209 |
function &getStaticProperty($class, $var)
|
210 |
{
|
211 |
static $properties;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
return $properties[$class][$var];
|
213 |
}
|
214 |
|
@@ -226,6 +240,12 @@ class PEAR
|
|
226 |
*/
|
227 |
function registerShutdownFunc($func, $args = array())
|
228 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
$GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
|
230 |
}
|
231 |
|
@@ -245,16 +265,17 @@ class PEAR
|
|
245 |
*/
|
246 |
function isError($data, $code = null)
|
247 |
{
|
248 |
-
if (is_a($data, 'PEAR_Error')) {
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
}
|
257 |
-
|
|
|
258 |
}
|
259 |
|
260 |
// }}}
|
@@ -422,7 +443,6 @@ class PEAR
|
|
422 |
function delExpect($error_code)
|
423 |
{
|
424 |
$deleted = false;
|
425 |
-
|
426 |
if ((is_array($error_code) && (0 != count($error_code)))) {
|
427 |
// $error_code is a non-empty array here;
|
428 |
// we walk through it trying to unset all
|
@@ -442,10 +462,10 @@ class PEAR
|
|
442 |
} else {
|
443 |
return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
|
444 |
}
|
445 |
-
} else {
|
446 |
-
// $error_code is empty
|
447 |
-
return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME
|
448 |
}
|
|
|
|
|
|
|
449 |
}
|
450 |
|
451 |
// }}}
|
@@ -488,7 +508,7 @@ class PEAR
|
|
488 |
* @see PEAR::setErrorHandling
|
489 |
* @since PHP 4.0.5
|
490 |
*/
|
491 |
-
function raiseError($message = null,
|
492 |
$code = null,
|
493 |
$mode = null,
|
494 |
$options = null,
|
@@ -512,6 +532,7 @@ class PEAR
|
|
512 |
$mode = PEAR_ERROR_RETURN;
|
513 |
}
|
514 |
}
|
|
|
515 |
// No mode given, try global ones
|
516 |
if ($mode === null) {
|
517 |
// Class error handler
|
@@ -532,11 +553,20 @@ class PEAR
|
|
532 |
} else {
|
533 |
$ec = 'PEAR_Error';
|
534 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
535 |
if ($skipmsg) {
|
536 |
-
|
537 |
} else {
|
538 |
-
|
539 |
}
|
|
|
|
|
540 |
}
|
541 |
|
542 |
// }}}
|
@@ -549,18 +579,91 @@ class PEAR
|
|
549 |
* @param string $message
|
550 |
*
|
551 |
*/
|
552 |
-
function throwError($message = null,
|
553 |
$code = null,
|
554 |
$userinfo = null)
|
555 |
{
|
556 |
if (isset($this) && is_a($this, 'PEAR')) {
|
557 |
-
|
558 |
-
|
559 |
-
return PEAR::raiseError($message, $code, null, null, $userinfo);
|
560 |
}
|
|
|
|
|
|
|
561 |
}
|
562 |
|
563 |
// }}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
564 |
// {{{ pushErrorHandling()
|
565 |
|
566 |
/**
|
@@ -637,6 +740,7 @@ class PEAR
|
|
637 |
if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) {
|
638 |
return false;
|
639 |
}
|
|
|
640 |
if (OS_WINDOWS) {
|
641 |
$suffix = '.dll';
|
642 |
} elseif (PHP_OS == 'HP-UX') {
|
@@ -648,14 +752,20 @@ class PEAR
|
|
648 |
} else {
|
649 |
$suffix = '.so';
|
650 |
}
|
|
|
651 |
return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix);
|
652 |
}
|
|
|
653 |
return true;
|
654 |
}
|
655 |
|
656 |
// }}}
|
657 |
}
|
658 |
|
|
|
|
|
|
|
|
|
659 |
// {{{ _PEAR_call_destructors()
|
660 |
|
661 |
function _PEAR_call_destructors()
|
@@ -665,6 +775,16 @@ function _PEAR_call_destructors()
|
|
665 |
sizeof($_PEAR_destructor_object_list))
|
666 |
{
|
667 |
reset($_PEAR_destructor_object_list);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
668 |
while (list($k, $objref) = each($_PEAR_destructor_object_list)) {
|
669 |
$classname = get_class($objref);
|
670 |
while ($classname) {
|
@@ -691,7 +811,23 @@ function _PEAR_call_destructors()
|
|
691 |
}
|
692 |
|
693 |
// }}}
|
694 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
695 |
class PEAR_Error
|
696 |
{
|
697 |
// {{{ properties
|
@@ -737,8 +873,18 @@ class PEAR_Error
|
|
737 |
$this->code = $code;
|
738 |
$this->mode = $mode;
|
739 |
$this->userinfo = $userinfo;
|
740 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
741 |
$this->backtrace = debug_backtrace();
|
|
|
|
|
|
|
742 |
}
|
743 |
if ($mode & PEAR_ERROR_CALLBACK) {
|
744 |
$this->level = E_USER_NOTICE;
|
@@ -779,8 +925,8 @@ class PEAR_Error
|
|
779 |
}
|
780 |
}
|
781 |
if ($this->mode & PEAR_ERROR_EXCEPTION) {
|
782 |
-
trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class
|
783 |
-
eval('$e = new Exception($this->message, $this->code)
|
784 |
}
|
785 |
}
|
786 |
|
@@ -895,6 +1041,9 @@ class PEAR_Error
|
|
895 |
*/
|
896 |
function getBacktrace($frame = null)
|
897 |
{
|
|
|
|
|
|
|
898 |
if ($frame === null) {
|
899 |
return $this->backtrace;
|
900 |
}
|
@@ -913,6 +1062,12 @@ class PEAR_Error
|
|
913 |
}
|
914 |
}
|
915 |
|
|
|
|
|
|
|
|
|
|
|
|
|
916 |
// }}}
|
917 |
// {{{ toString()
|
918 |
|
@@ -929,14 +1084,16 @@ class PEAR_Error
|
|
929 |
E_USER_ERROR => 'error');
|
930 |
if ($this->mode & PEAR_ERROR_CALLBACK) {
|
931 |
if (is_array($this->callback)) {
|
932 |
-
$callback =
|
|
|
|
|
933 |
$this->callback[1];
|
934 |
} else {
|
935 |
$callback = $this->callback;
|
936 |
}
|
937 |
return sprintf('[%s: message="%s" code=%d mode=callback '.
|
938 |
'callback=%s prefix="%s" info="%s"]',
|
939 |
-
get_class($this), $this->message, $this->code,
|
940 |
$callback, $this->error_message_prefix,
|
941 |
$this->userinfo);
|
942 |
}
|
@@ -954,7 +1111,7 @@ class PEAR_Error
|
|
954 |
}
|
955 |
return sprintf('[%s: message="%s" code=%d mode=%s level=%s '.
|
956 |
'prefix="%s" info="%s"]',
|
957 |
-
get_class($this), $this->message, $this->code,
|
958 |
implode("|", $modes), $levels[$this->level],
|
959 |
$this->error_message_prefix,
|
960 |
$this->userinfo);
|
@@ -963,13 +1120,10 @@ class PEAR_Error
|
|
963 |
// }}}
|
964 |
}
|
965 |
|
966 |
-
register_shutdown_function("_PEAR_call_destructors");
|
967 |
-
|
968 |
/*
|
969 |
* Local Variables:
|
970 |
* mode: php
|
971 |
* tab-width: 4
|
972 |
* c-basic-offset: 4
|
973 |
* End:
|
974 |
-
*/
|
975 |
-
?>
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
* PEAR, the PHP Extension and Application Repository
|
4 |
+
*
|
5 |
+
* PEAR class and PEAR_Error class
|
6 |
+
*
|
7 |
+
* PHP versions 4 and 5
|
8 |
+
*
|
9 |
+
* @category pear
|
10 |
+
* @package PEAR
|
11 |
+
* @author Sterling Hughes <sterling@php.net>
|
12 |
+
* @author Stig Bakken <ssb@php.net>
|
13 |
+
* @author Tomas V.V.Cox <cox@idecnet.com>
|
14 |
+
* @author Greg Beaver <cellog@php.net>
|
15 |
+
* @copyright 1997-2009 The Authors
|
16 |
+
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
17 |
+
* @version CVS: $Id: PEAR.php,v 1.112 2009/04/15 04:05:13 dufuz Exp $
|
18 |
+
* @link http://pear.php.net/package/PEAR
|
19 |
+
* @since File available since Release 0.1
|
20 |
+
*/
|
|
|
|
|
21 |
|
22 |
+
/**#@+
|
23 |
+
* ERROR constants
|
24 |
+
*/
|
25 |
define('PEAR_ERROR_RETURN', 1);
|
26 |
define('PEAR_ERROR_PRINT', 2);
|
27 |
define('PEAR_ERROR_TRIGGER', 4);
|
32 |
* @deprecated
|
33 |
*/
|
34 |
define('PEAR_ERROR_EXCEPTION', 32);
|
35 |
+
/**#@-*/
|
36 |
define('PEAR_ZE2', (function_exists('version_compare') &&
|
37 |
version_compare(zend_version(), "2-dev", "ge")));
|
38 |
|
46 |
define('PEAR_OS', 'Unix'); // blatant assumption
|
47 |
}
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
$GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN;
|
50 |
$GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE;
|
51 |
$GLOBALS['_PEAR_destructor_object_list'] = array();
|
52 |
$GLOBALS['_PEAR_shutdown_funcs'] = array();
|
53 |
$GLOBALS['_PEAR_error_handler_stack'] = array();
|
54 |
|
55 |
+
@ini_set('track_errors', true);
|
56 |
|
57 |
/**
|
58 |
* Base class for other PEAR classes. Provides rudimentary
|
71 |
* IMPORTANT! To use the emulated destructors you need to create the
|
72 |
* objects by reference: $obj =& new PEAR_child;
|
73 |
*
|
74 |
+
* @category pear
|
75 |
+
* @package PEAR
|
76 |
+
* @author Stig Bakken <ssb@php.net>
|
77 |
+
* @author Tomas V.V. Cox <cox@idecnet.com>
|
78 |
+
* @author Greg Beaver <cellog@php.net>
|
79 |
+
* @copyright 1997-2006 The PHP Group
|
80 |
+
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
81 |
+
* @version Release: 1.8.1
|
82 |
+
* @link http://pear.php.net/package/PEAR
|
83 |
+
* @see PEAR_Error
|
84 |
+
* @since Class available since PHP 4.0.2
|
85 |
+
* @link http://pear.php.net/manual/en/core.pear.php#core.pear.pear
|
86 |
*/
|
87 |
class PEAR
|
88 |
{
|
154 |
*/
|
155 |
function PEAR($error_class = null)
|
156 |
{
|
157 |
+
$classname = strtolower(get_class($this));
|
158 |
if ($this->_debug) {
|
159 |
print "PEAR constructor called, class=$classname\n";
|
160 |
}
|
161 |
if ($error_class !== null) {
|
162 |
$this->_error_class = $error_class;
|
163 |
}
|
164 |
+
while ($classname && strcasecmp($classname, "pear")) {
|
165 |
$destructor = "_$classname";
|
166 |
if (method_exists($this, $destructor)) {
|
167 |
global $_PEAR_destructor_object_list;
|
168 |
$_PEAR_destructor_object_list[] = &$this;
|
169 |
+
if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
|
170 |
+
register_shutdown_function("_PEAR_call_destructors");
|
171 |
+
$GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
|
172 |
+
}
|
173 |
break;
|
174 |
} else {
|
175 |
$classname = get_parent_class($classname);
|
193 |
*/
|
194 |
function _PEAR() {
|
195 |
if ($this->_debug) {
|
196 |
+
printf("PEAR destructor called, class=%s\n", strtolower(get_class($this)));
|
197 |
}
|
198 |
}
|
199 |
|
215 |
function &getStaticProperty($class, $var)
|
216 |
{
|
217 |
static $properties;
|
218 |
+
if (!isset($properties[$class])) {
|
219 |
+
$properties[$class] = array();
|
220 |
+
}
|
221 |
+
|
222 |
+
if (!array_key_exists($var, $properties[$class])) {
|
223 |
+
$properties[$class][$var] = null;
|
224 |
+
}
|
225 |
+
|
226 |
return $properties[$class][$var];
|
227 |
}
|
228 |
|
240 |
*/
|
241 |
function registerShutdownFunc($func, $args = array())
|
242 |
{
|
243 |
+
// if we are called statically, there is a potential
|
244 |
+
// that no shutdown func is registered. Bug #6445
|
245 |
+
if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
|
246 |
+
register_shutdown_function("_PEAR_call_destructors");
|
247 |
+
$GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
|
248 |
+
}
|
249 |
$GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
|
250 |
}
|
251 |
|
265 |
*/
|
266 |
function isError($data, $code = null)
|
267 |
{
|
268 |
+
if (!is_a($data, 'PEAR_Error')) {
|
269 |
+
return false;
|
270 |
+
}
|
271 |
+
|
272 |
+
if (is_null($code)) {
|
273 |
+
return true;
|
274 |
+
} elseif (is_string($code)) {
|
275 |
+
return $data->getMessage() == $code;
|
276 |
}
|
277 |
+
|
278 |
+
return $data->getCode() == $code;
|
279 |
}
|
280 |
|
281 |
// }}}
|
443 |
function delExpect($error_code)
|
444 |
{
|
445 |
$deleted = false;
|
|
|
446 |
if ((is_array($error_code) && (0 != count($error_code)))) {
|
447 |
// $error_code is a non-empty array here;
|
448 |
// we walk through it trying to unset all
|
462 |
} else {
|
463 |
return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
|
464 |
}
|
|
|
|
|
|
|
465 |
}
|
466 |
+
|
467 |
+
// $error_code is empty
|
468 |
+
return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME
|
469 |
}
|
470 |
|
471 |
// }}}
|
508 |
* @see PEAR::setErrorHandling
|
509 |
* @since PHP 4.0.5
|
510 |
*/
|
511 |
+
function &raiseError($message = null,
|
512 |
$code = null,
|
513 |
$mode = null,
|
514 |
$options = null,
|
532 |
$mode = PEAR_ERROR_RETURN;
|
533 |
}
|
534 |
}
|
535 |
+
|
536 |
// No mode given, try global ones
|
537 |
if ($mode === null) {
|
538 |
// Class error handler
|
553 |
} else {
|
554 |
$ec = 'PEAR_Error';
|
555 |
}
|
556 |
+
|
557 |
+
if (intval(PHP_VERSION) < 5) {
|
558 |
+
// little non-eval hack to fix bug #12147
|
559 |
+
include 'PEAR/FixPHP5PEARWarnings.php';
|
560 |
+
return $a;
|
561 |
+
}
|
562 |
+
|
563 |
if ($skipmsg) {
|
564 |
+
$a = new $ec($code, $mode, $options, $userinfo);
|
565 |
} else {
|
566 |
+
$a = new $ec($message, $code, $mode, $options, $userinfo);
|
567 |
}
|
568 |
+
|
569 |
+
return $a;
|
570 |
}
|
571 |
|
572 |
// }}}
|
579 |
* @param string $message
|
580 |
*
|
581 |
*/
|
582 |
+
function &throwError($message = null,
|
583 |
$code = null,
|
584 |
$userinfo = null)
|
585 |
{
|
586 |
if (isset($this) && is_a($this, 'PEAR')) {
|
587 |
+
$a = &$this->raiseError($message, $code, null, null, $userinfo);
|
588 |
+
return $a;
|
|
|
589 |
}
|
590 |
+
|
591 |
+
$a = &PEAR::raiseError($message, $code, null, null, $userinfo);
|
592 |
+
return $a;
|
593 |
}
|
594 |
|
595 |
// }}}
|
596 |
+
function staticPushErrorHandling($mode, $options = null)
|
597 |
+
{
|
598 |
+
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
|
599 |
+
$def_mode = &$GLOBALS['_PEAR_default_error_mode'];
|
600 |
+
$def_options = &$GLOBALS['_PEAR_default_error_options'];
|
601 |
+
$stack[] = array($def_mode, $def_options);
|
602 |
+
switch ($mode) {
|
603 |
+
case PEAR_ERROR_EXCEPTION:
|
604 |
+
case PEAR_ERROR_RETURN:
|
605 |
+
case PEAR_ERROR_PRINT:
|
606 |
+
case PEAR_ERROR_TRIGGER:
|
607 |
+
case PEAR_ERROR_DIE:
|
608 |
+
case null:
|
609 |
+
$def_mode = $mode;
|
610 |
+
$def_options = $options;
|
611 |
+
break;
|
612 |
+
|
613 |
+
case PEAR_ERROR_CALLBACK:
|
614 |
+
$def_mode = $mode;
|
615 |
+
// class/object method callback
|
616 |
+
if (is_callable($options)) {
|
617 |
+
$def_options = $options;
|
618 |
+
} else {
|
619 |
+
trigger_error("invalid error callback", E_USER_WARNING);
|
620 |
+
}
|
621 |
+
break;
|
622 |
+
|
623 |
+
default:
|
624 |
+
trigger_error("invalid error mode", E_USER_WARNING);
|
625 |
+
break;
|
626 |
+
}
|
627 |
+
$stack[] = array($mode, $options);
|
628 |
+
return true;
|
629 |
+
}
|
630 |
+
|
631 |
+
function staticPopErrorHandling()
|
632 |
+
{
|
633 |
+
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
|
634 |
+
$setmode = &$GLOBALS['_PEAR_default_error_mode'];
|
635 |
+
$setoptions = &$GLOBALS['_PEAR_default_error_options'];
|
636 |
+
array_pop($stack);
|
637 |
+
list($mode, $options) = $stack[sizeof($stack) - 1];
|
638 |
+
array_pop($stack);
|
639 |
+
switch ($mode) {
|
640 |
+
case PEAR_ERROR_EXCEPTION:
|
641 |
+
case PEAR_ERROR_RETURN:
|
642 |
+
case PEAR_ERROR_PRINT:
|
643 |
+
case PEAR_ERROR_TRIGGER:
|
644 |
+
case PEAR_ERROR_DIE:
|
645 |
+
case null:
|
646 |
+
$setmode = $mode;
|
647 |
+
$setoptions = $options;
|
648 |
+
break;
|
649 |
+
|
650 |
+
case PEAR_ERROR_CALLBACK:
|
651 |
+
$setmode = $mode;
|
652 |
+
// class/object method callback
|
653 |
+
if (is_callable($options)) {
|
654 |
+
$setoptions = $options;
|
655 |
+
} else {
|
656 |
+
trigger_error("invalid error callback", E_USER_WARNING);
|
657 |
+
}
|
658 |
+
break;
|
659 |
+
|
660 |
+
default:
|
661 |
+
trigger_error("invalid error mode", E_USER_WARNING);
|
662 |
+
break;
|
663 |
+
}
|
664 |
+
return true;
|
665 |
+
}
|
666 |
+
|
667 |
// {{{ pushErrorHandling()
|
668 |
|
669 |
/**
|
740 |
if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) {
|
741 |
return false;
|
742 |
}
|
743 |
+
|
744 |
if (OS_WINDOWS) {
|
745 |
$suffix = '.dll';
|
746 |
} elseif (PHP_OS == 'HP-UX') {
|
752 |
} else {
|
753 |
$suffix = '.so';
|
754 |
}
|
755 |
+
|
756 |
return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix);
|
757 |
}
|
758 |
+
|
759 |
return true;
|
760 |
}
|
761 |
|
762 |
// }}}
|
763 |
}
|
764 |
|
765 |
+
if (PEAR_ZE2) {
|
766 |
+
include_once 'PEAR5.php';
|
767 |
+
}
|
768 |
+
|
769 |
// {{{ _PEAR_call_destructors()
|
770 |
|
771 |
function _PEAR_call_destructors()
|
775 |
sizeof($_PEAR_destructor_object_list))
|
776 |
{
|
777 |
reset($_PEAR_destructor_object_list);
|
778 |
+
if (PEAR_ZE2) {
|
779 |
+
$destructLifoExists = PEAR5::getStaticProperty('PEAR', 'destructlifo');
|
780 |
+
} else {
|
781 |
+
$destructLifoExists = PEAR::getStaticProperty('PEAR', 'destructlifo');
|
782 |
+
}
|
783 |
+
|
784 |
+
if ($destructLifoExists) {
|
785 |
+
$_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list);
|
786 |
+
}
|
787 |
+
|
788 |
while (list($k, $objref) = each($_PEAR_destructor_object_list)) {
|
789 |
$classname = get_class($objref);
|
790 |
while ($classname) {
|
811 |
}
|
812 |
|
813 |
// }}}
|
814 |
+
/**
|
815 |
+
* Standard PEAR error class for PHP 4
|
816 |
+
*
|
817 |
+
* This class is supserseded by {@link PEAR_Exception} in PHP 5
|
818 |
+
*
|
819 |
+
* @category pear
|
820 |
+
* @package PEAR
|
821 |
+
* @author Stig Bakken <ssb@php.net>
|
822 |
+
* @author Tomas V.V. Cox <cox@idecnet.com>
|
823 |
+
* @author Gregory Beaver <cellog@php.net>
|
824 |
+
* @copyright 1997-2006 The PHP Group
|
825 |
+
* @license http://opensource.org/licenses/bsd-license.php New BSD License
|
826 |
+
* @version Release: 1.8.1
|
827 |
+
* @link http://pear.php.net/manual/en/core.pear.pear-error.php
|
828 |
+
* @see PEAR::raiseError(), PEAR::throwError()
|
829 |
+
* @since Class available since PHP 4.0.2
|
830 |
+
*/
|
831 |
class PEAR_Error
|
832 |
{
|
833 |
// {{{ properties
|
873 |
$this->code = $code;
|
874 |
$this->mode = $mode;
|
875 |
$this->userinfo = $userinfo;
|
876 |
+
|
877 |
+
if (PEAR_ZE2) {
|
878 |
+
$skiptrace = PEAR5::getStaticProperty('PEAR_Error', 'skiptrace');
|
879 |
+
} else {
|
880 |
+
$skiptrace = PEAR::getStaticProperty('PEAR_Error', 'skiptrace');
|
881 |
+
}
|
882 |
+
|
883 |
+
if (!$skiptrace) {
|
884 |
$this->backtrace = debug_backtrace();
|
885 |
+
if (isset($this->backtrace[0]) && isset($this->backtrace[0]['object'])) {
|
886 |
+
unset($this->backtrace[0]['object']);
|
887 |
+
}
|
888 |
}
|
889 |
if ($mode & PEAR_ERROR_CALLBACK) {
|
890 |
$this->level = E_USER_NOTICE;
|
925 |
}
|
926 |
}
|
927 |
if ($this->mode & PEAR_ERROR_EXCEPTION) {
|
928 |
+
trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING);
|
929 |
+
eval('$e = new Exception($this->message, $this->code);throw($e);');
|
930 |
}
|
931 |
}
|
932 |
|
1041 |
*/
|
1042 |
function getBacktrace($frame = null)
|
1043 |
{
|
1044 |
+
if (defined('PEAR_IGNORE_BACKTRACE')) {
|
1045 |
+
return null;
|
1046 |
+
}
|
1047 |
if ($frame === null) {
|
1048 |
return $this->backtrace;
|
1049 |
}
|
1062 |
}
|
1063 |
}
|
1064 |
|
1065 |
+
// }}}
|
1066 |
+
// {{{ toString()
|
1067 |
+
function __toString()
|
1068 |
+
{
|
1069 |
+
return $this->getMessage();
|
1070 |
+
}
|
1071 |
// }}}
|
1072 |
// {{{ toString()
|
1073 |
|
1084 |
E_USER_ERROR => 'error');
|
1085 |
if ($this->mode & PEAR_ERROR_CALLBACK) {
|
1086 |
if (is_array($this->callback)) {
|
1087 |
+
$callback = (is_object($this->callback[0]) ?
|
1088 |
+
strtolower(get_class($this->callback[0])) :
|
1089 |
+
$this->callback[0]) . '::' .
|
1090 |
$this->callback[1];
|
1091 |
} else {
|
1092 |
$callback = $this->callback;
|
1093 |
}
|
1094 |
return sprintf('[%s: message="%s" code=%d mode=callback '.
|
1095 |
'callback=%s prefix="%s" info="%s"]',
|
1096 |
+
strtolower(get_class($this)), $this->message, $this->code,
|
1097 |
$callback, $this->error_message_prefix,
|
1098 |
$this->userinfo);
|
1099 |
}
|
1111 |
}
|
1112 |
return sprintf('[%s: message="%s" code=%d mode=%s level=%s '.
|
1113 |
'prefix="%s" info="%s"]',
|
1114 |
+
strtolower(get_class($this)), $this->message, $this->code,
|
1115 |
implode("|", $modes), $levels[$this->level],
|
1116 |
$this->error_message_prefix,
|
1117 |
$this->userinfo);
|
1120 |
// }}}
|
1121 |
}
|
1122 |
|
|
|
|
|
1123 |
/*
|
1124 |
* Local Variables:
|
1125 |
* mode: php
|
1126 |
* tab-width: 4
|
1127 |
* c-basic-offset: 4
|
1128 |
* End:
|
1129 |
+
*/
|
|
PEAR5.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* This is only meant for PHP 5 to get rid of certain strict warning
|
4 |
+
* that doesn't get hidden since it's in the shutdown function
|
5 |
+
*/
|
6 |
+
class PEAR5
|
7 |
+
{
|
8 |
+
/**
|
9 |
+
* If you have a class that's mostly/entirely static, and you need static
|
10 |
+
* properties, you can use this method to simulate them. Eg. in your method(s)
|
11 |
+
* do this: $myVar = &PEAR5::getStaticProperty('myclass', 'myVar');
|
12 |
+
* You MUST use a reference, or they will not persist!
|
13 |
+
*
|
14 |
+
* @access public
|
15 |
+
* @param string $class The calling classname, to prevent clashes
|
16 |
+
* @param string $var The variable to retrieve.
|
17 |
+
* @return mixed A reference to the variable. If not set it will be
|
18 |
+
* auto initialised to NULL.
|
19 |
+
*/
|
20 |
+
static function &getStaticProperty($class, $var)
|
21 |
+
{
|
22 |
+
static $properties;
|
23 |
+
if (!isset($properties[$class])) {
|
24 |
+
$properties[$class] = array();
|
25 |
+
}
|
26 |
+
|
27 |
+
if (!array_key_exists($var, $properties[$class])) {
|
28 |
+
$properties[$class][$var] = null;
|
29 |
+
}
|
30 |
+
|
31 |
+
return $properties[$class][$var];
|
32 |
+
}
|
33 |
+
}
|
Revision
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
Revision: 148662
|
2 |
+
Last Changed Date: 2009-08-17 13:07:26 -0400 (Mon, 17 Aug 2009)
|
config_form.php
CHANGED
@@ -1,13 +1,43 @@
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
-
//require_once('admin.php');
|
3 |
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'postie-functions.php');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
global $wpdb,$wp_roles;
|
5 |
|
6 |
-
// if (!TestWPVersion()) {
|
7 |
-
// print("<h1>Warning!</h1>
|
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();
|
@@ -15,43 +45,42 @@ $messages[1] = __("Configuration successfully updated!",'postie');
|
|
15 |
$messages[2] = __("Error - unable to save configuration",'postie');
|
16 |
|
17 |
?>
|
18 |
-
<style type='text/css'>
|
19 |
-
legend {font-weight:bold;
|
20 |
-
border:1px solid black;
|
21 |
-
background:white;
|
22 |
-
padding:.3em;}
|
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 |
-
<
|
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 |
-
|
33 |
-
<input name="Submit" value="<?php _e("Reset Settings To Defaults", 'postie')?> »" type="submit">
|
34 |
-
</p>
|
35 |
</form>
|
36 |
-
<form name="postie-options" method=
|
37 |
-
|
38 |
-
<input name="Submit" value="<?php _e("Run Postie", 'postie');?> »" type="submit">
|
39 |
<?php _e("(To run the check mail script manually)", 'postie');?>
|
40 |
-
</p>
|
41 |
</form>
|
42 |
-
<form name="postie-options" method="post"
|
43 |
<input type="hidden" name="action" value="test" />
|
44 |
-
|
45 |
-
|
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"
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
<?php if (isset($config['CRONLESS']) && $config['CRONLESS']!='') {
|
52 |
?>
|
53 |
-
<fieldset class="options">
|
54 |
-
<legend><?php _e('Cronless postie settings', 'postie');?></legend>
|
55 |
<p><?php _e('Cronless postie should check for mail', 'postie') ?>
|
56 |
<select name='CRONLESS' id='CRONLESS'>
|
57 |
<option value="weekly" <?php if($config["CRONLESS"] == "weekly") { echo "selected='selected'";} ?>><?php _e('Once weekly', 'postie') ?></option>
|
@@ -60,65 +89,55 @@ fieldset {border: 1px solid black;}
|
|
60 |
<option value="twiceperhour" <?php if($config["CRONLESS"] == "twiceperhour") { echo "selected='selected'";} ?>><?php _e('twice per hour', 'postie') ?></option>
|
61 |
<option value="tenminutes" <?php if($config["CRONLESS"] == "tenminutes") { echo "selected='selected'";} ?>><?php _e('every ten minutes', 'postie') ?></option>
|
62 |
</select>
|
63 |
-
</fieldset>
|
64 |
</p>
|
65 |
<?php
|
66 |
}
|
67 |
?>
|
68 |
-
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
<tr><td colspan=2>
|
76 |
-
<fieldset class="options">
|
77 |
-
<legend><?php _e('E-mail and Mailserver Settings', 'postie');?></legend>
|
78 |
|
79 |
|
80 |
-
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
|
81 |
<tr>
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
<option value="
|
88 |
-
<?php if
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
111 |
|
112 |
-
|
113 |
-
|
114 |
-
</tr>
|
115 |
<tr valign="top">
|
116 |
<th scope="row"><?php _e('Mail Server:', 'postie') ?></th>
|
117 |
<td><input name="MAIL_SERVER" type="text" id="MAIL_SERVER" value="<?php echo $config["MAIL_SERVER"];?>" size="40" />
|
118 |
-
|
119 |
-
|
120 |
-
</td>
|
121 |
-
</tr>
|
122 |
<tr valign="top">
|
123 |
<th width="33%" scope="row"><?php _e('Mail Userid:', 'postie') ?></th>
|
124 |
<td><input name="MAIL_USERID" type="text" id="MAIL_USERID" value="<?php echo $config["MAIL_USERID"]; ?>" size="40" /></td>
|
@@ -130,17 +149,15 @@ fieldset {border: 1px solid black;}
|
|
130 |
</td>
|
131 |
</tr>
|
132 |
</table>
|
133 |
-
</
|
134 |
-
|
135 |
-
|
136 |
|
137 |
-
<tr><td colspan=2>
|
138 |
-
<fieldset class="options">
|
139 |
-
<legend><?php _e('Authorization Settings', 'postie');?></legend>
|
140 |
-
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
|
141 |
<?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.");?>
|
142 |
<tr>
|
143 |
-
<th scope="row"><?php _e('Roles That Can Post:', 'postie')
|
|
|
|
|
144 |
<td>
|
145 |
<table>
|
146 |
<tr><th>Administrator role can always post.</th>
|
@@ -160,8 +177,6 @@ fieldset {border: 1px solid black;}
|
|
160 |
}
|
161 |
?>
|
162 |
</table>
|
163 |
-
<br />
|
164 |
-
<code><?php _e("This allows you to grant access to other users to post if they have the proper access level", 'postie');?></code>
|
165 |
</td>
|
166 |
</tr>
|
167 |
<tr>
|
@@ -174,378 +189,483 @@ fieldset {border: 1px solid black;}
|
|
174 |
"SELECTED";} ?>>Draft</option>
|
175 |
<option value="pending" <?php if($config["POST_STATUS"] == "pending") { echo
|
176 |
"SELECTED";} ?>>Pending Review</option>
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
</td>
|
181 |
</tr>
|
182 |
<?php echo BuildTextArea("Authorized Addresses","AUTHORIZED_ADDRESSES",$config["AUTHORIZED_ADDRESSES"],"Put each email address on a single line. Posts from emails in this list will be treated as if they came from the admin. If you would prefer to have users post under their own name - create a WordPress user with the correct access level.");?>
|
183 |
<tr>
|
184 |
-
<th width="33%" valign="top" scope="row"
|
185 |
-
username:') ?> </th>
|
186 |
<td>
|
187 |
<input name="ADMIN_USERNAME" type="text" id="ADMIN_USERNAME"
|
188 |
-
value="<?php echo $config["ADMIN_USERNAME"]; ?>" size="50"
|
189 |
-
<?php _e("Recommended", 'postie');?>: <code>admin</code>
|
190 |
-
<br />
|
191 |
-
</td>
|
192 |
</tr>
|
193 |
</table>
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
<tr><td colspan=2>
|
200 |
-
<fieldset class="options">
|
201 |
-
<legend><?php _e('Directory Settings', 'postie');?></legend>
|
202 |
-
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
|
203 |
-
<tr>
|
204 |
-
<th width="33%" valign="top" scope="row"><?php _e('Directory For Photos:', 'postie') ?> </th>
|
205 |
-
<td>
|
206 |
-
<input name="PHOTOSDIR" type="text" id="PHOTOSDIR" value="<?php echo $config["PHOTOSDIR"]; ?>" size="50" /><br />
|
207 |
-
<?php _e("Recommended", 'postie');?>: <code>/wp-photos/</code>
|
208 |
-
<br />
|
209 |
-
</td>
|
210 |
-
</tr>
|
211 |
-
<tr>
|
212 |
-
<th width="33%" valign="top" scope="row"><?php _e('Directory For Files:', 'postie') ?> </th>
|
213 |
-
<td>
|
214 |
-
<input name="FILESDIR" type="text" id="FILESDIR" value="<?php echo $config["FILESDIR"]; ?>" size="50" /><br />
|
215 |
-
<?php _e("Recommended", 'postie');?>: <code>/wp-filez/</code>
|
216 |
-
<br />
|
217 |
-
</td>
|
218 |
-
</tr>
|
219 |
-
</table>
|
220 |
-
</fieldset>
|
221 |
-
</td>
|
222 |
-
</tr>
|
223 |
-
|
224 |
-
<tr><td colspan=2>
|
225 |
-
<fieldset class="options">
|
226 |
-
<legend><?php _e('Message Settings', 'postie');?></legend>
|
227 |
-
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
|
228 |
<tr valign="top">
|
229 |
<th scope="row"><?php _e('Default post by mail category:', 'postie') ?></th>
|
230 |
<td>
|
231 |
<?php
|
232 |
$defaultCat=$config['DEFAULT_POST_CATEGORY'];
|
233 |
wp_dropdown_categories("name=DEFAULT_POST_CATEGORY&hierarchical=1&selected=$defaultCat&hide_empty=0"); ?>
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
<tr valign="top">
|
247 |
-
<th scope="row"><?php _e('Default post by mail tag(s):
|
248 |
-
separated by commas', 'postie') ?></th>
|
249 |
-
<td><input type='text' name="DEFAULT_POST_TAGS"
|
250 |
-
id="DEFAULT_POST_TAGS" value='<?php echo
|
251 |
-
$config["DEFAULT_POST_TAGS"] ?>' />
|
252 |
-
</td>
|
253 |
-
</tr>
|
254 |
-
<tr>
|
255 |
<th width="33%" valign="top" scope="row"><?php _e('Default Title:', 'postie') ?> </th>
|
256 |
<td>
|
257 |
<input name="DEFAULT_TITLE" type="text" id="DEFAULT_TITLE" value="<?php echo $config["DEFAULT_TITLE"]; ?>" size="50" /><br />
|
258 |
-
<?php _e("Recommended", 'postie');?>: <code>Live from the field</code>
|
259 |
<br />
|
260 |
</td>
|
261 |
</tr>
|
262 |
<tr>
|
263 |
-
<th width="33%" valign="top" scope="row"><?php _e('
|
|
|
264 |
<td>
|
265 |
<select name="PREFER_TEXT_TYPE" id="PREFER_TEXT_TYPE">
|
266 |
<option value="plain">plain</option>
|
267 |
<option value="html" <?php if($config["PREFER_TEXT_TYPE"] == "html") { echo "SELECTED";} ?>>html</option>
|
268 |
</select><br />
|
269 |
-
<?php _e("Recommended", 'postie');?>: <code>plain</code>
|
270 |
-
<br />
|
271 |
</td>
|
272 |
</tr>
|
|
|
|
|
|
|
|
|
273 |
<tr>
|
274 |
-
<th width="33%" valign="top" scope="row"><?php _e('
|
|
|
|
|
275 |
<td>
|
276 |
-
<
|
277 |
-
<option value="no">no</option>
|
278 |
-
<option value="yes" <?php if($config["WRAP_PRE"] == "yes") { echo "SELECTED";} ?>>yes</option>
|
279 |
-
</select><br />
|
280 |
-
<?php _e("Recommended", 'postie');?>: <code>no</code>
|
281 |
-
<br />
|
282 |
</td>
|
283 |
</tr>
|
284 |
<tr>
|
285 |
-
<th width="33%" valign="top" scope="row"><?php _e('
|
|
|
|
|
286 |
<td>
|
287 |
-
<
|
288 |
-
<option value="no">no</option>
|
289 |
-
<option value="yes" <?php if($config["ADD_META"] == "yes") { echo "SELECTED";} ?>>yes</option>
|
290 |
-
</select><br />
|
291 |
-
<?php _e("Recommended", 'postie');?>: <code>no</code>
|
292 |
-
<br />
|
293 |
</td>
|
294 |
</tr>
|
295 |
-
|
296 |
-
|
297 |
-
|
|
|
|
|
|
|
|
|
|
|
298 |
<?php echo BuildBooleanSelect("Replace newline characters with
|
299 |
html line breaks (<br
|
300 |
/>)","CONVERTNEWLINE",$config["CONVERTNEWLINE"]);?>
|
301 |
-
<?php echo BuildBooleanSelect("
|
302 |
-
<?php echo BuildBooleanSelect("
|
303 |
-
<?php echo BuildBooleanSelect("Allow HTML In Mail Subject","ALLOW_HTML_IN_SUBJECT",$config["ALLOW_HTML_IN_SUBJECT"]);?>
|
304 |
-
<?php echo BuildBooleanSelect("Allow HTML In Mail Body","ALLOW_HTML_IN_BODY",$config["ALLOW_HTML_IN_BODY"]);?>
|
305 |
<?php echo BuildBooleanSelect("Automatically convert urls to links","CONVERTURLS",$config["CONVERTURLS"]);?>
|
|
|
306 |
<tr>
|
307 |
<th width="33%" valign="top" scope="row"><?php _e('Encoding for pages and feeds:', 'postie') ?> </th>
|
308 |
<td>
|
309 |
-
<input name="MESSAGE_ENCODING" type="text" id="MESSAGE_ENCODING" value="<?php echo $config["MESSAGE_ENCODING"]; ?>" size="
|
310 |
-
|
311 |
-
<br />
|
312 |
</td>
|
313 |
</tr>
|
314 |
-
<?php echo BuildBooleanSelect("Decode Quoted Printable Data","MESSAGE_DEQUOTE",$config["MESSAGE_DEQUOTE"]
|
315 |
<?php echo BuildTextArea("Supported File Types","SUPPORTED_FILE_TYPES",$config["SUPPORTED_FILE_TYPES"],"Put each type on a single line.");?>
|
316 |
-
<?php echo BuildTextArea("Banned File
|
317 |
-
Names","BANNED_FILES_LIST",$config["BANNED_FILES_LIST"],"Put each
|
318 |
-
file name on a single line.Files matching this list will never be
|
319 |
-
posted to your blog. You can use wildcards such as *.xls, or *.* for
|
320 |
-
all files");?>
|
321 |
-
<tr>
|
322 |
-
<th width="33%" valign="top" scope="row"><?php _e('Tag Of Message Start:', 'postie') ?> </th>
|
323 |
-
<td>
|
324 |
-
<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>
|
325 |
-
<input name="MESSAGE_START" type="text" id="MESSAGE_START" value="<?php echo $config["MESSAGE_START"]; ?>" size="50" /><br />
|
326 |
-
<?php _e("Recommended", 'postie');?>: <code>:start</code>
|
327 |
-
<br />
|
328 |
-
</td>
|
329 |
-
</tr>
|
330 |
-
<tr>
|
331 |
-
<th width="33%" valign="top" scope="row"><?php _e('Tag Of Message End:', 'postie') ?> </th>
|
332 |
-
<td>
|
333 |
-
<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>
|
334 |
-
<input name="MESSAGE_END" type="text" id="MESSAGE_END" value="<?php echo $config["MESSAGE_END"]; ?>" size="50" /><br />
|
335 |
-
<?php _e("Recommended", 'postie');?>: <code>:end</code>
|
336 |
-
<br />
|
337 |
-
</td>
|
338 |
-
</tr>
|
339 |
<?php echo BuildBooleanSelect("Drop The Signature From Mail","DROP_SIGNATURE",$config["DROP_SIGNATURE"]);?>
|
340 |
-
<?php echo BuildTextArea("Signature Patterns","SIG_PATTERN_LIST",$config["SIG_PATTERN_LIST"],"Put each pattern on a
|
|
|
|
|
341 |
</table>
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
|
347 |
-
<tr><td colspan=2>
|
348 |
-
<fieldset class="options">
|
349 |
-
<legend><?php _e('Image Settings', 'postie');?></legend>
|
350 |
-
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
|
351 |
-
<?php if (!HasGDInstalled()):?>
|
352 |
-
<tr>
|
353 |
-
<th scope="row">No GD Support </th>
|
354 |
-
<td>Currently your installation of PHP does not have GD installed so no image resizing can occur.
|
355 |
-
<input type="hidden" name="RESIZE_LARGE_IMAGES" value="0">
|
356 |
-
<input type="hidden" name="JPEGQUALITY"" value="80">
|
357 |
-
</td>
|
358 |
-
</tr>
|
359 |
-
<?php else:?>
|
360 |
-
<?php echo BuildBooleanSelect("Post Images At End","IMAGES_APPEND",$config["IMAGES_APPEND"],"No means they will be put before the text of the message.");?>
|
361 |
-
<?php echo BuildBooleanSelect("Resize Large Images","RESIZE_LARGE_IMAGES",$config["RESIZE_LARGE_IMAGES"]);?>
|
362 |
-
<tr>
|
363 |
-
<th scope="row"><?php _e('Maximum Image Width:', 'postie') ?> </th>
|
364 |
-
<td><input name="MAX_IMAGE_WIDTH" type="text" id="MAX_IMAGE_WIDTH" value="<?php echo $config['MAX_IMAGE_WIDTH']; ?>" size="4" />
|
365 |
-
<?php _e('pixels', 'postie') ?>
|
366 |
-
<br /><?php _e("Recommended", 'postie');?>: <code>400</code><br />
|
367 |
-
</td>
|
368 |
-
</tr>
|
369 |
-
<tr>
|
370 |
-
<th scope="row"><?php _e('Maximum Image Height:', 'postie') ?> </th>
|
371 |
-
<td><input name="MAX_IMAGE_HEIGHT" type="text" id="MAX_IMAGE_HEIGHT" value="<?php echo $config['MAX_IMAGE_HEIGHT']; ?>" size="4" />
|
372 |
-
<?php _e('pixels', 'postie') ?>
|
373 |
-
<br /><?php _e("Recommended", 'postie');?>: <code>Leave Blank</code><br />
|
374 |
-
</td>
|
375 |
-
</tr>
|
376 |
-
<tr>
|
377 |
-
<th scope="row"><?php _e('JPEG Compression:', 'postie') ?> </th>
|
378 |
-
<td><input name="JPEGQUALITY" type="text" id="JPEGQUALITY" value="<?php echo $config['JPEGQUALITY']; ?>" size="3" />
|
379 |
-
<?php _e('%', 'postie') ?>
|
380 |
-
<br /><?php _e("Recommended", 'postie');?>: <code>80</code>%
|
381 |
-
</td>
|
382 |
-
</tr>
|
383 |
-
<?php endif;?>
|
384 |
-
<?php echo BuildBooleanSelect("Use ImageMagick","USE_IMAGEMAGICK",$config["USE_IMAGEMAGICK"]);?>
|
385 |
-
<tr>
|
386 |
-
<th scope="row"><?php _e('convert binary location:', 'postie') ?> </th>
|
387 |
-
<td><input name="IMAGEMAGICK_CONVERT" type="text" id="IMAGEMAGICK_CONVERT" value="<?php echo $config['IMAGEMAGICK_CONVERT']; ?>" size="30" />
|
388 |
-
<br /><?php _e("Recommended", 'postie');?>: <code>only needed if you are using ImageMagick <br /> should be /usr/bin/convert</code>
|
389 |
-
</td>
|
390 |
-
</tr>
|
391 |
-
<?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");?>
|
392 |
|
|
|
|
|
393 |
<?php echo BuildBooleanSelect("Start Image Count At 0","START_IMAGE_COUNT_AT_ZERO",$config["START_IMAGE_COUNT_AT_ZERO"]);?>
|
394 |
<tr>
|
395 |
<th width="33%" valign="top" scope="row"><?php _e('Image Place Holder Tag:', 'postie') ?> </th>
|
396 |
<td>
|
397 |
<input name="IMAGE_PLACEHOLDER" type="text" id="IMAGE_PLACEHOLDER" value="<?php echo $config["IMAGE_PLACEHOLDER"]; ?>" size="50" /><br />
|
398 |
-
<?php _e("Recommended", 'postie');?>: <code>#img%#</code>
|
399 |
-
<br />
|
400 |
-
</td>
|
401 |
-
</tr>
|
402 |
-
<tr>
|
403 |
-
<th width="33%" valign="top" scope="row"><?php _e('Image CSS Class:', 'postie') ?> </th>
|
404 |
-
<td>
|
405 |
-
<input name="IMAGECLASS" type="text" id="IMAGECLASS" value="<?php echo $config["IMAGECLASS"]; ?>" size="50" /><br />
|
406 |
-
<?php _e("Recommended", 'postie');?>: <code>postie-image</code>
|
407 |
-
<br />
|
408 |
-
</td>
|
409 |
-
</tr>
|
410 |
-
<tr>
|
411 |
-
<th width="33%" valign="top" scope="row"><?php _e('Image CSS Style:', 'postie') ?> </th>
|
412 |
-
<td>
|
413 |
-
<input name="IMAGESTYLE" type="text" id="IMAGESTYLE" value="<?php echo $config["IMAGESTYLE"]; ?>" size="50" /><br />
|
414 |
-
<?php _e("Recommended", 'postie');?>: <code>border: none;</code>
|
415 |
-
<br />
|
416 |
</td>
|
417 |
</tr>
|
418 |
-
<tr>
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
425 |
</tr>
|
426 |
-
<?php echo BuildBooleanSelect("
|
427 |
-
window","IMAGE_NEW_WINDOW",$config["IMAGE_NEW_WINDOW"],"Recommended:
|
428 |
-
no");?>
|
429 |
-
<?php echo BuildBooleanSelect("Use custom image
|
430 |
-
template","USEIMAGETEMPLATE",$config["USEIMAGETEMPLATE"],"If you
|
431 |
-
don't like the default html output around images, you can enter
|
432 |
-
your own below. My personal template is already there. See the
|
433 |
-
readme for more details");?>
|
434 |
-
<tr>
|
435 |
-
<th width="33%" valign="top" scope="row"> <td>
|
436 |
-
<textarea cols="50" rows="6" name="IMAGETEMPLATE"
|
437 |
-
id="IMAGETEMPLATE"><?php echo $config["IMAGETEMPLATE"]; ?></textarea>
|
438 |
-
</td>
|
439 |
-
</tr>
|
440 |
-
<tr>
|
441 |
-
<th width="33%" valign="top" scope="row"><?php _e('Attachment Div CSS:', 'postie') ?> </th>
|
442 |
-
<td>
|
443 |
-
<input name="ATTACHMENTDIV" type="text" id="ATTACHMENTDIV" value="<?php echo $config["ATTACHMENTDIV"]; ?>" size="50" /><br />
|
444 |
-
<?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>
|
445 |
-
<br />
|
446 |
-
</td>
|
447 |
-
<?php echo BuildBooleanSelect("Use custom image
|
448 |
-
field","CUSTOM_IMAGE_FIELD",$config["CUSTOM_IMAGE_FIELD"],"When this option is set, images will not appear in the
|
449 |
-
post. Instead the url to the image will be input into a custom
|
450 |
-
field named 'image'.
|
451 |
-
Recommended:
|
452 |
-
no");?> </tr>
|
453 |
</table>
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
</table>
|
525 |
-
</fieldset>
|
526 |
</td>
|
527 |
</tr>
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
</table>
|
542 |
-
|
543 |
-
|
544 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
545 |
</form>
|
546 |
-
|
547 |
-
<a href="http://validator.w3.org/check?uri=referer"
|
548 |
-
<a href="http://jigsaw.w3.org/css-validator/check/referer"
|
|
|
549 |
Postie Version:
|
550 |
-
$Id: config_form.php
|
551 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div class="wrap">
|
2 |
+
<h2><a style='text-decoration:none' href='options-general.php?page=postie/postie.php'><img src="<?php echo
|
3 |
+
'../wp-content/plugins/postie/images/mail.png'; ?>" alt="postie" /><?php
|
4 |
+
_e('Postie Options', 'postie') ?></a></h2>
|
5 |
<?php
|
|
|
6 |
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'postie-functions.php');
|
7 |
+
if (isset($_POST["action"])) {
|
8 |
+
switch($_POST["action"]) {
|
9 |
+
case "reset":
|
10 |
+
ResetPostieConfig();
|
11 |
+
$message = 1;
|
12 |
+
break;
|
13 |
+
case "cronless":
|
14 |
+
check_postie();
|
15 |
+
$message = 1;
|
16 |
+
break;
|
17 |
+
case "test":
|
18 |
+
include('postie_test.php');
|
19 |
+
exit;
|
20 |
+
break;
|
21 |
+
case "runpostie":
|
22 |
+
echo "Checking for mail manually\n";
|
23 |
+
include('get_mail.php');
|
24 |
+
exit;
|
25 |
+
break;
|
26 |
+
case "config":
|
27 |
+
if( UpdatePostieConfig($_POST)) {
|
28 |
+
$message = 1;
|
29 |
+
}
|
30 |
+
else {
|
31 |
+
$message = 2;
|
32 |
+
}
|
33 |
+
break;
|
34 |
+
default:
|
35 |
+
$message = 2;
|
36 |
+
break;
|
37 |
+
}
|
38 |
+
}
|
39 |
global $wpdb,$wp_roles;
|
40 |
|
|
|
|
|
|
|
|
|
|
|
41 |
$title = __('Postie Options', 'postie');
|
42 |
$parent_file = 'options-general.php';
|
43 |
$config = GetConfig();
|
45 |
$messages[2] = __("Error - unable to save configuration",'postie');
|
46 |
|
47 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
<?php if (isset($_GET['message'])) : ?>
|
49 |
<div class="updated"><p><?php _e($messages[$_GET['message']], 'postie'); ?></p></div>
|
50 |
<?php endif; ?>
|
51 |
+
<form name="postie-options" method="post">
|
|
|
|
|
52 |
<input type="hidden" name="action" value="reset" />
|
53 |
+
<input name="Submit" value="<?php _e("Reset Settings To Defaults", 'postie')?> »" type="submit" class='button'>
|
|
|
|
|
54 |
</form>
|
55 |
+
<form name="postie-options" method='post'>
|
56 |
+
<input type="hidden" name="action" value="runpostie" />
|
57 |
+
<input name="Submit" value="<?php _e("Run Postie", 'postie');?> »" type="submit" class='button'>
|
58 |
<?php _e("(To run the check mail script manually)", 'postie');?>
|
|
|
59 |
</form>
|
60 |
+
<form name="postie-options" method="post">
|
61 |
<input type="hidden" name="action" value="test" />
|
62 |
+
<input name="Submit" value="<?php _e("Test Config", 'postie');?>»" type="submit" class='button'>
|
63 |
+
<?php _e("this will run a special script to test your configuration options", 'postie');?>
|
|
|
|
|
64 |
</form>
|
65 |
+
<form name="postie-options" method="post"> <input type="hidden" name="action" value="config" />
|
66 |
+
<div id="simpleTabs">
|
67 |
+
<div class="simpleTabs-nav">
|
68 |
+
<ul>
|
69 |
+
<li id="simpleTabs-nav-1"><?php _e('Mailserver' , 'postie') ?></li>
|
70 |
+
<li id="simpleTabs-nav-2"><?php _e('User' , 'postie') ?></li>
|
71 |
+
<li id="simpleTabs-nav-3"><?php _e('Message' , 'postie') ?></li>
|
72 |
+
<li id="simpleTabs-nav-4"><?php _e('Image' , 'postie') ?></li>
|
73 |
+
<li id="simpleTabs-nav-5"><?php _e('Video and Audio' , 'postie') ?></li>
|
74 |
+
<li id="simpleTabs-nav-6"><?php _e('Attachments' , 'postie') ?></li>
|
75 |
+
<li id="simpleTabs-nav-7"><?php _e('Help' , 'postie') ?></li>
|
76 |
+
<li id="simpleTabs-nav-8"><?php _e('FAQ' , 'postie') ?></li>
|
77 |
+
</ul>
|
78 |
+
</div>
|
79 |
+
<div id="simpleTabs-content-1" class="simpleTabs-content">
|
80 |
+
<table class='form-table'>
|
81 |
+
<tr><td colspan=2>
|
82 |
<?php if (isset($config['CRONLESS']) && $config['CRONLESS']!='') {
|
83 |
?>
|
|
|
|
|
84 |
<p><?php _e('Cronless postie should check for mail', 'postie') ?>
|
85 |
<select name='CRONLESS' id='CRONLESS'>
|
86 |
<option value="weekly" <?php if($config["CRONLESS"] == "weekly") { echo "selected='selected'";} ?>><?php _e('Once weekly', 'postie') ?></option>
|
89 |
<option value="twiceperhour" <?php if($config["CRONLESS"] == "twiceperhour") { echo "selected='selected'";} ?>><?php _e('twice per hour', 'postie') ?></option>
|
90 |
<option value="tenminutes" <?php if($config["CRONLESS"] == "tenminutes") { echo "selected='selected'";} ?>><?php _e('every ten minutes', 'postie') ?></option>
|
91 |
</select>
|
|
|
92 |
</p>
|
93 |
<?php
|
94 |
}
|
95 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
|
97 |
|
|
|
98 |
<tr>
|
99 |
+
<th scope="row"><?php _e('Mail Protocol:', 'postie') ?> </th>
|
100 |
+
<td>
|
101 |
+
<select name="INPUT_PROTOCOL" id="INPUT_PROTOCOL">
|
102 |
+
<option value="pop3">POP3</option>
|
103 |
+
<?php if (HasIMAPSupport(false)):?>
|
104 |
+
<option value="imap" <?php if($config["INPUT_PROTOCOL"] == "imap") { echo "SELECTED";} ?>>IMAP</option>
|
105 |
+
<option value="pop3-ssl" <?php if($config["INPUT_PROTOCOL"] == "pop3-ssl") { echo "SELECTED";} ?>>POP3-SSL</option>
|
106 |
+
<option value="imap-ssl" <?php if($config["INPUT_PROTOCOL"] == "imap-ssl") { echo "SELECTED";} ?>>IMAP-SSL</option>
|
107 |
+
<?php else:?>
|
108 |
+
<option value="pop3" ><?php _e("IMAP/IMAP-SSL/POP3-SSL unavailable", 'postie');?></option>
|
109 |
+
<?php endif;?>
|
110 |
+
</select>
|
111 |
+
</td>
|
112 |
+
</tr>
|
113 |
+
<tr>
|
114 |
+
<th scope="row"><?php _e('Port:', 'postie') ?><br />
|
115 |
+
<span class='recommendation'><?php _e("Standard Ports:", 'postie');?><br />
|
116 |
+
<?php _e("POP3", 'postie');?> - 110<br />
|
117 |
+
<?php _e("IMAP", 'postie');?> - 143<br />
|
118 |
+
<?php _e("IMAP-SSL", 'postie');?>- 993 <br />
|
119 |
+
<?php _e("POP3-SSL", 'postie');?> - 995 <br />
|
120 |
+
</span>
|
121 |
+
</th>
|
122 |
+
<td>
|
123 |
+
<input name="MAIL_SERVER_PORT" type="text" id="MAIL_SERVER_PORT" value="<?php echo $config["MAIL_SERVER_PORT"];?>" size="6" />
|
124 |
+
</td>
|
125 |
+
</tr>
|
126 |
+
<tr>
|
127 |
+
<th scope="row"><?php _e('Postie Time Correction:', 'postie') ?>
|
128 |
+
<br />
|
129 |
+
<span class='recommendation'><?php _e("Should be the same as your normal offset - but this lets you adjust it in cases where that doesn't work.", 'postie');?></span>
|
130 |
+
</th>
|
131 |
+
<td><input name="TIME_OFFSET" type="text" id="TIME_OFFSET" size="2" value="<?php echo $config['TIME_OFFSET']; ?>" />
|
132 |
+
<?php _e('hours', 'postie') ?>
|
133 |
|
134 |
+
</td>
|
135 |
+
</tr>
|
|
|
136 |
<tr valign="top">
|
137 |
<th scope="row"><?php _e('Mail Server:', 'postie') ?></th>
|
138 |
<td><input name="MAIL_SERVER" type="text" id="MAIL_SERVER" value="<?php echo $config["MAIL_SERVER"];?>" size="40" />
|
139 |
+
</td>
|
140 |
+
</tr>
|
|
|
|
|
141 |
<tr valign="top">
|
142 |
<th width="33%" scope="row"><?php _e('Mail Userid:', 'postie') ?></th>
|
143 |
<td><input name="MAIL_USERID" type="text" id="MAIL_USERID" value="<?php echo $config["MAIL_USERID"]; ?>" size="40" /></td>
|
149 |
</td>
|
150 |
</tr>
|
151 |
</table>
|
152 |
+
</div>
|
153 |
+
<div id="simpleTabs-content-2" class="simpleTabs-content">
|
154 |
+
<table class='form-table'>
|
155 |
|
|
|
|
|
|
|
|
|
156 |
<?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.");?>
|
157 |
<tr>
|
158 |
+
<th scope="row"><?php _e('Roles That Can Post:', 'postie') ?>
|
159 |
+
<br />
|
160 |
+
<span class='recommendation'><?php _e("This allows you to grant access to other users to post if they have the proper access level", 'postie');?></span></th>
|
161 |
<td>
|
162 |
<table>
|
163 |
<tr><th>Administrator role can always post.</th>
|
177 |
}
|
178 |
?>
|
179 |
</table>
|
|
|
|
|
180 |
</td>
|
181 |
</tr>
|
182 |
<tr>
|
189 |
"SELECTED";} ?>>Draft</option>
|
190 |
<option value="pending" <?php if($config["POST_STATUS"] == "pending") { echo
|
191 |
"SELECTED";} ?>>Pending Review</option>
|
192 |
+
<option value="private" <?php if($config["POST_STATUS"] == "private") { echo
|
193 |
+
"SELECTED";} ?>>Private</option>
|
194 |
+
</select> </td>
|
|
|
195 |
</tr>
|
196 |
<?php echo BuildTextArea("Authorized Addresses","AUTHORIZED_ADDRESSES",$config["AUTHORIZED_ADDRESSES"],"Put each email address on a single line. Posts from emails in this list will be treated as if they came from the admin. If you would prefer to have users post under their own name - create a WordPress user with the correct access level.");?>
|
197 |
<tr>
|
198 |
+
<th width="33%" valign="top" scope="row">
|
199 |
+
<?php _e('Admin username:') ?> </th>
|
200 |
<td>
|
201 |
<input name="ADMIN_USERNAME" type="text" id="ADMIN_USERNAME"
|
202 |
+
value="<?php echo $config["ADMIN_USERNAME"]; ?>" size="50" /> </td>
|
|
|
|
|
|
|
203 |
</tr>
|
204 |
</table>
|
205 |
+
</div>
|
206 |
+
<div id="simpleTabs-content-3" class="simpleTabs-content">
|
207 |
+
<table class='form-table'>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
<tr valign="top">
|
209 |
<th scope="row"><?php _e('Default post by mail category:', 'postie') ?></th>
|
210 |
<td>
|
211 |
<?php
|
212 |
$defaultCat=$config['DEFAULT_POST_CATEGORY'];
|
213 |
wp_dropdown_categories("name=DEFAULT_POST_CATEGORY&hierarchical=1&selected=$defaultCat&hide_empty=0"); ?>
|
214 |
+
</tr>
|
215 |
+
<tr valign="top">
|
216 |
+
<th scope="row">
|
217 |
+
<?php _e('Default post by mail tag(s)', 'postie') ?><br /><span
|
218 |
+
class='recommendation'><?php _e('separated by commas', 'postie')
|
219 |
+
?></span></th>
|
220 |
+
<td><input type='text' name="DEFAULT_POST_TAGS"
|
221 |
+
id="DEFAULT_POST_TAGS" value='<?php echo
|
222 |
+
$config["DEFAULT_POST_TAGS"] ?>' />
|
223 |
+
</td>
|
224 |
+
</tr>
|
225 |
+
<tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
<th width="33%" valign="top" scope="row"><?php _e('Default Title:', 'postie') ?> </th>
|
227 |
<td>
|
228 |
<input name="DEFAULT_TITLE" type="text" id="DEFAULT_TITLE" value="<?php echo $config["DEFAULT_TITLE"]; ?>" size="50" /><br />
|
|
|
229 |
<br />
|
230 |
</td>
|
231 |
</tr>
|
232 |
<tr>
|
233 |
+
<th width="33%" valign="top" scope="row"><?php _e('Preferred
|
234 |
+
Text Type:', 'postie') ?> </th>
|
235 |
<td>
|
236 |
<select name="PREFER_TEXT_TYPE" id="PREFER_TEXT_TYPE">
|
237 |
<option value="plain">plain</option>
|
238 |
<option value="html" <?php if($config["PREFER_TEXT_TYPE"] == "html") { echo "SELECTED";} ?>>html</option>
|
239 |
</select><br />
|
|
|
|
|
240 |
</td>
|
241 |
</tr>
|
242 |
+
<?php echo BuildBooleanSelect("Forward Rejected Mail","FORWARD_REJECTED_MAIL",$config["FORWARD_REJECTED_MAIL"]);?>
|
243 |
+
<?php echo BuildBooleanSelect("Allow Subject In Mail","ALLOW_SUBJECT_IN_MAIL",$config["ALLOW_SUBJECT_IN_MAIL"]);?>
|
244 |
+
<?php echo BuildBooleanSelect("Allow HTML In Mail Subject","ALLOW_HTML_IN_SUBJECT",$config["ALLOW_HTML_IN_SUBJECT"]);?>
|
245 |
+
<?php echo BuildBooleanSelect("Allow HTML In Mail Body","ALLOW_HTML_IN_BODY",$config["ALLOW_HTML_IN_BODY"]);?>
|
246 |
<tr>
|
247 |
+
<th width="33%" valign="top" scope="row"><?php _e('Tag Of
|
248 |
+
Message Start:', 'postie') ?> <br />
|
249 |
+
<span class='recommendation'><?php _e('Use to remove any text from a message that the email provider puts at the top of the message', 'postie') ?></span></th>
|
250 |
<td>
|
251 |
+
<input name="MESSAGE_START" type="text" id="MESSAGE_START" value="<?php echo $config["MESSAGE_START"]; ?>" size="20" /><br />
|
|
|
|
|
|
|
|
|
|
|
252 |
</td>
|
253 |
</tr>
|
254 |
<tr>
|
255 |
+
<th width="33%" valign="top" scope="row"><?php _e('Tag Of
|
256 |
+
Message End:', 'postie') ?> <br />
|
257 |
+
<span class='recommendation'><?php _e('Use to remove any text from a message that the email provider puts at the end of the message', 'postie') ?></span></th>
|
258 |
<td>
|
259 |
+
<input name="MESSAGE_END" type="text" id="MESSAGE_END" value="<?php echo $config["MESSAGE_END"]; ?>" size="20" /><br />
|
|
|
|
|
|
|
|
|
|
|
260 |
</td>
|
261 |
</tr>
|
262 |
+
</table>
|
263 |
+
<a style='cursor:pointer' onclick='showAdvanced("message-advanced", "message-advanced-arrow");'><span id="message-advanced-arrow">▶</span> Advanced options</a>
|
264 |
+
<div id="message-advanced" style='display:none;'>
|
265 |
+
<table class='form-table'>
|
266 |
+
<?php echo BuildBooleanSelect("Wrap content in pre tags","WRAP_PRE",$config["WRAP_PRE"]);?>
|
267 |
+
<?php echo BuildBooleanSelect("Filter newlines",
|
268 |
+
"FILTERNEWLINES",$config["FILTERNEWLINES"],
|
269 |
+
"Set to no if using markdown or textitle syntax");?>
|
270 |
<?php echo BuildBooleanSelect("Replace newline characters with
|
271 |
html line breaks (<br
|
272 |
/>)","CONVERTNEWLINE",$config["CONVERTNEWLINE"]);?>
|
273 |
+
<?php echo BuildBooleanSelect("Return rejected mail to sender","RETURN_TO_SENDER",$config["RETURN_TO_SENDER"]);?>
|
274 |
+
<?php echo BuildBooleanSelect("Send post confirmation e-mail to sender","CONFIRMATION_EMAIL",$config["CONFIRMATION_EMAIL"]);?>
|
|
|
|
|
275 |
<?php echo BuildBooleanSelect("Automatically convert urls to links","CONVERTURLS",$config["CONVERTURLS"]);?>
|
276 |
+
<?php echo BuildBooleanSelect("Use shortcode for embedding video (youtube and others)","SHORTCODE",$config["SHORTCODE"]);?>
|
277 |
<tr>
|
278 |
<th width="33%" valign="top" scope="row"><?php _e('Encoding for pages and feeds:', 'postie') ?> </th>
|
279 |
<td>
|
280 |
+
<input name="MESSAGE_ENCODING" type="text" id="MESSAGE_ENCODING" value="<?php echo $config["MESSAGE_ENCODING"]; ?>" size="10" />
|
281 |
+
<span class='recommendation'>UTF-8 <?php _e("should handle ISO-8859-1 as well", 'postie');?></span>
|
|
|
282 |
</td>
|
283 |
</tr>
|
284 |
+
<?php echo BuildBooleanSelect("Decode Quoted Printable Data","MESSAGE_DEQUOTE",$config["MESSAGE_DEQUOTE"]);?>
|
285 |
<?php echo BuildTextArea("Supported File Types","SUPPORTED_FILE_TYPES",$config["SUPPORTED_FILE_TYPES"],"Put each type on a single line.");?>
|
286 |
+
<?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. You can use wildcards such as *.xls, or *.* for all files");?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
287 |
<?php echo BuildBooleanSelect("Drop The Signature From Mail","DROP_SIGNATURE",$config["DROP_SIGNATURE"]);?>
|
288 |
+
<?php echo BuildTextArea("Signature Patterns","SIG_PATTERN_LIST",$config["SIG_PATTERN_LIST"],"Put each pattern on a separate line and make sure to escape any special characters.");?>
|
289 |
+
<?php echo BuildTextArea("Allowed SMTP
|
290 |
+
servers","SMTP",$config["SMTP"],"Only allow messages which have been sent throught the following smtp servers. Put each server on a separate line. Leave blank to not check stmp servers.");?>
|
291 |
</table>
|
292 |
+
</div> <!-- advanced options -->
|
293 |
+
</div>
|
294 |
+
<div id="simpleTabs-content-4" class="simpleTabs-content">
|
295 |
+
<table class='form-table'>
|
296 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
|
298 |
+
<?php echo BuildBooleanSelect("Post Images At
|
299 |
+
End","IMAGES_APPEND",$config["IMAGES_APPEND"],"No means they will be put before the text of the message.");?>
|
300 |
<?php echo BuildBooleanSelect("Start Image Count At 0","START_IMAGE_COUNT_AT_ZERO",$config["START_IMAGE_COUNT_AT_ZERO"]);?>
|
301 |
<tr>
|
302 |
<th width="33%" valign="top" scope="row"><?php _e('Image Place Holder Tag:', 'postie') ?> </th>
|
303 |
<td>
|
304 |
<input name="IMAGE_PLACEHOLDER" type="text" id="IMAGE_PLACEHOLDER" value="<?php echo $config["IMAGE_PLACEHOLDER"]; ?>" size="50" /><br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
305 |
</td>
|
306 |
</tr>
|
307 |
+
<tr>
|
308 |
+
<th width="33%" valign="top" scope="row"><?php _e('Image
|
309 |
+
Template', 'postie') ?><br />
|
310 |
+
<span class='recommendation'><?php _e('Choose a default template,
|
311 |
+
then customize to your liking in the text box',
|
312 |
+
'postie');?></span><br /><br />
|
313 |
+
<span class='recommendation'><?php _e('Sizes for thumbnail, medium, and large images can be chosen in the <a href="options-media.php">Media Settings</a>. The samples here use the default sizes, and will not reflect the sizes you have chosen.', 'postie');?></span>
|
314 |
+
</th>
|
315 |
+
<td>
|
316 |
+
<input type='hidden' id='SELECTED_IMAGETEMPLATE' name='SELECTED_IMAGETEMPLATE'
|
317 |
+
value="<?php echo attribute_escape($config['SELECTED_IMAGETEMPLATE']) ?>" />
|
318 |
+
<input type='hidden' id='CURRENT_IMAGETEMPLATE' value="<?php echo
|
319 |
+
attribute_escape($config['IMAGETEMPLATE']) ?>" />
|
320 |
+
<select name='IMAGETEMPLATESELECT' id='IMAGETEMPLATESELECT'
|
321 |
+
onchange="changeStyle('imageTemplatePreview','IMAGETEMPLATE',
|
322 |
+
'IMAGETEMPLATESELECT', 'SELECTED_IMAGETEMPLATE','smiling.jpg');" />
|
323 |
+
<?php
|
324 |
+
$styleOptions=unserialize($config['IMAGETEMPLATES']);
|
325 |
+
$selected=$config['SELECTED_IMAGETEMPLATE'];
|
326 |
+
foreach ($styleOptions as $key=>$value) {
|
327 |
+
if ($key!='selected') {
|
328 |
+
if ($key==$selected) {
|
329 |
+
$select=' selected=selected ';
|
330 |
+
} else {
|
331 |
+
$select=' ';
|
332 |
+
}
|
333 |
+
echo '<option' . $select . 'value="'.
|
334 |
+
attribute_escape($value) . '" >'.$key . '</option>';
|
335 |
+
}
|
336 |
+
}
|
337 |
+
?>
|
338 |
+
</select>
|
339 |
+
|
340 |
+
<?php _e('Preview', 'postie'); ?>
|
341 |
+
<span id='imageTemplatePreview' alt='preview'></span>
|
342 |
+
<textarea onchange='changeStyle("imageTemplatePreview", "IMAGETEMPLATE",
|
343 |
+
"IMAGETEMPLATESELECT", "SELECTED_IMAGETEMPLATE", "smiling.jpg", true);' cols='70' rows='7' id="IMAGETEMPLATE"
|
344 |
+
name="IMAGETEMPLATE"><?php echo attribute_escape($config['IMAGETEMPLATE']) ?></textarea>
|
345 |
+
</td>
|
346 |
</tr>
|
347 |
+
<?php echo BuildBooleanSelect("Use custom image field","CUSTOM_IMAGE_FIELD",$config["CUSTOM_IMAGE_FIELD"],"When true, images will not appear in the post. Instead the url to the image will be input into a custom field named 'image'.");?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
348 |
</table>
|
349 |
+
</div>
|
350 |
+
|
351 |
+
<!--
|
352 |
+
########## VIDEO AND AUDIO OPTIONS ###################
|
353 |
+
-->
|
354 |
+
|
355 |
+
<div id="simpleTabs-content-5" class="simpleTabs-content">
|
356 |
+
<table class='form-table'>
|
357 |
+
|
358 |
+
<tr><th scope='row'><?php _e('Video template 1', 'postie') ?><br />
|
359 |
+
<span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></span></th>
|
360 |
+
<?php $templateDir = get_option('siteurl') . '/' . PLUGINDIR . '/postie/templates'; ?>
|
361 |
+
<td>
|
362 |
+
<input type='hidden' id='SELECTED_VIDEO1TEMPLATE' name='SELECTED_VIDEO1TEMPLATE'
|
363 |
+
value="<?php echo attribute_escape($config['SELECTED_VIDEO1TEMPLATE']) ?>" />
|
364 |
+
<input type='hidden' id='CURRENT_VIDEO1TEMPLATE' value="<?php echo
|
365 |
+
attribute_escape($config['VIDEO1TEMPLATE']) ?>" />
|
366 |
+
<select name='VIDEO1TEMPLATESELECT' id='VIDEO1TEMPLATESELECT'
|
367 |
+
onchange="changeStyle('video1TemplatePreview','VIDEO1TEMPLATE', 'VIDEO1TEMPLATESELECT', 'SELECTED_VIDEO1TEMPLATE','hi.mp4');" />
|
368 |
+
<?php
|
369 |
+
$styleOptions=unserialize($config['VIDEO1TEMPLATES']);
|
370 |
+
$selected=$config['SELECTED_VIDEO1TEMPLATE'];
|
371 |
+
foreach ($styleOptions as $key=>$value) {
|
372 |
+
if ($key!='selected') {
|
373 |
+
if ($key==$selected) {
|
374 |
+
$select=' selected=selected ';
|
375 |
+
} else {
|
376 |
+
$select=' ';
|
377 |
+
}
|
378 |
+
echo '<option' . $select . 'value="'.
|
379 |
+
attribute_escape($value) . '" >'.$key . '</option>';
|
380 |
+
}
|
381 |
+
}
|
382 |
+
?>
|
383 |
+
</select>
|
384 |
+
|
385 |
+
<?php _e('Preview', 'postie'); ?>
|
386 |
+
<span id='video1TemplatePreview' alt='preview'></span>
|
387 |
+
<textarea onchange="changeStyle('video1TemplatePreview','VIDEO1TEMPLATE',
|
388 |
+
'VIDEO1TEMPLATESELECT', 'SELECTED_VIDEO1TEMPLATE','hi.mp4',true);" cols='70' rows='7' id="VIDEO1TEMPLATE"
|
389 |
+
name="VIDEO1TEMPLATE"><?php echo attribute_escape($config['VIDEO1TEMPLATE']) ?></textarea>
|
390 |
+
</td>
|
391 |
+
</tr>
|
392 |
+
<tr>
|
393 |
+
<th width="33%" valign="top" scope="row">
|
394 |
+
<?php _e('Video 1 file types:') ?><br /><span class='recommendation'>
|
395 |
+
<?php _e('Use the video template 1 for these files types (separated by
|
396 |
+
commas)', 'postie') ?></span> </th>
|
397 |
+
<td>
|
398 |
+
<input name="VIDEO1TYPES" type="text" id="VIDEO1TYPES"
|
399 |
+
value="<?php if ($config['VIDEO1TYPES']!='') echo implode(', ', $config["VIDEO1TYPES"]); ?>" size="40" /> </td>
|
400 |
+
</tr>
|
401 |
+
<tr><th scope='row'><?php _e('Video template 2', 'postie') ?><br />
|
402 |
+
<span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></span></th>
|
403 |
+
<td>
|
404 |
+
<input type='hidden' id='SELECTED_VIDEO2TEMPLATE' name='SELECTED_VIDEO2TEMPLATE'
|
405 |
+
value="<?php echo attribute_escape($config['SELECTED_VIDEO2TEMPLATE']) ?>" />
|
406 |
+
<input type='hidden' id='CURRENT_VIDEO2TEMPLATE' value="<?php echo
|
407 |
+
attribute_escape($config['VIDEO2TEMPLATE']) ?>" />
|
408 |
+
<select name='VIDEO2TEMPLATESELECT' id='VIDEO2TEMPLATESELECT'
|
409 |
+
onchange="changeStyle('video2TemplatePreview','VIDEO2TEMPLATE', 'VIDEO2TEMPLATESELECT', 'SELECTED_VIDEO2TEMPLATE','hi.flv');" />
|
410 |
+
<?php
|
411 |
+
$styleOptions=unserialize($config['VIDEO2TEMPLATES']);
|
412 |
+
$selected=$config['SELECTED_VIDEO2TEMPLATE'];
|
413 |
+
foreach ($styleOptions as $key=>$value) {
|
414 |
+
if ($key!='selected') {
|
415 |
+
if ($key==$selected) {
|
416 |
+
$select=' selected=selected ';
|
417 |
+
} else {
|
418 |
+
$select=' ';
|
419 |
+
}
|
420 |
+
echo '<option' . $select . 'value="'.
|
421 |
+
attribute_escape($value) . '" >'.$key . '</option>';
|
422 |
+
}
|
423 |
+
}
|
424 |
+
?>
|
425 |
+
</select>
|
426 |
+
|
427 |
+
<?php _e('Preview', 'postie'); ?>
|
428 |
+
<span id='video2TemplatePreview' alt='preview'></span>
|
429 |
+
<textarea onchange="changeStyle('video2TemplatePreview','VIDEO2TEMPLATE',
|
430 |
+
'VIDEO2TEMPLATESELECT', 'SELECTED_VIDEO2TEMPLATE','hi.flv',true);" cols='70' rows='7' id="VIDEO2TEMPLATE"
|
431 |
+
name="VIDEO2TEMPLATE"><?php echo attribute_escape($config['VIDEO2TEMPLATE']) ?></textarea>
|
432 |
+
</td>
|
433 |
+
</tr>
|
434 |
+
<tr>
|
435 |
+
<th width="33%" valign="top" scope="row">
|
436 |
+
<?php _e('Video 2 file types:') ?><br /><span class='recommendation'>
|
437 |
+
<?php _e('Use the video template 2 for these files types (separated by
|
438 |
+
commas)', 'postie') ?></span> </th>
|
439 |
+
<td>
|
440 |
+
<input name="VIDEO2TYPES" type="text" id="VIDEO2TYPES"
|
441 |
+
value="<?php if ($config['VIDEO2TYPES']!='') echo implode(', ', $config["VIDEO2TYPES"]); ?>" size="40" /> </td>
|
442 |
+
</tr>
|
443 |
+
<tr><th scope='row'><?php _e('Audio template', 'postie') ?><br />
|
444 |
+
<span class='recommendation'><?php _e('Choose a default template, then customize to your liking in the text box', 'postie') ?></span></th>
|
445 |
+
<td>
|
446 |
+
<input type='hidden' id='SELECTED_AUDIOTEMPLATE' name='SELECTED_AUDIOTEMPLATE'
|
447 |
+
value="<?php echo attribute_escape($config['SELECTED_AUDIOTEMPLATE']) ?>" />
|
448 |
+
<input type='hidden' id='CURRENT_AUDIOTEMPLATE' value="<?php echo
|
449 |
+
attribute_escape($config['AUDIOTEMPLATE']) ?>" />
|
450 |
+
<select name='AUDIOTEMPLATESELECT' id='AUDIOTEMPLATESELECT'
|
451 |
+
onchange="changeStyle('audioTemplatePreview','AUDIOTEMPLATE',
|
452 |
+
'AUDIOTEMPLATESELECT', 'SELECTED_AUDIOTEMPLATE','funky.mp3', false);" />
|
453 |
+
<?php
|
454 |
+
$styleOptions=unserialize($config['AUDIOTEMPLATES']);
|
455 |
+
echo "audiotemplates= " . $config['AUDIOTEMPLATES'];
|
456 |
+
$selected=$config['SELECTED_AUDIOTEMPLATE'];
|
457 |
+
foreach ($styleOptions as $key=>$value) {
|
458 |
+
if ($key!='selected') {
|
459 |
+
if ($key==$selected) {
|
460 |
+
$select=' selected=selected ';
|
461 |
+
} else {
|
462 |
+
$select=' ';
|
463 |
+
}
|
464 |
+
echo '<option' . $select . 'value="'.
|
465 |
+
attribute_escape($value) . '" >'.$key . '</option>';
|
466 |
+
}
|
467 |
+
}
|
468 |
+
?>
|
469 |
+
</select>
|
470 |
+
|
471 |
+
<?php _e('Preview', 'postie'); ?>
|
472 |
+
<span id='audioTemplatePreview' alt='preview'></span>
|
473 |
+
<textarea onchange="changeStyle('audioTemplatePreview','AUDIOTEMPLATE',
|
474 |
+
'AUDIOTEMPLATESELECT', 'SELECTED_AUDIOTEMPLATE','funky.mp3', true);" cols='70' rows='7' id="AUDIOTEMPLATE"
|
475 |
+
name="AUDIOTEMPLATE"><?php echo attribute_escape($config['AUDIOTEMPLATE']) ?></textarea>
|
476 |
+
</td>
|
477 |
+
</tr>
|
478 |
+
<tr>
|
479 |
+
<th width="33%" valign="top" scope="row">
|
480 |
+
<?php _e('Audio file types:') ?><br /><span class='recommendation'>
|
481 |
+
<?php _e('Use the audio template for these files types (separated by
|
482 |
+
commas)', 'postie') ?></span> </th>
|
483 |
+
<td>
|
484 |
+
<input name="AUDIOTYPES" type="text" id="AUDIOTYPES"
|
485 |
+
value="<?php if ($config['AUDIOTYPES']!='') echo implode(', ', $config["AUDIOTYPES"]); ?>" size="40" /> </td>
|
486 |
+
</tr>
|
487 |
</table>
|
|
|
488 |
</td>
|
489 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
</table>
|
491 |
+
</div>
|
492 |
+
<div id="simpleTabs-content-6" class="simpleTabs-content">
|
493 |
+
<table class='form-table'>
|
494 |
+
|
495 |
+
<tr><th scope='row'><?php _e('Attachment icon set', 'postie') ?><br />
|
496 |
+
<td>
|
497 |
+
<input type='hidden' id='ICON_SET' name='ICON_SET'
|
498 |
+
value="<?php echo attribute_escape($config['ICON_SET']) ?>" />
|
499 |
+
<select name='ICON_SET_SELECT' id='ICON_SET_SELECT'
|
500 |
+
onchange="changeIconSet(this);" />
|
501 |
+
<?php
|
502 |
+
$styleOptions=$config['ICON_SETS'];
|
503 |
+
$selected=$config['ICON_SET'];
|
504 |
+
foreach ($styleOptions as $key) {
|
505 |
+
if ($key!='selected') {
|
506 |
+
if ($key==$selected) {
|
507 |
+
$select=' selected=selected ';
|
508 |
+
} else {
|
509 |
+
$select=' ';
|
510 |
+
}
|
511 |
+
echo '<option' . $select . 'value="'.
|
512 |
+
attribute_escape($key) . '" >'.$key . '</option>';
|
513 |
+
}
|
514 |
+
}
|
515 |
+
?>
|
516 |
+
</select>
|
517 |
+
</td>
|
518 |
+
</tr>
|
519 |
+
<tr><th scope='row'><?php _e('Attachment icon size (in pixels)', 'postie') ?><br />
|
520 |
+
<td>
|
521 |
+
<input type='hidden' id='ICON_SIZE' name='ICON_SIZE'
|
522 |
+
value="<?php echo attribute_escape($config['ICON_SIZE']) ?>" />
|
523 |
+
<select name='ICON_SIZE_SELECT' id='ICON_SIZE_SELECT'
|
524 |
+
onchange="changeIconSet(this, true);" />
|
525 |
+
<?php
|
526 |
+
$styleOptions=$config['ICON_SIZES'];
|
527 |
+
$selected=$config['ICON_SIZE'];
|
528 |
+
foreach ($styleOptions as $key) {
|
529 |
+
if ($key!='selected') {
|
530 |
+
if ($key==$selected) {
|
531 |
+
$select=' selected=selected ';
|
532 |
+
} else {
|
533 |
+
$select=' ';
|
534 |
+
}
|
535 |
+
echo '<option' . $select . 'value="'.
|
536 |
+
attribute_escape($key) . '" >'.$key . '</option>';
|
537 |
+
}
|
538 |
+
}
|
539 |
+
?>
|
540 |
+
</select>
|
541 |
+
</td>
|
542 |
+
</tr>
|
543 |
+
<tr>
|
544 |
+
<th style='height:64px'>
|
545 |
+
<?php _e('Preview', 'postie'); ?>
|
546 |
+
</th>
|
547 |
+
<td>
|
548 |
+
<span id='ATTACHMENT_PREVIEW'></span>
|
549 |
+
</td>
|
550 |
+
</tr>
|
551 |
+
</tr>
|
552 |
+
</table>
|
553 |
+
</div>
|
554 |
+
<div id="simpleTabs-content-7" class="simpleTabs-content">
|
555 |
+
<?php include('readme.html'); ?>
|
556 |
+
</div>
|
557 |
+
<div id="simpleTabs-content-8" class="simpleTabs-content">
|
558 |
+
<?php include('faq.html'); ?>
|
559 |
+
</div>
|
560 |
+
<input type="submit" name="Submit" value="<?php _e('Update Options', 'postie') ?> »" class='button' />
|
561 |
</form>
|
562 |
+
<div id="w3c">
|
563 |
+
<a href="http://validator.w3.org/check?uri=referer"><img src="<?php echo '../wp-content/plugins/postie/images/valid-xhtml10-blue.png'; ?>" alt="Valid XHTML 1.0 Transitional" height="31" width="88" /></a>
|
564 |
+
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img style="border:0;width:88px;height:31px" src="<?php echo '../wp-content/plugins/postie/images/vcss-blue.gif'; ?>" alt="Valid CSS!" /></a>
|
565 |
+
</div>
|
566 |
Postie Version:
|
567 |
+
$Id: config_form.php 145637 2009-08-13 21:08:39Z robfelty $
|
568 |
</div>
|
569 |
+
|
570 |
+
<?php $iconDir = get_option('siteurl') . '/' . PLUGINDIR . '/postie/icons'; ?>
|
571 |
+
<script type="text/javascript">
|
572 |
+
jQuery(document).ready(function() {
|
573 |
+
jQuery("#simpleTabs").simpleTabs({
|
574 |
+
fadeSpeed: "medium", // @param : low, medium, fast
|
575 |
+
defautContent: 1, // @param : number ( simpleTabs-nav-number)
|
576 |
+
autoNav: "false", // @param : true or false
|
577 |
+
closeTabs : "false" // @param : true or false;
|
578 |
+
});
|
579 |
+
|
580 |
+
});
|
581 |
+
function changeIconSet(selectBox, size) {
|
582 |
+
var iconSet=document.getElementById('ICON_SET');
|
583 |
+
var iconSize=document.getElementById('ICON_SIZE');
|
584 |
+
var preview=document.getElementById('ATTACHMENT_PREVIEW');
|
585 |
+
var iconDir = '<?php echo $iconDir ?>/';
|
586 |
+
if (size==true) {
|
587 |
+
var hiddenInput=iconSize
|
588 |
+
} else {
|
589 |
+
var hiddenInput=iconSet;
|
590 |
+
}
|
591 |
+
for(i=0; i<selectBox.options.length; i++) {
|
592 |
+
if (selectBox.options[i].selected == true) {
|
593 |
+
hiddenInput.value=selectBox.options[i].value;
|
594 |
+
}
|
595 |
+
}
|
596 |
+
var fileTypes= new Array('doc', 'pdf', 'xls', 'ppt');
|
597 |
+
preview.innerHTML='';
|
598 |
+
for (j=0; j<fileTypes.length; j++) {
|
599 |
+
preview.innerHTML+="<img src='" + iconDir + iconSet.value + '/' +
|
600 |
+
fileTypes[j] + '-' + iconSize.value + ".png' />";
|
601 |
+
}
|
602 |
+
preview.innerHTML+='<br />Here is some sample text with a link to a' +
|
603 |
+
'word document that I think you might find interesting<br />' +
|
604 |
+
"<a href='#'><img style='text-decoration:none' src='" +
|
605 |
+
iconDir + iconSet.value + '/doc' +
|
606 |
+
'-' + iconSize.value + ".png' />Interesting document</a>";
|
607 |
+
}
|
608 |
+
function changeStyle(preview,template,select,selected,sample,custom) {
|
609 |
+
var preview = document.getElementById(preview);
|
610 |
+
var pageStyles = document.getElementById(select);
|
611 |
+
var selectedStyle;
|
612 |
+
var hiddenStyle=document.getElementById(selected);
|
613 |
+
var pageStyle = document.getElementById(template);
|
614 |
+
if (custom==true) {
|
615 |
+
selectedStyle=pageStyles.options[pageStyles.options.length-1];
|
616 |
+
selectedStyle.value=pageStyle.value;
|
617 |
+
selectedStyle.selected=true;
|
618 |
+
} else {
|
619 |
+
for(i=0; i<pageStyles.options.length; i++) {
|
620 |
+
if (pageStyles.options[i].selected == true) {
|
621 |
+
selectedStyle=pageStyles.options[i];
|
622 |
+
}
|
623 |
+
}
|
624 |
+
}
|
625 |
+
hiddenStyle.value=selectedStyle.innerHTML
|
626 |
+
var previewHTML=selectedStyle.value;
|
627 |
+
var fileLink = '<?php echo $templateDir ?>/' + sample;
|
628 |
+
var thumb = '<?php echo $templateDir ?>/' + sample.replace(/\.jpg/,
|
629 |
+
'-150x150.jpg');
|
630 |
+
var medium = '<?php echo $templateDir ?>/' + sample.replace(/\.jpg/,
|
631 |
+
'-300x200.jpg');
|
632 |
+
var large = '<?php echo $templateDir ?>/' + sample.replace(/\.jpg/,
|
633 |
+
'-1024x682.jpg');
|
634 |
+
previewHTML=previewHTML.replace(/{FILELINK}/g, fileLink);
|
635 |
+
previewHTML=previewHTML.replace(/{IMAGE}/g, fileLink);
|
636 |
+
previewHTML=previewHTML.replace(/{FILENAME}/, sample);
|
637 |
+
previewHTML=previewHTML.replace(/{THUMB(NAIL|)}/, thumb);
|
638 |
+
previewHTML=previewHTML.replace(/{MEDIUM}/, medium);
|
639 |
+
previewHTML=previewHTML.replace(/{LARGE}/, large);
|
640 |
+
previewHTML=previewHTML.replace(/{CAPTION}/g, 'Spencer smiling');
|
641 |
+
preview.innerHTML=previewHTML;
|
642 |
+
pageStyle.value=selectedStyle.value;
|
643 |
+
}
|
644 |
+
function restoreStyle(current,template) {
|
645 |
+
var defaultStyle = document.getElementById(current).value;
|
646 |
+
var pageStyle = document.getElementById(template);
|
647 |
+
pageStyle.value=defaultStyle;
|
648 |
+
}
|
649 |
+
|
650 |
+
function showAdvanced(advancedId, arrowId) {
|
651 |
+
var advanced = document.getElementById(advancedId);
|
652 |
+
var arrow = document.getElementById(arrowId);
|
653 |
+
if (advanced.style.display=='none') {
|
654 |
+
advanced.style.display='block';
|
655 |
+
arrow.innerHTML='▼';
|
656 |
+
} else {
|
657 |
+
advanced.style.display='none';
|
658 |
+
arrow.innerHTML='▶';
|
659 |
+
}
|
660 |
+
}
|
661 |
+
|
662 |
+
changeStyle('audioTemplatePreview','AUDIOTEMPLATE', 'AUDIOTEMPLATESELECT',
|
663 |
+
'SELECTED_AUDIOTEMPLATE','funky.mp3', false);
|
664 |
+
changeStyle('imageTemplatePreview','IMAGETEMPLATE', 'IMAGETEMPLATESELECT',
|
665 |
+
'SELECTED_AUDIOTEMPLATE','smiling.jpg', false);
|
666 |
+
changeStyle('video1TemplatePreview','VIDEO1TEMPLATE', 'VIDEO1TEMPLATESELECT',
|
667 |
+
'SELECTED_VIDEO1TEMPLATE','hi.mp4', false);
|
668 |
+
changeStyle('video2TemplatePreview','VIDEO2TEMPLATE', 'VIDEO2TEMPLATESELECT',
|
669 |
+
'SELECTED_VIDEO2TEMPLATE','hi.flv', false);
|
670 |
+
changeIconSet(document.getElementById('ICON_SET_SELECT'));
|
671 |
+
</script>
|
config_handler.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* This file handles submissions from the config form
|
4 |
-
*/
|
5 |
-
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR ."postie-functions.php");
|
6 |
-
|
7 |
-
if (isset($_POST["action"])) {
|
8 |
-
switch($_POST["action"]) {
|
9 |
-
|
10 |
-
case "reset":
|
11 |
-
ResetPostieConfig();
|
12 |
-
$message = 1;
|
13 |
-
break;
|
14 |
-
case "cronless":
|
15 |
-
check_postie();
|
16 |
-
$message = 1;
|
17 |
-
break;
|
18 |
-
case "test":
|
19 |
-
$location = get_option('siteurl') . '/wp-admin/options-general.php?page=postie/postie_test.php';
|
20 |
-
header("Location: $location\n\n");
|
21 |
-
exit;
|
22 |
-
break;
|
23 |
-
case "config":
|
24 |
-
if( UpdatePostieConfig($_POST)) {
|
25 |
-
$message = 1;
|
26 |
-
}
|
27 |
-
else {
|
28 |
-
$message = 2;
|
29 |
-
}
|
30 |
-
break;
|
31 |
-
default:
|
32 |
-
$message = 2;
|
33 |
-
break;
|
34 |
-
}
|
35 |
-
$location = get_option('siteurl') . '/wp-admin/options-general.php?page=postie/postie.php';
|
36 |
-
header("Location: $location&message=$message\n\n");
|
37 |
-
exit();
|
38 |
-
}
|
39 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cronless_postie.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Cronless Postie
|
|
4 |
Plugin URI: http://blog.robfelty.com/plugins/postie
|
5 |
Description: Checks e-mail periodically using wordpress's built-in scheduling mechanism
|
6 |
Author: Robert Felty
|
7 |
-
Version: 1.
|
8 |
Author URI: http://blog.robfelty.com
|
9 |
*/
|
10 |
|
@@ -63,8 +63,8 @@ function postie_decron() {
|
|
63 |
function more_reccurences() {
|
64 |
return array(
|
65 |
'weekly' => array('interval' => 604800, 'display' => 'Once Weekly'),
|
66 |
-
'twiceperhour' => array('interval' => 1800, 'display' => 'Twice per hour
|
67 |
-
'
|
68 |
);
|
69 |
}
|
70 |
add_filter('cron_schedules', 'more_reccurences');
|
4 |
Plugin URI: http://blog.robfelty.com/plugins/postie
|
5 |
Description: Checks e-mail periodically using wordpress's built-in scheduling mechanism
|
6 |
Author: Robert Felty
|
7 |
+
Version: 1.3.1
|
8 |
Author URI: http://blog.robfelty.com
|
9 |
*/
|
10 |
|
63 |
function more_reccurences() {
|
64 |
return array(
|
65 |
'weekly' => array('interval' => 604800, 'display' => 'Once Weekly'),
|
66 |
+
'twiceperhour' => array('interval' => 1800, 'display' => 'Twice per hour '),
|
67 |
+
'tenminutes' =>array('interval' => 600, 'display' => 'Every 10 minutes')
|
68 |
);
|
69 |
}
|
70 |
add_filter('cron_schedules', 'more_reccurences');
|
css/Thumbs.db
ADDED
Binary file
|
css/menu-bits.gif
ADDED
Binary file
|
css/simpleTabs.css
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#simpleTabs {
|
2 |
+
width: 98%;
|
3 |
+
border: 1px solid #c9efec;
|
4 |
+
border-top: none;
|
5 |
+
margin-top: 10px;
|
6 |
+
margin-bottom: 10px;
|
7 |
+
}
|
8 |
+
.simpleTabs-nav ul{
|
9 |
+
overflow: hidden;
|
10 |
+
list-style: none;
|
11 |
+
margin: 0;
|
12 |
+
padding: 0;
|
13 |
+
background: #e1efee;
|
14 |
+
}
|
15 |
+
.simpleTabs-nav li{
|
16 |
+
float: left;
|
17 |
+
padding: 5px 15px;
|
18 |
+
color: #6d6d6d;
|
19 |
+
cursor: pointer;
|
20 |
+
text-align: center;
|
21 |
+
}
|
22 |
+
.simpleTabs-nav li:hover{
|
23 |
+
background: #c9efec;
|
24 |
+
}
|
25 |
+
.simpleTabs-nav li.close{
|
26 |
+
float: right;
|
27 |
+
}
|
28 |
+
.simpleTabs-nav li.actif{
|
29 |
+
color: #fff;
|
30 |
+
font-weight: bold;
|
31 |
+
background:#6D6D6D url(../images/menu-bits.gif) repeat-x scroll left top;
|
32 |
+
}
|
33 |
+
.simpleTabs-content{
|
34 |
+
clear: both;
|
35 |
+
padding: 10px;
|
36 |
+
}
|
css/style.css
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
div input.button {
|
2 |
+
margin: 3px 0px 3px 0px;
|
3 |
+
}
|
4 |
+
|
5 |
+
.wrap h2 img {
|
6 |
+
vertical-align:middle;
|
7 |
+
margin-right: 10px;
|
8 |
+
}
|
9 |
+
|
10 |
+
#w3c {
|
11 |
+
margin-top: 50px;
|
12 |
+
}
|
13 |
+
|
14 |
+
table.form-table td {line-height:1em;
|
15 |
+
margin:0;
|
16 |
+
padding:0;
|
17 |
+
font-size:1em;}
|
18 |
+
table.form-table th {width:40%;
|
19 |
+
font-weight:bold;}
|
20 |
+
span.recommendation {font-size:.7em;
|
21 |
+
font-weight:normal;
|
22 |
+
color:#222;
|
23 |
+
}
|
24 |
+
div.simpleTabs-content ul {margin-left:1em}
|
25 |
+
div.simpleTabs-content li {list-style-type:disc;
|
26 |
+
margin-left:1em;}
|
27 |
+
div.simpleTabs-content li li {list-style-type:square;}
|
28 |
+
div.simpleTabs-content li li li {list-style-type:circle;}
|
faq.html
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<li id='question-0'><a href='#answer-0'>Mail is not showing up right when I send html (rich formatted) e-mail!</a></li>
|
2 |
+
<li id='question-1'><a href='#answer-1'>Do I need to any code to my theme for postie to work?</a></li>
|
3 |
+
<li id='question-2'><a href='#answer-2'>I read somewhere to add an iframe to my footer. Should I do this?</a></li>
|
4 |
+
<li id='question-3'><a href='#answer-3'>My mail host requires SSL, but postie will not allow me to select pop3-ssl or imap-ssl</a></li>
|
5 |
+
<li id='question-4'><a href='#answer-4'>Can I use postie to check a gmail account?</a></li>
|
6 |
+
<li id='question-5'><a href='#answer-5'>My posts show up as being posted by 'admin' instead of me. Why?</a></li>
|
7 |
+
<li id='question-6'><a href='#answer-6'>Images aren't showing up at all?</a></li>
|
8 |
+
<li id='question-7'><a href='#answer-7'>Can I delete the wp-files directory needed by postie version <1.3.0?</a></li>
|
9 |
+
<li id='question-8'><a href='#answer-8'>How can I get rid of stupid stuff my e-mail provider adds to my messages?</a></li>
|
10 |
+
<li id='question-9'><a href='#answer-9'>How can I add custom attachment icons?</a></li>
|
11 |
+
<li id='question-10'><a href='#answer-10'>Can I add special text to the body of the post when using postie?</a></li>
|
12 |
+
<li id='question-11'><a href='#answer-11'>Can I add special text to the title of the post when using postie?</a></li>
|
13 |
+
<h3>Frequently Asked Questions</h3>
|
14 |
+
<h4 id='answer-0'>Mail is not showing up right when I send html (rich formatted) e-mail!</h4>
|
15 |
+
|
16 |
+
<p>Make sure you set the preferred text type to html</p>
|
17 |
+
|
18 |
+
<h4 id='answer-1'>Do I need to any code to my theme for postie to work?</h4>
|
19 |
+
|
20 |
+
<p>No. </p>
|
21 |
+
|
22 |
+
<h4 id='answer-2'>I read somewhere to add an iframe to my footer. Should I do this?</h4>
|
23 |
+
|
24 |
+
<p>No. Do not add an iframe in your footer to get postie to check mail
|
25 |
+
periodically. To check e-mail periodically, either set-up a cron job, or use
|
26 |
+
cronless postie. See installation instructions</p>
|
27 |
+
|
28 |
+
<h4 id='answer-3'>My mail host requires SSL, but postie will not allow me to select pop3-ssl or imap-ssl</h4>
|
29 |
+
|
30 |
+
<p>You must have php-imap installed on your server for this to work. Ask your
|
31 |
+
hosting provider about this.</p>
|
32 |
+
|
33 |
+
<h4 id='answer-4'>Can I use postie to check a gmail account?</h4>
|
34 |
+
|
35 |
+
<p>Yes. You can use either pop3-ssl or imap-ssl with a gmail account. Before
|
36 |
+
attempting to use with postie, make sure that you enable pop or imap in your
|
37 |
+
gmail preferences.</p>
|
38 |
+
|
39 |
+
<ul>
|
40 |
+
<li>Pop3 settings:
|
41 |
+
|
42 |
+
<ul>
|
43 |
+
<li>protocol - pop3-ssl</li>
|
44 |
+
<li>server - pop.gmail.com</li>
|
45 |
+
<li>port - 995</li>
|
46 |
+
<li>userid - your username (e.g. if your e-mail address is foo@gmail.com,
|
47 |
+
this would be just foo)</li>
|
48 |
+
<li>password - your password </li>
|
49 |
+
</ul></li>
|
50 |
+
<li>IMAP settings:
|
51 |
+
|
52 |
+
<ul>
|
53 |
+
<li>protocol - imap-ssl</li>
|
54 |
+
<li>server - imap.gmail.com</li>
|
55 |
+
<li>port - 993</li>
|
56 |
+
<li>userid - your username (e.g. if your e-mail address is foo@gmail.com,
|
57 |
+
this would be just foo)</li>
|
58 |
+
<li>password - your password </li>
|
59 |
+
</ul></li>
|
60 |
+
</ul>
|
61 |
+
|
62 |
+
<h4 id='answer-5'>My posts show up as being posted by 'admin' instead of me. Why?</h4>
|
63 |
+
|
64 |
+
<p>If your admin account is linked to bar@gmail.com, and you send mail from
|
65 |
+
bar@gmail.com, it will show up as being posted by admin. If you have a
|
66 |
+
wordpress user named "John Doe", which is linked to johndoe@gmail.com, make
|
67 |
+
sure that you send e-mails from johndoe@gmail.com. It doesn't matter which
|
68 |
+
e-mail address postie is checking. That is, if you send mail from
|
69 |
+
johndoe@gmail.com to foo@gmail.com, it gets posted as "John Doe". </p>
|
70 |
+
|
71 |
+
<p>If you send an e-mail to your postie address from an e-mail address that is no
|
72 |
+
t linked to a wordpress user, it will get posted as admin.</p>
|
73 |
+
|
74 |
+
<h4 id='answer-6'>Images aren't showing up at all?</h4>
|
75 |
+
|
76 |
+
<p>There are a couple possible reasons for this. First, check to see if you can
|
77 |
+
add an image through wordpress's normal posting mechanism. If not, then there
|
78 |
+
is probably 1 or 2 problems:
|
79 |
+
1. Your server does not have the php-gd library installed. Ask your hosting
|
80 |
+
provider about this.</p>
|
81 |
+
|
82 |
+
<ol>
|
83 |
+
<li>Your wp-content/uploads directory is not writable by the webserver. Make
|
84 |
+
sure that it is</li>
|
85 |
+
</ol>
|
86 |
+
|
87 |
+
<h4 id='answer-7'>Can I delete the wp-files directory needed by postie version <1.3.0?</h4>
|
88 |
+
|
89 |
+
<p>If you have posts published already by older versions of postie, getting rid
|
90 |
+
of those directories will delete any files you might have had associated with
|
91 |
+
those old posts. If you don't have any such posts, then you can safely delete
|
92 |
+
them.</p>
|
93 |
+
|
94 |
+
<h4 id='answer-8'>How can I get rid of stupid stuff my e-mail provider adds to my messages?</h4>
|
95 |
+
|
96 |
+
<p>To strip off stuff that they add at the beginning of a message, start your
|
97 |
+
post with :start</p>
|
98 |
+
|
99 |
+
<p>To strip off stuff that they add at the end of a message, end your
|
100 |
+
post with :end</p>
|
101 |
+
|
102 |
+
<h4 id='answer-9'>How can I add custom attachment icons?</h4>
|
103 |
+
|
104 |
+
<p>Simply upload the icons you want to the postie/icons/custom directory. You
|
105 |
+
must name the icons according to the following scheme:
|
106 |
+
{filetype}-{size}.png</p>
|
107 |
+
|
108 |
+
<p>For example, for word documents, you could use:</p>
|
109 |
+
|
110 |
+
<pre><code>doc-32.png
|
111 |
+
</code></pre>
|
112 |
+
|
113 |
+
<p>for a 32x32 pixel icon. (You can actually create any size icon you want, but
|
114 |
+
if you name it 32, then it will only be used if you select to use size 32
|
115 |
+
icons)</p>
|
116 |
+
|
117 |
+
<p>See the other directories in icons for more examples.</p>
|
118 |
+
|
119 |
+
<p>Currently the following filetypes are supported:</p>
|
120 |
+
|
121 |
+
<ul>
|
122 |
+
<li>doc - microsoft word (including docx)</li>
|
123 |
+
<li>ppt - microsoft powerpoint (including pptx)</li>
|
124 |
+
<li>xls - microsoft excel (including xlsx)</li>
|
125 |
+
<li>numbers - iWork numbres spreadsheet</li>
|
126 |
+
<li>pages - iWork pages document</li>
|
127 |
+
<li>key - iWork keynote presentation</li>
|
128 |
+
<li>pdf - portable document format</li>
|
129 |
+
<li>rtf - rich text format</li>
|
130 |
+
<li>txt - plain text document</li>
|
131 |
+
</ul>
|
132 |
+
|
133 |
+
<h4 id='answer-10'>Can I add special text to the body of the post when using postie?</h4>
|
134 |
+
|
135 |
+
<p>Yes. You can create your own function, and use the postie_post filter
|
136 |
+
Two short examples are included in the filterPostie.php file</p>
|
137 |
+
|
138 |
+
<h4 id='answer-11'>Can I add special text to the title of the post when using postie?</h4>
|
139 |
+
|
140 |
+
<p>Yes. You can create your own function, and use the postie_post filter
|
141 |
+
Two short examples are included in the filterPostie.php file</p>
|
filterPostie.php
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Postie Filter
|
4 |
+
Plugin URI: http://blog.robfelty.com/plugins/postie
|
5 |
+
Description: Adds my own custom filter to messages posted by postie
|
6 |
+
Version: 1.3.1
|
7 |
+
Author: Robert Felty
|
8 |
+
Author URI: http://blog.robfelty.com/
|
9 |
+
*/
|
10 |
+
|
11 |
+
/*
|
12 |
+
* Any filter function you write should accept one argument, which is the post
|
13 |
+
array, which contains the following fields:
|
14 |
+
'post_author'
|
15 |
+
'comment_author'
|
16 |
+
'comment_author_url'
|
17 |
+
'user_ID'
|
18 |
+
'email_author'
|
19 |
+
'post_date'
|
20 |
+
'post_date_gmt'
|
21 |
+
'post_content'
|
22 |
+
'post_title'
|
23 |
+
'post_modified'
|
24 |
+
'post_modified_gmt'
|
25 |
+
'ping_status'
|
26 |
+
'post_category'
|
27 |
+
'tags_input'
|
28 |
+
'comment_status'
|
29 |
+
'post_name'
|
30 |
+
'post_excerpt'
|
31 |
+
'ID'
|
32 |
+
'customImages'
|
33 |
+
'post_status'
|
34 |
+
|
35 |
+
Your function can modify any of these fields. It should then return the array
|
36 |
+
back.
|
37 |
+
|
38 |
+
Two example functions are provided here
|
39 |
+
*/
|
40 |
+
|
41 |
+
function filter_content($post) {
|
42 |
+
//this function prepends a link to bookmark the category of the post
|
43 |
+
$this_cat = get_the_category($post['ID']);
|
44 |
+
//var_dump($this_cat);
|
45 |
+
$link = '<a href="' . get_category_link($this_cat[0]->term_id) .
|
46 |
+
'">Bookmark this category</a>' . "\n";
|
47 |
+
$post['post_content'] = $link . $post['post_content'];
|
48 |
+
return ($post);
|
49 |
+
}
|
50 |
+
|
51 |
+
function filter_title($post) {
|
52 |
+
//this function appends "(via postie)" to the title (subject)
|
53 |
+
$post['post_title']= $post['post_title'] . ' (via postie)';
|
54 |
+
return ($post);
|
55 |
+
}
|
56 |
+
|
57 |
+
add_filter('postie_post', 'filter_title');
|
58 |
+
add_filter('postie_post', 'filter_content');
|
59 |
+
|
60 |
+
?>
|
get_mail.php
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
#!/usr/bin/php -q
|
2 |
<?php
|
3 |
|
4 |
//Load up some usefull libraries
|
@@ -6,32 +5,36 @@ include_once (dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR
|
|
6 |
require_once (dirname(__FILE__). DIRECTORY_SEPARATOR . 'mimedecode.php');
|
7 |
require_once (dirname(__FILE__). DIRECTORY_SEPARATOR . 'postie-functions.php');
|
8 |
|
9 |
-
//if (!TestWPVersion()) {
|
10 |
-
//print("<p>Postie Only Works For Word Press 2.0 and above.</p>");
|
11 |
-
//exit();
|
12 |
-
//}
|
13 |
|
14 |
/* END OF USER VARIABLES */
|
15 |
//some variables
|
16 |
-
error_reporting(2037);
|
17 |
-
TestWPMailInstallation();
|
18 |
|
19 |
//Retreive emails
|
20 |
print("<pre>\n");
|
|
|
|
|
21 |
$config = GetConfig();
|
22 |
//print_r($config);
|
23 |
$emails = FetchMail($config['MAIL_SERVER'], $config['MAIL_SERVER_PORT'],
|
24 |
$config['MAIL_USERID'], $config['MAIL_PASSWORD'], $config['INPUT_PROTOCOL'],
|
25 |
-
$config['TIME_OFFSET'], $config['TEST_EMAIL']
|
|
|
26 |
//loop through messages
|
27 |
foreach ($emails as $email) {
|
|
|
|
|
28 |
//sanity check to see if there is any info in the message
|
29 |
if ($email == NULL ) {
|
30 |
-
|
31 |
continue;
|
|
|
|
|
|
|
|
|
32 |
}
|
33 |
-
|
34 |
-
$mimeDecodedEmail = DecodeMimeMail($email);
|
35 |
$from = RemoveExtraCharactersInEmailAddress(trim($mimeDecodedEmail->headers["from"]));
|
36 |
/*
|
37 |
if ($from != "") {
|
@@ -40,15 +43,19 @@ foreach ($emails as $email) {
|
|
40 |
*/
|
41 |
|
42 |
//Check poster to see if a valid person
|
43 |
-
$poster = ValidatePoster($mimeDecodedEmail);
|
44 |
if (!empty($poster)) {
|
45 |
-
|
46 |
-
|
|
|
47 |
}
|
48 |
else {
|
49 |
print("<p>Ignoring email - not authorized.\n");
|
50 |
}
|
|
|
|
|
51 |
} // end looping over messages
|
|
|
52 |
print("</pre>\n");
|
53 |
|
54 |
/* END PROGRAM */
|
|
|
1 |
<?php
|
2 |
|
3 |
//Load up some usefull libraries
|
5 |
require_once (dirname(__FILE__). DIRECTORY_SEPARATOR . 'mimedecode.php');
|
6 |
require_once (dirname(__FILE__). DIRECTORY_SEPARATOR . 'postie-functions.php');
|
7 |
|
|
|
|
|
|
|
|
|
8 |
|
9 |
/* END OF USER VARIABLES */
|
10 |
//some variables
|
11 |
+
//error_reporting(2037);
|
|
|
12 |
|
13 |
//Retreive emails
|
14 |
print("<pre>\n");
|
15 |
+
print("This is the postie plugin\n");
|
16 |
+
include('Revision');
|
17 |
$config = GetConfig();
|
18 |
//print_r($config);
|
19 |
$emails = FetchMail($config['MAIL_SERVER'], $config['MAIL_SERVER_PORT'],
|
20 |
$config['MAIL_USERID'], $config['MAIL_PASSWORD'], $config['INPUT_PROTOCOL'],
|
21 |
+
$config['TIME_OFFSET'], $config['TEST_EMAIL'],
|
22 |
+
$config['DELETE_MAIL_AFTER_PROCESSING']);
|
23 |
//loop through messages
|
24 |
foreach ($emails as $email) {
|
25 |
+
if (function_exists('memory_get_usage'))
|
26 |
+
echo "memory at start of e-mail processing:" . memory_get_usage() . "\n";
|
27 |
//sanity check to see if there is any info in the message
|
28 |
if ($email == NULL ) {
|
29 |
+
$message= __('Dang, message is empty!', 'postie');
|
30 |
continue;
|
31 |
+
} else if ($email=='already read') {
|
32 |
+
$message = "\n" . __("There does not seem to be any new mail.", 'postie') .
|
33 |
+
"\n";
|
34 |
+
continue;
|
35 |
}
|
36 |
+
$message='';
|
37 |
+
$mimeDecodedEmail = DecodeMimeMail($email, true);
|
38 |
$from = RemoveExtraCharactersInEmailAddress(trim($mimeDecodedEmail->headers["from"]));
|
39 |
/*
|
40 |
if ($from != "") {
|
43 |
*/
|
44 |
|
45 |
//Check poster to see if a valid person
|
46 |
+
$poster = ValidatePoster($mimeDecodedEmail, $config);
|
47 |
if (!empty($poster)) {
|
48 |
+
if ($config['TEST_EMAIL'])
|
49 |
+
DebugEmailOutput($email,$mimeDecodedEmail);
|
50 |
+
PostEmail($poster,$mimeDecodedEmail, $config);
|
51 |
}
|
52 |
else {
|
53 |
print("<p>Ignoring email - not authorized.\n");
|
54 |
}
|
55 |
+
if (function_exists('memory_get_usage'))
|
56 |
+
echo "memory at end of e-mail processing:" . memory_get_usage() . "\n";
|
57 |
} // end looping over messages
|
58 |
+
print $message;
|
59 |
print("</pre>\n");
|
60 |
|
61 |
/* END PROGRAM */
|
icons/black/aac-32.png
ADDED
Binary file
|
icons/black/aac-48.png
ADDED
Binary file
|
icons/black/aac-64.png
ADDED
Binary file
|
icons/black/avi-32.png
ADDED
Binary file
|
icons/black/avi-48.png
ADDED
Binary file
|
icons/black/avi-64.png
ADDED
Binary file
|
icons/black/default-32.png
ADDED
Binary file
|
icons/black/default-48.png
ADDED
Binary file
|
icons/black/default-64.png
ADDED
Binary file
|
icons/black/divx-32.png
ADDED
Binary file
|
icons/black/divx-48.png
ADDED
Binary file
|
icons/black/divx-64.png
ADDED
Binary file
|
icons/black/doc-32.png
ADDED
Binary file
|
icons/black/doc-48.png
ADDED
Binary file
|
icons/black/doc-64.png
ADDED
Binary file
|
icons/black/m4a-32.png
ADDED
Binary file
|
icons/black/m4a-48.png
ADDED
Binary file
|
icons/black/m4a-64.png
ADDED
Binary file
|
icons/black/midi-32.png
ADDED
Binary file
|
icons/black/midi-48.png
ADDED
Binary file
|
icons/black/midi-64.png
ADDED
Binary file
|
icons/black/mov-32.png
ADDED
Binary file
|
icons/black/mov-48.png
ADDED
Binary file
|
icons/black/mov-64.png
ADDED
Binary file
|
icons/black/mp3-32.png
ADDED
Binary file
|
icons/black/mp3-48.png
ADDED
Binary file
|
icons/black/mp3-64.png
ADDED
Binary file
|
icons/black/mp4-32.png
ADDED
Binary file
|
icons/black/mp4-48.png
ADDED
Binary file
|
icons/black/mp4-64.png
ADDED
Binary file
|
icons/black/mpc-32.png
ADDED
Binary file
|
icons/black/mpc-48.png
ADDED
Binary file
|
icons/black/mpc-64.png
ADDED
Binary file
|
icons/black/mpg-32.png
ADDED
Binary file
|
icons/black/mpg-48.png
ADDED
Binary file
|
icons/black/mpg-64.png
ADDED
Binary file
|
icons/black/ogg-32.png
ADDED
Binary file
|
icons/black/ogg-48.png
ADDED
Binary file
|
icons/black/ogg-64.png
ADDED
Binary file
|
icons/black/pdf-32.png
ADDED
Binary file
|
icons/black/pdf-48.png
ADDED
Binary file
|
icons/black/pdf-64.png
ADDED
Binary file
|
icons/black/ppt-32.png
ADDED
Binary file
|
icons/black/ppt-48.png
ADDED
Binary file
|
icons/black/ppt-64.png
ADDED
Binary file
|
icons/black/ra-32.png
ADDED
Binary file
|
icons/black/ra-48.png
ADDED
Binary file
|
icons/black/ra-64.png
ADDED
Binary file
|
icons/black/rm-32.png
ADDED
Binary file
|
icons/black/rm-48.png
ADDED
Binary file
|
icons/black/rm-64.png
ADDED
Binary file
|
icons/black/rtf-32.png
ADDED
Binary file
|
icons/black/rtf-48.png
ADDED
Binary file
|
icons/black/rtf-64.png
ADDED
Binary file
|
icons/black/tex-32.png
ADDED
Binary file
|
icons/black/tex-48.png
ADDED
Binary file
|
icons/black/tex-64.png
ADDED
Binary file
|
icons/black/text-32.png
ADDED
Binary file
|
icons/black/text-48.png
ADDED
Binary file
|
icons/black/text-64.png
ADDED
Binary file
|
icons/black/wav-32.png
ADDED
Binary file
|
icons/black/wav-48.png
ADDED
Binary file
|
icons/black/wav-64.png
ADDED
Binary file
|
icons/black/wma-32.png
ADDED
Binary file
|
icons/black/wma-48.png
ADDED
Binary file
|
icons/black/wma-64.png
ADDED
Binary file
|
icons/black/wmv-32.png
ADDED
Binary file
|
icons/black/wmv-48.png
ADDED
Binary file
|
icons/black/wmv-64.png
ADDED
Binary file
|
icons/black/xls-32.png
ADDED
Binary file
|
icons/black/xls-48.png
ADDED
Binary file
|
icons/black/xls-64.png
ADDED
Binary file
|
icons/silver/SilverFileText-001.png
ADDED
Binary file
|
icons/silver/aac-32.png
ADDED
Binary file
|
icons/silver/aac-48.png
ADDED
Binary file
|
icons/silver/aac-64.png
ADDED
Binary file
|
icons/silver/ai-32.png
ADDED
Binary file
|
icons/silver/ai-48.png
ADDED
Binary file
|
icons/silver/ai-64.png
ADDED
Binary file
|
icons/silver/avi-32.png
ADDED
Binary file
|
icons/silver/avi-48.png
ADDED
Binary file
|
icons/silver/avi-64.png
ADDED
Binary file
|
icons/silver/bmp-32.png
ADDED
Binary file
|
icons/silver/bmp-48.png
ADDED
Binary file
|
icons/silver/bmp-64.png
ADDED
Binary file
|
icons/silver/default-32.png
ADDED
Binary file
|
icons/silver/default-48.png
ADDED
Binary file
|
icons/silver/default-64.png
ADDED
Binary file
|
icons/silver/divx-32.png
ADDED
Binary file
|
icons/silver/divx-48.png
ADDED
Binary file
|
icons/silver/divx-64.png
ADDED
Binary file
|
icons/silver/doc-32.png
ADDED
Binary file
|
icons/silver/doc-48.png
ADDED
Binary file
|
icons/silver/doc-64.png
ADDED
Binary file
|
icons/silver/gif-32.png
ADDED
Binary file
|
icons/silver/gif-48.png
ADDED
Binary file
|
icons/silver/gif-64.png
ADDED
Binary file
|
icons/silver/jpg-32.png
ADDED
Binary file
|
icons/silver/jpg-48.png
ADDED
Binary file
|
icons/silver/jpg-64.png
ADDED
Binary file
|
icons/silver/m4a-32.png
ADDED
Binary file
|
icons/silver/m4a-48.png
ADDED
Binary file
|
icons/silver/m4a-64.png
ADDED
Binary file
|
icons/silver/midi-32.png
ADDED
Binary file
|
icons/silver/midi-48.png
ADDED
Binary file
|
icons/silver/midi-64.png
ADDED
Binary file
|
icons/silver/mov-32.png
ADDED
Binary file
|
icons/silver/mov-48.png
ADDED
Binary file
|
icons/silver/mov-64.png
ADDED
Binary file
|
icons/silver/mp3-32.png
ADDED
Binary file
|
icons/silver/mp3-48.png
ADDED
Binary file
|
icons/silver/mp3-64.png
ADDED
Binary file
|
icons/silver/mp4-32.png
ADDED
Binary file
|
icons/silver/mp4-48.png
ADDED
Binary file
|
icons/silver/mp4-64.png
ADDED
Binary file
|
icons/silver/mpc-32.png
ADDED
Binary file
|
icons/silver/mpc-48.png
ADDED
Binary file
|
icons/silver/mpc-64.png
ADDED
Binary file
|
icons/silver/mpg-32.png
ADDED
Binary file
|
icons/silver/mpg-48.png
ADDED
Binary file
|
icons/silver/mpg-64.png
ADDED
Binary file
|
icons/silver/ogg-32.png
ADDED
Binary file
|
icons/silver/ogg-48.png
ADDED
Binary file
|
icons/silver/ogg-64.png
ADDED
Binary file
|
icons/silver/pdf-32.png
ADDED
Binary file
|
icons/silver/pdf-48.png
ADDED
Binary file
|
icons/silver/pdf-64.png
ADDED
Binary file
|
icons/silver/png-32.png
ADDED
Binary file
|
icons/silver/png-48.png
ADDED
Binary file
|
icons/silver/png-64.png
ADDED
Binary file
|
icons/silver/ppt-32.png
ADDED
Binary file
|
icons/silver/ppt-48.png
ADDED
Binary file
|
icons/silver/ppt-64.png
ADDED
Binary file
|
icons/silver/psd-32.png
ADDED
Binary file
|
icons/silver/psd-48.png
ADDED
Binary file
|
icons/silver/psd-64.png
ADDED
Binary file
|
icons/silver/ra-32.png
ADDED
Binary file
|
icons/silver/ra-48.png
ADDED
Binary file
|
icons/silver/ra-64.png
ADDED
Binary file
|
icons/silver/rm-32.png
ADDED
Binary file
|
icons/silver/rm-48.png
ADDED
Binary file
|
icons/silver/rm-64.png
ADDED
Binary file
|
icons/silver/rtf-32.png
ADDED
Binary file
|
icons/silver/rtf-48.png
ADDED
Binary file
|
icons/silver/rtf-64.png
ADDED
Binary file
|
icons/silver/svg-32.png
ADDED
Binary file
|
icons/silver/svg-48.png
ADDED
Binary file
|
icons/silver/svg-64.png
ADDED
Binary file
|
icons/silver/tex-32.png
ADDED
Binary file
|
icons/silver/tex-48.png
ADDED
Binary file
|
icons/silver/tex-64.png
ADDED
Binary file
|
icons/silver/text-32.png
ADDED
Binary file
|
icons/silver/text-48.png
ADDED
Binary file
|
icons/silver/text-64.png
ADDED
Binary file
|
icons/silver/tga-32.png
ADDED
Binary file
|
icons/silver/tga-48.png
ADDED
Binary file
|
icons/silver/tga-64.png
ADDED
Binary file
|
icons/silver/tiff-32.png
ADDED
Binary file
|
icons/silver/tiff-48.png
ADDED
Binary file
|
icons/silver/tiff-64.png
ADDED
Binary file
|
icons/silver/wav-32.png
ADDED
Binary file
|
icons/silver/wav-48.png
ADDED
Binary file
|
icons/silver/wav-64.png
ADDED
Binary file
|
icons/silver/wma-32.png
ADDED
Binary file
|
icons/silver/wma-48.png
ADDED
Binary file
|
icons/silver/wma-64.png
ADDED
Binary file
|
icons/silver/wmv-32.png
ADDED
Binary file
|
icons/silver/wmv-48.png
ADDED
Binary file
|
icons/silver/wmv-64.png
ADDED
Binary file
|
icons/silver/xls-32.png
ADDED
Binary file
|
icons/silver/xls-48.png
ADDED
Binary file
|
icons/silver/xls-64.png
ADDED
Binary file
|
icons/white/default-32.png
ADDED
Binary file
|
icons/white/default-48.png
ADDED
Binary file
|
icons/white/default-64.png
ADDED
Binary file
|
icons/white/doc-32.png
ADDED
Binary file
|
icons/white/doc-48.png
ADDED
Binary file
|
icons/white/doc-64.png
ADDED
Binary file
|
icons/white/pdf-32.png
ADDED
Binary file
|
icons/white/pdf-48.png
ADDED
Binary file
|
icons/white/pdf-64.png
ADDED
Binary file
|
icons/white/tmp-32.png
ADDED
Binary file
|
icons/white/tmp-48.png
ADDED
Binary file
|
icons/white/tmp-64.png
ADDED
Binary file
|
icons/white/txt-32.png
ADDED
Binary file
|
icons/white/txt-48.png
ADDED
Binary file
|
icons/white/txt-64.png
ADDED
Binary file
|
icons/white/xls-32.png
ADDED
Binary file
|
icons/white/xls-48.png
ADDED
Binary file
|
icons/white/xls-64.png
ADDED
Binary file
|
icons/white/xml-32.png
ADDED
Binary file
|
icons/white/xml-48.png
ADDED
Binary file
|
icons/white/xml-64.png
ADDED
Binary file
|
images/Thumbs.db
ADDED
Binary file
|
images/mail.png
ADDED
Binary file
|
images/menu-bits.gif
ADDED
Binary file
|
images/valid-xhtml10-blue.png
ADDED
Binary file
|
images/vcss-blue.gif
ADDED
Binary file
|
js/simpleTabs.jquery.js
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/**
|
2 |
+
* simpleTabs ( http://supercanard.phpnet.org/jquery-test/simpleTabs/ )
|
3 |
+
* plugin jQuery pour afficher des bôites d'onglet.
|
4 |
+
*
|
5 |
+
* Version 1.0
|
6 |
+
*
|
7 |
+
* Auteur : Jonathan Coulet ( j.coulet@gmail.com )
|
8 |
+
*
|
9 |
+
**/
|
10 |
+
(function($){
|
11 |
+
$.fn.simpleTabs = function(option){
|
12 |
+
// Param plugin
|
13 |
+
var param = jQuery.extend({
|
14 |
+
fadeSpeed: "medium", // @param : low, medium, fast
|
15 |
+
defautContent: 1, // @param : number ( simpleTabs-nav-number)
|
16 |
+
autoNav: "false", // @param : true or false
|
17 |
+
closeTabs : "true" // @param : true or false;
|
18 |
+
}, option);
|
19 |
+
$(this).each(function() {
|
20 |
+
// Initialisation
|
21 |
+
var $this = this;
|
22 |
+
var $thisId = "#"+this.id;
|
23 |
+
var nbTab = $($thisId+" > div").size();
|
24 |
+
autoNav();
|
25 |
+
showCloseTabs();
|
26 |
+
hideAll();
|
27 |
+
changeContent(param.defautContent);
|
28 |
+
// Fonctions
|
29 |
+
function hideAll(){
|
30 |
+
// Masque tous les content
|
31 |
+
$($thisId+" .simpleTabs-content").hide();
|
32 |
+
}
|
33 |
+
function changeContent(indice){
|
34 |
+
// Masque tous les content - Supprime la classe actif de tous les onglets
|
35 |
+
// Ajoute la classe actif à l'onglet cliqué - Affiche le content ciblé - Execute showCloseTabs
|
36 |
+
hideAll();
|
37 |
+
$($thisId+" .simpleTabs-nav li").removeClass("actif");
|
38 |
+
$($thisId+" #simpleTabs-nav-"+indice).addClass("actif");
|
39 |
+
$($thisId+" #simpleTabs-content-"+indice).fadeIn(param.fadeSpeed);
|
40 |
+
showCloseTabs();
|
41 |
+
}
|
42 |
+
function autoNav(){
|
43 |
+
// Génère les onglets automatiquement
|
44 |
+
if(param.autoNav == "true"){
|
45 |
+
var listeNav = '';
|
46 |
+
for(i=1; i!=nbTab; i++){
|
47 |
+
listeNav = listeNav+'<li id="simpleTabs-nav-'+i+'">'+i+'</li>';
|
48 |
+
}
|
49 |
+
$($thisId+" .simpleTabs-nav").append('<ul>'+listeNav+'</ul>');
|
50 |
+
}
|
51 |
+
}
|
52 |
+
function showCloseTabs(){
|
53 |
+
// Génére un bouton de fermeture générale des content
|
54 |
+
if(param.closeTabs == "true"){
|
55 |
+
if($($thisId+" .simpleTabs-nav li.close").size() == 0){
|
56 |
+
$($thisId+" .simpleTabs-nav ul").append("<li title=\"Fermer tous les onglets\" class=\"close\">x</li>");
|
57 |
+
}
|
58 |
+
}
|
59 |
+
}
|
60 |
+
// Exec
|
61 |
+
$($thisId+" .simpleTabs-nav li").click(function(){
|
62 |
+
var numContent = this.id.substr(this.id.length-1,this.id.length);
|
63 |
+
changeContent(numContent);
|
64 |
+
});
|
65 |
+
// test function closeTabs
|
66 |
+
$($thisId+" .simpleTabs-nav li.close").click(function(){
|
67 |
+
hideAll();
|
68 |
+
$($thisId+" .simpleTabs-nav li").removeClass("actif");
|
69 |
+
$($thisId+" .simpleTabs-nav li.close").remove();
|
70 |
+
//alert($($thisId+" .simpleTabs-nav li.close").size());
|
71 |
+
});
|
72 |
+
});
|
73 |
+
}
|
74 |
+
})(jQuery);
|
mimedecode.php
CHANGED
@@ -1,149 +1,152 @@
|
|
1 |
-
<?
|
2 |
-
// +-----------------------------------------------------------------------+
|
3 |
-
// | Copyright (c) 2002-2003 Richard Heyes |
|
4 |
-
// | All rights reserved. |
|
5 |
-
// | |
|
6 |
-
// | Redistribution and use in source and binary forms, with or without |
|
7 |
-
// | modification, are permitted provided that the following conditions |
|
8 |
-
// | are met: |
|
9 |
-
// | |
|
10 |
-
// | o Redistributions of source code must retain the above copyright |
|
11 |
-
// | notice, this list of conditions and the following disclaimer. |
|
12 |
-
// | o Redistributions in binary form must reproduce the above copyright |
|
13 |
-
// | notice, this list of conditions and the following disclaimer in the |
|
14 |
-
// | documentation and/or other materials provided with the distribution.|
|
15 |
-
// | o The names of the authors may not be used to endorse or promote |
|
16 |
-
// | products derived from this software without specific prior written |
|
17 |
-
// | permission. |
|
18 |
-
// | |
|
19 |
-
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
20 |
-
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
21 |
-
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
|
22 |
-
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
|
23 |
-
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
|
24 |
-
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
|
25 |
-
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
|
26 |
-
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
|
27 |
-
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
|
28 |
-
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|
29 |
-
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|
30 |
-
// | |
|
31 |
-
// +-----------------------------------------------------------------------+
|
32 |
-
// | Author: Richard Heyes <richard@phpguru.org> |
|
33 |
-
// +-----------------------------------------------------------------------+
|
34 |
-
|
35 |
-
if (!function_exists("_PEAR_call_destructors")) {
|
36 |
-
include_once (dirname(__FILE__). DIRECTORY_SEPARATOR . 'PEAR.php');
|
37 |
-
}
|
38 |
/**
|
39 |
-
*
|
40 |
-
*
|
41 |
-
*
|
42 |
-
*
|
43 |
-
*
|
44 |
-
*
|
45 |
-
*
|
46 |
-
*
|
47 |
-
*
|
48 |
-
*
|
49 |
-
*
|
50 |
-
*
|
51 |
-
*
|
52 |
-
*
|
53 |
-
*
|
54 |
-
*
|
55 |
-
*
|
56 |
-
*
|
57 |
-
*
|
58 |
-
*
|
59 |
-
*
|
60 |
-
*
|
61 |
-
*
|
62 |
-
*
|
63 |
-
*
|
64 |
-
*
|
65 |
-
*
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
*
|
88 |
-
* @author
|
89 |
-
* @
|
90 |
-
* @
|
91 |
-
|
|
|
|
|
92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
class Mail_mimeDecode extends PEAR
|
94 |
{
|
95 |
-
|
96 |
/**
|
97 |
* The raw email to decode
|
|
|
98 |
* @var string
|
|
|
99 |
*/
|
100 |
var $_input;
|
101 |
|
102 |
/**
|
103 |
* The header part of the input
|
|
|
104 |
* @var string
|
|
|
105 |
*/
|
106 |
var $_header;
|
107 |
|
108 |
/**
|
109 |
* The body part of the input
|
|
|
110 |
* @var string
|
|
|
111 |
*/
|
112 |
var $_body;
|
113 |
|
114 |
/**
|
115 |
* If an error occurs, this is used to store the message
|
|
|
116 |
* @var string
|
|
|
117 |
*/
|
118 |
var $_error;
|
119 |
|
120 |
/**
|
121 |
* Flag to determine whether to include bodies in the
|
122 |
* returned object.
|
|
|
123 |
* @var boolean
|
|
|
124 |
*/
|
125 |
var $_include_bodies;
|
126 |
|
127 |
/**
|
128 |
* Flag to determine whether to decode bodies
|
|
|
129 |
* @var boolean
|
|
|
130 |
*/
|
131 |
var $_decode_bodies;
|
132 |
|
133 |
/**
|
134 |
* Flag to determine whether to decode headers
|
|
|
135 |
* @var boolean
|
|
|
136 |
*/
|
137 |
var $_decode_headers;
|
138 |
|
139 |
-
/**
|
140 |
-
* If invoked from a class, $this will be set. This has problematic
|
141 |
-
* connotations for calling decode() statically. Hence this variable
|
142 |
-
* is used to determine if we are indeed being called statically or
|
143 |
-
* via an object.
|
144 |
-
*/
|
145 |
-
var $mailMimeDecode;
|
146 |
-
|
147 |
/**
|
148 |
* Constructor.
|
149 |
*
|
@@ -162,8 +165,6 @@ class Mail_mimeDecode extends PEAR
|
|
162 |
$this->_body = $body;
|
163 |
$this->_decode_bodies = false;
|
164 |
$this->_include_bodies = true;
|
165 |
-
|
166 |
-
$this->mailMimeDecode = true;
|
167 |
}
|
168 |
|
169 |
/**
|
@@ -185,27 +186,35 @@ class Mail_mimeDecode extends PEAR
|
|
185 |
*/
|
186 |
function decode($params = null)
|
187 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
|
189 |
-
// Have we been called statically? If so, create an object and pass details to that.
|
190 |
-
if (!is_object($this) AND isset($params['input'])) {
|
191 |
$obj = new Mail_mimeDecode($params['input']);
|
192 |
$structure = $obj->decode($params);
|
193 |
|
194 |
// Called statically but no input
|
195 |
-
|
196 |
-
|
197 |
|
198 |
// Called via an object
|
199 |
} else {
|
200 |
-
$this->_include_bodies = isset($params['include_bodies'])
|
201 |
-
|
202 |
-
$this->
|
|
|
|
|
|
|
203 |
|
204 |
$structure = $this->_decode($this->_header, $this->_body);
|
205 |
if ($structure === false) {
|
206 |
$structure = $this->raiseError($this->_error);
|
207 |
}
|
208 |
}
|
|
|
209 |
return $structure;
|
210 |
}
|
211 |
|
@@ -258,7 +267,7 @@ class Mail_mimeDecode extends PEAR
|
|
258 |
}
|
259 |
break;
|
260 |
|
261 |
-
case 'content-disposition'
|
262 |
$content_disposition = $this->_parseHeaderValue($headers[$key]['value']);
|
263 |
$return->disposition = $content_disposition['value'];
|
264 |
if (isset($content_disposition['other'])) {
|
@@ -287,6 +296,7 @@ class Mail_mimeDecode extends PEAR
|
|
287 |
break;
|
288 |
|
289 |
case 'multipart/parallel':
|
|
|
290 |
case 'multipart/report': // RFC1892
|
291 |
case 'multipart/signed': // PGP
|
292 |
case 'multipart/digest':
|
@@ -452,13 +462,22 @@ class Mail_mimeDecode extends PEAR
|
|
452 |
if (strlen($input) > 0) {
|
453 |
|
454 |
// This splits on a semi-colon, if there's no preceeding backslash
|
455 |
-
//
|
456 |
-
//
|
457 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
458 |
|
459 |
for ($i = 0; $i < count($parameters); $i++) {
|
460 |
-
$param_name = substr($parameters[$i], 0, $pos = strpos($parameters[$i], '='));
|
461 |
-
$param_value = substr($parameters[$i], $pos + 1);
|
462 |
if ($param_value[0] == '"') {
|
463 |
$param_value = substr($param_value, 1, -1);
|
464 |
}
|
@@ -828,4 +847,3 @@ class Mail_mimeDecode extends PEAR
|
|
828 |
}
|
829 |
|
830 |
} // End of class
|
831 |
-
?>
|
1 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
/**
|
3 |
+
* The Mail_mimeDecode class is used to decode mail/mime messages
|
4 |
+
*
|
5 |
+
* This class will parse a raw mime email and return
|
6 |
+
* the structure. Returned structure is similar to
|
7 |
+
* that returned by imap_fetchstructure().
|
8 |
+
*
|
9 |
+
* +----------------------------- IMPORTANT ------------------------------+
|
10 |
+
* | Usage of this class compared to native php extensions such as |
|
11 |
+
* | mailparse or imap, is slow and may be feature deficient. If available|
|
12 |
+
* | you are STRONGLY recommended to use the php extensions. |
|
13 |
+
* +----------------------------------------------------------------------+
|
14 |
+
*
|
15 |
+
* Compatible with PHP versions 4 and 5
|
16 |
+
*
|
17 |
+
* LICENSE: This LICENSE is in the BSD license style.
|
18 |
+
* Copyright (c) 2002-2003, Richard Heyes <richard@phpguru.org>
|
19 |
+
* Copyright (c) 2003-2006, PEAR <pear-group@php.net>
|
20 |
+
* All rights reserved.
|
21 |
+
*
|
22 |
+
* Redistribution and use in source and binary forms, with or
|
23 |
+
* without modification, are permitted provided that the following
|
24 |
+
* conditions are met:
|
25 |
+
*
|
26 |
+
* - Redistributions of source code must retain the above copyright
|
27 |
+
* notice, this list of conditions and the following disclaimer.
|
28 |
+
* - Redistributions in binary form must reproduce the above copyright
|
29 |
+
* notice, this list of conditions and the following disclaimer in the
|
30 |
+
* documentation and/or other materials provided with the distribution.
|
31 |
+
* - Neither the name of the authors, nor the names of its contributors
|
32 |
+
* may be used to endorse or promote products derived from this
|
33 |
+
* software without specific prior written permission.
|
34 |
+
*
|
35 |
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
36 |
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
37 |
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
38 |
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
39 |
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
40 |
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
41 |
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
42 |
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
43 |
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
44 |
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
45 |
+
* THE POSSIBILITY OF SUCH DAMAGE.
|
46 |
+
*
|
47 |
+
* @category Mail
|
48 |
+
* @package Mail_Mime
|
49 |
+
* @author Richard Heyes <richard@phpguru.org>
|
50 |
+
* @author George Schlossnagle <george@omniti.com>
|
51 |
+
* @author Cipriano Groenendal <cipri@php.net>
|
52 |
+
* @author Sean Coates <sean@php.net>
|
53 |
+
* @copyright 2003-2006 PEAR <pear-group@php.net>
|
54 |
+
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
|
55 |
+
* @version CVS: $Id: mimeDecode.php,v 1.48 2006/12/03 13:43:33 cipri Exp $
|
56 |
+
* @link http://pear.php.net/package/Mail_mime
|
57 |
+
*/
|
58 |
|
59 |
+
|
60 |
+
/**
|
61 |
+
* require PEAR
|
62 |
+
*
|
63 |
+
* This package depends on PEAR to raise errors.
|
64 |
+
*/
|
65 |
+
require_once 'PEAR.php';
|
66 |
+
|
67 |
+
|
68 |
+
/**
|
69 |
+
* The Mail_mimeDecode class is used to decode mail/mime messages
|
70 |
+
*
|
71 |
+
* This class will parse a raw mime email and return the structure.
|
72 |
+
* Returned structure is similar to that returned by imap_fetchstructure().
|
73 |
+
*
|
74 |
+
* +----------------------------- IMPORTANT ------------------------------+
|
75 |
+
* | Usage of this class compared to native php extensions such as |
|
76 |
+
* | mailparse or imap, is slow and may be feature deficient. If available|
|
77 |
+
* | you are STRONGLY recommended to use the php extensions. |
|
78 |
+
* +----------------------------------------------------------------------+
|
79 |
+
*
|
80 |
+
* @category Mail
|
81 |
+
* @package Mail_Mime
|
82 |
+
* @author Richard Heyes <richard@phpguru.org>
|
83 |
+
* @author George Schlossnagle <george@omniti.com>
|
84 |
+
* @author Cipriano Groenendal <cipri@php.net>
|
85 |
+
* @author Sean Coates <sean@php.net>
|
86 |
+
* @copyright 2003-2006 PEAR <pear-group@php.net>
|
87 |
+
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
|
88 |
+
* @version Release: @package_version@
|
89 |
+
* @link http://pear.php.net/package/Mail_mime
|
90 |
+
*/
|
91 |
class Mail_mimeDecode extends PEAR
|
92 |
{
|
|
|
93 |
/**
|
94 |
* The raw email to decode
|
95 |
+
*
|
96 |
* @var string
|
97 |
+
* @access private
|
98 |
*/
|
99 |
var $_input;
|
100 |
|
101 |
/**
|
102 |
* The header part of the input
|
103 |
+
*
|
104 |
* @var string
|
105 |
+
* @access private
|
106 |
*/
|
107 |
var $_header;
|
108 |
|
109 |
/**
|
110 |
* The body part of the input
|
111 |
+
*
|
112 |
* @var string
|
113 |
+
* @access private
|
114 |
*/
|
115 |
var $_body;
|
116 |
|
117 |
/**
|
118 |
* If an error occurs, this is used to store the message
|
119 |
+
*
|
120 |
* @var string
|
121 |
+
* @access private
|
122 |
*/
|
123 |
var $_error;
|
124 |
|
125 |
/**
|
126 |
* Flag to determine whether to include bodies in the
|
127 |
* returned object.
|
128 |
+
*
|
129 |
* @var boolean
|
130 |
+
* @access private
|
131 |
*/
|
132 |
var $_include_bodies;
|
133 |
|
134 |
/**
|
135 |
* Flag to determine whether to decode bodies
|
136 |
+
*
|
137 |
* @var boolean
|
138 |
+
* @access private
|
139 |
*/
|
140 |
var $_decode_bodies;
|
141 |
|
142 |
/**
|
143 |
* Flag to determine whether to decode headers
|
144 |
+
*
|
145 |
* @var boolean
|
146 |
+
* @access private
|
147 |
*/
|
148 |
var $_decode_headers;
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
/**
|
151 |
* Constructor.
|
152 |
*
|
165 |
$this->_body = $body;
|
166 |
$this->_decode_bodies = false;
|
167 |
$this->_include_bodies = true;
|
|
|
|
|
168 |
}
|
169 |
|
170 |
/**
|
186 |
*/
|
187 |
function decode($params = null)
|
188 |
{
|
189 |
+
// determine if this method has been called statically
|
190 |
+
$isStatic = !(isset($this) && get_class($this) == __CLASS__);
|
191 |
+
|
192 |
+
// Have we been called statically?
|
193 |
+
// If so, create an object and pass details to that.
|
194 |
+
if ($isStatic AND isset($params['input'])) {
|
195 |
|
|
|
|
|
196 |
$obj = new Mail_mimeDecode($params['input']);
|
197 |
$structure = $obj->decode($params);
|
198 |
|
199 |
// Called statically but no input
|
200 |
+
} elseif ($isStatic) {
|
201 |
+
return PEAR::raiseError('Called statically and no input given');
|
202 |
|
203 |
// Called via an object
|
204 |
} else {
|
205 |
+
$this->_include_bodies = isset($params['include_bodies']) ?
|
206 |
+
$params['include_bodies'] : false;
|
207 |
+
$this->_decode_bodies = isset($params['decode_bodies']) ?
|
208 |
+
$params['decode_bodies'] : false;
|
209 |
+
$this->_decode_headers = isset($params['decode_headers']) ?
|
210 |
+
$params['decode_headers'] : false;
|
211 |
|
212 |
$structure = $this->_decode($this->_header, $this->_body);
|
213 |
if ($structure === false) {
|
214 |
$structure = $this->raiseError($this->_error);
|
215 |
}
|
216 |
}
|
217 |
+
|
218 |
return $structure;
|
219 |
}
|
220 |
|
267 |
}
|
268 |
break;
|
269 |
|
270 |
+
case 'content-disposition':
|
271 |
$content_disposition = $this->_parseHeaderValue($headers[$key]['value']);
|
272 |
$return->disposition = $content_disposition['value'];
|
273 |
if (isset($content_disposition['other'])) {
|
296 |
break;
|
297 |
|
298 |
case 'multipart/parallel':
|
299 |
+
case 'multipart/appledouble': // Appledouble mail
|
300 |
case 'multipart/report': // RFC1892
|
301 |
case 'multipart/signed': // PGP
|
302 |
case 'multipart/digest':
|
462 |
if (strlen($input) > 0) {
|
463 |
|
464 |
// This splits on a semi-colon, if there's no preceeding backslash
|
465 |
+
// Now works with quoted values; had to glue the \; breaks in PHP
|
466 |
+
// the regex is already bordering on incomprehensible
|
467 |
+
$splitRegex = '/([^;\'"]*[\'"]([^\'"]*([^\'"]*)*)[\'"][^;\'"]*|([^;]+))(;|$)/';
|
468 |
+
preg_match_all($splitRegex, $input, $matches);
|
469 |
+
$parameters = array();
|
470 |
+
for ($i=0; $i<count($matches[0]); $i++) {
|
471 |
+
$param = $matches[0][$i];
|
472 |
+
while (substr($param, -2) == '\;') {
|
473 |
+
$param .= $matches[0][++$i];
|
474 |
+
}
|
475 |
+
$parameters[] = $param;
|
476 |
+
}
|
477 |
|
478 |
for ($i = 0; $i < count($parameters); $i++) {
|
479 |
+
$param_name = trim(substr($parameters[$i], 0, $pos = strpos($parameters[$i], '=')), "'\";\t\\ ");
|
480 |
+
$param_value = trim(str_replace('\;', ';', substr($parameters[$i], $pos + 1)), "'\";\t\\ ");
|
481 |
if ($param_value[0] == '"') {
|
482 |
$param_value = substr($param_value, 1, -1);
|
483 |
}
|
847 |
}
|
848 |
|
849 |
} // End of class
|
|
postie-functions.php
CHANGED
@@ -1,18 +1,31 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
2 |
/*
|
3 |
-
$Id: postie-functions.php
|
4 |
*/
|
|
|
5 |
/*TODO
|
6 |
-
* check if image height is being consulted
|
7 |
* html purify
|
8 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
*/
|
10 |
#global $config,$debug;
|
11 |
#$debug=true;
|
12 |
#$config=GetConfig();
|
13 |
|
14 |
-
include_once (dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . "wp-config.php");
|
15 |
-
define("POSTIE_ROOT",dirname(__FILE__));
|
16 |
define("POSTIE_TABLE",$GLOBALS["table_prefix"]. "postie_config");
|
17 |
|
18 |
/* this function is necessary for wildcard matching on non-posix systems */
|
@@ -26,91 +39,121 @@ if (!function_exists('fnmatch')) {
|
|
26 |
);
|
27 |
}
|
28 |
}
|
|
|
29 |
/**
|
30 |
* This is the main handler for all of the processing
|
31 |
*/
|
32 |
-
function PostEmail($poster,$mimeDecodedEmail) {
|
33 |
-
|
34 |
-
$GLOBALS["POSTIE_IMAGE_ROTATION"] = 0;
|
35 |
$attachments = array(
|
36 |
"html" => array(), //holds the html for each image
|
37 |
"cids" => array(), //holds the cids for HTML email
|
38 |
"image_files" => array() //holds the files for each image
|
39 |
);
|
40 |
-
print("<p>Message Id is :" .
|
|
|
41 |
print("<p>Email has following attachments:</p>");
|
42 |
-
foreach($mimeDecodedEmail->parts as $parts) {
|
43 |
-
|
44 |
-
}
|
45 |
-
FilterTextParts($mimeDecodedEmail);
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
52 |
if ($debug) {
|
53 |
echo "the subject is $subject, right after calling GetSubject\n";
|
54 |
}
|
55 |
-
$
|
56 |
-
|
57 |
-
|
58 |
-
}
|
59 |
-
$customImages = SpecialMessageParsing($content,$attachments);
|
60 |
-
$post_excerpt = GetPostExcerpt($content);
|
61 |
$postAuthorDetails=getPostAuthorDetails($subject,$content,
|
62 |
$mimeDecodedEmail);
|
63 |
$message_date = NULL;
|
64 |
if (array_key_exists("date",$mimeDecodedEmail->headers)
|
65 |
&& !empty($mimeDecodedEmail->headers["date"])) {
|
66 |
-
HandleMessageEncoding(
|
67 |
$mimeDecodedEmail->headers["content-transfer-encoding"],
|
68 |
$mimeDecodedEmail->ctype_parameters["charset"],
|
69 |
-
$mimeDecodedEmail->headers["date"]);
|
70 |
-
|
71 |
}
|
72 |
-
list($post_date,$post_date_gmt) = DeterminePostDate($content,
|
|
|
73 |
|
74 |
ubb2HTML($content);
|
75 |
|
76 |
-
if ($config['
|
77 |
-
$content
|
|
|
78 |
//$content = FixEmailQuotes($content);
|
79 |
|
80 |
$id=checkReply($subject);
|
81 |
-
$post_categories = GetPostCategories($subject
|
82 |
-
|
|
|
83 |
$comment_status = AllowCommentsOnPost($content);
|
84 |
|
85 |
-
if ((empty($id) || is_null($id))
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
|
|
|
|
91 |
} else {
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
}
|
96 |
} else {
|
97 |
-
|
98 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
}
|
|
|
|
|
100 |
}
|
101 |
-
if ($config['
|
102 |
-
$content=
|
103 |
-
}
|
104 |
|
105 |
|
106 |
-
$
|
|
|
|
|
|
|
|
|
|
|
107 |
$details = array(
|
108 |
'post_author' => $poster,
|
109 |
'comment_author' => $postAuthorDetails['author'],
|
|
|
|
|
110 |
'email_author' => $postAuthorDetails['email'],
|
111 |
'post_date' => $post_date,
|
112 |
'post_date_gmt' => $post_date_gmt,
|
113 |
-
'post_content' =>
|
114 |
'post_title' => $subject,
|
115 |
'post_modified' => $post_date,
|
116 |
'post_modified_gmt' => $post_date_gmt,
|
@@ -124,13 +167,18 @@ function PostEmail($poster,$mimeDecodedEmail) {
|
|
124 |
'customImages' => $customImages,
|
125 |
'post_status' => $post_status
|
126 |
);
|
|
|
127 |
DisplayEmailPost($details);
|
128 |
-
PostToDB($details
|
|
|
|
|
|
|
|
|
129 |
}
|
130 |
/** FUNCTIONS **/
|
131 |
|
132 |
|
133 |
-
function clickableLink($text) {
|
134 |
# this functions deserves credit to the fine folks at phpbb.com
|
135 |
|
136 |
$text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:",
|
@@ -138,18 +186,26 @@ function clickableLink($text) {
|
|
138 |
|
139 |
// pad it with a space so we can match things at the start of the 1st line.
|
140 |
$ret = ' ' . $text;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
|
142 |
// matches an "xxxx://yyyy" URL at the start of a line, or after a space.
|
143 |
// xxxx can only be alpha characters.
|
144 |
// yyyy is anything up to the first space, newline, comma, double quote or <
|
145 |
-
$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)
|
146 |
"\\1<a href=\"\\2\" >\\2</a>", $ret);
|
147 |
|
148 |
// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
|
149 |
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
|
150 |
// zzzz is optional.. will contain everything up to the first space, newline,
|
151 |
// comma, double quote or <.
|
152 |
-
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)
|
153 |
"\\1<a href=\"http://\\2\" >\\2</a>", $ret);
|
154 |
|
155 |
// matches an email@domain type address at the start of a line, or after a space.
|
@@ -182,9 +238,18 @@ function getPostAuthorDetails(&$subject,&$content,&$mimeDecodedEmail) {
|
|
182 |
}
|
183 |
} else {
|
184 |
$theDate=$mimeDecodedEmail->headers['date'];
|
185 |
-
$theAuthor=GetNameFromEmail($mimeDecodedEmail->headers['from']);
|
186 |
$theEmail = RemoveExtraCharactersInEmailAddress(trim(
|
187 |
$mimeDecodedEmail->headers["from"]));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
}
|
189 |
// now get rid of forwarding info in the content
|
190 |
$lines=preg_split("/\r\n/",$content);
|
@@ -202,6 +267,8 @@ function getPostAuthorDetails(&$subject,&$content,&$mimeDecodedEmail) {
|
|
202 |
" posted:</div>",
|
203 |
'emaildate' => $theDate,
|
204 |
'author' => $theAuthor,
|
|
|
|
|
205 |
'email' => $theEmail
|
206 |
);
|
207 |
return($theDetails);
|
@@ -218,7 +285,7 @@ function checkReply(&$subject) {
|
|
218 |
|
219 |
global $wpdb;
|
220 |
// see if subject starts with Re:
|
221 |
-
if (preg_match("/(^Re:) (.*)/", $subject, $matches)) {
|
222 |
$subject=trim($matches[2]);
|
223 |
// strip out category info into temporary variable
|
224 |
$tmpSubject=$subject;
|
@@ -265,13 +332,7 @@ function PostieMenu() {
|
|
265 |
* This handles actually showing the form
|
266 |
*/
|
267 |
function ConfigurePostie() {
|
268 |
-
|
269 |
-
//if (current_user_can('config_postie')) {
|
270 |
-
include(POSTIE_ROOT . DIRECTORY_SEPARATOR. "config_form.php");
|
271 |
-
//}
|
272 |
-
//else {
|
273 |
-
//postie_read_me();
|
274 |
-
//}
|
275 |
}
|
276 |
|
277 |
/**
|
@@ -279,8 +340,7 @@ function ConfigurePostie() {
|
|
279 |
* @return array
|
280 |
*/
|
281 |
function FetchMail($server=NULL, $port=NULL, $email=NULL, $password=NULL,
|
282 |
-
$protocol=NULL, $offset=NULL, $test=NULL) {
|
283 |
-
//$config = GetConfig();
|
284 |
$emails = array();
|
285 |
if (!$server || !$port || !$email) {
|
286 |
die("Missing Configuration For Mail Server\n");
|
@@ -306,7 +366,7 @@ function FetchMail($server=NULL, $port=NULL, $email=NULL, $password=NULL,
|
|
306 |
$emails = TestIMAPMessageFetch();
|
307 |
} else {
|
308 |
$emails = IMAPMessageFetch($server, $port, $email,
|
309 |
-
$password, $protocol, $offset, $test);
|
310 |
}
|
311 |
break;
|
312 |
case 'pop3':
|
@@ -315,11 +375,11 @@ function FetchMail($server=NULL, $port=NULL, $email=NULL, $password=NULL,
|
|
315 |
$emails = TestPOP3MessageFetch();
|
316 |
} else {
|
317 |
$emails =POP3MessageFetch ($server, $port, $email,
|
318 |
-
$password, $protocol, $offset, $test);
|
319 |
}
|
320 |
}
|
321 |
if (!$emails)
|
322 |
-
die("\
|
323 |
return($emails);
|
324 |
}
|
325 |
/**
|
@@ -339,10 +399,8 @@ function TestIMAPMessageFetch ( ) {
|
|
339 |
*Handles fetching messages from an imap server
|
340 |
*/
|
341 |
function IMAPMessageFetch ($server=NULL, $port=NULL, $email=NULL,
|
342 |
-
$password=NULL, $protocol=NULL, $offset=NULL, $test=NULL
|
343 |
-
|
344 |
-
$config = GetConfig();
|
345 |
-
}
|
346 |
require_once("postieIMAP.php");
|
347 |
|
348 |
$mail_server = &PostieIMAP::Factory($protocol);
|
@@ -361,16 +419,13 @@ function IMAPMessageFetch ($server=NULL, $port=NULL, $email=NULL,
|
|
361 |
// loop through messages
|
362 |
for ($i=1; $i <= $msg_count; $i++) {
|
363 |
$emails[$i] = $mail_server->fetchEmail($i);
|
364 |
-
|
365 |
$mail_server->deleteMessage($i);
|
366 |
}
|
367 |
-
else {
|
368 |
-
print("Not deleting messages!\n");
|
369 |
-
}
|
370 |
}
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
//clean up
|
375 |
$mail_server->disconnect();
|
376 |
return $emails;
|
@@ -388,10 +443,8 @@ function TestPOP3MessageFetch ( ) {
|
|
388 |
*Retrieves email via POP3
|
389 |
*/
|
390 |
function POP3MessageFetch ($server=NULL, $port=NULL, $email=NULL,
|
391 |
-
$password=NULL, $protocol=NULL, $offset=NULL, $test=NULL
|
392 |
-
|
393 |
-
$config = GetConfig();
|
394 |
-
}
|
395 |
require_once(ABSPATH.WPINC.DIRECTORY_SEPARATOR.'class-pop3.php');
|
396 |
$pop3 = &new POP3();
|
397 |
print("\nConnecting to $server:$port ($protocol)) \n");
|
@@ -409,15 +462,18 @@ function POP3MessageFetch ($server=NULL, $port=NULL, $email=NULL,
|
|
409 |
|
410 |
//Check to see if there is any mail, if not die
|
411 |
$msg_count = $pop3->login($email, $password);
|
412 |
-
if (
|
413 |
$pop3->quit();
|
|
|
|
|
|
|
414 |
return(array());
|
415 |
}
|
416 |
|
417 |
// loop through messages
|
418 |
for ($i=1; $i <= $msg_count; $i++) {
|
419 |
$emails[$i] = implode ('',$pop3->get($i));
|
420 |
-
if (
|
421 |
if( !$pop3->delete($i) ) {
|
422 |
echo 'Oops '.$pop3->ERROR.'\n';
|
423 |
$pop3->reset();
|
@@ -434,74 +490,45 @@ function POP3MessageFetch ($server=NULL, $port=NULL, $email=NULL,
|
|
434 |
$pop3->quit();
|
435 |
return $emails;
|
436 |
}
|
437 |
-
/**
|
438 |
-
* Determines if it is a writable directory
|
439 |
-
*/
|
440 |
-
function IsWritableDirectory($directory) {
|
441 |
-
if (!is_dir($directory)) {
|
442 |
-
die ("Sorry but ".$directory." is not a valid directory.");
|
443 |
-
}
|
444 |
-
if (!is_writable($directory)) {
|
445 |
-
die("The web server cannot write to ".$directory." please correct the permissions");
|
446 |
-
}
|
447 |
-
|
448 |
-
}
|
449 |
/**
|
450 |
* This function handles putting the actual entry into the database
|
451 |
* @param array - categories to be posted to
|
452 |
* @param array - details of the post
|
453 |
*/
|
454 |
-
function PostToDB($details) {
|
455 |
-
|
456 |
-
if ($config["POST_TO_DB"]) {
|
457 |
//generate sql for insertion
|
458 |
-
|
459 |
-
if (
|
460 |
-
$post_ID =
|
461 |
} else {
|
462 |
-
// strip out quoted content
|
463 |
-
$lines=preg_split("/[\r\n]/",$details['post_content']);
|
464 |
-
print_r($lines);
|
465 |
-
$newContents='';
|
466 |
-
foreach ($lines as $line) {
|
467 |
-
//$match=preg_match("/^>.*/i",$line);
|
468 |
-
//echo "line=$line, match=$match";
|
469 |
-
if (preg_match("/^>.*/i",$line)==0 &&
|
470 |
-
preg_match("/^(from|subject|to|date):.*?/i",$line)==0 &&
|
471 |
-
preg_match("/^-+.*?(from|subject|to|date).*?/i",$line)==0 &&
|
472 |
-
preg_match("/^on.*?wrote:$/i",$line)==0 &&
|
473 |
-
preg_match("/^-+\s*forwarded\s*message\s*-+/i",$line)==0) {
|
474 |
-
$newContents.="$line\n";
|
475 |
-
}
|
476 |
-
}
|
477 |
$comment = array(
|
478 |
'comment_author'=>$details['comment_author'],
|
479 |
'comment_post_ID' =>$details['ID'],
|
480 |
'comment_author_email' => $details['email_author'],
|
481 |
'comment_date' =>$details['post_date'],
|
482 |
'comment_date_gmt' =>$details['post_date_gmt'],
|
483 |
-
'comment_content' =>$
|
484 |
-
'comment_author_url'
|
485 |
'comment_author_IP' =>'',
|
486 |
'comment_approved' =>1,
|
487 |
'comment_agent' =>'',
|
488 |
'comment_type' =>'',
|
489 |
-
'comment_parent' => 0
|
|
|
490 |
);
|
491 |
|
492 |
-
echo "the comment is:\n";
|
493 |
-
print_r($comment);
|
494 |
$post_ID = wp_insert_comment($comment);
|
495 |
}
|
496 |
-
if ($
|
497 |
if (count($details['customImages'])>1) {
|
498 |
-
|
499 |
foreach ($details['customImages'] as $image) {
|
500 |
-
add_post_meta($post_ID, 'image'. $imageField, $image);
|
501 |
$imageField++;
|
502 |
}
|
503 |
} else {
|
504 |
-
add_post_meta($post_ID, 'image', $
|
505 |
}
|
506 |
}
|
507 |
}
|
@@ -512,9 +539,8 @@ function PostToDB($details) {
|
|
512 |
* @param string
|
513 |
* @return boolean
|
514 |
*/
|
515 |
-
function BannedFileName($filename) {
|
516 |
-
$
|
517 |
-
foreach ($config["BANNED_FILES_LIST"] as $bannedFile) {
|
518 |
if (fnmatch($bannedFile, $filename)) {
|
519 |
print("<p>Ignoreing $filename - it is on the banned files list.");
|
520 |
return(true);
|
@@ -524,16 +550,20 @@ function BannedFileName($filename) {
|
|
524 |
}
|
525 |
|
526 |
//tear apart the meta part for useful information
|
527 |
-
function GetContent ($part,&$attachments) {
|
528 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
529 |
$meta_return = NULL;
|
530 |
-
|
531 |
DecodeBase64Part($part);
|
532 |
-
if (BannedFileName($part->ctype_parameters['name']
|
533 |
-
|
534 |
return(NULL);
|
535 |
-
}
|
536 |
-
|
537 |
if ($part->ctype_primary == "application"
|
538 |
&& $part->ctype_secondary == "octet-stream") {
|
539 |
if ($part->disposition == "attachment") {
|
@@ -547,32 +577,39 @@ function GetContent ($part,&$attachments) {
|
|
547 |
}
|
548 |
} else {
|
549 |
$mimeDecodedEmail = DecodeMIMEMail($part->body);
|
550 |
-
FilterTextParts($mimeDecodedEmail);
|
551 |
foreach($mimeDecodedEmail->parts as $section) {
|
552 |
-
$meta_return .= GetContent($section,$attachments);
|
553 |
}
|
554 |
}
|
555 |
}
|
556 |
if ($part->ctype_primary == "multipart"
|
557 |
&& $part->ctype_secondary == "appledouble") {
|
558 |
$mimeDecodedEmail = DecodeMIMEMail("Content-Type: multipart/mixed; boundary=".$part->ctype_parameters["boundary"]."\n".$part->body);
|
559 |
-
FilterTextParts($mimeDecodedEmail);
|
560 |
FilterAppleFile($mimeDecodedEmail);
|
561 |
foreach($mimeDecodedEmail->parts as $section) {
|
562 |
-
$meta_return .= GetContent($section,$attachments);
|
563 |
}
|
564 |
} else {
|
565 |
switch ( strtolower($part->ctype_primary) ) {
|
566 |
case 'multipart':
|
567 |
-
FilterTextParts($part);
|
568 |
foreach ($part->parts as $section) {
|
569 |
-
$meta_return .= GetContent($section,$attachments);
|
570 |
}
|
571 |
break;
|
572 |
case 'text':
|
573 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
574 |
$part->ctype_parameters["charset"],
|
575 |
-
$part->body);
|
576 |
|
577 |
//go through each sub-section
|
578 |
if ($part->ctype_secondary=='enriched') {
|
@@ -580,13 +617,13 @@ function GetContent ($part,&$attachments) {
|
|
580 |
$meta_return .= etf2HTML($part->body ) . "\n";
|
581 |
} elseif ($part->ctype_secondary=='html') {
|
582 |
//strip excess HTML
|
583 |
-
|
|
|
584 |
} else {
|
585 |
//regular text, so just strip the pgp signature
|
586 |
if (ALLOW_HTML_IN_BODY) {
|
587 |
$meta_return .= $part->body . "\n";
|
588 |
-
}
|
589 |
-
else {
|
590 |
$meta_return .= htmlentities( $part->body ) . "\n";
|
591 |
}
|
592 |
$meta_return = StripPGP($meta_return);
|
@@ -594,165 +631,79 @@ function GetContent ($part,&$attachments) {
|
|
594 |
break;
|
595 |
|
596 |
case 'image':
|
597 |
-
$
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
|
|
606 |
}
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
if ($
|
613 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
614 |
}
|
615 |
-
$
|
|
|
|
|
|
|
|
|
|
|
616 |
$cid = trim($part->headers["content-id"],"<>");; //cids are in <cid>
|
617 |
-
if ($
|
618 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
619 |
}
|
620 |
-
$attachments["
|
621 |
-
|
622 |
-
|
623 |
-
list($marime,$caption)=DetermineImageSize($file);
|
624 |
-
$marimex=$marime[0]+20;
|
625 |
-
$marimey=$marime[1]+20;
|
626 |
-
$onclick='';
|
627 |
-
if ($config['IMAGE_NEW_WINDOW']) {
|
628 |
-
$onclick='" onclick="window.open(' . "'"
|
629 |
-
. $config["URLPHOTOSDIR"] . $fullImage . "','"
|
630 |
-
. "full_size_image" . "','"
|
631 |
-
. "toolbar=0,scrollbars=0,location=0,status=0,menubar=0,resizable=1,height=" . $marimey . ",width=" . $marimex . "');" . "return false;";
|
632 |
-
}
|
633 |
-
if ($thumbImage) {
|
634 |
-
if ($config['USEIMAGETEMPLATE']) {
|
635 |
-
$attachments["html"][] .=
|
636 |
-
parseImageTemplate($thumbImage,$fullImage,$caption);
|
637 |
-
} else {
|
638 |
-
$attachments["html"][] .= '<div class="' .
|
639 |
-
$config["IMAGEDIV"].'"><a href="' .
|
640 |
-
$config["URLPHOTOSDIR"] . $fullImage .
|
641 |
-
$onclick . '"><img src="' . $config["URLPHOTOSDIR"] .
|
642 |
-
$thumbImage . '" alt="' . $part->ctype_parameters['name'] .
|
643 |
-
'" title="' . $part->ctype_parameters['name'] .
|
644 |
-
'" style="'.$config["IMAGESTYLE"].'" class="'.
|
645 |
-
$config["IMAGECLASS"].'" /></a></div>' . "\n";
|
646 |
-
}
|
647 |
-
if ($cid) {
|
648 |
-
$attachments["cids"][$cid] = array($config["URLPHOTOSDIR"] .
|
649 |
-
$fullImage,count($attachments["html"]) - 1);
|
650 |
-
}
|
651 |
-
} else {
|
652 |
-
if ($config['USEIMAGETEMPLATE']) {
|
653 |
-
$attachments["html"][]
|
654 |
-
.=parseImageTemplate('',$fileName,$caption);
|
655 |
-
} else {
|
656 |
-
$attachments["html"][] .= '<div class="' . $config["IMAGEDIV"].'"><img src="' . $config["URLPHOTOSDIR"] . $fileName
|
657 |
-
. '" alt="' . $part->ctype_parameters['name'] . '" style="'
|
658 |
-
. $config["IMAGESTYLE"] . '" class="' . $config["IMAGECLASS"] . '" /></div>' . "\n";
|
659 |
-
if ($cid) {
|
660 |
-
$attachments["cids"][$cid] = array($config["URLPHOTOSDIR"] . $fileName,count($attachments["html"]) - 1);
|
661 |
-
}
|
662 |
-
}
|
663 |
-
}
|
664 |
|
665 |
-
break;
|
666 |
default:
|
667 |
-
if (in_array(strtolower($part->ctype_primary)
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
$
|
673 |
-
$
|
674 |
-
|
675 |
-
fclose($fp);
|
676 |
-
@exec ('chmod 755 ' . $file);
|
677 |
$cid = trim($part->headers["content-id"],"<>");; //cids are in <cid>
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|| $part->ctype_secondary == "quicktime"
|
685 |
-
|| $part->ctype_secondary == "3gpp2") {
|
686 |
-
if ($config["3GP_QT"]) {
|
687 |
-
//Shamelessly borrowed from http://www.postneo.com/2003/12/19/embedding-3gpp-in-html
|
688 |
-
$autoplay='false';
|
689 |
-
if ($config['AUTOPLAY']) {
|
690 |
-
$autoplay='true';
|
691 |
-
}
|
692 |
-
$attachments["html"][] = '<!--Mime Type of File is '.$part->ctype_primary."/".$part->ctype_secondary.' -->' .
|
693 |
-
'<object '.
|
694 |
-
'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '.
|
695 |
-
'codebase="http://www.apple.com/qtactivex/qtplugin.cab" '.
|
696 |
-
'width="' . $config['VIDEO_WIDTH'] . '" '.
|
697 |
-
'height="' . $config['VIDEO_HEIGHT'] . '"> '.
|
698 |
-
'<param name="src" VALUE="'. $config["URLFILESDIR"] . $filename .'"> '.
|
699 |
-
"<param name=\"autoplay\" VALUE=\"$autoplay\"> ".
|
700 |
-
'<param name="controller" VALUE="true"> '.
|
701 |
-
'<embed '.
|
702 |
-
'src="'. $config["URLFILESDIR"] . $filename .'" '.
|
703 |
-
'width="' . $config['VIDEO_WIDTH'] . '" '.
|
704 |
-
'height="' . $config['VIDEO_HEIGHT'] . '"'.
|
705 |
-
"autoplay=\"$autoplay\" ".
|
706 |
-
'controller="true" '.
|
707 |
-
'type="video/quicktime" '.
|
708 |
-
'pluginspage="http://www.apple.com/quicktime/download/" '.
|
709 |
-
'width="' . $config['PLAYER_WIDTH'] . '" '.
|
710 |
-
'height="' . $config['PLAYER_HEIGHT'] . '">'.
|
711 |
-
'</embed> '.
|
712 |
-
'</object>';
|
713 |
-
} else {
|
714 |
-
if (file_exists($config["3GP_FFMPEG"])) {
|
715 |
-
$fileName = basename($file);
|
716 |
-
//options from http://www.getid3.org/phpBB2/viewtopic.php?p=1290&
|
717 |
-
$scaledFileName = "thumb.".$fileName;
|
718 |
-
$scaledFile = $config["REALPHOTOSDIR"] . $scaledFileName;
|
719 |
-
|
720 |
-
@exec (escapeshellcmd($config["3GP_FFMPEG"]) .
|
721 |
-
" -i " . escapeshellarg($file) .
|
722 |
-
" -y -ss 00:00:01 -vframes 1 -an -sameq -f gif " .
|
723 |
-
escapeshellarg($scaledFile) );
|
724 |
-
@exec ('chmod 755 ' . escapeshellarg($scaledFile));
|
725 |
-
|
726 |
-
$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";
|
727 |
-
} else {
|
728 |
-
$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";
|
729 |
-
}
|
730 |
-
}
|
731 |
-
} elseif ($part->ctype_secondary == "x-shockwave-flash") {
|
732 |
-
$attachments["html"][] = '<!--Mime Type of File is '.$part->ctype_primary."/".$part->ctype_secondary.' -->'.
|
733 |
-
'<object '.
|
734 |
-
'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" '.
|
735 |
-
'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" '.
|
736 |
-
'width="" '. 'height=""> '.
|
737 |
-
'<param name="movie" value="'. $config["URLFILESDIR"] .
|
738 |
-
$filename .'"> '.
|
739 |
-
'<param name="quality" value="high"> '.
|
740 |
-
'<embed '. 'src="'. $config["URLFILESDIR"] . $filename .'" '.
|
741 |
-
'width="" '. 'height="" '. 'quality="high" '.
|
742 |
-
'pluginspage="http://www.macromedia.com/go/getflashplayer" '.
|
743 |
-
'type="application/x-shockwave-flash" '.
|
744 |
-
'width="" '. 'height=""></embed> '. '</object>';
|
745 |
-
} else {
|
746 |
-
$attachments["html"][] = '<!--Mime Type of File is '.$part->ctype_primary."/".$part->ctype_secondary.' --><a href="' . $config["URLFILESDIR"] . $filename . '">' . $part->ctype_parameters['name'] . '</a>' . "\n";
|
747 |
-
}
|
748 |
if ($cid) {
|
749 |
-
$attachments["cids"][$cid] = array($
|
|
|
750 |
}
|
751 |
}
|
752 |
break;
|
753 |
}
|
754 |
}
|
755 |
-
return
|
756 |
}
|
757 |
|
758 |
function ubb2HTML(&$text) {
|
@@ -832,18 +783,18 @@ $replace = array (
|
|
832 |
// This function cleans up HTML in the e-mail
|
833 |
function HTML2HTML ( $content ) {
|
834 |
$search = array(
|
835 |
-
'/<html
|
836 |
-
'/<\/html>/',
|
837 |
-
'
|
838 |
-
'
|
839 |
-
'
|
840 |
-
'
|
841 |
-
'/<
|
842 |
-
'
|
843 |
-
'
|
844 |
-
'
|
845 |
'/<!DOCTYPE[^<]*>/',
|
846 |
-
'/<img src=[\'"][^<]*>/'
|
847 |
// '/<img src="cid:(.*)" .*>/'
|
848 |
);
|
849 |
|
@@ -866,57 +817,73 @@ $replace = array (
|
|
866 |
return ($content);
|
867 |
}
|
868 |
|
|
|
|
|
869 |
/**
|
870 |
* Determines if the sender is a valid user.
|
871 |
* @return integer|NULL
|
872 |
*/
|
873 |
-
function ValidatePoster( &$mimeDecodedEmail ) {
|
874 |
global $wpdb;
|
875 |
-
$config = GetConfig();
|
876 |
$poster = NULL;
|
877 |
$from = RemoveExtraCharactersInEmailAddress(trim($mimeDecodedEmail->headers["from"]));
|
878 |
$resentFrom = RemoveExtraCharactersInEmailAddress(trim($mimeDecodedEmail->headers["resent-from"]));
|
879 |
-
|
880 |
if ( empty($from) ) {
|
881 |
echo 'Invalid Sender - Emtpy! ';
|
882 |
return;
|
883 |
}
|
|
|
884 |
|
885 |
//See if the email address is one of the special authorized ones
|
886 |
print("Confirming Access For $from \n");
|
887 |
$sql = 'SELECT id FROM '. $wpdb->users.' WHERE user_email=\'' . addslashes($from) . "' LIMIT 1;";
|
888 |
$user_ID= $wpdb->get_var($sql);
|
889 |
$user = new WP_User($user_ID);
|
890 |
-
if ($config["TURN_AUTHORIZATION_OFF"] ||
|
|
|
|
|
891 |
if (empty($user_ID)){
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
}
|
899 |
-
else {
|
900 |
$poster = $user_ID;
|
901 |
}
|
|
|
|
|
902 |
}
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
echo "The message was unable to be forwarded to the adminstrator.\n";
|
913 |
-
}
|
914 |
}
|
915 |
-
|
|
|
916 |
}
|
917 |
return $poster;
|
918 |
}
|
919 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
920 |
/**
|
921 |
* Looks at the content for the start of the message and removes everything before that
|
922 |
* If the pattern is not found everything is returned
|
@@ -938,17 +905,21 @@ function StartFilter(&$content,$start) {
|
|
938 |
* @param array - a list of patterns to determine if it is a sig block
|
939 |
*/
|
940 |
function RemoveSignature( &$content,$filterList = array('--','- --' )) {
|
|
|
|
|
941 |
$arrcontent = explode("\n", $content);
|
942 |
$i = 0;
|
|
|
|
|
|
|
943 |
for ($i = 0; $i<=count($arrcontent); $i++) {
|
944 |
-
$line = $arrcontent[$i];
|
945 |
$nextline = $arrcontent[$i+1];
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
}
|
952 |
$strcontent .= $line ."\n";
|
953 |
}
|
954 |
$content = $strcontent;
|
@@ -975,27 +946,29 @@ for ($i = 0; $i<=count($arrcontent); $i++) {
|
|
975 |
}
|
976 |
|
977 |
//filter content for new lines
|
978 |
-
function FilterNewLines ( $content ) {
|
979 |
-
$config=GetConfig();
|
980 |
$search = array (
|
981 |
"/\r\n/",
|
982 |
"/\r/",
|
983 |
"/\n\n/",
|
|
|
984 |
"/\n/"
|
985 |
);
|
986 |
$replace = array (
|
987 |
"\n",
|
988 |
"\n",
|
989 |
'ACTUAL_NEW_LINE',
|
|
|
990 |
'LINEBREAK'
|
991 |
);
|
992 |
// strip extra line breaks, and replace double line breaks with paragraph
|
993 |
// tags
|
994 |
$result = preg_replace($search,$replace,$content);
|
995 |
//$newContent='<p>' . preg_replace('/ACTUAL_NEW_LINE/',"</p>\n<p>",$result);
|
996 |
-
|
|
|
997 |
//$newContent=preg_replace('/<p>LINEBREAK$/', '', $newContent);
|
998 |
-
if ($
|
999 |
$newContent= preg_replace('/LINEBREAK/',"<br />\n",$newContent);
|
1000 |
if ($debug) {
|
1001 |
echo "converting newlines\n";
|
@@ -1039,60 +1012,99 @@ function StripPGP ( $content ) {
|
|
1039 |
return $return;
|
1040 |
}
|
1041 |
|
1042 |
-
function ConvertToISO_8859_1($encoding,$charset,
|
1043 |
-
$config = GetConfig();
|
1044 |
$charset = strtolower($charset);
|
1045 |
$encoding = strtolower($encoding);
|
1046 |
-
if
|
1047 |
if( $encoding == 'base64' || $encoding == 'quoted-printable' ) {
|
1048 |
$body = utf8_decode($body);
|
1049 |
}
|
1050 |
}
|
|
|
1051 |
}
|
1052 |
-
function
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
|
|
|
|
|
|
1056 |
}
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
return(true);
|
1063 |
}
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
}
|
1073 |
-
*/
|
1074 |
-
HandleQuotedPrintable($encoding, $body);
|
1075 |
-
if (isISO88591Blog()) {
|
1076 |
-
ConvertToISO_8859_1($encoding,$charset,$body);
|
1077 |
-
}
|
1078 |
-
else {
|
1079 |
-
ConvertToUTF_8($encoding,$charset,$body);
|
1080 |
-
}
|
1081 |
}
|
1082 |
-
function ConvertToUTF_8($encoding,$charset
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1096 |
}
|
1097 |
|
1098 |
/**
|
@@ -1104,368 +1116,14 @@ function DecodeBase64Part( &$part ) {
|
|
1104 |
}
|
1105 |
}
|
1106 |
|
1107 |
-
function HandleQuotedPrintable($encoding, &$body ) {
|
1108 |
-
$
|
1109 |
-
|
1110 |
$body = quoted_printable_decode($body);
|
1111 |
}
|
1112 |
}
|
1113 |
|
1114 |
|
1115 |
-
function GenerateImageFileName($dir,$type) {
|
1116 |
-
static $ctr;
|
1117 |
-
$config = GetConfig();
|
1118 |
-
$ctr++;
|
1119 |
-
$type = strtolower($type);
|
1120 |
-
if ($type == "jpeg"
|
1121 |
-
|| $type = "pjpeg") {
|
1122 |
-
$type = "jpg";
|
1123 |
-
}
|
1124 |
-
if ($config["TEST_EMAIL"]) {
|
1125 |
-
return($dir . "TEST-" . date("Ymd-His-",time()) . $ctr . "." . $type);
|
1126 |
-
}
|
1127 |
-
else {
|
1128 |
-
return($dir . date("Ymd-His-",time()) . $ctr . "." . $type);
|
1129 |
-
}
|
1130 |
-
}
|
1131 |
-
function ConfirmTrailingDirectorySeperator($string) {
|
1132 |
-
if (substr($string,strlen($string) - 1,1) == DIRECTORY_SEPARATOR) {
|
1133 |
-
return(true);
|
1134 |
-
}
|
1135 |
-
return(false);
|
1136 |
-
}
|
1137 |
-
/**
|
1138 |
-
* This function handles figuring out the size of the image
|
1139 |
-
*@return array - array(width,height)
|
1140 |
-
*/
|
1141 |
-
function DetermineImageSize($file) {
|
1142 |
-
$config = GetConfig();
|
1143 |
-
if ($config["USE_IMAGEMAGICK"]) {
|
1144 |
-
list($size,$caption)=DetermineImageSizeWithImageMagick($file);
|
1145 |
-
}
|
1146 |
-
else {
|
1147 |
-
list($size,$caption)=DetermineImageSizeWithGD($file);
|
1148 |
-
}
|
1149 |
-
return(array($size,$caption));
|
1150 |
-
}
|
1151 |
-
/**
|
1152 |
-
* This function handles figuring out the size of the image
|
1153 |
-
*@return array - array(width,height)
|
1154 |
-
*/
|
1155 |
-
function DetermineImageSizeWithImageMagick($file) {
|
1156 |
-
$config = GetConfig();
|
1157 |
-
$size = array(0,0);
|
1158 |
-
if (file_exists($config["IMAGEMAGICK_IDENTIFY"])) {
|
1159 |
-
$geometry = @exec (escapeshellcmd($config["IMAGEMAGICK_IDENTIFY"]) .
|
1160 |
-
" -ping " .
|
1161 |
-
escapeshellarg($file));
|
1162 |
-
preg_match("/([0-9]+)x([0-9]+)/",$geometry,$matches);
|
1163 |
-
if (isset($matches[1])) {
|
1164 |
-
$size[0] = $matches[1];
|
1165 |
-
}
|
1166 |
-
if (isset($matches[2])) {
|
1167 |
-
$size[1] = $matches[2];
|
1168 |
-
}
|
1169 |
-
}
|
1170 |
-
if (file_exists($config["IMAGEMAGICK_CONVERT"])) {
|
1171 |
-
$caption = @exec (escapeshellcmd($config["IMAGEMAGICK_CONVERT"]) .
|
1172 |
-
" " . escapeshellarg($file)) . '8BIMTEXT:- ';
|
1173 |
-
preg_match('/Caption="(.*)"/', $caption, $matches);
|
1174 |
-
if (isset($matches[1])) {
|
1175 |
-
$caption = $matches[1];
|
1176 |
-
} else {
|
1177 |
-
$caption='';
|
1178 |
-
}
|
1179 |
-
}
|
1180 |
-
return(array($size,$caption));
|
1181 |
-
}
|
1182 |
-
/**
|
1183 |
-
* This function handles figuring out the size of the image
|
1184 |
-
*@return array - array(width,height)
|
1185 |
-
*/
|
1186 |
-
function DetermineImageSizeWithGD($file) {
|
1187 |
-
$size = getimagesize($file, $info);
|
1188 |
-
if(isset($info['APP13'])) {
|
1189 |
-
$iptc = iptcparse($info['APP13']);
|
1190 |
-
$caption= $iptc['2#120'][0];
|
1191 |
-
}
|
1192 |
-
return(array($size,$caption));
|
1193 |
-
}
|
1194 |
-
|
1195 |
-
function ResizeImage($file,$type) {
|
1196 |
-
$config = GetConfig();
|
1197 |
-
list($sizeInfo,$caption) = DetermineImageSize($file);
|
1198 |
-
$fileName = basename($file);
|
1199 |
-
if (DetermineScale($sizeInfo[0],$sizeInfo[1],$config["MAX_IMAGE_WIDTH"], $config["MAX_IMAGE_HEIGHT"]) != 1) {
|
1200 |
-
if ($config["USE_IMAGEMAGICK"]) {
|
1201 |
-
list($scaledFileName, $fileName,$caption)=ResizeImageWithImageMagick($file,$type);
|
1202 |
-
} else {
|
1203 |
-
list($scaledFileName, $fileName,$caption)=ResizeImageWithGD($file,$type);
|
1204 |
-
}
|
1205 |
-
}
|
1206 |
-
return(array($scaledFileName,$fileName, $caption));
|
1207 |
-
|
1208 |
-
}
|
1209 |
-
function RotateImages($rotation,$imageList) {
|
1210 |
-
$config = GetConfig();
|
1211 |
-
foreach ($imageList as $data) {
|
1212 |
-
if ($config["USE_IMAGEMAGICK"]) {
|
1213 |
-
if ($data[0]) {
|
1214 |
-
RotateImageWithImageMagick($data[0],$data[2],$rotation);
|
1215 |
-
}
|
1216 |
-
RotateImageWithImageMagick($data[1],$data[2],$rotation);
|
1217 |
-
}
|
1218 |
-
else {
|
1219 |
-
if ($data[0]) {
|
1220 |
-
RotateImageWithGD($data[0],$data[2],$rotation);
|
1221 |
-
}
|
1222 |
-
RotateImageWithGD($data[1],$data[2],$rotation);
|
1223 |
-
}
|
1224 |
-
}
|
1225 |
-
}
|
1226 |
-
function ImageMagickSharpen($source,$dest = null) {
|
1227 |
-
$config = GetConfig();
|
1228 |
-
if (!$dest) {
|
1229 |
-
$dest = $source;
|
1230 |
-
}
|
1231 |
-
@exec (escapeshellcmd($config["IMAGEMAGICK_CONVERT"]) . " ".
|
1232 |
-
escapeshellarg($source) . " ".
|
1233 |
-
'\( +clone -modulate 100,0 \) \( +clone -unsharp 0x1+200+0 \) \( -clone 0 -edge 3 -colorspace GRAY -colors 256 -level 20%,95% -gaussian 10 -level 10%,95% \) -colorspace RGB -fx "u[0]+(((u[2]+1)/(u[1]+1))-1)*u[0]*u[3]" ' .
|
1234 |
-
escapeshellarg($dest) );
|
1235 |
-
@exec ('chmod 755 ' . escapeshellarg($dest));
|
1236 |
-
|
1237 |
-
}
|
1238 |
-
function RotateImageWithImageMagick($file,$type,$rotation) {
|
1239 |
-
$config = GetConfig();
|
1240 |
-
@exec (escapeshellcmd($config["IMAGEMAGICK_CONVERT"]) .
|
1241 |
-
" -rotate " .
|
1242 |
-
escapeshellarg($rotation) .
|
1243 |
-
" " .
|
1244 |
-
escapeshellarg($file) .
|
1245 |
-
" " .
|
1246 |
-
escapeshellarg($file) );
|
1247 |
-
@exec ('chmod 755 ' . escapeshellarg($file));
|
1248 |
-
}
|
1249 |
-
function RotateImageWithGD($file,$type,$rotation) {
|
1250 |
-
$config = GetConfig();
|
1251 |
-
$fileName = basename($file);
|
1252 |
-
$sourceImage = NULL;
|
1253 |
-
|
1254 |
-
switch($type) {
|
1255 |
-
case "jpeg":
|
1256 |
-
case "jpg":
|
1257 |
-
case "pjpeg":
|
1258 |
-
$typePrefix = "jpeg";
|
1259 |
-
break;
|
1260 |
-
case "gif":
|
1261 |
-
$typePrefix = "gif";
|
1262 |
-
break;
|
1263 |
-
case "png":
|
1264 |
-
$typePrefix = "png";
|
1265 |
-
break;
|
1266 |
-
default:
|
1267 |
-
$typePrefix = NULL;
|
1268 |
-
break;
|
1269 |
-
}
|
1270 |
-
if ($typePrefix) {
|
1271 |
-
eval ('$sourceImage = imagecreatefrom'.$typePrefix.'($file);');
|
1272 |
-
if (function_exists("imagerotate")) {
|
1273 |
-
$rotatedImage = imagerotate($sourceImage,$rotation,0);
|
1274 |
-
}
|
1275 |
-
else {
|
1276 |
-
$rotatedImage = CustomImageRotate($sourceImage,$rotation);
|
1277 |
-
}
|
1278 |
-
eval ('image'.$typePrefix.'($rotatedImage,$file);');
|
1279 |
-
imagedestroy($sourceImage);
|
1280 |
-
@exec ('chmod 755 ' . escapeshellarg($file));
|
1281 |
-
}
|
1282 |
-
}
|
1283 |
-
/**
|
1284 |
-
* This function handles rotating in GD when you do not have imagerotate available
|
1285 |
-
* Writen byu wulff at fyens dot dk
|
1286 |
-
* From http://us2.php.net/manual/en/function.imagerotate.php#50487
|
1287 |
-
*/
|
1288 |
-
// $src_img - a GD image resource
|
1289 |
-
// $angle - degrees to rotate clockwise, in degrees
|
1290 |
-
// returns a GD image resource
|
1291 |
-
// USAGE:
|
1292 |
-
// $im = imagecreatefrompng('test.png');
|
1293 |
-
// $im = imagerotate($im, 15);
|
1294 |
-
// header('Content-type: image/png');
|
1295 |
-
// imagepng($im);
|
1296 |
-
function CustomImageRotate($src_img, $angle, $bicubic=false) {
|
1297 |
-
|
1298 |
-
// convert degrees to radians
|
1299 |
-
$angle = $angle + 180;
|
1300 |
-
$angle = deg2rad($angle);
|
1301 |
-
|
1302 |
-
$src_x = imagesx($src_img);
|
1303 |
-
$src_y = imagesy($src_img);
|
1304 |
-
|
1305 |
-
$center_x = floor($src_x/2);
|
1306 |
-
$center_y = floor($src_y/2);
|
1307 |
-
|
1308 |
-
$cosangle = cos($angle);
|
1309 |
-
$sinangle = sin($angle);
|
1310 |
-
|
1311 |
-
$corners=array(array(0,0), array($src_x,0), array($src_x,$src_y), array(0,$src_y));
|
1312 |
-
|
1313 |
-
foreach($corners as $key=>$value) {
|
1314 |
-
$value[0]-=$center_x; //Translate coords to center for rotation
|
1315 |
-
$value[1]-=$center_y;
|
1316 |
-
$temp=array();
|
1317 |
-
$temp[0]=$value[0]*$cosangle+$value[1]*$sinangle;
|
1318 |
-
$temp[1]=$value[1]*$cosangle-$value[0]*$sinangle;
|
1319 |
-
$corners[$key]=$temp;
|
1320 |
-
}
|
1321 |
-
|
1322 |
-
$min_x=1000000000000000;
|
1323 |
-
$max_x=-1000000000000000;
|
1324 |
-
$min_y=1000000000000000;
|
1325 |
-
$max_y=-1000000000000000;
|
1326 |
-
|
1327 |
-
foreach($corners as $key => $value) {
|
1328 |
-
if($value[0]<$min_x)
|
1329 |
-
$min_x=$value[0];
|
1330 |
-
if($value[0]>$max_x)
|
1331 |
-
$max_x=$value[0];
|
1332 |
-
|
1333 |
-
if($value[1]<$min_y)
|
1334 |
-
$min_y=$value[1];
|
1335 |
-
if($value[1]>$max_y)
|
1336 |
-
$max_y=$value[1];
|
1337 |
-
}
|
1338 |
-
|
1339 |
-
$rotate_width=round($max_x-$min_x);
|
1340 |
-
$rotate_height=round($max_y-$min_y);
|
1341 |
-
|
1342 |
-
$rotate=imagecreatetruecolor($rotate_width,$rotate_height);
|
1343 |
-
imagealphablending($rotate, false);
|
1344 |
-
imagesavealpha($rotate, true);
|
1345 |
-
|
1346 |
-
//Reset center to center of our image
|
1347 |
-
$newcenter_x = ($rotate_width)/2;
|
1348 |
-
$newcenter_y = ($rotate_height)/2;
|
1349 |
-
|
1350 |
-
for ($y = 0; $y < ($rotate_height); $y++) {
|
1351 |
-
for ($x = 0; $x < ($rotate_width); $x++) {
|
1352 |
-
// rotate...
|
1353 |
-
$old_x = round((($newcenter_x-$x) * $cosangle + ($newcenter_y-$y) * $sinangle))
|
1354 |
-
+ $center_x;
|
1355 |
-
$old_y = round((($newcenter_y-$y) * $cosangle - ($newcenter_x-$x) * $sinangle))
|
1356 |
-
+ $center_y;
|
1357 |
-
|
1358 |
-
if ( $old_x >= 0 && $old_x < $src_x
|
1359 |
-
&& $old_y >= 0 && $old_y < $src_y ) {
|
1360 |
-
|
1361 |
-
$color = imagecolorat($src_img, $old_x, $old_y);
|
1362 |
-
} else {
|
1363 |
-
// this line sets the background colour
|
1364 |
-
$color = imagecolorallocatealpha($src_img, 255, 255, 255, 127);
|
1365 |
-
}
|
1366 |
-
imagesetpixel($rotate, $x, $y, $color);
|
1367 |
-
}
|
1368 |
-
}
|
1369 |
-
|
1370 |
-
return($rotate);
|
1371 |
-
}
|
1372 |
-
/*
|
1373 |
-
function DetermineScale($width,$height, $max_width, $max_height) {
|
1374 |
-
if (!empty($max_width)) {
|
1375 |
-
return($max_width/$width);
|
1376 |
-
}
|
1377 |
-
else if (!empty($max_height)) {
|
1378 |
-
return($max_height/$height);
|
1379 |
-
}
|
1380 |
-
return(1);
|
1381 |
-
}
|
1382 |
-
*/
|
1383 |
-
function DetermineScale($width,$height, $max_width=0, $max_height=0) {
|
1384 |
-
if ($max_width!=0 || $max_height!=0) {
|
1385 |
-
$width_scale=($max_width/$width);
|
1386 |
-
$height_scale=($max_height/$height);
|
1387 |
-
if ($max_width==0) {
|
1388 |
-
$scale=$height_scale;
|
1389 |
-
} else if ($max_height==0) {
|
1390 |
-
$scale=$width_scale;
|
1391 |
-
} else {
|
1392 |
-
$scale = $width_scale < $height_scale? $width_scale : $height_scale;
|
1393 |
-
}
|
1394 |
-
return($scale);
|
1395 |
-
}
|
1396 |
-
return(1);
|
1397 |
-
}
|
1398 |
-
|
1399 |
-
function ResizeImageWithImageMagick($file,$type) {
|
1400 |
-
//print("<h1>Using ImageMagick</h1>");
|
1401 |
-
$config = GetConfig();
|
1402 |
-
list($sizeInfo,$caption) = DetermineImageSize($file);
|
1403 |
-
$fileName = basename($file);
|
1404 |
-
$scaledFileName = "";
|
1405 |
-
$scale = DetermineScale($sizeInfo[0],$sizeInfo[1],$config["MAX_IMAGE_WIDTH"], $config["MAX_IMAGE_HEIGHT"]);
|
1406 |
-
if ($scale < 1) {
|
1407 |
-
$scaledH = round($sizeInfo[1] * $scale );
|
1408 |
-
$scaledW = round($sizeInfo[0] * $scale );
|
1409 |
-
$scaledFileName = "thumb.".$fileName;
|
1410 |
-
$scaledFile = $config["REALPHOTOSDIR"] . $scaledFileName;
|
1411 |
-
@exec (escapeshellcmd($config["IMAGEMAGICK_CONVERT"]) .
|
1412 |
-
" -resize " .
|
1413 |
-
$scaledW .
|
1414 |
-
"x" .
|
1415 |
-
$scaledH .
|
1416 |
-
" " .
|
1417 |
-
escapeshellarg($file) .
|
1418 |
-
" " .
|
1419 |
-
escapeshellarg($scaledFile) );
|
1420 |
-
|
1421 |
-
@exec ('chmod 755 ' . escapeshellarg($scaledFile));
|
1422 |
-
}
|
1423 |
-
return(array($scaledFileName,$fileName,$caption));
|
1424 |
-
|
1425 |
-
}
|
1426 |
-
function ResizeImageWithGD($file,$type) {
|
1427 |
-
$original_mem_limit = ini_get('memory_limit');
|
1428 |
-
ini_set('memory_limit', -1);
|
1429 |
-
$config = GetConfig();
|
1430 |
-
list($sizeInfo,$caption) = DetermineImageSize($file);
|
1431 |
-
$fileName = basename($file);
|
1432 |
-
$scaledFileName = "";
|
1433 |
-
$scale = DetermineScale($sizeInfo[0],$sizeInfo[1],$config["MAX_IMAGE_WIDTH"], $config["MAX_IMAGE_HEIGHT"]);
|
1434 |
-
if ($scale < 1) {
|
1435 |
-
$sourceImage = NULL;
|
1436 |
-
switch($type) {
|
1437 |
-
case "jpeg":
|
1438 |
-
case "jpg":
|
1439 |
-
case "pjpeg":
|
1440 |
-
$sourceImage = imagecreatefromjpeg($file);
|
1441 |
-
break;
|
1442 |
-
case "gif":
|
1443 |
-
$sourceImage = imagecreatefromgif($file);
|
1444 |
-
break;
|
1445 |
-
case "png":
|
1446 |
-
$sourceImage = imagecreatefrompng($file);
|
1447 |
-
break;
|
1448 |
-
}
|
1449 |
-
if ($sourceImage) {
|
1450 |
-
$scaledH = round($sizeInfo[1] * $scale );
|
1451 |
-
$scaledW = round($sizeInfo[0] * $scale );
|
1452 |
-
$scaledFileName = "thumb.".$fileName;
|
1453 |
-
$scaledFile = $config["REALPHOTOSDIR"] . $scaledFileName;
|
1454 |
-
$scaledImage = imagecreatetruecolor($scaledW,$scaledH);
|
1455 |
-
imagecopyresampled($scaledImage,$sourceImage,0,0,0,0,
|
1456 |
-
$scaledW,$scaledH,
|
1457 |
-
$sizeInfo[0],$sizeInfo[1]);
|
1458 |
-
imagejpeg($scaledImage,$scaledFile,$config["JPEGQUALITY"]);
|
1459 |
-
@exec ('chmod 755 ' . escapeshellarg($scaledFile));
|
1460 |
-
imagedestroy($scaledImage);
|
1461 |
-
imagedestroy($sourceImage);
|
1462 |
-
}
|
1463 |
-
}
|
1464 |
-
// Revert to original limit
|
1465 |
-
ini_set('memory_limit', $original_mem_limit);
|
1466 |
-
return(array($scaledFileName,$fileName,$caption));
|
1467 |
-
|
1468 |
-
}
|
1469 |
/**
|
1470 |
* Checks for the comments tag
|
1471 |
* @return boolean
|
@@ -1486,24 +1144,10 @@ function AllowCommentsOnPost(&$content) {
|
|
1486 |
}
|
1487 |
return($comments_allowed);
|
1488 |
}
|
1489 |
-
/**
|
1490 |
-
* This function figures out how much rotation should be applied to all images in the message
|
1491 |
-
*/
|
1492 |
-
function GetRotation(&$mimeDecodedEmail,&$content) {
|
1493 |
-
$rotation = 0;
|
1494 |
-
if (eregi("rotate:([0-9]+)",$content,$matches)
|
1495 |
-
&& trim($matches[1])) {
|
1496 |
-
$delay = (($days * 24 + $hours) * 60 + $minutes) * 60;
|
1497 |
-
$rotation = $matches[1];
|
1498 |
-
$content = ereg_replace("rotate:$matches[1]","",$content);
|
1499 |
-
}
|
1500 |
-
return($rotation);
|
1501 |
-
}
|
1502 |
/**
|
1503 |
* Needed to be able to modify the content to remove the usage of the delay tag
|
1504 |
*/
|
1505 |
-
function DeterminePostDate(&$content, $message_date = NULL) {
|
1506 |
-
$config = GetConfig();
|
1507 |
$delay = 0;
|
1508 |
if ($debug) {
|
1509 |
echo "inside Determine Post Date, message_date = $message_date\n";
|
@@ -1528,27 +1172,28 @@ function DeterminePostDate(&$content, $message_date = NULL) {
|
|
1528 |
else {
|
1529 |
$dateInSeconds = time() + $delay;
|
1530 |
}
|
1531 |
-
$post_date = gmdate('Y-m-d H:i:s',$dateInSeconds + ($
|
1532 |
$post_date_gmt = gmdate('Y-m-d H:i:s',$dateInSeconds);
|
1533 |
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
|
|
|
|
1538 |
return(array($post_date,$post_date_gmt));
|
1539 |
}
|
1540 |
/**
|
1541 |
* This function takes the content of the message - looks for a subject at the begining surrounded by # and then removes that from the content
|
1542 |
*/
|
1543 |
-
function ParseInMessageSubject($content) {
|
1544 |
-
$config = GetConfig();
|
1545 |
if (substr($content,0,1) != "#") {
|
1546 |
//print("<p>Didn't start with # '".substr(ltrim($content),0,10)."'");
|
1547 |
-
return(array($
|
1548 |
}
|
1549 |
$subjectEndIndex = strpos($content,"#",1);
|
1550 |
if (!$subjectEndIndex > 0) {
|
1551 |
-
return(array($
|
1552 |
}
|
1553 |
$subject = substr($content,1,$subjectEndIndex - 1);
|
1554 |
$content = substr($content,$subjectEndIndex + 1,strlen($content));
|
@@ -1574,7 +1219,186 @@ function FilterAppleFile(&$mimeDecodedEmail) {
|
|
1574 |
$mimeDecodedEmail->parts = $newParts; //This is now the filtered list of just the preferred type.
|
1575 |
}
|
1576 |
}
|
1577 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1578 |
* Searches for the existance of a certain MIME TYPE in the tree of mime attachments
|
1579 |
* @param primary mime
|
1580 |
* @param secondary mime
|
@@ -1598,91 +1422,114 @@ function SearchForMIMEType($part,$primary,$secondary) {
|
|
1598 |
* that type is present it filters out all other text types. If it is not - then nothing is done
|
1599 |
*@param object
|
1600 |
*/
|
1601 |
-
function FilterTextParts(&$mimeDecodedEmail) {
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
}
|
1615 |
-
}
|
1616 |
-
if ($found && $newParts) {
|
1617 |
-
$mimeDecodedEmail->parts = $newParts; //This is now the filtered list of just the preferred type.
|
1618 |
}
|
|
|
|
|
|
|
|
|
|
|
1619 |
}
|
1620 |
/**
|
1621 |
-
*This
|
1622 |
-
*It
|
1623 |
*/
|
1624 |
-
function
|
1625 |
-
$
|
1626 |
-
|
1627 |
-
|
1628 |
-
|
1629 |
$user = get_userdata('1');
|
1630 |
$myname = $user->user_nicename;
|
1631 |
$myemailadd = get_option("admin_email");
|
1632 |
$blogname = get_option("blogname");
|
1633 |
-
$
|
|
|
1634 |
if (count($recipients) == 0) {
|
1635 |
return false;
|
1636 |
}
|
1637 |
|
1638 |
$from = trim($mail_content->headers["from"]);
|
1639 |
$subject = $mail_content->headers['subject'];
|
|
|
|
|
|
|
1640 |
|
|
|
1641 |
// Set email subject
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
1645 |
-
|
1646 |
-
|
1647 |
-
|
1648 |
}
|
1649 |
-
|
1650 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1651 |
}
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
$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.";
|
1664 |
-
$message .= "\n\nOtherwise, the e-mail has already been deleted from the server and you can ignore this message.";
|
1665 |
-
$message .= "\n\nIf you would like to prevent posstie from forwarding mail
|
1666 |
-
in the future, please change the FORWARD_REJECTED_MAIL setting in the Postie
|
1667 |
-
settings panel";
|
1668 |
-
$message .= "\n\nThe original content of the e-mail has been attached.\n\n";
|
1669 |
-
$boundary = "--".$mail_content->ctype_parameters["boundary"] ."\n";
|
1670 |
-
|
1671 |
-
$mailtext = $boundary;
|
1672 |
$mailtext .= "Content-Type: text/plain;format=flowed;charset=\"iso-8859-1\";reply-type=original\n";
|
1673 |
$mailtext .= "Content-Transfer-Encoding: 7bit\n";
|
1674 |
$mailtext .= "\n";
|
1675 |
-
$mailtext .= $message;
|
1676 |
-
|
1677 |
-
|
1678 |
-
|
1679 |
-
|
1680 |
-
|
1681 |
-
|
1682 |
-
|
1683 |
-
|
1684 |
-
|
|
|
|
|
|
|
|
|
|
|
1685 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1686 |
|
1687 |
// Send message
|
1688 |
mail($myemailadd, $alert_subject, $mailtext, $headers);
|
@@ -1694,12 +1541,13 @@ function ForwardRejectedMailToAdmin( &$mail_content) {
|
|
1694 |
* @param string
|
1695 |
* @return array
|
1696 |
*/
|
1697 |
-
function DecodeMIMEMail($email) {
|
1698 |
$params = array();
|
1699 |
$params['include_bodies'] = true;
|
1700 |
$params['decode_bodies'] = false;
|
1701 |
-
$params['decode_headers'] =
|
1702 |
$params['input'] = $email;
|
|
|
1703 |
return(Mail_mimeDecode::decode($params));
|
1704 |
}
|
1705 |
|
@@ -1717,14 +1565,12 @@ function DisplayMIMEPartTypes($mimeDecodedEmail) {
|
|
1717 |
* @param string - email address
|
1718 |
* @return boolean
|
1719 |
*/
|
1720 |
-
function CheckEmailAddress($address) {
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
}
|
1727 |
-
return(in_array($address,$config["AUTHORIZED_ADDRESSES"]));
|
1728 |
}
|
1729 |
/**
|
1730 |
*This method works around a problemw with email address with extra <> in the email address
|
@@ -1759,36 +1605,131 @@ function GetNameFromEmail($address) {
|
|
1759 |
return($name);
|
1760 |
}
|
1761 |
|
1762 |
-
|
1763 |
-
|
1764 |
-
|
1765 |
-
|
1766 |
-
|
1767 |
-
|
1768 |
-
|
1769 |
-
|
1770 |
-
|
1771 |
-
|
1772 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1773 |
} else {
|
1774 |
-
$
|
1775 |
-
|
1776 |
-
|
1777 |
-
|
1778 |
-
|
1779 |
-
$
|
1780 |
-
|
1781 |
-
$
|
1782 |
-
|
1783 |
-
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
1788 |
-
|
1789 |
-
|
1790 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1791 |
}
|
|
|
1792 |
/**
|
1793 |
* When sending in HTML email the html refers to the content-id(CID) of the image - this replaces
|
1794 |
* the cid place holder with the actual url of the image sent in
|
@@ -1818,8 +1759,8 @@ function ReplaceImageCIDs(&$content,&$attachments) {
|
|
1818 |
* @param string - text of post
|
1819 |
* @param array - array of HTML for images for post
|
1820 |
*/
|
1821 |
-
function ReplaceImagePlaceHolders(&$content,$attachments) {
|
1822 |
-
|
1823 |
($config["START_IMAGE_COUNT_AT_ZERO"] ? $startIndex = 0 :$startIndex = 1);
|
1824 |
foreach ( $attachments as $i => $value ) {
|
1825 |
// looks for ' #img1# ' etc... and replaces with image
|
@@ -1832,24 +1773,28 @@ function ReplaceImagePlaceHolders(&$content,$attachments) {
|
|
1832 |
stristr($content, $eimg_placeholder_temp) ) {
|
1833 |
// look for caption
|
1834 |
$caption='';
|
1835 |
-
if ( preg_match("
|
1836 |
$caption =$matches[1];
|
1837 |
-
$img_placeholder_temp
|
1838 |
-
$eimg_placeholder_temp
|
|
|
1839 |
}
|
1840 |
$value = str_replace('{CAPTION}', $caption, $value);
|
1841 |
$img_placeholder_temp.='#';
|
1842 |
$eimg_placeholder_temp.='#';
|
1843 |
$content = str_replace($img_placeholder_temp, $value, $content);
|
1844 |
$content = str_replace($eimg_placeholder_temp, $value, $content);
|
1845 |
-
print(htmlspecialchars("value=$value",ENT_QUOTES));
|
1846 |
-
print(htmlspecialchars("content
|
1847 |
} else {
|
1848 |
$value = str_replace('{CAPTION}', '', $value);
|
1849 |
-
if
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
|
|
|
|
|
|
1853 |
}
|
1854 |
}
|
1855 |
}
|
@@ -1858,40 +1803,68 @@ function ReplaceImagePlaceHolders(&$content,$attachments) {
|
|
1858 |
*This function handles finding and setting the correct subject
|
1859 |
* @return array - (subject,content)
|
1860 |
*/
|
1861 |
-
function GetSubject(&$mimeDecodedEmail,&$content) {
|
1862 |
-
|
1863 |
-
|
1864 |
-
|
1865 |
-
|
1866 |
-
|
1867 |
-
|
1868 |
-
else {
|
1869 |
-
$subject = $config["DEFAULT_TITLE"];
|
1870 |
-
}
|
1871 |
-
$mimeDecodedEmail->headers['subject'] = $subject;
|
1872 |
-
} else {
|
1873 |
-
$subject = $mimeDecodedEmail->headers['subject'];
|
1874 |
-
HandleMessageEncoding($mimeDecodedEmail->headers["content-transfer-encoding"],
|
1875 |
-
$mimeDecodedEmail->ctype_parameters["charset"],
|
1876 |
-
$subject);
|
1877 |
-
if (!$config["ALLOW_HTML_IN_SUBJECT"]) {
|
1878 |
-
$subject = htmlentities($subject);
|
1879 |
-
}
|
1880 |
}
|
1881 |
-
|
1882 |
-
|
1883 |
-
|
1884 |
-
|
1885 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1886 |
}
|
1887 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1888 |
}
|
1889 |
/**
|
1890 |
* this function determines tags for the post
|
1891 |
*
|
1892 |
*/
|
1893 |
-
function
|
1894 |
-
$config = GetConfig();
|
1895 |
global $wpdb;
|
1896 |
$post_tags = array();
|
1897 |
//try and determine tags
|
@@ -1900,8 +1873,7 @@ function GetPostTags(&$content) {
|
|
1900 |
$post_tags = preg_split("/,\s*/", $matches[1]);
|
1901 |
}
|
1902 |
if (!count($post_tags)) {
|
1903 |
-
|
1904 |
-
$post_tags = $config["DEFAULT_POST_TAGS"];
|
1905 |
}
|
1906 |
return($post_tags);
|
1907 |
}
|
@@ -1909,18 +1881,14 @@ function GetPostTags(&$content) {
|
|
1909 |
* this function determines excerpt for the post
|
1910 |
*
|
1911 |
*/
|
1912 |
-
function GetPostExcerpt(&$content) {
|
1913 |
-
$config = GetConfig();
|
1914 |
global $wpdb;
|
1915 |
$post_excerpt = '';
|
1916 |
-
//try and determine excerpt
|
1917 |
-
//echo "CONTENT ------
|
1918 |
-
//$content
|
1919 |
-
//-------";
|
1920 |
if ( preg_match('/:excerptstart ?(.*):excerptend/s', $content, $matches)) {
|
1921 |
$content = str_replace($matches[0], "", $content);
|
1922 |
$post_excerpt = $matches[1];
|
1923 |
-
|
|
|
1924 |
}
|
1925 |
return($post_excerpt);
|
1926 |
}
|
@@ -1928,8 +1896,7 @@ function GetPostExcerpt(&$content) {
|
|
1928 |
* This function determines categories for the post
|
1929 |
* @return array
|
1930 |
*/
|
1931 |
-
function GetPostCategories(&$subject) {
|
1932 |
-
$config = GetConfig();
|
1933 |
global $wpdb;
|
1934 |
$post_categories = array();
|
1935 |
$matches = array();
|
@@ -1975,7 +1942,7 @@ function GetPostCategories(&$subject) {
|
|
1975 |
}
|
1976 |
}
|
1977 |
if (!count($post_categories)) {
|
1978 |
-
$post_categories[] = $
|
1979 |
}
|
1980 |
return($post_categories);
|
1981 |
}
|
@@ -1983,7 +1950,6 @@ function GetPostCategories(&$subject) {
|
|
1983 |
*This function just outputs a simple html report about what is being posted in
|
1984 |
*/
|
1985 |
function DisplayEmailPost($details) {
|
1986 |
-
$config = GetConfig();
|
1987 |
if ($debug) {
|
1988 |
print_r($config);
|
1989 |
print_r($details);
|
@@ -2000,18 +1966,11 @@ function DisplayEmailPost($details) {
|
|
2000 |
print '<b>Comment Status</b>: ' . $details["comment_status"] . '<br />' . "\n";
|
2001 |
print '<b>Subject</b>: ' . $details["post_title"]. '<br />' . "\n";
|
2002 |
print '<b>Postname</b>: ' . $details["post_name"] . '<br />' . "\n";
|
2003 |
-
print '<b>
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
|
2008 |
-
function TestWPMailInstallation() {
|
2009 |
-
$config = GetConfig();
|
2010 |
-
IsWritableDirectory($config["REALPHOTOSDIR"]);
|
2011 |
-
IsWritableDirectory($config["REALFILESDIR"]);
|
2012 |
-
if (!TestPostieDirectory) {
|
2013 |
-
print("<p>Postie should be in its own directory in wp-content/plugins/postie</p>");
|
2014 |
-
}
|
2015 |
}
|
2016 |
/**
|
2017 |
* Takes a value and builds a simple simple yes/no select box
|
@@ -2027,10 +1986,10 @@ function BuildBooleanSelect($label,$id,$current_value,$recommendation = NULL) {
|
|
2027 |
<option value=\"1\">".__("Yes", 'postie')."</option>
|
2028 |
<option value=\"0\" ". (!$current_value ? "SELECTED" : NULL) .
|
2029 |
">".__("No", 'postie').'</option>
|
2030 |
-
</select>
|
2031 |
-
<br />';
|
2032 |
if ($recommendation!=NULL) {
|
2033 |
-
$string.='<
|
|
|
2034 |
}
|
2035 |
$string.="</td>\n</tr>";
|
2036 |
return($string);
|
@@ -2043,24 +2002,22 @@ function BuildBooleanSelect($label,$id,$current_value,$recommendation = NULL) {
|
|
2043 |
*@param string
|
2044 |
*/
|
2045 |
function BuildTextArea($label,$id,$current_value,$recommendation = NULL) {
|
2046 |
-
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
2050 |
-
|
2051 |
-
|
2052 |
-
|
2053 |
-
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
2057 |
-
|
2058 |
-
|
2059 |
-
|
2060 |
-
}
|
2061 |
-
$string .= "</textarea></td>
|
2062 |
</tr>";
|
2063 |
-
|
2064 |
}
|
2065 |
/**
|
2066 |
*Handles the creation of the table needed to store all the data
|
@@ -2081,86 +2038,111 @@ function SetupConfiguration() {
|
|
2081 |
*/
|
2082 |
function ResetPostieConfig() {
|
2083 |
global $wpdb;
|
2084 |
-
|
2085 |
-
|
2086 |
-
|
2087 |
-
|
2088 |
-
|
2089 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2090 |
}
|
2091 |
-
|
|
|
|
|
2092 |
}
|
2093 |
/**
|
2094 |
* This function handles updating the configuration
|
2095 |
*@return boolean
|
2096 |
*/
|
2097 |
function UpdatePostieConfig($data) {
|
2098 |
-
|
2099 |
-
|
2100 |
-
|
2101 |
-
|
2102 |
-
|
2103 |
-
|
2104 |
-
|
2105 |
-
|
2106 |
-
|
2107 |
-
|
2108 |
-
|
2109 |
-
}
|
2110 |
-
}
|
2111 |
-
}
|
2112 |
-
else {
|
2113 |
-
$config[$key] = $data[$key];
|
2114 |
-
}
|
2115 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2116 |
}
|
2117 |
-
|
2118 |
-
|
2119 |
-
|
|
|
2120 |
}
|
2121 |
/**
|
2122 |
* This handles actually writing out the changes
|
2123 |
*@param array
|
2124 |
*/
|
2125 |
function WriteConfig($config) {
|
2126 |
-
|
2127 |
-
|
2128 |
-
|
2129 |
-
|
2130 |
-
|
2131 |
-
|
2132 |
-
|
2133 |
-
|
2134 |
-
|
2135 |
-
|
2136 |
-
|
2137 |
-
|
2138 |
-
|
2139 |
}
|
2140 |
/**
|
2141 |
*This handles actually reading the config from the database
|
2142 |
* @return array
|
2143 |
*/
|
2144 |
function ReadDBConfig() {
|
2145 |
-
|
2146 |
-
|
2147 |
-
|
2148 |
-
|
2149 |
-
|
2150 |
-
|
2151 |
-
|
2152 |
-
|
2153 |
-
|
2154 |
-
|
2155 |
-
|
2156 |
-
}
|
2157 |
-
else {
|
2158 |
-
$config[$row->label] = $row->value;
|
2159 |
-
}
|
2160 |
-
}
|
2161 |
}
|
2162 |
-
|
2163 |
-
|
2164 |
}
|
2165 |
/**
|
2166 |
* This handles the configs that are stored in the data base
|
@@ -2170,101 +2152,123 @@ function ReadDBConfig() {
|
|
2170 |
*/
|
2171 |
function GetDBConfig() {
|
2172 |
$config = ReadDBConfig();
|
2173 |
-
if (!isset($config["
|
2174 |
-
|
2175 |
-
|
2176 |
-
|
2177 |
-
if (!isset($config["
|
2178 |
-
|
2179 |
-
if (!isset($config["
|
2180 |
-
|
2181 |
-
if (!isset($config["
|
2182 |
-
|
2183 |
-
if (!isset($config["
|
2184 |
-
|
2185 |
-
if (!isset($config["
|
2186 |
-
|
2187 |
-
if (!isset($config["
|
2188 |
-
|
2189 |
-
if (!isset($config["
|
2190 |
-
|
2191 |
-
if (!isset($config["
|
2192 |
-
|
2193 |
-
if (!isset($config["
|
2194 |
-
|
2195 |
-
if (!isset($config["
|
2196 |
-
|
2197 |
-
if (!isset($config["
|
2198 |
-
|
2199 |
-
if (!isset($config["
|
2200 |
-
|
2201 |
-
if (!isset($config["
|
2202 |
-
|
2203 |
-
if (!isset($config["
|
2204 |
-
|
2205 |
-
if (!isset($config["
|
2206 |
-
|
2207 |
-
if (!isset($config["MESSAGE_DEQUOTE"]))
|
2208 |
-
|
2209 |
-
if (!isset($config["
|
2210 |
-
|
2211 |
-
if (!isset($config["
|
2212 |
-
|
2213 |
-
if (!isset($config["
|
2214 |
-
|
2215 |
-
|
2216 |
-
|
2217 |
-
if (!isset($config["BANNED_FILES_LIST"]))
|
2218 |
-
|
2219 |
-
if (!isset($config["
|
2220 |
-
|
2221 |
-
if (!isset($config["
|
2222 |
-
|
2223 |
-
if (!isset($config["
|
2224 |
-
|
2225 |
-
if (!isset($config["
|
2226 |
-
|
2227 |
-
if (!isset($config["
|
2228 |
-
|
2229 |
-
if (!isset($config["
|
2230 |
-
|
2231 |
-
if (!isset($config["
|
2232 |
-
|
2233 |
-
|
2234 |
-
|
2235 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2236 |
if (!isset($config["POST_STATUS"]))
|
2237 |
$config["POST_STATUS"] = 'publish';
|
2238 |
if (!isset($config["IMAGE_NEW_WINDOW"]))
|
2239 |
$config["IMAGE_NEW_WINDOW"] = false;
|
2240 |
if (!isset($config["FILTERNEWLINES"]))
|
2241 |
$config["FILTERNEWLINES"] = true;
|
2242 |
-
|
2243 |
-
|
2244 |
-
|
2245 |
-
|
2246 |
-
|
2247 |
-
|
2248 |
-
|
2249 |
-
|
2250 |
-
'height="' . $config['VIDEO_HEIGHT'] . '"> '.
|
2251 |
-
'<param name="src" VALUE="'.
|
2252 |
-
$config["URLFILESDIR"] . $filename .'"> '.
|
2253 |
-
'<param name="autoplay" VALUE="no"> '.
|
2254 |
-
'<param name="controller" VALUE="true"> '.
|
2255 |
-
'<embed '.
|
2256 |
-
'src="'. $config["URLFILESDIR"] . $filename .'" '.
|
2257 |
-
'width="' . $config['VIDEO_WIDTH'] . '" '.
|
2258 |
-
'height="' . $config['VIDEO_HEIGHT'] . '"'.
|
2259 |
-
'autoplay="no" '.
|
2260 |
-
'controller="true" '.
|
2261 |
-
'type="video/quicktime" '.
|
2262 |
-
'pluginspage="http://www.apple.com/quicktime/download/" '.
|
2263 |
-
'width="' . $config['PLAYER_WIDTH'] . '" '.
|
2264 |
-
'height="' . $config['PLAYER_HEIGHT'] . '">'.
|
2265 |
-
'</embed> '.
|
2266 |
-
'</object>';
|
2267 |
-
}
|
2268 |
return($config);
|
2269 |
}
|
2270 |
/**
|
@@ -2273,55 +2277,32 @@ function GetDBConfig() {
|
|
2273 |
*/
|
2274 |
function GetConfig() {
|
2275 |
$config = GetDBConfig();
|
2276 |
-
if (!ConfirmTrailingDirectorySeperator($config["PHOTOSDIR"])) {
|
2277 |
-
$config["PHOTOSDIR"] .= DIRECTORY_SEPARATOR;
|
2278 |
-
}
|
2279 |
-
if (!ConfirmTrailingDirectorySeperator($config["FILESDIR"])) {
|
2280 |
-
$config["FILESDIR"] .= DIRECTORY_SEPARATOR;
|
2281 |
-
}
|
2282 |
//These should only be modified if you are testing
|
2283 |
$config["DELETE_MAIL_AFTER_PROCESSING"] = true;
|
2284 |
$config["POST_TO_DB"] = true;
|
2285 |
$config["TEST_EMAIL"] = false;
|
2286 |
$config["TEST_EMAIL_ACCOUNT"] = "blogtest";
|
2287 |
$config["TEST_EMAIL_PASSWORD"] = "yourpassword";
|
|
|
|
|
|
|
2288 |
//include(POSTIE_ROOT . "/../postie-test.php");
|
2289 |
// These are computed
|
2290 |
-
|
2291 |
-
if ($config["USE_IMAGEMAGICK"]) {
|
2292 |
-
if (!file_exists($config["IMAGEMAGICK_IDENTIFY"])
|
2293 |
-
||!file_exists($config["IMAGEMAGICK_CONVERT"])) {
|
2294 |
-
$config["RESIZE_LARGE_IMAGES"] = false;
|
2295 |
-
}
|
2296 |
-
} else {
|
2297 |
-
if (!HasGDInstalled(false)) {
|
2298 |
-
$config["RESIZE_LARGE_IMAGES"] = false;
|
2299 |
-
}
|
2300 |
-
}
|
2301 |
$config["POSTIE_ROOT"] = POSTIE_ROOT;
|
2302 |
-
$config["URLPHOTOSDIR"] = get_option('siteurl') . ConvertFilePathToUrl($config["PHOTOSDIR"]);
|
2303 |
-
$config["REALPHOTOSDIR"] = realpath(ABSPATH . $config["PHOTOSDIR"]). DIRECTORY_SEPARATOR;
|
2304 |
-
$config["RELPHOTOSDIR"] = $config["PHOTOSDIR"]. DIRECTORY_SEPARATOR;
|
2305 |
-
$config["URLFILESDIR"] = get_option('siteurl') . ConvertFilePathToUrl($config["FILESDIR"]);
|
2306 |
-
$config["REALFILESDIR"] = realpath(ABSPATH . $config["FILESDIR"]) . DIRECTORY_SEPARATOR;
|
2307 |
for ($i = 0; $i < count($config["AUTHORIZED_ADDRESSES"]); $i++) {
|
2308 |
$config["AUTHORIZED_ADDRESSES"][$i] = strtolower($config["AUTHORIZED_ADDRESSES"][$i]);
|
2309 |
}
|
2310 |
return $config;
|
2311 |
}
|
2312 |
-
/**
|
2313 |
-
* Converts from one directory structure to url
|
2314 |
-
* @return string
|
2315 |
-
*/
|
2316 |
-
function ConvertFilePathToUrl($path) {
|
2317 |
-
return(str_replace(DIRECTORY_SEPARATOR , "/", $path));
|
2318 |
-
}
|
2319 |
/**
|
2320 |
* Returns a list of config keys that should be arrays
|
2321 |
*@return array
|
2322 |
*/
|
2323 |
function GetListOfArrayConfig() {
|
2324 |
-
|
|
|
|
|
2325 |
}
|
2326 |
/**
|
2327 |
* Detects if they can do IMAP
|
@@ -2339,18 +2320,6 @@ function HasIconvInstalled($display = true) {
|
|
2339 |
$function_list = array("iconv");
|
2340 |
return(HasFunctions($function_list,$display));
|
2341 |
}
|
2342 |
-
function HasGDInstalled($display = true) {
|
2343 |
-
$function_list = array("getimagesize",
|
2344 |
-
"imagecreatefromjpeg",
|
2345 |
-
"imagecreatefromgif",
|
2346 |
-
"imagecreatefrompng",
|
2347 |
-
"imagecreatetruecolor",
|
2348 |
-
"imagecreatetruecolor",
|
2349 |
-
"imagecopyresampled",
|
2350 |
-
"imagejpeg",
|
2351 |
-
"imagedestroy");
|
2352 |
-
return(HasFunctions($function_list,$display));
|
2353 |
-
}
|
2354 |
/**
|
2355 |
* Handles verifing that a list of functions exists
|
2356 |
* @return boolean
|
@@ -2367,13 +2336,6 @@ function HasFunctions($function_list,$display = true) {
|
|
2367 |
}
|
2368 |
return(true);
|
2369 |
}
|
2370 |
-
/**
|
2371 |
-
* This filter makes it easy to change the html from showing the thumbnail to the actual picture
|
2372 |
-
*/
|
2373 |
-
function filter_postie_thumbnail_with_full($content) {
|
2374 |
-
$content = str_replace("thumb.","",$content);
|
2375 |
-
return($content);
|
2376 |
-
}
|
2377 |
/**
|
2378 |
* This function tests to see if postie is its own directory
|
2379 |
*/
|
@@ -2399,55 +2361,41 @@ function TestForMarkdown() {
|
|
2399 |
* This function handles setting up the basic permissions
|
2400 |
*/
|
2401 |
function PostieAdminPermissions() {
|
2402 |
-
|
2403 |
-
|
2404 |
-
|
2405 |
-
|
2406 |
-
|
2407 |
-
|
2408 |
-
|
2409 |
-
|
2410 |
-
|
2411 |
-
|
2412 |
-
|
2413 |
-
|
2414 |
-
|
2415 |
-
|
2416 |
-
|
2417 |
-
|
2418 |
-
|
2419 |
-
|
2420 |
-
|
2421 |
-
$role->remove_cap("post_via_postie");
|
2422 |
-
}
|
2423 |
-
}
|
2424 |
-
}
|
2425 |
-
}
|
2426 |
-
function TestWPVersion() {
|
2427 |
-
//fix from Mathew Boedicker
|
2428 |
-
$version_parts = explode('.', get_bloginfo('version'));
|
2429 |
-
if ((count($version_parts) > 0) && (intval($version_parts[0]) >= 2)) {
|
2430 |
-
return true;
|
2431 |
}
|
2432 |
-
|
2433 |
}
|
2434 |
function DebugEmailOutput(&$email,&$mimeDecodedEmail) {
|
2435 |
-
|
2436 |
-
|
2437 |
-
|
2438 |
-
|
2439 |
-
|
2440 |
-
|
2441 |
-
fwrite($file, print_r($mimeDecodedEmail,true));
|
2442 |
-
fclose($file);
|
2443 |
-
}
|
2444 |
}
|
2445 |
/**
|
2446 |
* This function provides a hook to be able to write special parses for provider emails that are difficult to work with
|
2447 |
* If you want to extend this functionality - write a new function and call it from here
|
2448 |
*/
|
2449 |
-
function SpecialMessageParsing(&$content, &$attachments){
|
2450 |
-
$config = GetConfig();
|
2451 |
if ( preg_match('/You have been sent a message from Vodafone mobile/',$content)) {
|
2452 |
VodafoneHandler($content, $attachments); //Everything for this type of message is handled below
|
2453 |
return;
|
@@ -2466,11 +2414,11 @@ function SpecialMessageParsing(&$content, &$attachments){
|
|
2466 |
ReplaceImageCIDs($content,$attachments);
|
2467 |
}
|
2468 |
if (!$config['CUSTOM_IMAGE_FIELD']) {
|
2469 |
-
ReplaceImagePlaceHolders($content,$attachments["html"]);
|
2470 |
} else {
|
2471 |
$customImages=array();
|
2472 |
foreach ($attachments["html"] as $value) {
|
2473 |
-
preg_match(
|
2474 |
array_push($customImages,$matches[1]);
|
2475 |
}
|
2476 |
|
@@ -2499,4 +2447,45 @@ function VodafoneHandler(&$content, &$attachments){
|
|
2499 |
}
|
2500 |
|
2501 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2502 |
?>
|
1 |
<?php
|
2 |
+
$revisions= WP_POST_REVISIONS;
|
3 |
+
define('WP_POST_REVISIONS', false);
|
4 |
+
$original_mem_limit = ini_get('memory_limit');
|
5 |
+
ini_set('memory_limit', -1);
|
6 |
+
|
7 |
/*
|
8 |
+
$Id: postie-functions.php 148682 2009-08-24 18:17:18Z robfelty $
|
9 |
*/
|
10 |
+
|
11 |
/*TODO
|
|
|
12 |
* html purify
|
13 |
+
* USE built-in php message decoding to improve speed
|
14 |
+
* Add custom fields
|
15 |
+
* fix delay
|
16 |
+
* support for flexible upload plugin
|
17 |
+
* confirm post
|
18 |
+
* return reject to sender
|
19 |
+
* icons
|
20 |
+
* iso 8859-2 support
|
21 |
+
* add private post function
|
22 |
+
http://forum.robfelty.com/topic/how-to-private-posts-from-postie?replies=2#post-1515
|
23 |
*/
|
24 |
#global $config,$debug;
|
25 |
#$debug=true;
|
26 |
#$config=GetConfig();
|
27 |
|
28 |
+
//include_once (dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . "wp-config.php");
|
|
|
29 |
define("POSTIE_TABLE",$GLOBALS["table_prefix"]. "postie_config");
|
30 |
|
31 |
/* this function is necessary for wildcard matching on non-posix systems */
|
39 |
);
|
40 |
}
|
41 |
}
|
42 |
+
|
43 |
/**
|
44 |
* This is the main handler for all of the processing
|
45 |
*/
|
46 |
+
function PostEmail($poster,$mimeDecodedEmail,$config) {
|
47 |
+
|
|
|
48 |
$attachments = array(
|
49 |
"html" => array(), //holds the html for each image
|
50 |
"cids" => array(), //holds the cids for HTML email
|
51 |
"image_files" => array() //holds the files for each image
|
52 |
);
|
53 |
+
print("<p>Message Id is :" .
|
54 |
+
htmlentities($mimeDecodedEmail->headers["message-id"]) . "</p><br/>\n");
|
55 |
print("<p>Email has following attachments:</p>");
|
56 |
+
//foreach($mimeDecodedEmail->parts as $parts) {
|
57 |
+
// print("<p>".$parts->ctype_primary ." ".$parts->ctype_secondary) ."</p>\n";
|
58 |
+
//}
|
59 |
+
FilterTextParts($mimeDecodedEmail, $config['PREFER_TEXT_TYPE']);
|
60 |
+
$tmpPost=array('post_title'=> 'tmptitle',
|
61 |
+
'post_status' => 'draft',
|
62 |
+
'post_content'=>'tmoPost');
|
63 |
+
/* in order to do attachments correctly, we need to associate the
|
64 |
+
attachments with a post. So we add the post here, then update it
|
65 |
+
*/
|
66 |
+
$post_id = wp_insert_post($tmpPost);
|
67 |
+
$content = GetContent($mimeDecodedEmail,$attachments,$post_id, $config);
|
68 |
+
$subject = GetSubject($mimeDecodedEmail,$content, $config);
|
69 |
if ($debug) {
|
70 |
echo "the subject is $subject, right after calling GetSubject\n";
|
71 |
}
|
72 |
+
$customImages = SpecialMessageParsing($content,$attachments, $config);
|
73 |
+
$post_excerpt = GetPostExcerpt($content, $config['FILTERNEWLINES'],
|
74 |
+
$config['CONVERTNEWLINE']);
|
|
|
|
|
|
|
75 |
$postAuthorDetails=getPostAuthorDetails($subject,$content,
|
76 |
$mimeDecodedEmail);
|
77 |
$message_date = NULL;
|
78 |
if (array_key_exists("date",$mimeDecodedEmail->headers)
|
79 |
&& !empty($mimeDecodedEmail->headers["date"])) {
|
80 |
+
$message_date=HandleMessageEncoding(
|
81 |
$mimeDecodedEmail->headers["content-transfer-encoding"],
|
82 |
$mimeDecodedEmail->ctype_parameters["charset"],
|
83 |
+
$mimeDecodedEmail->headers["date"], $config['MESSAGE_ENCODING'], $config['MESSAGE_DEQUOTE']);
|
84 |
+
//$message_date = $mimeDecodedEmail->headers['date'];
|
85 |
}
|
86 |
+
list($post_date,$post_date_gmt) = DeterminePostDate($content,
|
87 |
+
$message_date,$config['TIME_OFFSET']);
|
88 |
|
89 |
ubb2HTML($content);
|
90 |
|
91 |
+
if ($config['CONVERTURLS'])
|
92 |
+
$content=clickableLink($content, $config['SHORTCODE']);
|
93 |
+
|
94 |
//$content = FixEmailQuotes($content);
|
95 |
|
96 |
$id=checkReply($subject);
|
97 |
+
$post_categories = GetPostCategories($subject,
|
98 |
+
$config['DEFAULT_POST_CATEGORY']);
|
99 |
+
$post_tags = postie_get_tags($content, $config['DEFAULT_POST_TAGS']);
|
100 |
$comment_status = AllowCommentsOnPost($content);
|
101 |
|
102 |
+
if ((empty($id) || is_null($id))) {
|
103 |
+
$id=$post_id;
|
104 |
+
$isReply=false;
|
105 |
+
if ($config['ADD_META']=='yes') {
|
106 |
+
if ($config['WRAP_PRE']=='yes') {
|
107 |
+
$content = $postAuthorDetails['content'] . "<pre>\n" . $content . "</pre>\n";
|
108 |
+
$content = "<pre>\n" . $content . "</pre>\n";
|
109 |
+
} else {
|
110 |
+
$content = $postAuthorDetails['content'] . $content;
|
111 |
+
$content = $content;
|
112 |
+
}
|
113 |
} else {
|
114 |
+
if ($config['WRAP_PRE']=='yes') {
|
115 |
+
$content = "<pre>\n" . $content . "</pre>\n";
|
116 |
+
}
|
117 |
}
|
118 |
} else {
|
119 |
+
$isReply=true;
|
120 |
+
// strip out quoted content
|
121 |
+
$lines=explode("\n",$content);
|
122 |
+
//$lines=preg_split('/([\r\n]|<br \/>)/',$content);
|
123 |
+
$newContents='';
|
124 |
+
foreach ($lines as $line) {
|
125 |
+
//$match=preg_match("/^>.*/i",$line);
|
126 |
+
//echo "line=$line, match=$match";
|
127 |
+
if (preg_match("/^>.*/i",$line)==0 &&
|
128 |
+
preg_match("/^(from|subject|to|date):.*?/i",$line)==0 &&
|
129 |
+
preg_match("/^-+.*?(from|subject|to|date).*?/i",$line)==0 &&
|
130 |
+
preg_match("/^on.*?wrote:$/i",$line)==0 &&
|
131 |
+
preg_match("/^-+\s*forwarded\s*message\s*-+/i",$line)==0) {
|
132 |
+
$newContents.="$line\n";
|
133 |
+
}
|
134 |
}
|
135 |
+
$content=$newContents;
|
136 |
+
wp_delete_post($post_id);
|
137 |
}
|
138 |
+
if ($config['FILTERNEWLINES'])
|
139 |
+
$content = FilterNewLines($content, $config['CONVERTNEWLINE']);
|
|
|
140 |
|
141 |
|
142 |
+
$now = date('U');
|
143 |
+
if (strtotime($post_date)>$now) {
|
144 |
+
$post_status='future';
|
145 |
+
} else {
|
146 |
+
$post_status=$config['POST_STATUS'];
|
147 |
+
}
|
148 |
$details = array(
|
149 |
'post_author' => $poster,
|
150 |
'comment_author' => $postAuthorDetails['author'],
|
151 |
+
'comment_author_url' => $postAuthorDetails['comment_author_url'],
|
152 |
+
'user_ID' => $postAuthorDetails['user_ID'],
|
153 |
'email_author' => $postAuthorDetails['email'],
|
154 |
'post_date' => $post_date,
|
155 |
'post_date_gmt' => $post_date_gmt,
|
156 |
+
'post_content' => apply_filters('content_save_pre',$content),
|
157 |
'post_title' => $subject,
|
158 |
'post_modified' => $post_date,
|
159 |
'post_modified_gmt' => $post_date_gmt,
|
167 |
'customImages' => $customImages,
|
168 |
'post_status' => $post_status
|
169 |
);
|
170 |
+
$details = apply_filters('postie_post', $details);
|
171 |
DisplayEmailPost($details);
|
172 |
+
PostToDB($details,$isReply, $config['POST_TO_DB'],
|
173 |
+
$config['CUSTOM_IMAGE_FIELD']);
|
174 |
+
if ($config['CONFIRMATION_EMAIL'])
|
175 |
+
MailToRecipients($mimeDecodedEmail, false,
|
176 |
+
array($postAuthorDetails['email']), false, false);
|
177 |
}
|
178 |
/** FUNCTIONS **/
|
179 |
|
180 |
|
181 |
+
function clickableLink($text, $shortcode=false) {
|
182 |
# this functions deserves credit to the fine folks at phpbb.com
|
183 |
|
184 |
$text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:",
|
186 |
|
187 |
// pad it with a space so we can match things at the start of the 1st line.
|
188 |
$ret = ' ' . $text;
|
189 |
+
// try to embed youtube videos
|
190 |
+
$youtube="#(^|[\n ]|<p[^<]*>)[\w]+?://(www\.)?youtube\.com/watch\?v=([_a-zA-Z0-9]+).*?([ \n]|$|</p>)#is";
|
191 |
+
if ($shortcode) {
|
192 |
+
$youtube_replace= "\\1[youtube \\3]\\4";
|
193 |
+
} else {
|
194 |
+
$youtube_replace= "\\1<embed width='425' height='344' allowfullscreen='true' allowscriptaccess='always' type='application/x-shockwave-flash' src=\"http://www.youtube.com/v/\\3&hl=en&fs=1\" />\\4";
|
195 |
+
}
|
196 |
+
$ret = preg_replace($youtube,$youtube_replace, $ret);
|
197 |
|
198 |
// matches an "xxxx://yyyy" URL at the start of a line, or after a space.
|
199 |
// xxxx can only be alpha characters.
|
200 |
// yyyy is anything up to the first space, newline, comma, double quote or <
|
201 |
+
$ret = preg_replace("#(^|[\n ])<?([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)>?#is",
|
202 |
"\\1<a href=\"\\2\" >\\2</a>", $ret);
|
203 |
|
204 |
// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
|
205 |
// Must contain at least 2 dots. xxxx contains either alphanum, or "-"
|
206 |
// zzzz is optional.. will contain everything up to the first space, newline,
|
207 |
// comma, double quote or <.
|
208 |
+
$ret = preg_replace("#(^|[\n ])<?((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)>?#is",
|
209 |
"\\1<a href=\"http://\\2\" >\\2</a>", $ret);
|
210 |
|
211 |
// matches an email@domain type address at the start of a line, or after a space.
|
238 |
}
|
239 |
} else {
|
240 |
$theDate=$mimeDecodedEmail->headers['date'];
|
|
|
241 |
$theEmail = RemoveExtraCharactersInEmailAddress(trim(
|
242 |
$mimeDecodedEmail->headers["from"]));
|
243 |
+
$regAuthor=get_user_by('email', $theEmail);
|
244 |
+
if ($regAuthor) {
|
245 |
+
$theAuthor=$regAuthor->user_login;
|
246 |
+
$theUrl=$regAuthor->user_url;
|
247 |
+
$theID= $regAuthor->ID;
|
248 |
+
} else {
|
249 |
+
$theAuthor=GetNameFromEmail($mimeDecodedEmail->headers['from']);
|
250 |
+
$theUrl='';
|
251 |
+
$theID='';
|
252 |
+
}
|
253 |
}
|
254 |
// now get rid of forwarding info in the content
|
255 |
$lines=preg_split("/\r\n/",$content);
|
267 |
" posted:</div>",
|
268 |
'emaildate' => $theDate,
|
269 |
'author' => $theAuthor,
|
270 |
+
'comment_author_url' => $theUrl,
|
271 |
+
'user_ID' => $theID,
|
272 |
'email' => $theEmail
|
273 |
);
|
274 |
return($theDetails);
|
285 |
|
286 |
global $wpdb;
|
287 |
// see if subject starts with Re:
|
288 |
+
if (preg_match("/(^Re:) (.*)/i", $subject, $matches)) {
|
289 |
$subject=trim($matches[2]);
|
290 |
// strip out category info into temporary variable
|
291 |
$tmpSubject=$subject;
|
332 |
* This handles actually showing the form
|
333 |
*/
|
334 |
function ConfigurePostie() {
|
335 |
+
include(POSTIE_ROOT . DIRECTORY_SEPARATOR. "config_form.php");
|
|
|
|
|
|
|
|
|
|
|
|
|
336 |
}
|
337 |
|
338 |
/**
|
340 |
* @return array
|
341 |
*/
|
342 |
function FetchMail($server=NULL, $port=NULL, $email=NULL, $password=NULL,
|
343 |
+
$protocol=NULL, $offset=NULL, $test=NULL, $deleteMessages=true) {
|
|
|
344 |
$emails = array();
|
345 |
if (!$server || !$port || !$email) {
|
346 |
die("Missing Configuration For Mail Server\n");
|
366 |
$emails = TestIMAPMessageFetch();
|
367 |
} else {
|
368 |
$emails = IMAPMessageFetch($server, $port, $email,
|
369 |
+
$password, $protocol, $offset, $test, $deleteMessages);
|
370 |
}
|
371 |
break;
|
372 |
case 'pop3':
|
375 |
$emails = TestPOP3MessageFetch();
|
376 |
} else {
|
377 |
$emails =POP3MessageFetch ($server, $port, $email,
|
378 |
+
$password, $protocol, $offset, $test, $deleteMessages);
|
379 |
}
|
380 |
}
|
381 |
if (!$emails)
|
382 |
+
die("\n" . __('There does not seem to be any new mail.', 'postie') . "\n");
|
383 |
return($emails);
|
384 |
}
|
385 |
/**
|
399 |
*Handles fetching messages from an imap server
|
400 |
*/
|
401 |
function IMAPMessageFetch ($server=NULL, $port=NULL, $email=NULL,
|
402 |
+
$password=NULL, $protocol=NULL, $offset=NULL, $test=NULL,
|
403 |
+
$deleteMessages=true) {
|
|
|
|
|
404 |
require_once("postieIMAP.php");
|
405 |
|
406 |
$mail_server = &PostieIMAP::Factory($protocol);
|
419 |
// loop through messages
|
420 |
for ($i=1; $i <= $msg_count; $i++) {
|
421 |
$emails[$i] = $mail_server->fetchEmail($i);
|
422 |
+
if ($deleteMessages) {
|
423 |
$mail_server->deleteMessage($i);
|
424 |
}
|
|
|
|
|
|
|
425 |
}
|
426 |
+
if ( $deleteMessages) {
|
427 |
+
$mail_server->expungeMessages();
|
428 |
+
}
|
429 |
//clean up
|
430 |
$mail_server->disconnect();
|
431 |
return $emails;
|
443 |
*Retrieves email via POP3
|
444 |
*/
|
445 |
function POP3MessageFetch ($server=NULL, $port=NULL, $email=NULL,
|
446 |
+
$password=NULL, $protocol=NULL, $offset=NULL, $test=NULL,
|
447 |
+
$deleteMessages=true) {
|
|
|
|
|
448 |
require_once(ABSPATH.WPINC.DIRECTORY_SEPARATOR.'class-pop3.php');
|
449 |
$pop3 = &new POP3();
|
450 |
print("\nConnecting to $server:$port ($protocol)) \n");
|
462 |
|
463 |
//Check to see if there is any mail, if not die
|
464 |
$msg_count = $pop3->login($email, $password);
|
465 |
+
if ($msg_count===false) {
|
466 |
$pop3->quit();
|
467 |
+
// we should die if $msg_count is false, but the core wordpress pop3 needs
|
468 |
+
// to be fixed before we can do that
|
469 |
+
// die("there was a problem logging in. Please check username and password.");
|
470 |
return(array());
|
471 |
}
|
472 |
|
473 |
// loop through messages
|
474 |
for ($i=1; $i <= $msg_count; $i++) {
|
475 |
$emails[$i] = implode ('',$pop3->get($i));
|
476 |
+
if ($deleteMessages) {
|
477 |
if( !$pop3->delete($i) ) {
|
478 |
echo 'Oops '.$pop3->ERROR.'\n';
|
479 |
$pop3->reset();
|
490 |
$pop3->quit();
|
491 |
return $emails;
|
492 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
493 |
/**
|
494 |
* This function handles putting the actual entry into the database
|
495 |
* @param array - categories to be posted to
|
496 |
* @param array - details of the post
|
497 |
*/
|
498 |
+
function PostToDB($details,$isReply, $postToDb=true, $customImageField=false) {
|
499 |
+
if ($postToDb) {
|
|
|
500 |
//generate sql for insertion
|
501 |
+
//$_POST['publish'] = true; //Added to make subscribe2 work - it will only handle it if the global varilable _POST is set
|
502 |
+
if (!$isReply) {
|
503 |
+
$post_ID = wp_update_post($details);
|
504 |
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
$comment = array(
|
506 |
'comment_author'=>$details['comment_author'],
|
507 |
'comment_post_ID' =>$details['ID'],
|
508 |
'comment_author_email' => $details['email_author'],
|
509 |
'comment_date' =>$details['post_date'],
|
510 |
'comment_date_gmt' =>$details['post_date_gmt'],
|
511 |
+
'comment_content' =>$details['post_content'],
|
512 |
+
'comment_author_url' =>$details['comment_author_url'],
|
513 |
'comment_author_IP' =>'',
|
514 |
'comment_approved' =>1,
|
515 |
'comment_agent' =>'',
|
516 |
'comment_type' =>'',
|
517 |
+
'comment_parent' => 0,
|
518 |
+
'user_id' => $details['user_ID']
|
519 |
);
|
520 |
|
|
|
|
|
521 |
$post_ID = wp_insert_comment($comment);
|
522 |
}
|
523 |
+
if ($customImageField) {
|
524 |
if (count($details['customImages'])>1) {
|
525 |
+
$imageField=1;
|
526 |
foreach ($details['customImages'] as $image) {
|
527 |
+
add_post_meta($post_ID, 'image'. $imageField, $image);
|
528 |
$imageField++;
|
529 |
}
|
530 |
} else {
|
531 |
+
add_post_meta($post_ID, 'image', $details['customImages'][0]);
|
532 |
}
|
533 |
}
|
534 |
}
|
539 |
* @param string
|
540 |
* @return boolean
|
541 |
*/
|
542 |
+
function BannedFileName($filename, $bannedFiles) {
|
543 |
+
foreach ($bannedFiles as $bannedFile) {
|
|
|
544 |
if (fnmatch($bannedFile, $filename)) {
|
545 |
print("<p>Ignoreing $filename - it is on the banned files list.");
|
546 |
return(true);
|
550 |
}
|
551 |
|
552 |
//tear apart the meta part for useful information
|
553 |
+
function GetContent ($part,&$attachments, $post_id, $config) {
|
554 |
+
global $charset, $encoding;
|
555 |
+
/*
|
556 |
+
if (function_exists(imap_mime_header_decode) && $charset=='') {
|
557 |
+
$element=imap_mime_header_decode($mimeDecodedEmail->headers['subject']);
|
558 |
+
$charset = $element->charset;
|
559 |
+
}
|
560 |
+
*/
|
561 |
$meta_return = NULL;
|
562 |
+
echo "primary= " . $part->ctype_primary . ", secondary = " . $part->ctype_secondary . "\n";
|
563 |
DecodeBase64Part($part);
|
564 |
+
if (BannedFileName($part->ctype_parameters['name'],
|
565 |
+
$config['BANNED_FILES_LIST']))
|
566 |
return(NULL);
|
|
|
|
|
567 |
if ($part->ctype_primary == "application"
|
568 |
&& $part->ctype_secondary == "octet-stream") {
|
569 |
if ($part->disposition == "attachment") {
|
577 |
}
|
578 |
} else {
|
579 |
$mimeDecodedEmail = DecodeMIMEMail($part->body);
|
580 |
+
FilterTextParts($mimeDecodedEmail, $config['PREFER_TEXT_TYPE']);
|
581 |
foreach($mimeDecodedEmail->parts as $section) {
|
582 |
+
$meta_return .= GetContent($section,$attachments,$post_id, $config);
|
583 |
}
|
584 |
}
|
585 |
}
|
586 |
if ($part->ctype_primary == "multipart"
|
587 |
&& $part->ctype_secondary == "appledouble") {
|
588 |
$mimeDecodedEmail = DecodeMIMEMail("Content-Type: multipart/mixed; boundary=".$part->ctype_parameters["boundary"]."\n".$part->body);
|
589 |
+
FilterTextParts($mimeDecodedEmail, $config['PREFER_TEXT_TYPE']);
|
590 |
FilterAppleFile($mimeDecodedEmail);
|
591 |
foreach($mimeDecodedEmail->parts as $section) {
|
592 |
+
$meta_return .= GetContent($section,$attachments,$post_id, $config);
|
593 |
}
|
594 |
} else {
|
595 |
switch ( strtolower($part->ctype_primary) ) {
|
596 |
case 'multipart':
|
597 |
+
FilterTextParts($part, $config['PREFER_TEXT_TYPE']);
|
598 |
foreach ($part->parts as $section) {
|
599 |
+
$meta_return .= GetContent($section,$attachments,$post_id, $config);
|
600 |
}
|
601 |
break;
|
602 |
case 'text':
|
603 |
+
$tmpcharset=trim($part->ctype_parameters['charset']);
|
604 |
+
if ($tmpcharset!='')
|
605 |
+
$charset=$tmpcharset;
|
606 |
+
$tmpencoding=trim($part->headers['content-transfer-encoding']);
|
607 |
+
if ($tmpencoding!='')
|
608 |
+
$encoding=$tmpencoding;
|
609 |
+
|
610 |
+
$part->body=HandleMessageEncoding($part->headers["content-transfer-encoding"],
|
611 |
$part->ctype_parameters["charset"],
|
612 |
+
$part->body, $config['MESSAGE_ENCODING'], $config['MESSAGE_DEQUOTE']);
|
613 |
|
614 |
//go through each sub-section
|
615 |
if ($part->ctype_secondary=='enriched') {
|
617 |
$meta_return .= etf2HTML($part->body ) . "\n";
|
618 |
} elseif ($part->ctype_secondary=='html') {
|
619 |
//strip excess HTML
|
620 |
+
//$meta_return .= HTML2HTML($part->body ) . "\n";
|
621 |
+
$meta_return .= $part->body . "\n";
|
622 |
} else {
|
623 |
//regular text, so just strip the pgp signature
|
624 |
if (ALLOW_HTML_IN_BODY) {
|
625 |
$meta_return .= $part->body . "\n";
|
626 |
+
} else {
|
|
|
627 |
$meta_return .= htmlentities( $part->body ) . "\n";
|
628 |
}
|
629 |
$meta_return = StripPGP($meta_return);
|
631 |
break;
|
632 |
|
633 |
case 'image':
|
634 |
+
$file_id = postie_media_handle_upload($part, $post_id);
|
635 |
+
$file = wp_get_attachment_url($file_id);
|
636 |
+
|
637 |
+
$cid = trim($part->headers["content-id"],"<>");; //cids are in <cid>
|
638 |
+
$the_post=get_post($file_id);
|
639 |
+
/* TODO make these options */
|
640 |
+
$attachments["html"][] = parseTemplate($file_id, $part->ctype_primary,
|
641 |
+
$config['IMAGETEMPLATE']);
|
642 |
+
if ($cid) {
|
643 |
+
$attachments["cids"][$cid] = array($file,count($attachments["html"]) - 1);
|
644 |
}
|
645 |
+
break;
|
646 |
+
case 'audio':
|
647 |
+
$file_id = postie_media_handle_upload($part, $post_id);
|
648 |
+
$file = wp_get_attachment_url($file_id);
|
649 |
+
$cid = trim($part->headers["content-id"],"<>");; //cids are in <cid>
|
650 |
+
if (in_array($part->ctype_secondary,
|
651 |
+
$config['AUDIOTYPES'])) {
|
652 |
+
$audioTemplate=$config['AUDIOTEMPLATE'];
|
653 |
+
} else {
|
654 |
+
$icon=chooseAttachmentIcon($file, $part->ctype_primary,
|
655 |
+
$part->ctype_secondary, $config['ICON_SET'],
|
656 |
+
$config['ICON_SIZE']);
|
657 |
+
$audioTemplate='<a href="{FILELINK}">' . $icon . '{FILENAME}</a>';
|
658 |
}
|
659 |
+
$attachments["html"][] = parseTemplate($file_id, $part->ctype_primary,
|
660 |
+
$audioTemplate);
|
661 |
+
break;
|
662 |
+
case 'video':
|
663 |
+
$file_id = postie_media_handle_upload($part, $post_id);
|
664 |
+
$file = wp_get_attachment_url($file_id);
|
665 |
$cid = trim($part->headers["content-id"],"<>");; //cids are in <cid>
|
666 |
+
if (in_array($part->ctype_secondary,
|
667 |
+
$config['VIDEO1TYPES'])) {
|
668 |
+
$videoTemplate=$config['VIDEO1TEMPLATE'];
|
669 |
+
} else if (in_array($part->ctype_secondary,
|
670 |
+
$config['VIDEO2TYPES'])) {
|
671 |
+
$videoTemplate=$config['VIDEO2TEMPLATE'];
|
672 |
+
} else {
|
673 |
+
$icon=chooseAttachmentIcon($file, $part->ctype_primary,
|
674 |
+
$part->ctype_secondary, $config['ICON_SET'],
|
675 |
+
$config['ICON_SIZE']);
|
676 |
+
$videoTemplate='<a href="{FILELINK}">' . $icon . '{FILENAME}</a>';
|
677 |
}
|
678 |
+
$attachments["html"][] = parseTemplate($file_id, $part->ctype_primary,
|
679 |
+
$videoTemplate);
|
680 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
681 |
|
|
|
682 |
default:
|
683 |
+
if (in_array(strtolower($part->ctype_primary),
|
684 |
+
$config["SUPPORTED_FILE_TYPES"])) {
|
685 |
+
//pgp signature - then forget it
|
686 |
+
if ( $part->ctype_secondary == 'pgp-signature' )
|
687 |
+
break;
|
688 |
+
$file_id = postie_media_handle_upload($part, $post_id);
|
689 |
+
$file = wp_get_attachment_url($file_id);
|
690 |
+
echo "file=$file\n";
|
|
|
|
|
691 |
$cid = trim($part->headers["content-id"],"<>");; //cids are in <cid>
|
692 |
+
$icon=chooseAttachmentIcon($file, $part->ctype_primary,
|
693 |
+
$part->ctype_secondary, $config['ICON_SET'],
|
694 |
+
$config['ICON_SIZE']);
|
695 |
+
$attachments["html"][] = '<a href="' . $file .
|
696 |
+
'" style="text-decoration:none">' . $icon .
|
697 |
+
$part->ctype_parameters['name'] . '</a>' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
698 |
if ($cid) {
|
699 |
+
$attachments["cids"][$cid] = array($file,
|
700 |
+
count($attachments["html"]) - 1);
|
701 |
}
|
702 |
}
|
703 |
break;
|
704 |
}
|
705 |
}
|
706 |
+
return($meta_return);
|
707 |
}
|
708 |
|
709 |
function ubb2HTML(&$text) {
|
783 |
// This function cleans up HTML in the e-mail
|
784 |
function HTML2HTML ( $content ) {
|
785 |
$search = array(
|
786 |
+
'/<html [^<]*>/is',
|
787 |
+
'/<\/html>/i',
|
788 |
+
'/<\/?title>/i',
|
789 |
+
'/<body[^<]*>/i',
|
790 |
+
'/<\/body>/i',
|
791 |
+
'/<\/?head>/i',
|
792 |
+
'/<meta[^<]*>/i',
|
793 |
+
'/<style[^<]*>.*<\/style>/is',
|
794 |
+
'/<!--.*?-->/is',
|
795 |
+
'/<\/?o:[^<]*>/i',
|
796 |
'/<!DOCTYPE[^<]*>/',
|
797 |
+
//'/<img src=[\'"][^<]*>/'
|
798 |
// '/<img src="cid:(.*)" .*>/'
|
799 |
);
|
800 |
|
817 |
return ($content);
|
818 |
}
|
819 |
|
820 |
+
|
821 |
+
|
822 |
/**
|
823 |
* Determines if the sender is a valid user.
|
824 |
* @return integer|NULL
|
825 |
*/
|
826 |
+
function ValidatePoster( &$mimeDecodedEmail, $config ) {
|
827 |
global $wpdb;
|
|
|
828 |
$poster = NULL;
|
829 |
$from = RemoveExtraCharactersInEmailAddress(trim($mimeDecodedEmail->headers["from"]));
|
830 |
$resentFrom = RemoveExtraCharactersInEmailAddress(trim($mimeDecodedEmail->headers["resent-from"]));
|
831 |
+
/*
|
832 |
if ( empty($from) ) {
|
833 |
echo 'Invalid Sender - Emtpy! ';
|
834 |
return;
|
835 |
}
|
836 |
+
*/
|
837 |
|
838 |
//See if the email address is one of the special authorized ones
|
839 |
print("Confirming Access For $from \n");
|
840 |
$sql = 'SELECT id FROM '. $wpdb->users.' WHERE user_email=\'' . addslashes($from) . "' LIMIT 1;";
|
841 |
$user_ID= $wpdb->get_var($sql);
|
842 |
$user = new WP_User($user_ID);
|
843 |
+
if ($config["TURN_AUTHORIZATION_OFF"] ||
|
844 |
+
CheckEmailAddress($from, $config['AUTHORIZED_ADDRESSES']) ||
|
845 |
+
CheckEmailAddress($resentFrom, $config['AUTHORIZED_ADDRESSES'])) {
|
846 |
if (empty($user_ID)){
|
847 |
+
print("$from is authorized to post as the administrator\n");
|
848 |
+
$from = get_option("admin_email");
|
849 |
+
$adminUser=$config['ADMIN_USERNAME'];
|
850 |
+
echo "adminUser='$adminUser'";
|
851 |
+
$poster = $wpdb->get_var("SELECT ID FROM $wpdb->users WHERE
|
852 |
+
user_login = '$adminUser'");
|
853 |
+
} else {
|
|
|
854 |
$poster = $user_ID;
|
855 |
}
|
856 |
+
} else if ($user->has_cap("post_via_postie")) {
|
857 |
+
$poster = $user_ID;
|
858 |
}
|
859 |
+
$validSMTP=checkSMTP($mimeDecodedEmail, $config['SMTP']);
|
860 |
+
if (!$poster || !$validSMTP) {
|
861 |
+
echo 'Invalid sender: ' . htmlentities($from) . "! Not adding email!\n";
|
862 |
+
if ($config["FORWARD_REJECTED_MAIL"]) {
|
863 |
+
if (MailToRecipients($mimeDecodedEmail, $config['TEST_EMAIL'],
|
864 |
+
array(), $config['RETURN_TO_SENDER'])) {
|
865 |
+
echo "A copy of the message has been forwarded to the administrator.\n";
|
866 |
+
} else {
|
867 |
+
echo "The message was unable to be forwarded to the adminstrator.\n";
|
|
|
|
|
868 |
}
|
869 |
+
}
|
870 |
+
return;
|
871 |
}
|
872 |
return $poster;
|
873 |
}
|
874 |
|
875 |
+
function checkSMTP($mimeDecodedEmail, $smtpservers) {
|
876 |
+
if (empty($smtpservers))
|
877 |
+
return(true);
|
878 |
+
foreach ($mimeDecodedEmail->headers['received'] as $received) {
|
879 |
+
foreach ($smtpservers as $smtp) {
|
880 |
+
if (stristr($received, $smtp))
|
881 |
+
return(true);
|
882 |
+
}
|
883 |
+
}
|
884 |
+
return(false);
|
885 |
+
}
|
886 |
+
|
887 |
/**
|
888 |
* Looks at the content for the start of the message and removes everything before that
|
889 |
* If the pattern is not found everything is returned
|
905 |
* @param array - a list of patterns to determine if it is a sig block
|
906 |
*/
|
907 |
function RemoveSignature( &$content,$filterList = array('--','- --' )) {
|
908 |
+
if (empty($filterList))
|
909 |
+
return;
|
910 |
$arrcontent = explode("\n", $content);
|
911 |
$i = 0;
|
912 |
+
$pattern='/^(';
|
913 |
+
$pattern.=implode('|',$filterList);
|
914 |
+
$pattern.=')/';
|
915 |
for ($i = 0; $i<=count($arrcontent); $i++) {
|
916 |
+
$line = trim($arrcontent[$i]);
|
917 |
$nextline = $arrcontent[$i+1];
|
918 |
+
if (preg_match($pattern,trim($line))) {
|
919 |
+
//if (!strpos(trim($line), $pattern)==0) {
|
920 |
+
//print("<p>Found in $line");
|
921 |
+
break;
|
922 |
+
}
|
|
|
923 |
$strcontent .= $line ."\n";
|
924 |
}
|
925 |
$content = $strcontent;
|
946 |
}
|
947 |
|
948 |
//filter content for new lines
|
949 |
+
function FilterNewLines ( $content, $convertNewLines=false ) {
|
|
|
950 |
$search = array (
|
951 |
"/\r\n/",
|
952 |
"/\r/",
|
953 |
"/\n\n/",
|
954 |
+
"/\r\n\r\n/",
|
955 |
"/\n/"
|
956 |
);
|
957 |
$replace = array (
|
958 |
"\n",
|
959 |
"\n",
|
960 |
'ACTUAL_NEW_LINE',
|
961 |
+
'ACTUAL_NEW_LINE',
|
962 |
'LINEBREAK'
|
963 |
);
|
964 |
// strip extra line breaks, and replace double line breaks with paragraph
|
965 |
// tags
|
966 |
$result = preg_replace($search,$replace,$content);
|
967 |
//$newContent='<p>' . preg_replace('/ACTUAL_NEW_LINE/',"</p>\n<p>",$result);
|
968 |
+
|
969 |
+
$newContent=preg_replace('/(ACTUAL_NEW_LINE|LINEBREAK\s*LINEBREAK)/',"\n\n",$result);
|
970 |
//$newContent=preg_replace('/<p>LINEBREAK$/', '', $newContent);
|
971 |
+
if ($convertNewLines) {
|
972 |
$newContent= preg_replace('/LINEBREAK/',"<br />\n",$newContent);
|
973 |
if ($debug) {
|
974 |
echo "converting newlines\n";
|
1012 |
return $return;
|
1013 |
}
|
1014 |
|
1015 |
+
function ConvertToISO_8859_1($encoding,$charset, $body, $blogEncoding ) {
|
|
|
1016 |
$charset = strtolower($charset);
|
1017 |
$encoding = strtolower($encoding);
|
1018 |
+
if (strtolower($blogEncoding == "iso-8859-1") && (strtolower($charset) != 'iso-8859-1')) {
|
1019 |
if( $encoding == 'base64' || $encoding == 'quoted-printable' ) {
|
1020 |
$body = utf8_decode($body);
|
1021 |
}
|
1022 |
}
|
1023 |
+
return($body);
|
1024 |
}
|
1025 |
+
function HandleMessageEncoding($encoding, $charset,$body,
|
1026 |
+
$blogEncoding='utf-8', $dequote=true) {
|
1027 |
+
$charset = strtolower($charset);
|
1028 |
+
$encoding = strtolower($encoding);
|
1029 |
+
/*
|
1030 |
+
if ($encoding == '') {
|
1031 |
+
$encoding = '7bit';
|
1032 |
}
|
1033 |
+
*/
|
1034 |
+
if ( $dequote && strtolower($encoding) == 'quoted-printable' ) {
|
1035 |
+
//echo "handling quoted printable";
|
1036 |
+
$body = quoted_printable_decode($body);
|
1037 |
+
//echo "now body is:\n\n $body\n\n";
|
|
|
1038 |
}
|
1039 |
+
//HandleQuotedPrintable($encoding, $body, $dequote);
|
1040 |
+
if ($blogEncoding=='iso-8859-1') {
|
1041 |
+
$text=ConvertToISO_8859_1($encoding,$charset,$body, $blogEncoding);
|
1042 |
+
}
|
1043 |
+
else {
|
1044 |
+
$text=ConvertToUTF_8($encoding,$charset,$body);
|
1045 |
+
}
|
1046 |
+
return($text);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1047 |
}
|
1048 |
+
function ConvertToUTF_8($encoding,$charset,$body) {
|
1049 |
+
$charset = strtolower($charset);
|
1050 |
+
$encoding = strtolower($encoding);
|
1051 |
+
|
1052 |
+
switch($charset) {
|
1053 |
+
case "iso-8859-1":
|
1054 |
+
$body = utf8_encode($body);
|
1055 |
+
break;
|
1056 |
+
case "iso-2022-jp":
|
1057 |
+
$body = iconv("ISO-2022-JP//TRANSLIT","UTF-8",$body);
|
1058 |
+
break;
|
1059 |
+
case ($charset=="windows-1252" || $charset=="cp-1252" ||
|
1060 |
+
$charset=="cp 1252"):
|
1061 |
+
$body = cp1252_to_utf8($body);
|
1062 |
+
break;
|
1063 |
+
case ($charset=="windows-1256" || $charset=="cp-1256" ||
|
1064 |
+
$charset=="cp 1256"):
|
1065 |
+
$body = iconv("Windows-1256//TRANSLIT","UTF-8",$body);
|
1066 |
+
break;
|
1067 |
+
case 'koi8-r':
|
1068 |
+
$body = iconv("koi8-r//TRANSLIT","UTF-8",$body);
|
1069 |
+
break;
|
1070 |
+
case 'iso-8859-2':
|
1071 |
+
$body = iconv("iso-8859-2//TRANSLIT","UTF-8",$body);
|
1072 |
+
break;
|
1073 |
+
}
|
1074 |
+
return($body);
|
1075 |
+
}
|
1076 |
+
/* this function will convert windows-1252 (also known as cp-1252 to utf-8 */
|
1077 |
+
function cp1252_to_utf8($str) {
|
1078 |
+
$cp1252_map = array (
|
1079 |
+
"\xc2\x80" => "\xe2\x82\xac",
|
1080 |
+
"\xc2\x82" => "\xe2\x80\x9a",
|
1081 |
+
"\xc2\x83" => "\xc6\x92",
|
1082 |
+
"\xc2\x84" => "\xe2\x80\x9e",
|
1083 |
+
"\xc2\x85" => "\xe2\x80\xa6",
|
1084 |
+
"\xc2\x86" => "\xe2\x80\xa0",
|
1085 |
+
"\xc2\x87" => "\xe2\x80\xa1",
|
1086 |
+
"\xc2\x88" => "\xcb\x86",
|
1087 |
+
"\xc2\x89" => "\xe2\x80\xb0",
|
1088 |
+
"\xc2\x8a" => "\xc5\xa0",
|
1089 |
+
"\xc2\x8b" => "\xe2\x80\xb9",
|
1090 |
+
"\xc2\x8c" => "\xc5\x92",
|
1091 |
+
"\xc2\x8e" => "\xc5\xbd",
|
1092 |
+
"\xc2\x91" => "\xe2\x80\x98",
|
1093 |
+
"\xc2\x92" => "\xe2\x80\x99",
|
1094 |
+
"\xc2\x93" => "\xe2\x80\x9c",
|
1095 |
+
"\xc2\x94" => "\xe2\x80\x9d",
|
1096 |
+
"\xc2\x95" => "\xe2\x80\xa2",
|
1097 |
+
"\xc2\x96" => "\xe2\x80\x93",
|
1098 |
+
"\xc2\x97" => "\xe2\x80\x94",
|
1099 |
+
"\xc2\x98" => "\xcb\x9c",
|
1100 |
+
"\xc2\x99" => "\xe2\x84\xa2",
|
1101 |
+
"\xc2\x9a" => "\xc5\xa1",
|
1102 |
+
"\xc2\x9b" => "\xe2\x80\xba",
|
1103 |
+
"\xc2\x9c" => "\xc5\x93",
|
1104 |
+
"\xc2\x9e" => "\xc5\xbe",
|
1105 |
+
"\xc2\x9f" => "\xc5\xb8"
|
1106 |
+
);
|
1107 |
+
return strtr ( utf8_encode ( $str ), $cp1252_map );
|
1108 |
}
|
1109 |
|
1110 |
/**
|
1116 |
}
|
1117 |
}
|
1118 |
|
1119 |
+
function HandleQuotedPrintable($encoding, &$body,$dequote=true ) {
|
1120 |
+
if ( $dequote && strtolower($encoding) == 'quoted-printable' ) {
|
1121 |
+
echo "handling quoted printable";
|
1122 |
$body = quoted_printable_decode($body);
|
1123 |
}
|
1124 |
}
|
1125 |
|
1126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1127 |
/**
|
1128 |
* Checks for the comments tag
|
1129 |
* @return boolean
|
1144 |
}
|
1145 |
return($comments_allowed);
|
1146 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1147 |
/**
|
1148 |
* Needed to be able to modify the content to remove the usage of the delay tag
|
1149 |
*/
|
1150 |
+
function DeterminePostDate(&$content, $message_date = NULL, $offset=0) {
|
|
|
1151 |
$delay = 0;
|
1152 |
if ($debug) {
|
1153 |
echo "inside Determine Post Date, message_date = $message_date\n";
|
1172 |
else {
|
1173 |
$dateInSeconds = time() + $delay;
|
1174 |
}
|
1175 |
+
$post_date = gmdate('Y-m-d H:i:s',$dateInSeconds + ($offset * 3600));
|
1176 |
$post_date_gmt = gmdate('Y-m-d H:i:s',$dateInSeconds);
|
1177 |
|
1178 |
+
/*
|
1179 |
+
echo "--------------------DELAY------------\n";
|
1180 |
+
echo "delay=$delay, dateInSeconds = $dateInSeconds\n";
|
1181 |
+
echo "post_date=$post_date\n";
|
1182 |
+
echo "--------------------DELAY------------\n";
|
1183 |
+
*/
|
1184 |
return(array($post_date,$post_date_gmt));
|
1185 |
}
|
1186 |
/**
|
1187 |
* This function takes the content of the message - looks for a subject at the begining surrounded by # and then removes that from the content
|
1188 |
*/
|
1189 |
+
function ParseInMessageSubject($content, $defaultTitle) {
|
|
|
1190 |
if (substr($content,0,1) != "#") {
|
1191 |
//print("<p>Didn't start with # '".substr(ltrim($content),0,10)."'");
|
1192 |
+
return(array($defaultTitle,$content));
|
1193 |
}
|
1194 |
$subjectEndIndex = strpos($content,"#",1);
|
1195 |
if (!$subjectEndIndex > 0) {
|
1196 |
+
return(array($defaultTitle,$content));
|
1197 |
}
|
1198 |
$subject = substr($content,1,$subjectEndIndex - 1);
|
1199 |
$content = substr($content,$subjectEndIndex + 1,strlen($content));
|
1219 |
$mimeDecodedEmail->parts = $newParts; //This is now the filtered list of just the preferred type.
|
1220 |
}
|
1221 |
}
|
1222 |
+
function postie_media_handle_upload($part, $post_id, $post_data = array()) {
|
1223 |
+
$overrides = array('test_form'=>false);
|
1224 |
+
//$overrides = array('test_form'=>false, 'test_size'=>false,
|
1225 |
+
// 'test_type'=>false);
|
1226 |
+
$tmpFile=tempnam(getenv('TEMP'), 'postie');
|
1227 |
+
if (!is_writable($tmpFile)) {
|
1228 |
+
$uploadDir=wp_upload_dir();
|
1229 |
+
$tmpFile=tempnam($uploadDir['path'], 'postie');
|
1230 |
+
}
|
1231 |
+
$fp = fopen($tmpFile, 'w');
|
1232 |
+
if ($fp) {
|
1233 |
+
fwrite($fp, $part->body);
|
1234 |
+
fclose($fp);
|
1235 |
+
} else {
|
1236 |
+
echo "could not write to temp file: '$tmpFile' ";
|
1237 |
+
}
|
1238 |
+
//print_r($part->ctype_parameters);
|
1239 |
+
if ($part->ctype_parameters['name']=='') {
|
1240 |
+
if ($part->ctype_parameters['name']!='') {
|
1241 |
+
$name = $part->d_parameters['filename'];
|
1242 |
+
} else {
|
1243 |
+
$name = 'postie-media.'. $part->ctype_secondary;
|
1244 |
+
}
|
1245 |
+
} else {
|
1246 |
+
$name = $part->ctype_parameters['name'];
|
1247 |
+
}
|
1248 |
+
$the_file = array('name' => $name,
|
1249 |
+
'tmp_name' => $tmpFile,
|
1250 |
+
'size' => filesize($tmpFile),
|
1251 |
+
'error' => ''
|
1252 |
+
);
|
1253 |
+
if (stristr('.zip', $name)) {
|
1254 |
+
$parts=explode('.', $name);
|
1255 |
+
$ext=$parts[count($parts)-1];
|
1256 |
+
$type=$part->primary . '/' . $part->secondary;
|
1257 |
+
$the_file['ext'] = $ext;
|
1258 |
+
$the_file['type'] = $type;
|
1259 |
+
$overrides['test_type'] = false;
|
1260 |
+
}
|
1261 |
+
|
1262 |
+
$time = current_time('mysql');
|
1263 |
+
if ( $post = get_post($post_id) ) {
|
1264 |
+
if ( substr( $post->post_date, 0, 4 ) > 0 )
|
1265 |
+
$time = $post->post_date;
|
1266 |
+
}
|
1267 |
+
|
1268 |
+
$file = postie_handle_upload($the_file, $overrides, $time);
|
1269 |
+
//unlink($tmpFile);
|
1270 |
+
|
1271 |
+
if ( isset($file['error']) )
|
1272 |
+
return new WP_Error( 'upload_error', $file['error'] );
|
1273 |
+
|
1274 |
+
$url = $file['url'];
|
1275 |
+
$type= $file['type'];
|
1276 |
+
$file = $file['file'];
|
1277 |
+
$title = preg_replace('/\.[^.]+$/', '', basename($file));
|
1278 |
+
$content = '';
|
1279 |
+
|
1280 |
+
// use image exif/iptc data for title and caption defaults if possible
|
1281 |
+
if ( $image_meta = @wp_read_image_metadata($file) ) {
|
1282 |
+
if ( trim($image_meta['title']) )
|
1283 |
+
$title = $image_meta['title'];
|
1284 |
+
if ( trim($image_meta['caption']) )
|
1285 |
+
$content = $image_meta['caption'];
|
1286 |
+
}
|
1287 |
+
|
1288 |
+
// Construct the attachment array
|
1289 |
+
$attachment = array_merge( array(
|
1290 |
+
'post_mime_type' => $type,
|
1291 |
+
'guid' => $url,
|
1292 |
+
'post_parent' => $post_id,
|
1293 |
+
'post_title' => $title,
|
1294 |
+
'post_excerpt' => $content,
|
1295 |
+
'post_content' => $content,
|
1296 |
+
), $post_data );
|
1297 |
+
|
1298 |
+
// Save the data
|
1299 |
+
$id = wp_insert_attachment($attachment, $file, $post_id);
|
1300 |
+
if ( !is_wp_error($id) ) {
|
1301 |
+
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
|
1302 |
+
}
|
1303 |
+
|
1304 |
+
return $id;
|
1305 |
+
|
1306 |
+
}
|
1307 |
+
|
1308 |
+
function postie_handle_upload( &$file, $overrides = false, $time = null ) {
|
1309 |
+
// The default error handler.
|
1310 |
+
if (! function_exists( 'wp_handle_upload_error' ) ) {
|
1311 |
+
function wp_handle_upload_error( &$file, $message ) {
|
1312 |
+
return array( 'error'=>$message );
|
1313 |
+
}
|
1314 |
+
}
|
1315 |
+
|
1316 |
+
// You may define your own function and pass the name in $overrides['upload_error_handler']
|
1317 |
+
$upload_error_handler = 'wp_handle_upload_error';
|
1318 |
+
|
1319 |
+
// You may define your own function and pass the name in $overrides['unique_filename_callback']
|
1320 |
+
$unique_filename_callback = null;
|
1321 |
+
|
1322 |
+
// $_POST['action'] must be set and its value must equal $overrides['action'] or this:
|
1323 |
+
$action = 'wp_handle_upload';
|
1324 |
+
|
1325 |
+
// Courtesy of php.net, the strings that describe the error indicated in $_FILES[{form field}]['error'].
|
1326 |
+
$upload_error_strings = array( false,
|
1327 |
+
__( "The uploaded file exceeds the <code>upload_max_filesize</code> directive in <code>php.ini</code>." ),
|
1328 |
+
__( "The uploaded file exceeds the <em>MAX_FILE_SIZE</em> directive that was specified in the HTML form." ),
|
1329 |
+
__( "The uploaded file was only partially uploaded." ),
|
1330 |
+
__( "No file was uploaded." ),
|
1331 |
+
'',
|
1332 |
+
__( "Missing a temporary folder." ),
|
1333 |
+
__( "Failed to write file to disk." ));
|
1334 |
+
|
1335 |
+
// All tests are on by default. Most can be turned off by $override[{test_name}] = false;
|
1336 |
+
$test_form = true;
|
1337 |
+
$test_size = true;
|
1338 |
+
|
1339 |
+
// If you override this, you must provide $ext and $type!!!!
|
1340 |
+
$test_type = true;
|
1341 |
+
$mimes = false;
|
1342 |
+
|
1343 |
+
// Install user overrides. Did we mention that this voids your warranty?
|
1344 |
+
if ( is_array( $overrides ) )
|
1345 |
+
extract( $overrides, EXTR_OVERWRITE );
|
1346 |
+
|
1347 |
+
// A correct form post will pass this test.
|
1348 |
+
if ( $test_form && (!isset( $_POST['action'] ) || ($_POST['action'] != $action ) ) )
|
1349 |
+
return $upload_error_handler( $file, __( 'Invalid form submission.' ));
|
1350 |
+
|
1351 |
+
// A successful upload will pass this test. It makes no sense to override this one.
|
1352 |
+
if ( $file['error'] > 0 )
|
1353 |
+
return $upload_error_handler( $file, $upload_error_strings[$file['error']] );
|
1354 |
+
|
1355 |
+
// A non-empty file will pass this test.
|
1356 |
+
if ( $test_size && !($file['size'] > 0 ) )
|
1357 |
+
return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.' ));
|
1358 |
+
|
1359 |
+
// A properly uploaded file will pass this test. There should be no reason to override this one.
|
1360 |
+
if (!file_exists( $file['tmp_name'] ) )
|
1361 |
+
return $upload_error_handler( $file, __( 'Specified file failed upload test.'));
|
1362 |
+
// A correct MIME type will pass this test. Override $mimes or use the upload_mimes filter.
|
1363 |
+
if ( $test_type ) {
|
1364 |
+
$wp_filetype = wp_check_filetype( $file['name'], $mimes );
|
1365 |
+
|
1366 |
+
extract( $wp_filetype );
|
1367 |
+
|
1368 |
+
if ( ( !$type || !$ext ) && !current_user_can( 'unfiltered_upload' ) )
|
1369 |
+
return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' ));
|
1370 |
+
|
1371 |
+
if ( !$ext )
|
1372 |
+
$ext = ltrim(strrchr($file['name'], '.'), '.');
|
1373 |
+
|
1374 |
+
if ( !$type )
|
1375 |
+
$type = $file['type'];
|
1376 |
+
}
|
1377 |
+
|
1378 |
+
// A writable uploads dir will pass this test. Again, there's no point overriding this one.
|
1379 |
+
if ( ! ( ( $uploads = wp_upload_dir($time) ) && false === $uploads['error'] ) )
|
1380 |
+
return $upload_error_handler( $file, $uploads['error'] );
|
1381 |
+
|
1382 |
+
$filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback );
|
1383 |
+
|
1384 |
+
// Move the file to the uploads dir
|
1385 |
+
$new_file = $uploads['path'] . "/$filename";
|
1386 |
+
if ( false === @ rename( $file['tmp_name'], $new_file ) ) {
|
1387 |
+
return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) );
|
1388 |
+
}
|
1389 |
+
|
1390 |
+
// Set correct file permissions
|
1391 |
+
$stat = stat( dirname( $new_file ));
|
1392 |
+
$perms = $stat['mode'] & 0000666;
|
1393 |
+
@ chmod( $new_file, $perms );
|
1394 |
+
|
1395 |
+
// Compute the URL
|
1396 |
+
$url = $uploads['url'] . "/$filename";
|
1397 |
+
|
1398 |
+
$return = apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $type ) );
|
1399 |
+
|
1400 |
+
return $return;
|
1401 |
+
}/**
|
1402 |
* Searches for the existance of a certain MIME TYPE in the tree of mime attachments
|
1403 |
* @param primary mime
|
1404 |
* @param secondary mime
|
1422 |
* that type is present it filters out all other text types. If it is not - then nothing is done
|
1423 |
*@param object
|
1424 |
*/
|
1425 |
+
function FilterTextParts(&$mimeDecodedEmail, $preferTextType) {
|
1426 |
+
$newParts = array();
|
1427 |
+
$found = false;
|
1428 |
+
for ($i = 0; $i < count($mimeDecodedEmail->parts); $i++) {
|
1429 |
+
if (in_array($mimeDecodedEmail->parts[$i]->ctype_primary,
|
1430 |
+
array("text","multipart"))) {
|
1431 |
+
if (SearchForMIMEType($mimeDecodedEmail->parts[$i],"text",
|
1432 |
+
$preferTextType)) {
|
1433 |
+
$newParts[] = &$mimeDecodedEmail->parts[$i];
|
1434 |
+
$found = true;
|
1435 |
+
}
|
1436 |
+
} else {
|
1437 |
+
$newParts[] = &$mimeDecodedEmail->parts[$i];
|
|
|
|
|
|
|
|
|
1438 |
}
|
1439 |
+
}
|
1440 |
+
if ($found && $newParts) {
|
1441 |
+
//This is now the filtered list of just the preferred type.
|
1442 |
+
$mimeDecodedEmail->parts = $newParts;
|
1443 |
+
}
|
1444 |
}
|
1445 |
/**
|
1446 |
+
* This function can be used to send confirmation or rejection e-mails
|
1447 |
+
* It accepts an object containing the entire message
|
1448 |
*/
|
1449 |
+
function MailToRecipients( &$mail_content,$testEmail=false,
|
1450 |
+
$recipients=array(), $returnToSender, $reject=true) {
|
1451 |
+
if ($testEmail) {
|
1452 |
+
return;
|
1453 |
+
}
|
1454 |
$user = get_userdata('1');
|
1455 |
$myname = $user->user_nicename;
|
1456 |
$myemailadd = get_option("admin_email");
|
1457 |
$blogname = get_option("blogname");
|
1458 |
+
$blogurl = get_option("siteurl");
|
1459 |
+
array_push($recipients, $myemailadd);
|
1460 |
if (count($recipients) == 0) {
|
1461 |
return false;
|
1462 |
}
|
1463 |
|
1464 |
$from = trim($mail_content->headers["from"]);
|
1465 |
$subject = $mail_content->headers['subject'];
|
1466 |
+
if ($returnToSender) {
|
1467 |
+
array_push($recipients, $from);
|
1468 |
+
}
|
1469 |
|
1470 |
+
$headers = "From: Wordpress <" .$myemailadd .">\r\n";
|
1471 |
// Set email subject
|
1472 |
+
if ($reject) {
|
1473 |
+
$alert_subject = $blogname . ": Unauthorized Post Attempt from $from";
|
1474 |
+
if ($mail_content->ctype_parameters['boundary']) {
|
1475 |
+
$boundary = $mail_content->ctype_parameters["boundary"];
|
1476 |
+
} else {
|
1477 |
+
$boundary=uniqid("B_");
|
1478 |
}
|
1479 |
+
// Set sender details
|
1480 |
+
/*
|
1481 |
+
if (isset($mail_content->headers["mime-version"])) {
|
1482 |
+
$headers .= "Mime-Version: ". $mail_content->headers["mime-version"] . "\r\n";
|
1483 |
+
}
|
1484 |
+
if (isset($mail_content->headers["content-type"])) {
|
1485 |
+
$headers .= "Content-Type: ". $mail_content->headers["content-type"] . "\r\n";
|
1486 |
+
}
|
1487 |
+
*/
|
1488 |
+
|
1489 |
+
$headers.="Content-Type:multipart/alternative; boundary=\"$boundary\"\r\n";
|
1490 |
+
// SDM 20041123
|
1491 |
+
foreach ($recipients as $recipient) {
|
1492 |
+
$recipient = trim($recipient);
|
1493 |
+
if (! empty($recipient)) {
|
1494 |
+
$headers .= "Cc: " . $recipient . "\r\n";
|
1495 |
+
}
|
1496 |
}
|
1497 |
+
// construct mail message
|
1498 |
+
$message = "An unauthorized message has been sent to $blogname.\n";
|
1499 |
+
$message .= "Sender: $from\n";
|
1500 |
+
$message .= "Subject: $subject\n";
|
1501 |
+
$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.";
|
1502 |
+
$message .= "\n\nOtherwise, the e-mail has already been deleted from the server and you can ignore this message.";
|
1503 |
+
$message .= "\n\nIf you would like to prevent postie from forwarding mail
|
1504 |
+
in the future, please change the FORWARD_REJECTED_MAIL setting in the Postie
|
1505 |
+
settings panel";
|
1506 |
+
$message .= "\n\nThe original content of the e-mail has been attached.\n\n";
|
1507 |
+
$mailtext = "--$boundary\r\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1508 |
$mailtext .= "Content-Type: text/plain;format=flowed;charset=\"iso-8859-1\";reply-type=original\n";
|
1509 |
$mailtext .= "Content-Transfer-Encoding: 7bit\n";
|
1510 |
$mailtext .= "\n";
|
1511 |
+
$mailtext .= "$message\n";
|
1512 |
+
if ($mail_content->parts) {
|
1513 |
+
$mailparts=$mail_content->parts;
|
1514 |
+
} else {
|
1515 |
+
$mailparts[]=$mail_content;
|
1516 |
+
}
|
1517 |
+
foreach ($mailparts as $part) {
|
1518 |
+
$mailtext .= "--$boundary\r\n";
|
1519 |
+
$mailtext .= "Content-Type: ".$part->headers["content-type"] . "\n";
|
1520 |
+
$mailtext .= "Content-Transfer-Encoding: ".$part->headers["content-transfer-encoding"] . "\n";
|
1521 |
+
if (isset($part->headers["content-disposition"])) {
|
1522 |
+
$mailtext .= "Content-Disposition: ".$part->headers["content-disposition"] . "\n";
|
1523 |
+
}
|
1524 |
+
$mailtext .= "\n";
|
1525 |
+
$mailtext .= $part->body;
|
1526 |
}
|
1527 |
+
} else {
|
1528 |
+
$alert_subject = "Successfully posted to $blogname";
|
1529 |
+
$mailtext = "Your post '$subject' has been successfully published to " .
|
1530 |
+
"$blogname <$blogurl>.\n";
|
1531 |
+
}
|
1532 |
+
|
1533 |
|
1534 |
// Send message
|
1535 |
mail($myemailadd, $alert_subject, $mailtext, $headers);
|
1541 |
* @param string
|
1542 |
* @return array
|
1543 |
*/
|
1544 |
+
function DecodeMIMEMail($email, $decodeHeaders=false) {
|
1545 |
$params = array();
|
1546 |
$params['include_bodies'] = true;
|
1547 |
$params['decode_bodies'] = false;
|
1548 |
+
$params['decode_headers'] = $decodeHeaders;
|
1549 |
$params['input'] = $email;
|
1550 |
+
//$decoded = imap_mime_header_decode($email);
|
1551 |
return(Mail_mimeDecode::decode($params));
|
1552 |
}
|
1553 |
|
1565 |
* @param string - email address
|
1566 |
* @return boolean
|
1567 |
*/
|
1568 |
+
function CheckEmailAddress($address, $authorized) {
|
1569 |
+
$address = strtolower($address);
|
1570 |
+
if (!is_array($authorized) || !count($authorized)) {
|
1571 |
+
return false;
|
1572 |
+
}
|
1573 |
+
return(in_array($address,$authorized));
|
|
|
|
|
1574 |
}
|
1575 |
/**
|
1576 |
*This method works around a problemw with email address with extra <> in the email address
|
1605 |
return($name);
|
1606 |
}
|
1607 |
|
1608 |
+
/**
|
1609 |
+
* Choose an appropriate file icon based on the extension and mime type of
|
1610 |
+
* the attachment
|
1611 |
+
*/
|
1612 |
+
function chooseAttachmentIcon($file, $primary, $secondary, $iconSet='silver',
|
1613 |
+
$size='32') {
|
1614 |
+
if ($config['ICON_SET']=='none')
|
1615 |
+
return('');
|
1616 |
+
$fileName=basename($file);
|
1617 |
+
$parts=explode('.', $fileName);
|
1618 |
+
$ext=$parts[count($parts)-1];
|
1619 |
+
//echo "file='$fileName', ext=$ext, primary=$primary, secondary=$secondary\n";
|
1620 |
+
$docExts=array('doc', 'docx');
|
1621 |
+
$docMimes=array('msword', 'vnd.ms-word',
|
1622 |
+
'vnd.openxmlformats-officedocument.wordprocessingml.document');
|
1623 |
+
$pptExts=array('ppt','pptx');
|
1624 |
+
$pptMimes=array('mspowerpoint', 'vnd.ms-powerpoint',
|
1625 |
+
'vnd.openxmlformats-officedocument.');
|
1626 |
+
$xlsExts=array('xls', 'xlsx');
|
1627 |
+
$xlsMimes=array('msexcel', 'vnd.ms-excel',
|
1628 |
+
'vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
1629 |
+
$iWorkMimes=array('zip', 'octet-stream');
|
1630 |
+
$mpgExts=array('mpg', 'mpeg', 'mp2');
|
1631 |
+
$mpgMimes=array('mpg', 'mpeg', 'mp2');
|
1632 |
+
$mp3Exts=array('mp3');
|
1633 |
+
$mp3Mimes=array('mp3', 'mpeg3','mpeg');
|
1634 |
+
$mp4Exts=array('mp4', 'm4v');
|
1635 |
+
$mp4Mimes=array('mp4', 'mpeg4','octet-stream');
|
1636 |
+
$aacExts=array('m4a', 'aac');
|
1637 |
+
$aacMimes=array('m4a', 'aac', 'mp4');
|
1638 |
+
$aviExts=array('avi');
|
1639 |
+
$aviMimes=array('avi', 'x-msvideo');
|
1640 |
+
$movExts=array('mov');
|
1641 |
+
$movMimes=array('mov', 'quicktime');
|
1642 |
+
if ($ext=='pdf' && $secondary=='pdf') {
|
1643 |
+
$fileType='pdf';
|
1644 |
+
} else if ($ext=='pages' && in_array($secondary, $iWorkMimes)) {
|
1645 |
+
$fileType='pages';
|
1646 |
+
} else if ($ext=='numbers' && in_array($secondary, $iWorkMimes)) {
|
1647 |
+
$fileType='numbers';
|
1648 |
+
} else if ($ext=='key' && in_array($secondary, $iWorkMimes)) {
|
1649 |
+
$fileType='key';
|
1650 |
+
} else if (in_array($ext, $docExts) && in_array($secondary, $docMimes)) {
|
1651 |
+
$fileType='doc';
|
1652 |
+
} else if (in_array($ext, $pptExts) && in_array($secondary, $pptMimes)) {
|
1653 |
+
$fileType='ppt';
|
1654 |
+
} else if (in_array($ext, $xlsExts) && in_array($secondary, $xlsMimes)) {
|
1655 |
+
$fileType='xls';
|
1656 |
+
} else if (in_array($ext, $mp4Exts) && in_array($secondary, $mp4Mimes)) {
|
1657 |
+
$fileType='mp4';
|
1658 |
+
} else if (in_array($ext, $movExts) && in_array($secondary, $movMimes)) {
|
1659 |
+
$fileType='mov';
|
1660 |
+
} else if (in_array($ext, $aviExts) && in_array($secondary, $aviMimes)) {
|
1661 |
+
$fileType='avi';
|
1662 |
+
} else if (in_array($ext, $mp3Exts) && in_array($secondary, $mp3Mimes)) {
|
1663 |
+
$fileType='mp3';
|
1664 |
+
} else if (in_array($ext, $mpgExts) && in_array($secondary, $mpgMimes)) {
|
1665 |
+
$fileType='mpg';
|
1666 |
+
} else if (in_array($ext, $aacExts) && in_array($secondary, $aacMimes)) {
|
1667 |
+
$fileType='aac';
|
1668 |
} else {
|
1669 |
+
$fileType='default';
|
1670 |
+
}
|
1671 |
+
//echo "fileType=$fileType\n";
|
1672 |
+
$fileName="/icons/$iconSet/$fileType-$size.png";
|
1673 |
+
//echo "fileName=$fileName\n";
|
1674 |
+
if (!file_exists(POSTIE_ROOT . $fileName))
|
1675 |
+
$fileName="/icons/$iconSet/default-$size.png";
|
1676 |
+
$iconHtml="<img src='" . POSTIE_URL . $fileName . "' alt='$fileType icon' />";
|
1677 |
+
return($iconHtml);
|
1678 |
+
|
1679 |
+
}
|
1680 |
+
|
1681 |
+
function parseTemplate($id, $type, $template, $size='medium') {
|
1682 |
+
|
1683 |
+
/* we check template for thumb, thumbnail, large, full and use that as
|
1684 |
+
size. If not found, we default to medium */
|
1685 |
+
if ($type=='image') {
|
1686 |
+
$sizes=array('thumbnail', 'medium', 'large');
|
1687 |
+
$hwstrings=array();
|
1688 |
+
$widths=array();
|
1689 |
+
$heights=array();
|
1690 |
+
for ($i=0; $i<count($sizes); $i++) {
|
1691 |
+
list( $img_src[$i], $widths[$i], $heights[$i] ) = image_downsize($id,
|
1692 |
+
$sizes[$i]);
|
1693 |
+
$hwstrings[$i] = image_hwstring($widths[$i], $heights[$i]);
|
1694 |
+
}
|
1695 |
+
}
|
1696 |
+
$attachment=get_post($id);
|
1697 |
+
$the_parent=get_post($attachment->post_parent);
|
1698 |
+
$uploadDir=wp_upload_dir();
|
1699 |
+
$fileName=basename($attachment->guid);
|
1700 |
+
$absFileName=$uploadDir['path'] .'/'. $fileName;
|
1701 |
+
$relFileName=str_replace(ABSPATH,'', $absFileName);
|
1702 |
+
$fileLink=wp_get_attachment_url($id);
|
1703 |
+
$pageLink=get_attachment_link($id);
|
1704 |
+
|
1705 |
+
$template=str_replace('{TITLE}', $attachment->post_title, $template);
|
1706 |
+
$template=str_replace('{ID}', $id, $template);
|
1707 |
+
$template=str_replace('{THUMBNAIL}', $img_src[0], $template);
|
1708 |
+
$template=str_replace('{THUMB}', $img_src[0], $template);
|
1709 |
+
$template=str_replace('{MEDIUM}', $img_src[1], $template);
|
1710 |
+
$template=str_replace('{LARGE}', $img_src[2], $template);
|
1711 |
+
$template=str_replace('{FULL}', $fileLink, $template);
|
1712 |
+
$template=str_replace('{FILELINK}', $fileLink, $template);
|
1713 |
+
$template=str_replace('{PAGELINK}', $pageLink, $template);
|
1714 |
+
$template=str_replace('{THUMBWIDTH}', $widths[0] . 'px', $template);
|
1715 |
+
$template=str_replace('{THUMBHEIGHT}', $heights[0] . 'px', $template);
|
1716 |
+
$template=str_replace('{MEDIUMWIDTH}', $widths[1] . 'px', $template);
|
1717 |
+
$template=str_replace('{MEDIUMHEIGHT}', $heights[1] . 'px', $template);
|
1718 |
+
$template=str_replace('{LARGEWIDTH}', $widths[2] . 'px', $template);
|
1719 |
+
$template=str_replace('{LARGEHEIGHT}', $heights[2] . 'px', $template);
|
1720 |
+
$template=str_replace('{FILENAME}', $fileName, $template);
|
1721 |
+
$template=str_replace('{IMAGE}', $fileLink, $template);
|
1722 |
+
$template=str_replace('{URL}', $fileLink, $template);
|
1723 |
+
$template=str_replace('{RELFILENAME}', $relFileName, $template);
|
1724 |
+
$template=str_replace('{POSTTITLE}', $the_parent->post_title, $template);
|
1725 |
+
if ($attachment->post_excerpt!='') {
|
1726 |
+
$template=str_replace('{CAPTION}', $attachment->post_excerpt, $template);
|
1727 |
+
} else {
|
1728 |
+
//$template=str_replace('{CAPTION}', '', $template);
|
1729 |
+
}
|
1730 |
+
return($template . '<br />');
|
1731 |
}
|
1732 |
+
|
1733 |
/**
|
1734 |
* When sending in HTML email the html refers to the content-id(CID) of the image - this replaces
|
1735 |
* the cid place holder with the actual url of the image sent in
|
1759 |
* @param string - text of post
|
1760 |
* @param array - array of HTML for images for post
|
1761 |
*/
|
1762 |
+
function ReplaceImagePlaceHolders(&$content,$attachments, $config) {
|
1763 |
+
//echo "first content is: $content\n";
|
1764 |
($config["START_IMAGE_COUNT_AT_ZERO"] ? $startIndex = 0 :$startIndex = 1);
|
1765 |
foreach ( $attachments as $i => $value ) {
|
1766 |
// looks for ' #img1# ' etc... and replaces with image
|
1773 |
stristr($content, $eimg_placeholder_temp) ) {
|
1774 |
// look for caption
|
1775 |
$caption='';
|
1776 |
+
if ( preg_match("/$img_placeholder_temp caption=['\"](.*)['\"]/", $content, $matches)) {
|
1777 |
$caption =$matches[1];
|
1778 |
+
$img_placeholder_temp=$matches[0];
|
1779 |
+
$eimg_placeholder_temp=$matches[0];
|
1780 |
+
// echo "caption=$caption\n";
|
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\n",ENT_QUOTES));
|
1788 |
+
//print(htmlspecialchars("content=\n***\n$content\n***\n",ENT_QUOTES));
|
1789 |
} else {
|
1790 |
$value = str_replace('{CAPTION}', '', $value);
|
1791 |
+
/* if using the gallery shortcode, don't add pictures at all */
|
1792 |
+
if (!preg_match("/\[gallery[^\[]*\]/", $content, $matches)) {
|
1793 |
+
if ($config["IMAGES_APPEND"]) {
|
1794 |
+
$content .= $value;
|
1795 |
+
} else {
|
1796 |
+
$content = $value . $content;
|
1797 |
+
}
|
1798 |
}
|
1799 |
}
|
1800 |
}
|
1803 |
*This function handles finding and setting the correct subject
|
1804 |
* @return array - (subject,content)
|
1805 |
*/
|
1806 |
+
function GetSubject(&$mimeDecodedEmail,&$content, $config) {
|
1807 |
+
global $charset;
|
1808 |
+
//assign the default title/subject
|
1809 |
+
if ( $mimeDecodedEmail->headers['subject'] == NULL ) {
|
1810 |
+
if ($config["ALLOW_SUBJECT_IN_MAIL"]) {
|
1811 |
+
list($subject,$content) =
|
1812 |
+
ParseInMessageSubject($content,$config['DEFAULT_TITLE']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1813 |
}
|
1814 |
+
else {
|
1815 |
+
$subject = $config["DEFAULT_TITLE"];
|
1816 |
+
}
|
1817 |
+
$mimeDecodedEmail->headers['subject'] = $subject;
|
1818 |
+
} else {
|
1819 |
+
//$subject = $mimeDecodedEmail->headers['subject'];
|
1820 |
+
if ($mimeDecodedEmail->headers["content-transfer-encoding"]!='') {
|
1821 |
+
$encoding = $mimeDecodedEmail->headers["content-transfer-encoding"];
|
1822 |
+
} else if ($mimeDecodedEmail->ctype_parameters["content-transfer-encoding"]!='') {
|
1823 |
+
$encoding = $mimeDecodedEmail->ctype_parameters["content-transfer-encoding"];
|
1824 |
+
} else {
|
1825 |
+
$encoding='7bit';
|
1826 |
+
}
|
1827 |
+
if (function_exists(imap_mime_header_decode)) {
|
1828 |
+
//$elements=imap_mime_header_decode($mimeDecodedEmail->headers['subject']);
|
1829 |
+
//$text = "=?utf-8?b?w6XDpMO2?= unicode";
|
1830 |
+
$text=$mimeDecodedEmail->headers['subject'];
|
1831 |
+
//$text="test emails with ISO 8859-2 cahracters ąęśćółńżźĄĘŚÓŁŃŻŹ";
|
1832 |
+
//echo "text='$text'\n";
|
1833 |
+
$elements = imap_mime_header_decode($text);
|
1834 |
+
for ($i=0; $i<count($elements); $i++) {
|
1835 |
+
$thischarset=$elements[$i]->charset;
|
1836 |
+
if ($thischarset=='default')
|
1837 |
+
$thischarset=$charset;
|
1838 |
+
//echo "Charset: {$thischarset}\n";
|
1839 |
+
//echo "Text: ". utf8_encode($elements[$i]->text). "\n\n";
|
1840 |
+
$subject.=HandleMessageEncoding($encoding, $thischarset,
|
1841 |
+
$elements[$i]->text, $config['MESSAGE_ENCODING'],
|
1842 |
+
$config['MESSAGE_DEQUOTE']);
|
1843 |
+
//echo "subject=$subject\n";
|
1844 |
+
}
|
1845 |
+
//echo "now subject= $subject\n";
|
1846 |
+
//if ($element->charset!='') {
|
1847 |
+
//$charset = $element[0]->charset;
|
1848 |
+
//echo "charset='$charset'\n";
|
1849 |
+
// }
|
1850 |
}
|
1851 |
+
if (!$config["ALLOW_HTML_IN_SUBJECT"]) {
|
1852 |
+
$subject = htmlentities($subject);
|
1853 |
+
}
|
1854 |
+
}
|
1855 |
+
//This is for ISO-2022-JP - Can anyone confirm that this is still neeeded?
|
1856 |
+
// escape sequence is 'ESC $ B' == 1b 24 42 hex.
|
1857 |
+
if (strpos($subject, "\x1b\x24\x42") !== false) {
|
1858 |
+
// found iso-2022-jp escape sequence in subject... convert!
|
1859 |
+
$subject = iconv("ISO-2022-JP//TRANSLIT", "UTF-8", $subject);
|
1860 |
+
}
|
1861 |
+
return($subject);
|
1862 |
}
|
1863 |
/**
|
1864 |
* this function determines tags for the post
|
1865 |
*
|
1866 |
*/
|
1867 |
+
function postie_get_tags(&$content, $defaultTags) {
|
|
|
1868 |
global $wpdb;
|
1869 |
$post_tags = array();
|
1870 |
//try and determine tags
|
1873 |
$post_tags = preg_split("/,\s*/", $matches[1]);
|
1874 |
}
|
1875 |
if (!count($post_tags)) {
|
1876 |
+
$post_tags = $defaultTags;
|
|
|
1877 |
}
|
1878 |
return($post_tags);
|
1879 |
}
|
1881 |
* this function determines excerpt for the post
|
1882 |
*
|
1883 |
*/
|
1884 |
+
function GetPostExcerpt(&$content, $filterNewLines, $convertNewLines) {
|
|
|
1885 |
global $wpdb;
|
1886 |
$post_excerpt = '';
|
|
|
|
|
|
|
|
|
1887 |
if ( preg_match('/:excerptstart ?(.*):excerptend/s', $content, $matches)) {
|
1888 |
$content = str_replace($matches[0], "", $content);
|
1889 |
$post_excerpt = $matches[1];
|
1890 |
+
if ($filterNewLines)
|
1891 |
+
$post_excerpt = FilterNewLines($post_excerpt, $convertNewLines);
|
1892 |
}
|
1893 |
return($post_excerpt);
|
1894 |
}
|
1896 |
* This function determines categories for the post
|
1897 |
* @return array
|
1898 |
*/
|
1899 |
+
function GetPostCategories(&$subject, $defaultCategory) {
|
|
|
1900 |
global $wpdb;
|
1901 |
$post_categories = array();
|
1902 |
$matches = array();
|
1942 |
}
|
1943 |
}
|
1944 |
if (!count($post_categories)) {
|
1945 |
+
$post_categories[] = $defaultCategory;
|
1946 |
}
|
1947 |
return($post_categories);
|
1948 |
}
|
1950 |
*This function just outputs a simple html report about what is being posted in
|
1951 |
*/
|
1952 |
function DisplayEmailPost($details) {
|
|
|
1953 |
if ($debug) {
|
1954 |
print_r($config);
|
1955 |
print_r($details);
|
1966 |
print '<b>Comment Status</b>: ' . $details["comment_status"] . '<br />' . "\n";
|
1967 |
print '<b>Subject</b>: ' . $details["post_title"]. '<br />' . "\n";
|
1968 |
print '<b>Postname</b>: ' . $details["post_name"] . '<br />' . "\n";
|
1969 |
+
print '<b>Post Id</b>: ' . $details["ID"] . '<br />' . "\n";
|
1970 |
+
print '<b>Posted content:</b></p><hr />' .
|
1971 |
+
$details["post_content"] . '<hr /><pre>';
|
1972 |
+
if (function_exists('memory_get_peak_usage'))
|
1973 |
+
echo "Memory used: ". memory_get_peak_usage(). "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1974 |
}
|
1975 |
/**
|
1976 |
* Takes a value and builds a simple simple yes/no select box
|
1986 |
<option value=\"1\">".__("Yes", 'postie')."</option>
|
1987 |
<option value=\"0\" ". (!$current_value ? "SELECTED" : NULL) .
|
1988 |
">".__("No", 'postie').'</option>
|
1989 |
+
</select>';
|
|
|
1990 |
if ($recommendation!=NULL) {
|
1991 |
+
$string.='<span class="recommendation">'.__($recommendation,
|
1992 |
+
'postie').'</span>';
|
1993 |
}
|
1994 |
$string.="</td>\n</tr>";
|
1995 |
return($string);
|
2002 |
*@param string
|
2003 |
*/
|
2004 |
function BuildTextArea($label,$id,$current_value,$recommendation = NULL) {
|
2005 |
+
$string = "<tr> <th scope=\"row\">".__($label, 'postie').":";
|
2006 |
+
if ($recommendation) {
|
2007 |
+
$string.="<br /><span class='recommendation'>".__($recommendation,
|
2008 |
+
'postie')."</span>";
|
2009 |
+
}
|
2010 |
+
$string.="</th>";
|
2011 |
+
|
2012 |
+
$string .="<td><textarea cols=40 rows=3 name=\"$id\" id=\"$id\">";
|
2013 |
+
if (is_array($current_value)) {
|
2014 |
+
foreach($current_value as $item) {
|
2015 |
+
$string .= "$item\n";
|
2016 |
+
}
|
2017 |
+
}
|
2018 |
+
$string .= "</textarea></td>
|
|
|
|
|
2019 |
</tr>";
|
2020 |
+
return($string);
|
2021 |
}
|
2022 |
/**
|
2023 |
*Handles the creation of the table needed to store all the data
|
2038 |
*/
|
2039 |
function ResetPostieConfig() {
|
2040 |
global $wpdb;
|
2041 |
+
//Get rid of old values
|
2042 |
+
$query ="delete from ". POSTIE_TABLE . " WHERE label NOT IN ('MAIL_PASSWORD', 'MAIL_SERVER', 'MAIL_SERVER_PORT', 'MAIL_USERID', 'INPUT_PROTOCOL');";
|
2043 |
+
$results=$wpdb->query($wpdb->prepare($query));
|
2044 |
+
$config = GetConfig();
|
2045 |
+
$key_arrays = GetListOfArrayConfig();
|
2046 |
+
foreach($key_arrays as $key) {
|
2047 |
+
$config[$key] = join("\n",$config[$key]);
|
2048 |
+
}
|
2049 |
+
UpdatePostieConfig($config);
|
2050 |
+
}
|
2051 |
+
|
2052 |
+
function UpdateArrayConfig() {
|
2053 |
+
global $wpdb;
|
2054 |
+
$key_arrays = GetListOfArrayConfig();
|
2055 |
+
$data = $wpdb->get_results("SELECT label,value FROM ". POSTIE_TABLE .";");
|
2056 |
+
if (is_array($data)) {
|
2057 |
+
foreach($data as $row) {
|
2058 |
+
if (in_array($row->label,$key_arrays)) {
|
2059 |
+
if (unserialize($row->value)) {
|
2060 |
+
$config[$row->label] = unserialize($row->value);
|
2061 |
+
} else {
|
2062 |
+
if (!is_array($config[$row->label])) {
|
2063 |
+
$config[$row->label] = array();
|
2064 |
+
}
|
2065 |
+
$config[$row->label][] = $row->value;
|
2066 |
+
}
|
2067 |
+
} else {
|
2068 |
+
$config[$row->label] = $row->value;
|
2069 |
+
}
|
2070 |
}
|
2071 |
+
}
|
2072 |
+
WriteConfig($config);
|
2073 |
+
echo "updating database";
|
2074 |
}
|
2075 |
/**
|
2076 |
* This function handles updating the configuration
|
2077 |
*@return boolean
|
2078 |
*/
|
2079 |
function UpdatePostieConfig($data) {
|
2080 |
+
SetupConfiguration();
|
2081 |
+
$key_arrays = GetListOfArrayConfig();
|
2082 |
+
$config = GetDBConfig();
|
2083 |
+
foreach($config as $key => $value) {
|
2084 |
+
if (isset($data[$key])) {
|
2085 |
+
if (in_array($key,$key_arrays)) { //This is stored as an array
|
2086 |
+
$data[$key]=trim($data[$key]);
|
2087 |
+
if (strstr($data[$key], "\n")) {
|
2088 |
+
$delim = "\n";
|
2089 |
+
} else {
|
2090 |
+
$delim = ',';
|
|
|
|
|
|
|
|
|
|
|
|
|
2091 |
}
|
2092 |
+
$config[$key] = array();
|
2093 |
+
$values = explode($delim,$data[$key]);
|
2094 |
+
foreach($values as $item) {
|
2095 |
+
if (trim($item)) {
|
2096 |
+
$config[$key][] = trim($item);
|
2097 |
+
}
|
2098 |
+
}
|
2099 |
+
} else {
|
2100 |
+
$config[$key] = FilterNewLines($data[$key]);
|
2101 |
+
}
|
2102 |
}
|
2103 |
+
}
|
2104 |
+
WriteConfig($config);
|
2105 |
+
UpdatePostiePermissions($data["ROLE_ACCESS"]);
|
2106 |
+
return(1);
|
2107 |
}
|
2108 |
/**
|
2109 |
* This handles actually writing out the changes
|
2110 |
*@param array
|
2111 |
*/
|
2112 |
function WriteConfig($config) {
|
2113 |
+
global $wpdb;
|
2114 |
+
foreach($config as $key=>$value) {
|
2115 |
+
$label = $key;
|
2116 |
+
$q = $wpdb->query($wpdb->prepare("DELETE FROM ". POSTIE_TABLE . "
|
2117 |
+
WHERE label = '$label';"));
|
2118 |
+
if (is_array($value)) {
|
2119 |
+
$value=serialize($value);
|
2120 |
+
}
|
2121 |
+
$theQuery=$wpdb->prepare("INSERT INTO ". POSTIE_TABLE . "
|
2122 |
+
(label,value) VALUES
|
2123 |
+
('$label','". $value ."');");
|
2124 |
+
$q = $wpdb->query($theQuery);
|
2125 |
+
}
|
2126 |
}
|
2127 |
/**
|
2128 |
*This handles actually reading the config from the database
|
2129 |
* @return array
|
2130 |
*/
|
2131 |
function ReadDBConfig() {
|
2132 |
+
SetupConfiguration();
|
2133 |
+
$config = array();
|
2134 |
+
global $wpdb;
|
2135 |
+
$data = $wpdb->get_results("SELECT label,value FROM ". POSTIE_TABLE .";");
|
2136 |
+
if (is_array($data)) {
|
2137 |
+
foreach($data as $row) {
|
2138 |
+
if (in_array($row->label,GetListOfArrayConfig())) {
|
2139 |
+
$config[$row->label] = unserialize($row->value);
|
2140 |
+
} else {
|
2141 |
+
$config[$row->label] = $row->value;
|
2142 |
+
}
|
|
|
|
|
|
|
|
|
|
|
2143 |
}
|
2144 |
+
}
|
2145 |
+
return($config);
|
2146 |
}
|
2147 |
/**
|
2148 |
* This handles the configs that are stored in the data base
|
2152 |
*/
|
2153 |
function GetDBConfig() {
|
2154 |
$config = ReadDBConfig();
|
2155 |
+
if (!isset($config["ADMIN_USERNAME"]))
|
2156 |
+
$config["ADMIN_USERNAME"] = 'admin';
|
2157 |
+
if (!isset($config["PREFER_TEXT_TYPE"]))
|
2158 |
+
$config["PREFER_TEXT_TYPE"] = "plain";
|
2159 |
+
if (!isset($config["DEFAULT_TITLE"]))
|
2160 |
+
$config["DEFAULT_TITLE"] = "Live From The Field";
|
2161 |
+
if (!isset($config["INPUT_PROTOCOL"]))
|
2162 |
+
$config["INPUT_PROTOCOL"] = "pop3";
|
2163 |
+
if (!isset($config["IMAGE_PLACEHOLDER"]))
|
2164 |
+
$config["IMAGE_PLACEHOLDER"] = "#img%#";
|
2165 |
+
if (!isset($config["IMAGES_APPEND"]))
|
2166 |
+
$config["IMAGES_APPEND"] = true;
|
2167 |
+
if (!isset($config["ALLOW_SUBJECT_IN_MAIL"]))
|
2168 |
+
$config["ALLOW_SUBJECT_IN_MAIL"] = true;
|
2169 |
+
if (!isset($config["DROP_SIGNATURE"]))
|
2170 |
+
$config["DROP_SIGNATURE"] = true;
|
2171 |
+
if (!isset($config["MESSAGE_START"]))
|
2172 |
+
$config["MESSAGE_START"] = ":start";
|
2173 |
+
if (!isset($config["MESSAGE_END"]))
|
2174 |
+
$config["MESSAGE_END"] = ":end";
|
2175 |
+
if (!isset($config["FORWARD_REJECTED_MAIL"]))
|
2176 |
+
$config["FORWARD_REJECTED_MAIL"] = true;
|
2177 |
+
if (!isset($config["RETURN_TO_SENDER"]))
|
2178 |
+
$config["RETURN_TO_SENDER"] = false;
|
2179 |
+
if (!isset($config["CONFIRMATION_EMAIL"]))
|
2180 |
+
$config["CONFIRMATION_EMAIL"] = false;
|
2181 |
+
if (!isset($config["ALLOW_HTML_IN_SUBJECT"]))
|
2182 |
+
$config["ALLOW_HTML_IN_SUBJECT"] = true;
|
2183 |
+
if (!isset($config["ALLOW_HTML_IN_BODY"]))
|
2184 |
+
$config["ALLOW_HTML_IN_BODY"] = true;
|
2185 |
+
if (!isset($config["START_IMAGE_COUNT_AT_ZERO"]))
|
2186 |
+
$config["START_IMAGE_COUNT_AT_ZERO"] = false;
|
2187 |
+
if (!isset($config["MESSAGE_ENCODING"]))
|
2188 |
+
$config["MESSAGE_ENCODING"] = "UTF-8";
|
2189 |
+
if (!isset($config["MESSAGE_DEQUOTE"]))
|
2190 |
+
$config["MESSAGE_DEQUOTE"] = true;
|
2191 |
+
if (!isset($config["TURN_AUTHORIZATION_OFF"]))
|
2192 |
+
$config["TURN_AUTHORIZATION_OFF"] = false;
|
2193 |
+
if (!isset($config["CUSTOM_IMAGE_FIELD"]))
|
2194 |
+
$config["CUSTOM_IMAGE_FIELD"] = false;
|
2195 |
+
if (!isset($config["CONVERTNEWLINE"]))
|
2196 |
+
$config["CONVERTNEWLINE"] = false;
|
2197 |
+
if (!isset($config["SIG_PATTERN_LIST"]))
|
2198 |
+
$config["SIG_PATTERN_LIST"] = array('--','- --');
|
2199 |
+
if (!isset($config["BANNED_FILES_LIST"]))
|
2200 |
+
$config["BANNED_FILES_LIST"] = array();
|
2201 |
+
if (!isset($config["SUPPORTED_FILE_TYPES"]))
|
2202 |
+
$config["SUPPORTED_FILE_TYPES"] = array("video","application");
|
2203 |
+
if (!isset($config["AUTHORIZED_ADDRESSES"]))
|
2204 |
+
$config["AUTHORIZED_ADDRESSES"] = array();
|
2205 |
+
if (!isset($config["MAIL_SERVER"]))
|
2206 |
+
$config["MAIL_SERVER"] = NULL;
|
2207 |
+
if (!isset($config["MAIL_SERVER_PORT"]))
|
2208 |
+
$config["MAIL_SERVER_PORT"] = NULL;
|
2209 |
+
if (!isset($config["MAIL_USERID"]))
|
2210 |
+
$config["MAIL_USERID"] = NULL;
|
2211 |
+
if (!isset($config["MAIL_PASSWORD"]))
|
2212 |
+
$config["MAIL_PASSWORD"] = NULL;
|
2213 |
+
if (!isset($config["DEFAULT_POST_CATEGORY"]))
|
2214 |
+
$config["DEFAULT_POST_CATEGORY"] = NULL;
|
2215 |
+
if (!isset($config["DEFAULT_POST_TAGS"]))
|
2216 |
+
$config["DEFAULT_POST_TAGS"] = NULL;
|
2217 |
+
if (!isset($config["TIME_OFFSET"]))
|
2218 |
+
$config["TIME_OFFSET"] = get_option('gmt_offset');
|
2219 |
+
if (!isset($config["WRAP_PRE"]))
|
2220 |
+
$config["WRAP_PRE"] = 'no';
|
2221 |
+
if (!isset($config["CONVERTURLS"]))
|
2222 |
+
$config["CONVERTURLS"] = true;
|
2223 |
+
if (!isset($config["SHORTCODE"]))
|
2224 |
+
$config["SHORTCODE"] = false;
|
2225 |
+
if (!isset($config["ADD_META"]))
|
2226 |
+
$config["ADD_META"] = 'no';
|
2227 |
+
$config['ICON_SETS']=array('silver','black','white','custom', 'none');
|
2228 |
+
if (!isset($config["ICON_SET"]))
|
2229 |
+
$config["ICON_SET"] = 'silver';
|
2230 |
+
$config['ICON_SIZES']=array(32,48,64);
|
2231 |
+
if (!isset($config["ICON_SIZE"]))
|
2232 |
+
$config["ICON_SIZE"] = 32;
|
2233 |
+
if (!isset($config["AUDIOTEMPLATE"]))
|
2234 |
+
$config["AUDIOTEMPLATE"] =$simple_link;
|
2235 |
+
if (!isset($config["SELECTED_AUDIOTEMPLATE"]))
|
2236 |
+
$config['SELECTED_AUDIOTEMPLATE'] = 'simple_link';
|
2237 |
+
include('templates/audio_templates.php');
|
2238 |
+
$config['AUDIOTEMPLATES']=$audioTemplates;
|
2239 |
+
if (!isset($config["SELECTED_VIDEO1TEMPLATE"]))
|
2240 |
+
$config['SELECTED_VIDEO1TEMPLATE'] = 'simple_link';
|
2241 |
+
include('templates/video1_templates.php');
|
2242 |
+
$config['VIDEO1TEMPLATES']=$video1Templates;
|
2243 |
+
if (!isset($config["VIDEO1TEMPLATE"]))
|
2244 |
+
$config["VIDEO1TEMPLATE"] = $simple_link;
|
2245 |
+
if (!isset($config["VIDEO1TYPES"]))
|
2246 |
+
$config['VIDEO1TYPES'] = array('mp4', 'mpeg4', '3gp', '3gpp', '3gpp2',
|
2247 |
+
'3gp2', 'mov');
|
2248 |
+
if (!isset($config["AUDIOTYPES"]))
|
2249 |
+
$config['AUDIOTYPES'] = array('m4a', 'mp3', 'ogg', 'wav');
|
2250 |
+
if (!isset($config["SELECTED_VIDEO2TEMPLATE"]))
|
2251 |
+
$config['SELECTED_VIDEO2TEMPLATE'] = 'simple_link';
|
2252 |
+
include('templates/video2_templates.php');
|
2253 |
+
$config['VIDEO2TEMPLATES']=$video2Templates;
|
2254 |
+
if (!isset($config["VIDEO2TEMPLATE"]))
|
2255 |
+
$config["VIDEO2TEMPLATE"] = $simple_link;
|
2256 |
+
if (!isset($config["VIDEO2TYPES"]))
|
2257 |
+
$config['VIDEO2TYPES'] = array('x-flv');
|
2258 |
if (!isset($config["POST_STATUS"]))
|
2259 |
$config["POST_STATUS"] = 'publish';
|
2260 |
if (!isset($config["IMAGE_NEW_WINDOW"]))
|
2261 |
$config["IMAGE_NEW_WINDOW"] = false;
|
2262 |
if (!isset($config["FILTERNEWLINES"]))
|
2263 |
$config["FILTERNEWLINES"] = true;
|
2264 |
+
include('templates/image_templates.php');
|
2265 |
+
$config['IMAGETEMPLATES']=$imageTemplates;
|
2266 |
+
if (!isset($config["SELECTED_IMAGETEMPLATE"]))
|
2267 |
+
$config['SELECTED_IMAGETEMPLATE'] = 'wordpress_default';
|
2268 |
+
if (!isset($config["IMAGETEMPLATE"]))
|
2269 |
+
$config["IMAGETEMPLATE"] = $wordpress_default;
|
2270 |
+
if (!isset($config["SMTP"]))
|
2271 |
+
$config["SMTP"] = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2272 |
return($config);
|
2273 |
}
|
2274 |
/**
|
2277 |
*/
|
2278 |
function GetConfig() {
|
2279 |
$config = GetDBConfig();
|
|
|
|
|
|
|
|
|
|
|
|
|
2280 |
//These should only be modified if you are testing
|
2281 |
$config["DELETE_MAIL_AFTER_PROCESSING"] = true;
|
2282 |
$config["POST_TO_DB"] = true;
|
2283 |
$config["TEST_EMAIL"] = false;
|
2284 |
$config["TEST_EMAIL_ACCOUNT"] = "blogtest";
|
2285 |
$config["TEST_EMAIL_PASSWORD"] = "yourpassword";
|
2286 |
+
if (file_exists(POSTIE_ROOT . '/postie_test_variables.php')) {
|
2287 |
+
include(POSTIE_ROOT . '/postie_test_variables.php');
|
2288 |
+
}
|
2289 |
//include(POSTIE_ROOT . "/../postie-test.php");
|
2290 |
// These are computed
|
2291 |
+
$config["TIME_OFFSET"] = get_option('gmt_offset');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2292 |
$config["POSTIE_ROOT"] = POSTIE_ROOT;
|
|
|
|
|
|
|
|
|
|
|
2293 |
for ($i = 0; $i < count($config["AUTHORIZED_ADDRESSES"]); $i++) {
|
2294 |
$config["AUTHORIZED_ADDRESSES"][$i] = strtolower($config["AUTHORIZED_ADDRESSES"][$i]);
|
2295 |
}
|
2296 |
return $config;
|
2297 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2298 |
/**
|
2299 |
* Returns a list of config keys that should be arrays
|
2300 |
*@return array
|
2301 |
*/
|
2302 |
function GetListOfArrayConfig() {
|
2303 |
+
return(array('SUPPORTED_FILE_TYPES','AUTHORIZED_ADDRESSES',
|
2304 |
+
'SIG_PATTERN_LIST','BANNED_FILES_LIST', 'VIDEO1TYPES',
|
2305 |
+
'VIDEO2TYPES', 'AUDIOTYPES', 'SMTP'));
|
2306 |
}
|
2307 |
/**
|
2308 |
* Detects if they can do IMAP
|
2320 |
$function_list = array("iconv");
|
2321 |
return(HasFunctions($function_list,$display));
|
2322 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2323 |
/**
|
2324 |
* Handles verifing that a list of functions exists
|
2325 |
* @return boolean
|
2336 |
}
|
2337 |
return(true);
|
2338 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2339 |
/**
|
2340 |
* This function tests to see if postie is its own directory
|
2341 |
*/
|
2361 |
* This function handles setting up the basic permissions
|
2362 |
*/
|
2363 |
function PostieAdminPermissions() {
|
2364 |
+
global $wp_roles;
|
2365 |
+
$admin = $wp_roles->get_role("administrator");
|
2366 |
+
$admin->add_cap("config_postie");
|
2367 |
+
$admin->add_cap("post_via_postie");
|
2368 |
+
}
|
2369 |
+
function UpdatePostiePermissions($role_access, $unfiltered=true) {
|
2370 |
+
global $wp_roles;
|
2371 |
+
PostieAdminPermissions();
|
2372 |
+
if (!is_array($role_access)) {
|
2373 |
+
$role_access = array();
|
2374 |
+
}
|
2375 |
+
foreach($wp_roles->role_names as $roleId => $name) {
|
2376 |
+
$role = &$wp_roles->get_role($roleId);
|
2377 |
+
if ($roleId != "administrator") {
|
2378 |
+
if ($role_access[$roleId]) {
|
2379 |
+
$role->add_cap("post_via_postie");
|
2380 |
+
} else {
|
2381 |
+
$role->remove_cap("post_via_postie");
|
2382 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2383 |
}
|
2384 |
+
}
|
2385 |
}
|
2386 |
function DebugEmailOutput(&$email,&$mimeDecodedEmail) {
|
2387 |
+
$file = fopen("test_emails/" . $mimeDecodedEmail->headers["message-id"].".txt","w");
|
2388 |
+
fwrite($file, $email);
|
2389 |
+
fclose($file);
|
2390 |
+
$file = fopen("test_emails/" . $mimeDecodedEmail->headers["message-id"]."-mime.txt","w");
|
2391 |
+
fwrite($file, print_r($mimeDecodedEmail,true));
|
2392 |
+
fclose($file);
|
|
|
|
|
|
|
2393 |
}
|
2394 |
/**
|
2395 |
* This function provides a hook to be able to write special parses for provider emails that are difficult to work with
|
2396 |
* If you want to extend this functionality - write a new function and call it from here
|
2397 |
*/
|
2398 |
+
function SpecialMessageParsing(&$content, &$attachments, $config){
|
|
|
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;
|
2414 |
ReplaceImageCIDs($content,$attachments);
|
2415 |
}
|
2416 |
if (!$config['CUSTOM_IMAGE_FIELD']) {
|
2417 |
+
ReplaceImagePlaceHolders($content,$attachments["html"], $config);
|
2418 |
} else {
|
2419 |
$customImages=array();
|
2420 |
foreach ($attachments["html"] as $value) {
|
2421 |
+
preg_match("/src=['\"]([^'\"]*)['\"]/", $value, $matches);
|
2422 |
array_push($customImages,$matches[1]);
|
2423 |
}
|
2424 |
|
2447 |
}
|
2448 |
|
2449 |
}
|
2450 |
+
/* this is included in WP 2.8+. We are using our own (unmodified) version for
|
2451 |
+
backwards compatibility */
|
2452 |
+
if (!function_exists('get_user_by')) {
|
2453 |
+
function get_user_by($field, $value) {
|
2454 |
+
global $wpdb;
|
2455 |
+
|
2456 |
+
switch ($field) {
|
2457 |
+
case 'id':
|
2458 |
+
return get_userdata($value);
|
2459 |
+
break;
|
2460 |
+
case 'slug':
|
2461 |
+
$user_id = wp_cache_get($value, 'userslugs');
|
2462 |
+
$field = 'user_nicename';
|
2463 |
+
break;
|
2464 |
+
case 'email':
|
2465 |
+
$user_id = wp_cache_get($value, 'useremail');
|
2466 |
+
$field = 'user_email';
|
2467 |
+
break;
|
2468 |
+
case 'login':
|
2469 |
+
$value = sanitize_user( $value );
|
2470 |
+
$user_id = wp_cache_get($value, 'userlogins');
|
2471 |
+
$field = 'user_login';
|
2472 |
+
break;
|
2473 |
+
default:
|
2474 |
+
return false;
|
2475 |
+
}
|
2476 |
+
|
2477 |
+
if ( false !== $user_id )
|
2478 |
+
return get_userdata($user_id);
|
2479 |
+
|
2480 |
+
if ( !$user = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->users WHERE $field = %s", $value) ) )
|
2481 |
+
return false;
|
2482 |
+
|
2483 |
+
_fill_user($user);
|
2484 |
+
|
2485 |
+
return $user;
|
2486 |
+
}
|
2487 |
+
}
|
2488 |
+
|
2489 |
+
define('WP_POST_REVISIONS', $revisions);
|
2490 |
+
ini_set('memory_limit', $original_mem_limit);
|
2491 |
?>
|
postie.php
CHANGED
@@ -2,19 +2,29 @@
|
|
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://wordpress.org/extend/plugins/postie/other_notes'>Readme</a> for usage
|
6 |
-
Version: 1.
|
7 |
Author: Robert Felty
|
8 |
Author URI: http://blog.robfelty.com/
|
9 |
*/
|
10 |
|
11 |
/*
|
12 |
-
$Id: postie.php
|
13 |
* -= Requests Pending =-
|
14 |
* German Umlats don't work
|
|
|
15 |
* Problem with some mail server
|
16 |
* Multiple emails should tie to a single account
|
17 |
* Each user should be able to have a default category
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
* Test for calling from the command line
|
19 |
* Support userid/domain as a valid username
|
20 |
* WP-switcher not compatiable http://www.alexking.org/index.php?content=software/wordpress/content.php#wp_120
|
@@ -27,6 +37,28 @@ $Id: postie.php 118617 2009-05-18 01:52:54Z robfelty $
|
|
27 |
*/
|
28 |
|
29 |
//Older Version History is in the HISTORY file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
|
32 |
if (isset($_GET["postie_read_me"])) {
|
@@ -40,7 +72,8 @@ if (isset($_GET["postie_read_me"])) {
|
|
40 |
//Add Menu Configuration
|
41 |
if (is_admin()) {
|
42 |
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR ."postie-functions.php");
|
43 |
-
add_action("admin_menu","PostieMenu");
|
|
|
44 |
if(function_exists('load_plugin_textdomain')){
|
45 |
$plugin_dir = WP_PLUGIN_DIR . '/' . basename(dirname(__FILE__));
|
46 |
function postie_load_domain() {
|
@@ -50,7 +83,8 @@ if (is_admin()) {
|
|
50 |
add_action('init', 'postie_load_domain');
|
51 |
}
|
52 |
}
|
|
|
53 |
/* Version info
|
54 |
-
$Id: postie.php
|
55 |
*/
|
56 |
?>
|
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://wordpress.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.3.1
|
7 |
Author: Robert Felty
|
8 |
Author URI: http://blog.robfelty.com/
|
9 |
*/
|
10 |
|
11 |
/*
|
12 |
+
$Id: postie.php 148682 2009-08-24 18:17:18Z 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
|
20 |
+
* Setup poll
|
21 |
+
- web server
|
22 |
+
- mail clients
|
23 |
+
- plain/html
|
24 |
+
- phone/computer
|
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
|
37 |
*/
|
38 |
|
39 |
//Older Version History is in the HISTORY file
|
40 |
+
//error_reporting(E_ALL);
|
41 |
+
//ini_set("display_errors", 1);
|
42 |
+
|
43 |
+
define("POSTIE_ROOT",dirname(__FILE__));
|
44 |
+
define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
|
45 |
+
|
46 |
+
|
47 |
+
function postie_loadjs_add_page() {
|
48 |
+
$postiepage = add_options_page('Postie', 'Postie', 8, POSTIE_ROOT.'/postie.php', 'postie_loadjs_options_page');
|
49 |
+
add_action( "admin_print_scripts-$postiepage", 'postie_loadjs_admin_head' );
|
50 |
+
}
|
51 |
+
|
52 |
+
function postie_loadjs_options_page() {
|
53 |
+
require_once POSTIE_ROOT.'/config_form.php';
|
54 |
+
}
|
55 |
+
|
56 |
+
function postie_loadjs_admin_head() {
|
57 |
+
$plugindir = get_settings('home').'/wp-content/plugins/'.dirname(plugin_basename(__FILE__));
|
58 |
+
wp_enqueue_script('loadjs', $plugindir . '/js/simpleTabs.jquery.js');
|
59 |
+
echo '<link type="text/css" rel="stylesheet" href="' .get_bloginfo('url') .'/wp-content/plugins/postie/css/style.css" />'."\n";
|
60 |
+
echo '<link type="text/css" rel="stylesheet" href="' .get_bloginfo('url') .'/wp-content/plugins/postie/css/simpleTabs.css" />'."\n";
|
61 |
+
}
|
62 |
|
63 |
|
64 |
if (isset($_GET["postie_read_me"])) {
|
72 |
//Add Menu Configuration
|
73 |
if (is_admin()) {
|
74 |
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR ."postie-functions.php");
|
75 |
+
//add_action("admin_menu","PostieMenu");
|
76 |
+
add_action('admin_menu', 'postie_loadjs_add_page');
|
77 |
if(function_exists('load_plugin_textdomain')){
|
78 |
$plugin_dir = WP_PLUGIN_DIR . '/' . basename(dirname(__FILE__));
|
79 |
function postie_load_domain() {
|
83 |
add_action('init', 'postie_load_domain');
|
84 |
}
|
85 |
}
|
86 |
+
register_activation_hook(__FILE__, 'UpdateArrayConfig');
|
87 |
/* Version info
|
88 |
+
$Id: postie.php 148682 2009-08-24 18:17:18Z robfelty $
|
89 |
*/
|
90 |
?>
|
postieIMAP.php
CHANGED
@@ -21,6 +21,7 @@ class PostieIMAP {
|
|
21 |
var $_self_cert;
|
22 |
var $_tls_on;
|
23 |
var $_connection;
|
|
|
24 |
|
25 |
function PostieIMAP($protocol = "imap",$ssl_on = false,$self_cert = true) {
|
26 |
$this->_connected = false;
|
@@ -69,12 +70,12 @@ class PostieIMAP {
|
|
69 |
}
|
70 |
if (eregi("google",$server)) {
|
71 |
//Fix from Jim Hodgson http://www.jimhodgson.com/2006/07/19/postie/
|
72 |
-
$
|
73 |
}
|
74 |
else {
|
75 |
-
$
|
76 |
}
|
77 |
-
$this->_connection = imap_open($
|
78 |
|
79 |
if ($this->_connection) {
|
80 |
$this->_connected = true;
|
@@ -86,7 +87,9 @@ class PostieIMAP {
|
|
86 |
* @return integer
|
87 |
*/
|
88 |
function getNumberOfMessages() {
|
89 |
-
|
|
|
|
|
90 |
}
|
91 |
/**
|
92 |
* Gets the raw email message from the server
|
@@ -96,9 +99,14 @@ class PostieIMAP {
|
|
96 |
if ($index < 1 || $index > ($this->getNumberOfMessages() + 1)) {
|
97 |
die("Invalid IMAP/POP3 message index!");
|
98 |
}
|
99 |
-
$
|
100 |
-
$
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
102 |
}
|
103 |
/**
|
104 |
* Marks a message for deletion
|
21 |
var $_self_cert;
|
22 |
var $_tls_on;
|
23 |
var $_connection;
|
24 |
+
var $_server_string;
|
25 |
|
26 |
function PostieIMAP($protocol = "imap",$ssl_on = false,$self_cert = true) {
|
27 |
$this->_connected = false;
|
70 |
}
|
71 |
if (eregi("google",$server)) {
|
72 |
//Fix from Jim Hodgson http://www.jimhodgson.com/2006/07/19/postie/
|
73 |
+
$this->_server_string = "{".$server.":".$port.$option."}INBOX";
|
74 |
}
|
75 |
else {
|
76 |
+
$this->_server_string = "{".$server.":".$port.$option."}";
|
77 |
}
|
78 |
+
$this->_connection = imap_open($this->_server_string,$login,$password);
|
79 |
|
80 |
if ($this->_connection) {
|
81 |
$this->_connected = true;
|
87 |
* @return integer
|
88 |
*/
|
89 |
function getNumberOfMessages() {
|
90 |
+
//$status= imap_status($this->_connection,$this->_server_string, SA_UNSEEN);
|
91 |
+
return(imap_num_msg($this->_connection));
|
92 |
+
//return($status->unseen);
|
93 |
}
|
94 |
/**
|
95 |
* Gets the raw email message from the server
|
99 |
if ($index < 1 || $index > ($this->getNumberOfMessages() + 1)) {
|
100 |
die("Invalid IMAP/POP3 message index!");
|
101 |
}
|
102 |
+
$header_info = imap_headerinfo($this->_connection, $index);
|
103 |
+
if ($header_info->Recent=='N' || $header_info->Unseen=='U') {
|
104 |
+
$email = imap_fetchheader($this->_connection,$index);
|
105 |
+
$email .= imap_body($this->_connection,$index);
|
106 |
+
return($email);
|
107 |
+
} else {
|
108 |
+
return('already read');
|
109 |
+
}
|
110 |
}
|
111 |
/**
|
112 |
* Marks a message for deletion
|
postie_read_me.php
DELETED
@@ -1,7 +0,0 @@
|
|
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");?>
|
6 |
-
</pre>
|
7 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
postie_test.php
CHANGED
@@ -16,7 +16,7 @@ get_currentuserinfo();
|
|
16 |
}
|
17 |
?>
|
18 |
|
19 |
-
<?
|
20 |
$images = array("Test.png",
|
21 |
"Test.jpg",
|
22 |
"Test.gif");
|
@@ -31,17 +31,6 @@ get_currentuserinfo();
|
|
31 |
|
32 |
}
|
33 |
?>
|
34 |
-
<br/>
|
35 |
-
<?php
|
36 |
-
|
37 |
-
// if (!TestWPVersion()) {
|
38 |
-
// print("<h1>Warning!</h1>
|
39 |
-
// <p>Postie only works on on Word Press version 2.0 and above</p>");
|
40 |
-
// exit();
|
41 |
-
// }
|
42 |
-
?>
|
43 |
-
|
44 |
-
<br/>
|
45 |
<?php
|
46 |
|
47 |
if (!TestPostieDirectory()) {
|
@@ -54,10 +43,6 @@ get_currentuserinfo();
|
|
54 |
?>
|
55 |
|
56 |
<br/>
|
57 |
-
<h2>GD Library Test<h2>
|
58 |
-
<p>
|
59 |
-
<?php echo HasGDInstalled();?>
|
60 |
-
</p>
|
61 |
<h2>Iconv Library Test<h2>
|
62 |
<p><i>Only required if you want to support ISO-2022-JP</i>
|
63 |
<?php echo HasIconvInstalled();?>
|
@@ -123,98 +108,4 @@ get_currentuserinfo();
|
|
123 |
|
124 |
|
125 |
</table>
|
126 |
-
<h2>File Tests</h2>
|
127 |
-
|
128 |
-
<table>
|
129 |
-
<tr>
|
130 |
-
<th>Test</th>
|
131 |
-
<th>Result</th>
|
132 |
-
</tr>
|
133 |
-
<tr>
|
134 |
-
<th>Photos Directory Exists</th>
|
135 |
-
<td><?php echo (is_dir($config["REALPHOTOSDIR"]) ? "Yes" : "No"); ?></td>
|
136 |
-
</tr>
|
137 |
-
<tr>
|
138 |
-
<th>Files Directory Exists</th>
|
139 |
-
<td><?php echo (is_dir($config["REALFILESDIR"]) ? "Yes" : "No"); ?></td>
|
140 |
-
</tr>
|
141 |
-
<tr>
|
142 |
-
<th>Photos Directory Writable</th>
|
143 |
-
<td><?php echo (is_writable($config["REALPHOTOSDIR"]) ? "Yes" : "No"); ?></td>
|
144 |
-
</tr>
|
145 |
-
<tr>
|
146 |
-
<th>Files Directory Writable</th>
|
147 |
-
<td><?php echo (is_writable($config["REALFILESDIR"]) ? "Yes" : "No"); ?></td>
|
148 |
-
</tr>
|
149 |
-
|
150 |
-
<?php if ($config["USE_IMAGEMAGICK"]):?>
|
151 |
-
<tr>
|
152 |
-
<th>Convert exists</th>
|
153 |
-
<td><?php echo (file_exists($config["IMAGEMAGICK_CONVERT"]) ? "Yes" : "No"); ?></td>
|
154 |
-
</tr>
|
155 |
-
<tr>
|
156 |
-
<th>Identify exists</th>
|
157 |
-
<td><?php echo (file_exists($config["IMAGEMAGICK_IDENTIFY"]) ? "Yes" : "No"); ?></td>
|
158 |
-
</tr>
|
159 |
-
|
160 |
-
<?endif;?>
|
161 |
-
|
162 |
-
</table>
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
<h2>Image Tests</h2>
|
167 |
-
<p>Three images should be here - they are the test files</p>
|
168 |
-
<table>
|
169 |
-
<tr>
|
170 |
-
<td> </td>
|
171 |
-
<td>PNG</td>
|
172 |
-
<td>JPG</td>
|
173 |
-
<td>GIF</td>
|
174 |
-
</tr>
|
175 |
-
<tr>
|
176 |
-
<th>Plain Images</th>
|
177 |
-
<?php
|
178 |
-
foreach ($images as $image) {
|
179 |
-
$size = DetermineImageSize(POSTIE_ROOT . DIRECTORY_SEPARATOR . "test_files" . DIRECTORY_SEPARATOR .$image);
|
180 |
-
print("<td>$size[1] x $size[0]<br/>\n");
|
181 |
-
print("<img src='../wp-content/plugins/postie/test_files/$image' ></td>\n");
|
182 |
-
}
|
183 |
-
?>
|
184 |
-
</tr>
|
185 |
-
<tr>
|
186 |
-
<?php if($config["AUTO_SMART_SHARP"]){ ?>
|
187 |
-
<th> AutoSharpened <br/><p>WARNING-This feature takes a lot of processing power</p></th>
|
188 |
-
<?php
|
189 |
-
foreach ($images as $image) {
|
190 |
-
|
191 |
-
print("<td>");
|
192 |
-
|
193 |
-
ImageMagickSharpen(POSTIE_ROOT . DIRECTORY_SEPARATOR . "test_files" . DIRECTORY_SEPARATOR .$image,
|
194 |
-
$config["REALPHOTOSDIR"] ."Sharp-".$image);
|
195 |
-
print("<img src='".$config["URLPHOTOSDIR"]."/Sharp-".$image."'>");
|
196 |
-
print("</td>\n");
|
197 |
-
}
|
198 |
-
?>
|
199 |
-
</tr>
|
200 |
-
<?php }?>
|
201 |
-
<tr>
|
202 |
-
<th> Scaled & Rotated</th>
|
203 |
-
<?php
|
204 |
-
foreach ($images as $image) {
|
205 |
-
$result = ResizeImage(POSTIE_ROOT . DIRECTORY_SEPARATOR . "test_files" . DIRECTORY_SEPARATOR .$image,substr($image,-3,3));
|
206 |
-
|
207 |
-
RotateImages(90,array(
|
208 |
-
array(null,$config["REALPHOTOSDIR"] . $result[0],'jpg')
|
209 |
-
));
|
210 |
-
print("<td>");
|
211 |
-
$size = DetermineImageSize($config["REALPHOTOSDIR"] . DIRECTORY_SEPARATOR .$result[0]);
|
212 |
-
print("$size[1] x $size[0]<br\>\n");
|
213 |
-
print("<img src='".$config["URLPHOTOSDIR"].$result[0]."'>");
|
214 |
-
print("</td>\n");
|
215 |
-
}
|
216 |
-
?>
|
217 |
-
</tr>
|
218 |
-
</table>
|
219 |
-
|
220 |
</div>
|
16 |
}
|
17 |
?>
|
18 |
|
19 |
+
<?
|
20 |
$images = array("Test.png",
|
21 |
"Test.jpg",
|
22 |
"Test.gif");
|
31 |
|
32 |
}
|
33 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
<?php
|
35 |
|
36 |
if (!TestPostieDirectory()) {
|
43 |
?>
|
44 |
|
45 |
<br/>
|
|
|
|
|
|
|
|
|
46 |
<h2>Iconv Library Test<h2>
|
47 |
<p><i>Only required if you want to support ISO-2022-JP</i>
|
48 |
<?php echo HasIconvInstalled();?>
|
108 |
|
109 |
|
110 |
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
</div>
|
readme.html
ADDED
@@ -0,0 +1,182 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<h3>Installation</h3>
|
2 |
+
<ul>
|
3 |
+
<li>Either:
|
4 |
+
|
5 |
+
<ul>
|
6 |
+
<li>Put the postie.zip file in wp-content/plugins/ and unzip it</li>
|
7 |
+
</ul></li>
|
8 |
+
<li>Or:
|
9 |
+
|
10 |
+
<ul>
|
11 |
+
<li>Use the automatic installer (WP 2.7+)</li>
|
12 |
+
</ul></li>
|
13 |
+
<li>Login to WordPress as an administrator</li>
|
14 |
+
<li>Goto the Plugins tab in the WordPress Admin Site</li>
|
15 |
+
<li>Activate "Postie"</li>
|
16 |
+
<li>Goto to the "Settings" tab and click on the sub-tab "Postie" to configure it.</li>
|
17 |
+
<li>Make sure you enter the mailserver information correctly, including the type
|
18 |
+
of connection and the port number. Common port configurations:
|
19 |
+
|
20 |
+
<ul>
|
21 |
+
<li>pop3: 110 </li>
|
22 |
+
<li>pop3-ssl: 995</li>
|
23 |
+
<li>imap: 143</li>
|
24 |
+
<li>imap-ssl: 993</li>
|
25 |
+
</ul></li>
|
26 |
+
<li>(Postie ignores the settings under Settings->Writing->Writing-by-Email)</li>
|
27 |
+
</ul>
|
28 |
+
|
29 |
+
<h4>Automating checking e-mail</h4>
|
30 |
+
|
31 |
+
<p>If your site runs on a UNIX/linux server, and you have shell access, you can
|
32 |
+
enable mail checking using cron; if you don't know anything about cron, skip
|
33 |
+
to the cronless postie section.</p>
|
34 |
+
|
35 |
+
<p>Setup a cronjob to pull down the get_mail.php
|
36 |
+
Examples:</p>
|
37 |
+
|
38 |
+
<p>*/5 * * * * /usr/bin/lynx --source http://blog.robfelty.com/wp-content/plugins/postie/get_mail.php >/dev/null 2>&1</p>
|
39 |
+
|
40 |
+
<p>This fetches the mail every five minutes with lynx </p>
|
41 |
+
|
42 |
+
<p>*/10 * * * * /usr/bin/wget -O /dev/null http://blog.robfelty.com/wp-content/plugins/postie/get_mail.php >/dev/null 2>&1</p>
|
43 |
+
|
44 |
+
<p>This fetches the mail every ten minutes with wget </p>
|
45 |
+
|
46 |
+
<h4>Cronless Postie</h4>
|
47 |
+
|
48 |
+
<p>If you don't have access to cron, you can run postie without it.</p>
|
49 |
+
|
50 |
+
<ul>
|
51 |
+
<li>Activate the cronless postie plugin (it is included with the postie plugin,
|
52 |
+
so if you have downloaded postie, you don't need to download anything else</li>
|
53 |
+
<li>By default, cronless postie checks for new e-mail once every hour. To select
|
54 |
+
a different rate, change the cronless postie setting in the postie settings
|
55 |
+
page. </li>
|
56 |
+
<li>Note that timing with cronless postie is not very accurate. It depends
|
57 |
+
on people visiting your website. If you select to check every 10 minutes, but
|
58 |
+
you only get one visit every 30 minutes, then it might take 30 minutes for a
|
59 |
+
post to show up.</li>
|
60 |
+
</ul> <hr />
|
61 |
+
|
62 |
+
<h3>Usage</h3>
|
63 |
+
<ul>
|
64 |
+
<li>If you put in :start - the message processing won't start until it sees that string</li>
|
65 |
+
<li>If you put in :end - the message processing will stop once it sees that string</li>
|
66 |
+
<li>Posts can be delayed by adding a line with delayXdXhXm where X is a number.
|
67 |
+
|
68 |
+
<ul>
|
69 |
+
<li>delay:1d - 1 day</li>
|
70 |
+
<li>delay:1h - 1 hour</li>
|
71 |
+
<li>delay:1m - 1 minute</li>
|
72 |
+
<li>delay:1d2h4m - 1 day 2 hours 4m</li>
|
73 |
+
</ul></li>
|
74 |
+
<li>By putting comments:X in your message you can control if comments are allowed
|
75 |
+
|
76 |
+
<ul>
|
77 |
+
<li>comments:0 - means closed</li>
|
78 |
+
<li>comments:1 - means open</li>
|
79 |
+
<li>comments:2 - means registered only</li>
|
80 |
+
</ul></li>
|
81 |
+
<li>Replying to an e-mail gets posted as a comment.
|
82 |
+
|
83 |
+
<ul>
|
84 |
+
<li>For example, you e-mailed a post with the subject line "foo".
|
85 |
+
If you then send an e-mail with the subject line "Re: foo", it will
|
86 |
+
get posted as a comment to the "foo" post. This works by the subject
|
87 |
+
line, so if you have two posts with titles "foo", then the comment
|
88 |
+
will get placed in the more recent post.</li>
|
89 |
+
</ul></li>
|
90 |
+
<li>Custom excerpt
|
91 |
+
|
92 |
+
<ul>
|
93 |
+
<li>You can include a custom excerpt of an e-mail by putting it between
|
94 |
+
:excerptstart and :excerptend</li>
|
95 |
+
<li>You can include images in the excerpt by using the shortcode #eimg1#,
|
96 |
+
#eimg2# etc.</li>
|
97 |
+
</ul></li>
|
98 |
+
</ul>
|
99 |
+
|
100 |
+
<h4>Category and tag handling</h4>
|
101 |
+
|
102 |
+
<ul>
|
103 |
+
<li>If you put a category name in the subject with a : it will be used
|
104 |
+
as the category for the post</li>
|
105 |
+
<li>If you put a category id number in the subject with a : it will
|
106 |
+
be used as the category for the post</li>
|
107 |
+
<li><p>If you put the first part of a category name it will be posted in
|
108 |
+
the first category that the system finds that matches - so if you put</p>
|
109 |
+
|
110 |
+
<p>Subject: Gen: New News</p>
|
111 |
+
|
112 |
+
<p>The system will post that in General.</p></li>
|
113 |
+
<li><p>All of the above also applies if you put the category in brackets []</p></li>
|
114 |
+
<li><p>Using [] or you can post to multiple categories at once</p>
|
115 |
+
|
116 |
+
<p>Subject: [1] [Mo] [Br] My Subject</p>
|
117 |
+
|
118 |
+
<p>On my blog it would post to General (Id 1), Moblog, and Brewing all at one time</p></li>
|
119 |
+
<li><p>Using - or you can post to multiple categories at once</p>
|
120 |
+
|
121 |
+
<p>Subject: -1- -Mo- -Br- My Subject</p>
|
122 |
+
|
123 |
+
<p>On my blog it would post to General (Id 1), Moblog, and Brewing all at one time</p></li>
|
124 |
+
<li>You can add tags by adding a line in the body of the message like so:
|
125 |
+
tags: foo, bar</li>
|
126 |
+
<li>You can also set a default tag to be applied if no tags are included.</li>
|
127 |
+
</ul>
|
128 |
+
|
129 |
+
<h4>Image Handling</h4>
|
130 |
+
|
131 |
+
<ul>
|
132 |
+
<li>Allows you to attach images to your email and automatically post
|
133 |
+
them to your blog</li>
|
134 |
+
<li>You can publish images in the text of your message by using #img1#
|
135 |
+
#img2# - each one will be replaced with the HTML for the image
|
136 |
+
you attached</li>
|
137 |
+
<li><p>Captions - you can also add a caption like so:</p>
|
138 |
+
|
139 |
+
img1 caption='foo'
|
140 |
+
|
141 |
+
img2 caption='bar'
|
142 |
+
|
143 |
+
<p>Or, if you use IPTC captions, this caption will be used (adding a caption
|
144 |
+
in many photo editing programs (for example Picasa), will add an IPTC caption)</p></li>
|
145 |
+
<li><p>Image templates
|
146 |
+
Postie now uses the default wordpress image template, but you can specify a
|
147 |
+
different one if you wish.</p>
|
148 |
+
|
149 |
+
<p>You can also specify a custom image template. I use the following custom
|
150 |
+
template:</p>
|
151 |
+
|
152 |
+
<p><div class='imageframe alignleft'><a href='{IMAGE}'><img src="{THUMBNAIL}"
|
153 |
+
alt="{CAPTION}" title="{CAPTION}"
|
154 |
+
class="attachment" /></a><div
|
155 |
+
class='imagecaption'>{CAPTION}</div></div></p>
|
156 |
+
|
157 |
+
<ul>
|
158 |
+
<li>{THUMBNAIL} gets replaced with the url to the thumbnail image</li>
|
159 |
+
<li>{MEDIUM} gets replaced with the url to the medium-sized image</li>
|
160 |
+
<li>{LARGE} gets replaced with the url to the large-sized image</li>
|
161 |
+
<li>{FULL} gets replaced with the url to the full-sized image</li>
|
162 |
+
<li>{FILENAME} gets replaced with the absolute path to the full-size image</li>
|
163 |
+
<li>{RELFILENAME} gets replaced with the relative path to the full-size image</li>
|
164 |
+
<li>{CAPTION} gets replaced with the caption you specified (if any)</li>
|
165 |
+
<li>{WIDTH} gets replaced with width of the photo</li>
|
166 |
+
<li>{HEIGHT} gets replaced with the height of the photo</li>
|
167 |
+
</ul></li>
|
168 |
+
</ul>
|
169 |
+
|
170 |
+
<h4>Interoperability</h4>
|
171 |
+
|
172 |
+
<ul>
|
173 |
+
<li>If your mail client doesn't support setting the subject (nokia) you
|
174 |
+
can do so by putting #your title here# at the begining of your message</li>
|
175 |
+
<li>POP3,POP3-SSL,IMAP,IMAP-SSL now supported - last three require
|
176 |
+
php-imap support</li>
|
177 |
+
<li>The program understands enough about mime to not duplicate post
|
178 |
+
if you send an HTML and plain text message</li>
|
179 |
+
<li>Automatically confirms that you are installed correctly</li>
|
180 |
+
</ul>
|
181 |
+
<hr />
|
182 |
+
|
readme.txt
CHANGED
@@ -4,8 +4,8 @@ Donate link: http://blog.robfelty.com/plugins/postie
|
|
4 |
Plugin URI: http://blog.robfelty.com/plugins/postie
|
5 |
Tags: e-mail
|
6 |
Requires at least: 2.3
|
7 |
-
Tested up to: 2.8
|
8 |
-
Stable tag: 1.
|
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.
|
@@ -15,35 +15,52 @@ Postie offers many advanced features for posting to your blog via e-mail,
|
|
15 |
including the ability to assign categories by name, included pictures and
|
16 |
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 |
-
[FAQ](faq) page
|
20 |
|
|
|
21 |
|
22 |
-
|
23 |
-
*
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
== Installation ==
|
39 |
-
*
|
40 |
-
*
|
41 |
-
*
|
42 |
-
*
|
43 |
* Login to WordPress as an administrator
|
44 |
* Goto the Plugins tab in the WordPress Admin Site
|
45 |
* Activate "Postie"
|
46 |
-
* Goto to the "Settings" tab and click on the sub-tab "
|
47 |
* Make sure you enter the mailserver information correctly, including the type
|
48 |
of connection and the port number. Common port configurations:
|
49 |
* pop3: 110
|
@@ -83,18 +100,6 @@ If you don't have access to cron, you can run postie without it.
|
|
83 |
you only get one visit every 30 minutes, then it might take 30 minutes for a
|
84 |
post to show up.
|
85 |
|
86 |
-
== Options and Settings ==
|
87 |
-
|
88 |
-
* You can set the starting characters for you signature so that it
|
89 |
-
is removed from the posting message
|
90 |
-
* You can set a list of banned file names so if you provider adds
|
91 |
-
images to your post they don't show up in the blog
|
92 |
-
* If you post from an email address that is not a valid author the
|
93 |
-
email post will be forwarded to the admin
|
94 |
-
* You can control if you want HTML allowed in the body or subject
|
95 |
-
of your post
|
96 |
-
* Lets you set a default subject when you don't set one
|
97 |
-
* Defaults to posting to the default category you set in Word Press
|
98 |
|
99 |
== Usage ==
|
100 |
* If you put in :start - the message processing won't start until it sees that string
|
@@ -149,12 +154,8 @@ If you don't have access to cron, you can run postie without it.
|
|
149 |
* You can also set a default tag to be applied if no tags are included.
|
150 |
|
151 |
= Image Handling =
|
152 |
-
* Postie has a filter to make it easy to show full images on individual pages.
|
153 |
-
* Tells you if you have GD installed for resizing images
|
154 |
* Allows you to attach images to your email and automatically post
|
155 |
them to your blog
|
156 |
-
* Large images are automatically thumbnailed and linked to the larger
|
157 |
-
image (Requires GD)
|
158 |
* You can publish images in the text of your message by using #img1#
|
159 |
#img2# - each one will be replaced with the HTML for the image
|
160 |
you attached
|
@@ -166,9 +167,8 @@ If you don't have access to cron, you can run postie without it.
|
|
166 |
in many photo editing programs (for example Picasa), will add an IPTC caption)
|
167 |
|
168 |
* Image templates
|
169 |
-
|
170 |
-
|
171 |
-
full-size image in a new window.
|
172 |
|
173 |
You can also specify a custom image template. I use the following custom
|
174 |
template:
|
@@ -178,24 +178,15 @@ template:
|
|
178 |
class="attachment" /></a><div
|
179 |
class='imagecaption'>{CAPTION}</div></div>
|
180 |
|
181 |
-
* {IMAGE} gets replaced with the url to the full-size image
|
182 |
* {THUMBNAIL} gets replaced with the url to the thumbnail image
|
|
|
|
|
|
|
183 |
* {FILENAME} gets replaced with the absolute path to the full-size image
|
184 |
* {RELFILENAME} gets replaced with the relative path to the full-size image
|
185 |
* {CAPTION} gets replaced with the caption you specified (if any)
|
186 |
-
* {WIDTH} gets replaced with
|
187 |
-
* {HEIGHT} gets replaced with the
|
188 |
-
|
189 |
-
* Rotation - if you include the text
|
190 |
-
|
191 |
-
rotate:90
|
192 |
-
|
193 |
-
or any other number - all images in the message will be rotated for you.
|
194 |
-
|
195 |
-
* Images are renamed in a way that makes it impossible to accidentally
|
196 |
-
overwrite images you have already posted
|
197 |
-
|
198 |
-
|
199 |
|
200 |
= Interoperability =
|
201 |
* If your mail client doesn't support setting the subject (nokia) you
|
@@ -206,6 +197,9 @@ class='imagecaption'>{CAPTION}</div></div>
|
|
206 |
if you send an HTML and plain text message
|
207 |
* Automatically confirms that you are installed correctly
|
208 |
|
|
|
|
|
|
|
209 |
|
210 |
== Frequently Asked Questions ==
|
211 |
|
@@ -223,8 +217,7 @@ No. Do not add an iframe in your footer to get postie to check mail
|
|
223 |
periodically. To check e-mail periodically, either set-up a cron job, or use
|
224 |
cronless postie. See installation instructions
|
225 |
|
226 |
-
= My mail host requires SSL, but postie will not allow me to select pop3-ssl
|
227 |
-
or imap-ssl =
|
228 |
|
229 |
You must have php-imap installed on your server for this to work. Ask your
|
230 |
hosting provider about this.
|
@@ -262,13 +255,144 @@ johndoe@gmail.com to foo@gmail.com, it gets posted as "John Doe".
|
|
262 |
If you send an e-mail to your postie address from an e-mail address that is no
|
263 |
t linked to a wordpress user, it will get posted as admin.
|
264 |
|
265 |
-
|
266 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
267 |
* Fixed headers already sent bug
|
268 |
* Converted shortcode `<?` to proper `<?php` (thanks brack)
|
269 |
* Deleting mails after processing again
|
270 |
|
271 |
-
|
272 |
* Show empty categories for default category in options
|
273 |
* Image scaling fixed so that the smaller value of max image width and max
|
274 |
image height is used
|
@@ -276,9 +400,9 @@ t linked to a wordpress user, it will get posted as admin.
|
|
276 |
* Got rid of stupid mime tag (thanks Jeroen)
|
277 |
* No longer adding slashes before calling wp_insert_post
|
278 |
* When using custom image field, each image has a unique key
|
279 |
-
* Added FAQ
|
280 |
|
281 |
-
|
|
|
282 |
* Got rid of stupid version checking
|
283 |
* Improved cronless postie instructions and configuration
|
284 |
* Internationalization is working now
|
@@ -289,7 +413,7 @@ t linked to a wordpress user, it will get posted as admin.
|
|
289 |
* Can now use wildcards in excluding filenames
|
290 |
* Producing better quality thumbnails (thanks to robcarey)
|
291 |
|
292 |
-
|
293 |
* More video options:
|
294 |
* Can embed 3gp, mp4, mov videos
|
295 |
* Can specify video width, video height, player width, and player height
|
@@ -319,7 +443,7 @@ t linked to a wordpress user, it will get posted as admin.
|
|
319 |
prevent conflicts with other plugins such as registerplus
|
320 |
|
321 |
|
322 |
-
|
323 |
* Added option to have postie posts be pending review, published, or draft
|
324 |
* Settings panel only shows up for administrators
|
325 |
* Need not be user "admin" to modify settings or to post from non-registered
|
@@ -329,16 +453,16 @@ t linked to a wordpress user, it will get posted as admin.
|
|
329 |
* Will use IPTC captions if available
|
330 |
* Added option to replace newline characters with <br />
|
331 |
|
332 |
-
|
333 |
* Added more image options (open in new window, custom image template)
|
334 |
* can now add captions to images
|
335 |
* Can now add tags (including default tag option)
|
336 |
|
337 |
-
|
338 |
* Fixed delayed posting
|
339 |
* updated readme some
|
340 |
|
341 |
-
|
342 |
* now maintained by Robert Felty
|
343 |
* allow negative delays
|
344 |
* will glean author information from forwarded or redirected e*mails
|
@@ -347,294 +471,295 @@ t linked to a wordpress user, it will get posted as admin.
|
|
347 |
* fixed one syntax error
|
348 |
* added option to wrap posts and comments in <pre%gt; tags
|
349 |
|
|
|
|
|
|
|
350 |
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.
|
351 |
|
352 |
John didn't release any more versions at least up til July 2005. So I started accepting submissions and feature requests from people to help make the code better. In June/July 2005 I discovered a little plugin by Chris J Davis (http://www.chrisjdavis.org/cjd-notepad/) called notepad. I added a small feature to it (basically a bookmarklet). In the process I started looking at his code and realized how much you could do with the plugin system available in Word Press.
|
353 |
|
354 |
So I decided to make an offical fork. I put up an article on my blog asking for new names. I picked Postie. I then modified the code to be a proper plugin. And the rest is history :)
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
FEATURE:
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
FEATURE:
|
368 |
-
|
369 |
-
|
370 |
-
BUGFIX:
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
BUGFIX:
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
BUGFIX:
|
381 |
-
BUGFIX:
|
382 |
-
|
383 |
-
BUGFIX:
|
384 |
-
FEATURE: Added
|
385 |
-
BUGFIX:
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
FEATURE:
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
BUGFIX:
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
BUGFIX:
|
415 |
-
|
416 |
-
BUGFIX: Added
|
417 |
-
FEATURE: Added
|
418 |
-
|
419 |
-
FEATURE:
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
BUGFIX:
|
424 |
-
BUGFIX:
|
425 |
-
BUGFIX:
|
426 |
-
BUGFIX:
|
427 |
-
BUGFIX:
|
428 |
-
BUGFIX:
|
429 |
-
BUGFIX: HTML
|
430 |
-
BUGFIX:
|
431 |
-
BUGFIX:
|
432 |
-
BUGFIX:
|
433 |
-
BUGFIX: Postie
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
BUGFIX:
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
BUGFIX:
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
BUGFIX:
|
453 |
-
|
454 |
-
BUGFIX:
|
455 |
-
FEATURE:
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
BUGFIX:
|
471 |
-
|
472 |
-
|
473 |
-
BUGFIX:
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
BUGFIX:
|
482 |
-
BUGFIX:
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
BUGFIX:
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
BUGFIX:
|
495 |
-
FEATURE:
|
496 |
-
BUGFIX:
|
497 |
-
|
498 |
-
BUGFIX:
|
499 |
-
|
500 |
-
BUGFIX:
|
501 |
-
|
502 |
-
BUGFIX:
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
FEATURE:
|
512 |
-
|
513 |
-
FEATURE:
|
514 |
-
FEATURE: Added
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
BUGFIX:
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
FEATURE -
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
BUG FIX:
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
Bug Fix:
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
Fixed
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
Fixed bug:
|
586 |
-
|
587 |
-
|
588 |
-
Added
|
589 |
-
Added ability to
|
590 |
-
Added ability to
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
Added in
|
599 |
-
|
600 |
-
Added
|
601 |
-
|
602 |
-
|
603 |
-
Add
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
-
|
638 |
-
|
639 |
-
Version 0.1 - 2004-06
|
640 |
-
First release
|
4 |
Plugin URI: http://blog.robfelty.com/plugins/postie
|
5 |
Tags: e-mail
|
6 |
Requires at least: 2.3
|
7 |
+
Tested up to: 2.8
|
8 |
+
Stable tag: 1.3.1
|
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.
|
15 |
including the ability to assign categories by name, included pictures and
|
16 |
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? =
|
21 |
|
22 |
+
* 1.3.1 (2009.08.24)
|
23 |
+
* Changed GetContent filter to postie_content
|
24 |
+
* Added postie_subject filter
|
25 |
+
* Added database upgrade hook on activation
|
26 |
+
* Fixed bug where content would be empty if trying to remove signature,
|
27 |
+
and signature list was emtpy
|
28 |
+
|
29 |
+
* 1.3.0 (2009.08.14)
|
30 |
+
* Features
|
31 |
+
* Added mpeg4 to default list of videotypes
|
32 |
+
* Added support for KOI8-R character set (cyrillic)
|
33 |
+
* Added support for iso-8859-2 character set (eastern european)
|
34 |
+
* Added option to include custom icons for attachments
|
35 |
+
* Added option to send confirmation message to sender
|
36 |
+
* Enhanced e-mails for unauthorized users
|
37 |
+
* Added option to send unauthorized e-mail back to sender
|
38 |
+
* Added option to only allow e-mails from a specified list of smtp
|
39 |
+
servers
|
40 |
+
* Added option to use shortcode for embedding videos (works with the
|
41 |
+
videos plugin http://www.daburna.de/download/videos-plugin.zip
|
42 |
+
* Better handling of comment authors (thanks to Petter for suggestion)
|
43 |
+
* Simplified message options (now includes an advanced options section)
|
44 |
+
* Added filter ability for post content
|
45 |
+
* Bug fixes
|
46 |
+
* No longer including wp-config.php
|
47 |
+
* If tmpdir is not writable, try a different tmpdir
|
48 |
+
* More subject encoding fixes
|
49 |
+
* Updated image templates, which were causing problems for cron
|
50 |
+
* Fixed in text captions
|
51 |
+
* Fixed SQL problems when updating options
|
52 |
+
* Fixed name clashes with other plugins
|
53 |
+
* Fixed custom image field
|
54 |
|
55 |
== Installation ==
|
56 |
+
* Either:
|
57 |
+
* Put the postie.zip file in wp-content/plugins/ and unzip it
|
58 |
+
* Or:
|
59 |
+
* Use the automatic installer (WP 2.7+)
|
60 |
* Login to WordPress as an administrator
|
61 |
* Goto the Plugins tab in the WordPress Admin Site
|
62 |
* Activate "Postie"
|
63 |
+
* Goto to the "Settings" tab and click on the sub-tab "Postie" to configure it.
|
64 |
* Make sure you enter the mailserver information correctly, including the type
|
65 |
of connection and the port number. Common port configurations:
|
66 |
* pop3: 110
|
100 |
you only get one visit every 30 minutes, then it might take 30 minutes for a
|
101 |
post to show up.
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
|
104 |
== Usage ==
|
105 |
* If you put in :start - the message processing won't start until it sees that string
|
154 |
* You can also set a default tag to be applied if no tags are included.
|
155 |
|
156 |
= Image Handling =
|
|
|
|
|
157 |
* Allows you to attach images to your email and automatically post
|
158 |
them to your blog
|
|
|
|
|
159 |
* You can publish images in the text of your message by using #img1#
|
160 |
#img2# - each one will be replaced with the HTML for the image
|
161 |
you attached
|
167 |
in many photo editing programs (for example Picasa), will add an IPTC caption)
|
168 |
|
169 |
* Image templates
|
170 |
+
Postie now uses the default wordpress image template, but you can specify a
|
171 |
+
different one if you wish.
|
|
|
172 |
|
173 |
You can also specify a custom image template. I use the following custom
|
174 |
template:
|
178 |
class="attachment" /></a><div
|
179 |
class='imagecaption'>{CAPTION}</div></div>
|
180 |
|
|
|
181 |
* {THUMBNAIL} gets replaced with the url to the thumbnail image
|
182 |
+
* {MEDIUM} gets replaced with the url to the medium-sized image
|
183 |
+
* {LARGE} gets replaced with the url to the large-sized image
|
184 |
+
* {FULL} gets replaced with the url to the full-sized image
|
185 |
* {FILENAME} gets replaced with the absolute path to the full-size image
|
186 |
* {RELFILENAME} gets replaced with the relative path to the full-size image
|
187 |
* {CAPTION} gets replaced with the caption you specified (if any)
|
188 |
+
* {WIDTH} gets replaced with width of the photo
|
189 |
+
* {HEIGHT} gets replaced with the height of the photo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
= Interoperability =
|
192 |
* If your mail client doesn't support setting the subject (nokia) you
|
197 |
if you send an HTML and plain text message
|
198 |
* Automatically confirms that you are installed correctly
|
199 |
|
200 |
+
== Screenshots ==
|
201 |
+
|
202 |
+
1. Postie options (showing video and audio templates)
|
203 |
|
204 |
== Frequently Asked Questions ==
|
205 |
|
217 |
periodically. To check e-mail periodically, either set-up a cron job, or use
|
218 |
cronless postie. See installation instructions
|
219 |
|
220 |
+
= My mail host requires SSL, but postie will not allow me to select pop3-ssl or imap-ssl =
|
|
|
221 |
|
222 |
You must have php-imap installed on your server for this to work. Ask your
|
223 |
hosting provider about this.
|
255 |
If you send an e-mail to your postie address from an e-mail address that is no
|
256 |
t linked to a wordpress user, it will get posted as admin.
|
257 |
|
258 |
+
= Images aren't showing up at all? =
|
259 |
+
|
260 |
+
There are a couple possible reasons for this. First, check to see if you can
|
261 |
+
add an image through wordpress's normal posting mechanism. If not, then there
|
262 |
+
is probably 1 or 2 problems:
|
263 |
+
1. Your server does not have the php-gd library installed. Ask your hosting
|
264 |
+
provider about this.
|
265 |
+
|
266 |
+
2. Your wp-content/uploads directory is not writable by the webserver. Make
|
267 |
+
sure that it is
|
268 |
+
|
269 |
+
= Can I delete the wp-files directory needed by postie version <1.3.0? =
|
270 |
+
|
271 |
+
If you have posts published already by older versions of postie, getting rid
|
272 |
+
of those directories will delete any files you might have had associated with
|
273 |
+
those old posts. If you don't have any such posts, then you can safely delete
|
274 |
+
them.
|
275 |
+
|
276 |
+
= How can I get rid of stupid stuff my e-mail provider adds to my messages? =
|
277 |
+
|
278 |
+
To strip off stuff that they add at the beginning of a message, start your
|
279 |
+
post with :start
|
280 |
+
|
281 |
+
To strip off stuff that they add at the end of a message, end your
|
282 |
+
post with :end
|
283 |
+
|
284 |
+
= How can I add custom attachment icons? =
|
285 |
+
|
286 |
+
Simply upload the icons you want to the postie/icons/custom directory. You
|
287 |
+
must name the icons according to the following scheme:
|
288 |
+
{filetype}-{size}.png
|
289 |
+
|
290 |
+
For example, for word documents, you could use:
|
291 |
+
|
292 |
+
`doc-32.png`
|
293 |
+
|
294 |
+
for a 32x32 pixel icon. (You can actually create any size icon you want, but
|
295 |
+
if you name it 32, then it will only be used if you select to use size 32
|
296 |
+
icons)
|
297 |
+
|
298 |
+
See the other directories in icons for more examples.
|
299 |
+
|
300 |
+
Currently the following filetypes are supported:
|
301 |
+
|
302 |
+
* doc - microsoft word (including docx)
|
303 |
+
* ppt - microsoft powerpoint (including pptx)
|
304 |
+
* xls - microsoft excel (including xlsx)
|
305 |
+
* numbers - iWork numbres spreadsheet
|
306 |
+
* pages - iWork pages document
|
307 |
+
* key - iWork keynote presentation
|
308 |
+
* pdf - portable document format
|
309 |
+
* rtf - rich text format
|
310 |
+
* txt - plain text document
|
311 |
+
|
312 |
+
= Can I add special text to the body of the post when using postie? =
|
313 |
+
|
314 |
+
Yes. You can create your own function, and use the postie_post filter
|
315 |
+
Two short examples are included in the filterPostie.php file
|
316 |
+
|
317 |
+
= Can I add special text to the title of the post when using postie? =
|
318 |
+
|
319 |
+
Yes. You can create your own function, and use the postie_post filter
|
320 |
+
Two short examples are included in the filterPostie.php file
|
321 |
+
|
322 |
+
|
323 |
+
== CHANGELOG ==
|
324 |
+
|
325 |
+
= 1.3.1 (2009.08.24) =
|
326 |
+
* Changed GetContent filter to postie_post
|
327 |
+
* Added database upgrade hook on activation
|
328 |
+
* Fixed bug where content would be empty if trying to remove signature,
|
329 |
+
and signature list was emtpy
|
330 |
+
* Updated FAQ and readme
|
331 |
+
|
332 |
+
= 1.3.0 (2009.08.14) =
|
333 |
+
* Features
|
334 |
+
* Added mpeg4 to default list of videotypes
|
335 |
+
* Added support for KOI8-R character set (cyrillic)
|
336 |
+
* Added support for iso-8859-2 character set (eastern european)
|
337 |
+
* Added option to include custom icons for attachments
|
338 |
+
* Added option to send confirmation message to sender
|
339 |
+
* Enhanced e-mails for unauthorized users
|
340 |
+
* Added option to send unauthorized e-mail back to sender
|
341 |
+
* Added option to only allow e-mails from a specified list of smtp
|
342 |
+
servers
|
343 |
+
* Added option to use shortcode for embedding videos (works with the
|
344 |
+
videos plugin http://www.daburna.de/download/videos-plugin.zip
|
345 |
+
* Better handling of comment authors (thanks to Petter for suggestion)
|
346 |
+
* Simplified message options (now includes an advanced options section)
|
347 |
+
* Added filter ability for post content
|
348 |
+
* Bug fixes
|
349 |
+
* No longer including wp-config.php
|
350 |
+
* If tmpdir is not writable, try a different tmpdir
|
351 |
+
* More subject encoding fixes
|
352 |
+
* Updated image templates, which were causing problems for cron
|
353 |
+
* Fixed in text captions
|
354 |
+
* Fixed SQL problems when updating options
|
355 |
+
* Fixed name clashes with other plugins
|
356 |
+
* Fixed custom image field
|
357 |
+
|
358 |
+
= 1.3.beta (2009.07.01) =
|
359 |
+
* Mores fixes for character issues in subject
|
360 |
+
* Now handling Windows-1256 (arabic) character set
|
361 |
+
* Fixed image uploading on windows servers
|
362 |
+
* Fixed replying to message adds comment
|
363 |
+
* Uploading pictures via MMS should now work
|
364 |
+
* Fixed some issues with e-mails from outloook 12
|
365 |
+
* Greatly reduced number of database queries
|
366 |
+
* No longer requiring config_handler.php
|
367 |
+
|
368 |
+
= 1.3.alpha (2009.06.05) =
|
369 |
+
* Now using default wordpress image and upload handling, which means:
|
370 |
+
* No more creating special directories for postie
|
371 |
+
* No more confusion about imagemagick
|
372 |
+
* Can now use the [gallery] feature of wordpress
|
373 |
+
* Attachments are now connected to posts in the database
|
374 |
+
* All image resizing uses wordpress's default settings (under media)
|
375 |
+
* Configuration, settings and documentation improvements
|
376 |
+
* Completely redesigned settings page (mostly thanks to Rainman)
|
377 |
+
* Reset configuration no longer deletes mailserver settings
|
378 |
+
* Now including help files and faq directly in settings page
|
379 |
+
* More media features
|
380 |
+
* Automatically turn links to youtube into an embedded player
|
381 |
+
* Added option to embed audio files with custom templates
|
382 |
+
* Video options are now template based
|
383 |
+
* Image options are now solely template based, with several new default
|
384 |
+
templates
|
385 |
+
* Bug fixes
|
386 |
+
* Uploading images from vodafone phones should now work
|
387 |
+
* Correctly handling Windows-1252 encoding
|
388 |
+
* Correctly handling non-ascii characters in subject line
|
389 |
+
|
390 |
+
= 1.2.3 (2009.05.17) =
|
391 |
* Fixed headers already sent bug
|
392 |
* Converted shortcode `<?` to proper `<?php` (thanks brack)
|
393 |
* Deleting mails after processing again
|
394 |
|
395 |
+
= 1.2.2 (2009.05.15) =
|
396 |
* Show empty categories for default category in options
|
397 |
* Image scaling fixed so that the smaller value of max image width and max
|
398 |
image height is used
|
400 |
* Got rid of stupid mime tag (thanks Jeroen)
|
401 |
* No longer adding slashes before calling wp_insert_post
|
402 |
* When using custom image field, each image has a unique key
|
|
|
403 |
|
404 |
+
|
405 |
+
= 1.2.1 (2009.05.07) =
|
406 |
* Got rid of stupid version checking
|
407 |
* Improved cronless postie instructions and configuration
|
408 |
* Internationalization is working now
|
413 |
* Can now use wildcards in excluding filenames
|
414 |
* Producing better quality thumbnails (thanks to robcarey)
|
415 |
|
416 |
+
= 1.2 (2009.04.22) =
|
417 |
* More video options:
|
418 |
* Can embed 3gp, mp4, mov videos
|
419 |
* Can specify video width, video height, player width, and player height
|
443 |
prevent conflicts with other plugins such as registerplus
|
444 |
|
445 |
|
446 |
+
= 1.1.5 (2009.03.10) =
|
447 |
* Added option to have postie posts be pending review, published, or draft
|
448 |
* Settings panel only shows up for administrators
|
449 |
* Need not be user "admin" to modify settings or to post from non-registered
|
453 |
* Will use IPTC captions if available
|
454 |
* Added option to replace newline characters with <br />
|
455 |
|
456 |
+
= 1.1.4 (2009.03.06) =
|
457 |
* Added more image options (open in new window, custom image template)
|
458 |
* can now add captions to images
|
459 |
* Can now add tags (including default tag option)
|
460 |
|
461 |
+
= 1.1.3 (2009.02.20) =
|
462 |
* Fixed delayed posting
|
463 |
* updated readme some
|
464 |
|
465 |
+
= 1.1.2 (2008.07.12) =
|
466 |
* now maintained by Robert Felty
|
467 |
* allow negative delays
|
468 |
* will glean author information from forwarded or redirected e*mails
|
471 |
* fixed one syntax error
|
472 |
* added option to wrap posts and comments in <pre%gt; tags
|
473 |
|
474 |
+
|
475 |
+
= 1.1.1 =
|
476 |
+
|
477 |
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.
|
478 |
|
479 |
John didn't release any more versions at least up til July 2005. So I started accepting submissions and feature requests from people to help make the code better. In June/July 2005 I discovered a little plugin by Chris J Davis (http://www.chrisjdavis.org/cjd-notepad/) called notepad. I added a small feature to it (basically a bookmarklet). In the process I started looking at his code and realized how much you could do with the plugin system available in Word Press.
|
480 |
|
481 |
So I decided to make an offical fork. I put up an article on my blog asking for new names. I picked Postie. I then modified the code to be a proper plugin. And the rest is history :)
|
482 |
+
* BUGFIX -problem with subject
|
483 |
+
* BUGFIX -cronless postie typo
|
484 |
+
|
485 |
+
= 1.1 =
|
486 |
+
* FEATURE: Updated and tested with WordPress 2.1
|
487 |
+
* BUGFIX:Removed deprecated functions
|
488 |
+
* FEATURE: Cronless Postie now uses the WordPress native Psuedo Cron.
|
489 |
+
|
490 |
+
= 1.0 =
|
491 |
+
* BUGFIX: TestWPVersion broke with 2.1
|
492 |
+
* FEATURE: end: now marks the end of a message (Dan Cunningham)
|
493 |
+
* FEATURE: Better Readme (Michael Rasmussen)
|
494 |
+
* FEATURE: Smart Sharpen Option -EXPERIMENTAL- (Jonas Rhodin)
|
495 |
+
* BUGFIX: Issue with google imap fixed (Jim Hodgson)
|
496 |
+
* BUGFIX: Fixed espacing issue in subjects (Paul Clip)
|
497 |
+
* BUGFIX: Typo in Div fixed (phil)
|
498 |
+
|
499 |
+
= 0.9.9.3.2 =
|
500 |
+
* BUGFIX: Typo
|
501 |
+
= 0.9.9.3.1 =
|
502 |
+
* BUGFIX: Removed debugging code
|
503 |
+
|
504 |
+
= 0.9.9.3 =
|
505 |
+
* BUGFIX: If your email address matches an existing user - then it will post as that user - even if you allow anyone to post.
|
506 |
+
* BUGFIX: Replaced get_settings('home') with get_settings('siteurl')
|
507 |
+
* BUGFIX: Better handling for Japanese charactersets - Thanks to http://www.souzouzone.jp/blog/archives/009531.html
|
508 |
+
* BUGFIX: Better thumbnail window opening code - thanks to Gabi & Duntello!
|
509 |
+
* FEATURE: Added an option to set the MAX Height of an image - idea from Duntello
|
510 |
+
* BUGFIX: Modified the FilterNewLines for better flowed text handling - You now HAVE TO PUT TWO NEW LINES to end a paragraph.
|
511 |
+
* FEATURE: Added new CSS tags to support positioning images/attachments/3gp videos
|
512 |
+
* BUGFIX: Tries to use the date in the message (Thanks Ravan) I tried this once before and it never worked - hopefully this time it will.
|
513 |
+
* BUGFIX: Added a workaround to fix the problem with Subscribe2 - it will now notify on posts that are not set to show up in the future.
|
514 |
+
|
515 |
+
|
516 |
+
|
517 |
+
= 0.9.9.2 =
|
518 |
+
* BUGFIX: Looks for the NOOP error and disgards it
|
519 |
+
* FEATURE: Postie now detects the version of WordPress being used
|
520 |
+
* FEATURE: Smarter Parsing of VodaPhone
|
521 |
+
* FEATURE: Easy place to add new code to handle other brain-dead mail clients
|
522 |
+
* BUGFIX: Handles insertion of single quotes properly
|
523 |
+
* BUGFIX: Thumbnails should now link properly
|
524 |
+
|
525 |
+
= 0.9.9.1 =
|
526 |
+
* BUGFIX: Needed a strtolower in places to catch all iso-8859 - thx to Gitte Wange for the catch
|
527 |
+
* BUGFIX: Fixed issue with the category not being posted properly
|
528 |
+
|
529 |
+
= 0.9.9 =
|
530 |
+
* UPDATE TO WP 2.0
|
531 |
+
* BUGFIX: Config Page now works
|
532 |
+
* FEATURES: Supports role based posting
|
533 |
+
* BUGFIX: Posting updates the category counts.
|
534 |
+
|
535 |
+
= 0.9.8.6 =
|
536 |
+
* BUGFIX: Fixed problems with config page <%php became <?php
|
537 |
+
*
|
538 |
+
= 0.9.8.5 =
|
539 |
+
* BUGFIX: onClick changed to onclick
|
540 |
+
* BUGFIX: strolower added to test for iso - thanks daniele
|
541 |
+
* BUGFIX: Added a class to the 3gp video tags
|
542 |
+
* FEATURE: Added the option to put the images before the article
|
543 |
+
* BUGFIX: Added in selection for charsets - thanks Psykotik - this may cause problems for other encodings
|
544 |
+
* FEATURE: Added option to turn of quoted printable decoding
|
545 |
+
* FEATURE: :start tag - now postie looks for this tag before looking for you message - handy if your service provider prepends a message
|
546 |
+
* FEATURE: Template for translation now included
|
547 |
+
= 0.9.8.4 =
|
548 |
+
* BUGFIX: Fixed problem with config_form.php - select had "NULL" instead of ""
|
549 |
+
* BUGFIX: 3g2 now supported
|
550 |
+
* BUGFIX: More line break issues addressed
|
551 |
+
* BUGFIX: QuickTime controls are now visible even if the movie is done playing
|
552 |
+
* BUGFIX: Email addresses in the format <some@domain.com> (Full Name) supported
|
553 |
+
* BUGFIX: Some images that were not being resized - are now
|
554 |
+
* BUGFIX: HTML problems - if you posted plain text with HTML on it ignored all images
|
555 |
+
* BUGFIX: The test system blew up on the thumbnails
|
556 |
+
* BUGFIX: Selected HTML for preferred text is now shown in the config form properly
|
557 |
+
* BUGFIX: Postie now complains if it is not in its own directory
|
558 |
+
* BUGFIX: Postie doesn't include PEAR if it is already available
|
559 |
+
* BUGFIX: In Test mode rejected emails are simply dropped
|
560 |
+
* BUGFIX: Markdown messes up Postie - it will warn you if you turn it on.
|
561 |
+
*
|
562 |
+
= 0.9.8.3 =
|
563 |
+
* BUGFIX: Fixed issue with the line feed replacement
|
564 |
+
* BUGFIX: Added Banned File Config back in
|
565 |
+
* FEATURE: Added in a link around 3gp video embedded via QT
|
566 |
+
* BUGFIX: Email that has both Plain and HTML content will show the HTML content and not the plain if html is preferred
|
567 |
+
|
568 |
+
= 0.9.8.2 =
|
569 |
+
* BUGFIX: Fixed an extra new line after attachin non-image files.
|
570 |
+
* BUGFIX: The Test system now displays any missing gd functions
|
571 |
+
* BUGFIX: The test system was only using ImageMagick
|
572 |
+
|
573 |
+
= 0.9.8.1 =
|
574 |
+
* BUGFIX: The test images are now included in the zip
|
575 |
+
|
576 |
+
= 0.9.8 =
|
577 |
+
* BUGFIX: New Lines detected and handled properly in cases where the mail client doesn't put a space before the new line (Miss Distance)
|
578 |
+
* BUGFIX: 3gp mime type added (Paco Cotera)
|
579 |
+
* BUGFIX: Authorized Email Addresses are not case-insensitive
|
580 |
+
* FEATURE: The larger image now does a proper pop up
|
581 |
+
* BUGFIX: Fixed Timeing Issue - turns out it wasn't reading the db at all
|
582 |
+
* FEATURE: New Test Screen - to help track down problems
|
583 |
+
|
584 |
+
= 0.9.7 =
|
585 |
+
* BUGFIX: removed all short tags
|
586 |
+
* BUGFIX: There were spacing issues in the way I wrote the QT embed statements
|
587 |
+
* FEATURE: Added calls to WP-Cron - should work with that properly now if you activate Cronless Postie
|
588 |
+
* FEATURE: ImageMagick version works without any calls to GD
|
589 |
+
* BUGFIX: Postie now correctly handles cases wjere tjere are multiple blogs in one db
|
590 |
+
* BUGFIX: Turned off warnings when using without GD
|
591 |
+
* FEATURE: add the rotate:X to your message to rotate all images
|
592 |
+
* FEATURE: new filter_postie_thumbnail_with_full which makes it easy to show a thumbnail on the front page but full image on the single page - see FAQ
|
593 |
+
|
594 |
+
= 0.9.6 =
|
595 |
+
* BUGFIX: handles email addresses that are no name and just <email@email.com> (Steve Cooley Reported)
|
596 |
+
* FEATURE: Basic support for embedding flash files
|
597 |
+
* BUGFIX: Postie now handles creating the correct URL on non Unix platforms
|
598 |
+
* BUGFIX: Fixed problem with file attachments not being put in the right place.
|
599 |
+
* FEATURE: You can now choose to use imagemagick convert to handle making thumbnails
|
600 |
+
* BUGFIX: Rewrote Cronless Postie to use direct sockets
|
601 |
+
* BUGFIX: Time offset is now settable just for Postie - hopefully this will fix problems for cases where the normal time offset doesn't work properly.
|
602 |
+
* FEATURE: First draft of frame for a 3GP video
|
603 |
+
* FEATURE: Option to embed 3GP in QuickTime Controller.
|
604 |
+
|
605 |
+
= 0.9.5.2 =
|
606 |
+
* BUGFIX: gmt varialble not being set correctly
|
607 |
+
* BUGFIX: Changed the name of the Check Mail button to fix an issue with mod_security
|
608 |
+
* BUGFIX: Fixed issue with Cronless-Postie
|
609 |
+
* BUGFIX: There was an argument passed by reference incorrectly
|
610 |
+
* FEATURE: Added in Cronless Postie Readme
|
611 |
+
* FEATURE: Added in Postie Readme
|
612 |
+
|
613 |
+
= 0.9.5.1 =
|
614 |
+
* BUGFIX: Confirmed POP3-SSL on debian-3.0
|
615 |
+
* BUGFIX: Updated the plugin version
|
616 |
+
* BUGFIX: Stopped displaying the email account
|
617 |
+
*
|
618 |
+
= 0.9.5 =
|
619 |
+
* BUGFIX: Postie handles cases where you do not have GD
|
620 |
+
* FEATURE: You can now set the access level for posting - so other people can use the gate way
|
621 |
+
* BUGFIX: Fixed issue when admininstrator email is not tied to a user account.
|
622 |
+
* FEATURE: Can now reset all Postie configurations back to defaults
|
623 |
+
* BUGFIX: HTML Emails with embedded images are now handled properly.
|
624 |
+
* BUGFIX: The time difference should work correctly now
|
625 |
+
* BUGFIX: Postie's configs are completely seperate from Writing-By-Mail
|
626 |
+
* FEATURE: Warning if you use Gmail to make sure you turn on POP support
|
627 |
+
* BUGFIX: Manual Check Mail Button in interface
|
628 |
+
* BUGFIX: fixed issue of compatability with cjd-notepad
|
629 |
+
* BUGFIX: Windows Works Now
|
630 |
+
|
631 |
+
|
632 |
+
= 0.9.4 =
|
633 |
+
* BUGFIX: Cronless Postie - fixed the include statement
|
634 |
+
* BUGFIX: Authorized Addresses now supports a single address
|
635 |
+
* FEATURE: All configuration in Postie done in a single screen
|
636 |
+
* FEATURE: AUTHORIZATION can be completely overridden
|
637 |
+
* BUGFIX: line 1159 - didn't handle cases where the table didn't exist already very well
|
638 |
+
* FEATURE: Detects if you can do IMAP
|
639 |
+
* FEATURE: Added IMAP Support
|
640 |
+
* FEATURE: Added IMAP-SSL Support
|
641 |
+
* FEATURE: Added POP3-SSL Support
|
642 |
+
|
643 |
+
= 0.9.3 =
|
644 |
+
* Bug fixes for IIS
|
645 |
+
= 0.9.2 =
|
646 |
+
* Moved to more of a DIRECTORY_SEPARATOR structure
|
647 |
+
= 0.9.1 =
|
648 |
+
* Added a define to fix a problem with over including
|
649 |
+
= 0.9 =
|
650 |
+
* Converted to an honest to god plugin
|
651 |
+
* BUGFIX: If you put a single category:subject it now works
|
652 |
+
* BUGFIX: ? Special characters may be supported? The test post now shows a lot of umlats and accents?
|
653 |
+
* BUGFIX: The last ] in a subject with categories is now filtered out
|
654 |
+
* FEATURE: -1- subject - will put the post in category 1
|
655 |
+
= 0.312.13 =
|
656 |
+
* Code clean up - The main loop is finally readable by even non programmers
|
657 |
+
* FEATURE - You can now post to multiple categories at one time by using the [#],[Category Name], [Cat] in the subject
|
658 |
+
* FEATURE - You can now select a category by just including the begining characters [G] will select General
|
659 |
+
* if you don't have any other categories that start with g
|
660 |
+
* FEATURE - Jay Talbot - added a new feature so you can have multiple email addresses be allowed in
|
661 |
+
* Make multi category posting more obvious
|
662 |
+
* BUG FIX: Timezones of GMT+? should now work properly
|
663 |
+
* BUG FIX: Able to handle mis-mime typed images as long as they are named with .jpg/.gif/.png
|
664 |
+
|
665 |
+
= 0.312.12 =
|
666 |
+
* Code clean up - slowing shrinking the main to make it easiery to fix things
|
667 |
+
* FEATURE: Be able to turn on/off allowing comments in an email
|
668 |
+
* BUG FIX: AppleDouble now mostly supported
|
669 |
+
* BUG FIX: MIME handling improved.
|
670 |
+
* BUG FIX: Fix issue with timing delay
|
671 |
+
= 0.312.11 =
|
672 |
+
* FEATURE: Patterns to define where a sig starts are user configurable
|
673 |
+
* FEATURE: Add filter options for banned file names
|
674 |
+
* BUG FIX: Made it possible to turn off posting to the db for testing purposes
|
675 |
+
= 0.312.10 =
|
676 |
+
* FEATURE: Added in code to diplay the mime type of the file being linked to
|
677 |
+
* BUG FIX: It now tests for the existance of the directories and makes sure
|
678 |
+
* that the web server can write to them
|
679 |
+
= 0.312.9 =
|
680 |
+
* FEATURE:Should handle jpg as well as jpeg as the file type
|
681 |
+
* BUG FIX: Now correctly handles the subject in the message
|
682 |
+
* BUG FIX: Should handle Text preferences correctly
|
683 |
+
= 0.312.8 =
|
684 |
+
* Some general code tidying.
|
685 |
+
* FEATURE: Can now have email from invalid email addresses automatically forwared
|
686 |
+
* to the admin's email account. This forward includes all attachments.
|
687 |
+
* Props to David Luden for getting this started.
|
688 |
+
* Minor change: The system will continue if it runs into a message that doesn't have
|
689 |
+
* any content - it will also continue to process if it gets an email from
|
690 |
+
* someone not in the system. In the past this could result in deleted mail
|
691 |
+
* if your cron job didn't run often enough.
|
692 |
+
= 0.312.7 =
|
693 |
+
* Confirm the handling of 3gp video for cell phones o
|
694 |
+
* Added in new directive SUPPORTED_FILE_TYPES -if the mime type is listed here then the system will try to make a link to it without making a thumb nail.
|
695 |
+
= 0.312.6 =
|
696 |
+
* Bug Fix: Ok the last bug I fixed - actually caused another bug - man I should set up some unit tests. Now it handles mail from the nokia mail client correctly.
|
697 |
+
= 0.312.5 =
|
698 |
+
* Bug Fix : The system was accepting all test/* types. Now you can set a preference (defaults to text/plain)
|
699 |
+
* to use as the main text for the post.
|
700 |
+
= 0.312.4 =
|
701 |
+
* Added in sanitize_title call suggested by Jemima
|
702 |
+
* Added in ability to provide a subject in an mms - by using #Subject#
|
703 |
+
* Fixed an issue with the time stamp system so it now automatically uses the gmt_offset from WordPress
|
704 |
+
* Fixed issue with the delay:1d1h tag that prevented it from being removed from the body.
|
705 |
+
* Fixed issue with the delay tag that caused problems if it was the last thing before an image.
|
706 |
+
|
707 |
+
= 0.312.3-HEY (2005-05) =
|
708 |
+
* > Some changes and Bugfixes by Adrian Heydecker
|
709 |
+
* > Not (yet) in main development branch.
|
710 |
+
* Fixed bug: JPEG-thumbnails had a bigger filesize than full images caused by bad hardcoded compression value.
|
711 |
+
* Fixed bug: If images and signatures were present but no placeholder tags, the images were deleted together with the signature.
|
712 |
+
* Fixed bug: Generates valid postnames for users of mod_rewrite. Permalinks to posts should now work even when whitespaces are present in the subject line.
|
713 |
+
* Added support for Quoted Printable encoded mail.
|
714 |
+
* Added ability to encode Wordpress-posts in charset ISO-8859-1 instead of UTF-8.
|
715 |
+
* Added ability to choose JPEG-compression value for thumbnails.
|
716 |
+
* Added ability to add class="" and style="" to images.
|
717 |
+
* Added ability to use a different mailadress (eg. mobile) without setting up a new Wordpress-account.
|
718 |
+
|
719 |
+
= 0.312.2 =
|
720 |
+
* BUGFIX: It now removes the delay tag from the message
|
721 |
+
= 0.312.1 =
|
722 |
+
* Added modification for placeholder support for images (David Luden)
|
723 |
+
* Added in support to automatically scale down big images (Dirk Elmendorf)
|
724 |
+
* Fixed bug with multiple emails all getting the contents of the first image tag (Dirk Elmendorf)
|
725 |
+
* Added option to allow HTML in the body and subject of the email (Dirk Elmendorf)
|
726 |
+
* Switch config options to defines to reduce the number of global variables (Dirk Elmendorf)
|
727 |
+
* Added tests to make sure there is a trailing slash on the DIR definitions (Dirk Elmendorf)
|
728 |
+
* Add tests to see if they have gd installed (Dirk Elmendorf)
|
729 |
+
* Seperate the scaling out to a function for easier usage (Dirk Elmendorf)
|
730 |
+
* Add delay feature for future posting. (Dirk Elmendorf)
|
731 |
+
* Added in ability to use strtotime if it is available (Dirk ELmendorf)
|
732 |
+
|
733 |
+
* Todo
|
734 |
+
* Have option to have the email that is rejected forwarded on to another address.
|
735 |
+
* Fix bug that id still diplays the delay tag in the body
|
736 |
+
= 0.312 - 2005-03 =
|
737 |
+
* CHANGE FOR DEFAULT E-mail Categories, instead of [General] Subject you can now use General: Subject in the subject line. Less typing, and there must be a space after the colon.
|
738 |
+
* Fixed bugs with no default posting for categories and user
|
739 |
+
= 0.311 - 2005-01 =
|
740 |
+
* eep, major bug for pop3 server. Next time I test my code more before I released, fixed so that pop3 now works.`
|
741 |
+
= 0.31 - 2004-12 & 2005-01 =
|
742 |
+
* (Has it been this long, best get back into the swing of things... did most of this coding on my holiday as I didn't have a machine to play WoW on :)
|
743 |
+
* moved the deletion of pop3 emails into a check so that e-mails aren't deleted without proper checking.
|
744 |
+
* added HTML 'decoding' (basic support for Thunderbird & Outlook)
|
745 |
+
* updated the Category search so that it matches words as well as numbers (i.e. [General] Subjectname will work instead of just [1] Subjectname)
|
746 |
+
* Changed time function from time to strtotime (as per Senior Pez's suggestion), but found out that strtotime isn't in default php distro so removed...
|
747 |
+
|
748 |
+
= 0.3 - 2004-09 =
|
749 |
+
* Added UBB decoding support
|
750 |
+
* Added default title (when there is no subject assigned)
|
751 |
+
* Started doing a little code cleanup, been reading Advanced PHP Book :)
|
752 |
+
*
|
753 |
+
= 0.2 - 2004-08 =
|
754 |
+
* Stopped using pear body decoding in favour of own decoding (may be slower but more modifiable) because of enriched text decoding
|
755 |
+
* Added base64_decode checking (may help mobile phone users)
|
756 |
+
* Fixed Subject line for non-english users (htmlentities instead of just trim)
|
757 |
+
* Fixed error in some pop hanging -> more graceful exit on event on no emails in inbox ($pop3->quit)
|
758 |
+
* Added work around for email addresses with exta <> in field (ie: <blade@lansmash.com> instead of blade@lasmash.com
|
759 |
+
* Added some ===basic=== enriched text support
|
760 |
+
* Updated readme file for easier install
|
761 |
+
* Easy modify of globals (such as PHOTOSDIR and FILESDIR)
|
762 |
+
* Cleaned up some pear stuff in install
|
763 |
+
*
|
764 |
+
= 0.1 - 2004-06 =
|
765 |
+
* First release
|
|
|
|
screenshot-1.png
ADDED
Binary file
|
templates/audio_templates.php
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$google_reader = '<embed type="application/x-shockwave-flash" ' .
|
3 |
+
'src="http://www.google.com/reader/ui/3247397568-audio-player.swf?audioUrl={FILELINK}" ' .
|
4 |
+
'width="400" height="27" allowscriptaccess="never" quality="best" ' .
|
5 |
+
'bgcolor="#ffffff" wmode="window" flashvars="playerMode=embedded" />';
|
6 |
+
|
7 |
+
$simple_link = '<a href="{FILELINK}">{FILENAME}</a>';
|
8 |
+
|
9 |
+
$custom=$config['AUDIOTEMPLATE'];
|
10 |
+
$audioTemplates=serialize(compact('google_reader','simple_link',
|
11 |
+
'custom'));
|
12 |
+
?>
|
templates/funky.mp3
ADDED
Binary file
|
templates/hi.flv
ADDED
Binary file
|
templates/hi.mp4
ADDED
Binary file
|
templates/image_templates.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$simple_link = '<a href="{FILELINK}">{FILENAME}</a>';
|
3 |
+
$robert_felty = '<div style="margin-right:10px;background:black;color:white;padding:2px; width:{MEDIUMWIDTH};float:left"><a href="{IMAGE}"><img src="{MEDIUM}" alt="{CAPTION}" title="{CAPTION}" class="attachment" /></a><div style="padding:.2em;text-align:left">{CAPTION}</div></div>';
|
4 |
+
$no_wrappers = '<a href="{IMAGE}"><img src="{THUMBNAIL}" alt="{CAPTION}" title="{CAPTION}" class="attachment" /></a>';
|
5 |
+
$thumbnail_left = '<div style="float:left;margin-right:10px;"><a href="{IMAGE}"><img src="{THUMBNAIL}" alt="{CAPTION}" title="{CAPTION}" class="attachment" /></a></div>';
|
6 |
+
$thumbnail_right = '<div style="float:right;margin-left:10px;"><a href="{IMAGE}"><img src="{THUMBNAIL}" alt="{CAPTION}" title="{CAPTION}" class="attachment" /></a></div>';
|
7 |
+
$wordpress_default = '<div id="attachment_{ID}" class="wp-caption alignleft"
|
8 |
+
style="width: {MEDIUMWIDTH};"><a rel="attachment wp-att-{ID}" href="{PAGELINK}"><img class="size-medium wp-image-{ID}" title="{TITLE}" alt="{CAPTION}" src="{MEDIUM}" /> </a><p class="wp-caption-text">{CAPTION}</p></div>';
|
9 |
+
$postie_legacy = '<div class="postie-image-div"><a href="{IMAGE}"><img src="{THUMBNAIL}" alt="{FILENAME}" title="{FILENAME}" style="border:none" class="postie-image" /></a></div>';
|
10 |
+
|
11 |
+
$custom=$config['IMAGETEMPLATE'];
|
12 |
+
$imageTemplates=serialize(compact('simple_link','no_wrappers',
|
13 |
+
'wordpress_default','thumbnail_left','thumbnail_right','robert_felty','postie_legacy','custom'));
|
14 |
+
?>
|
templates/smiling-1024x682.jpg
ADDED
Binary file
|
templates/smiling-150x150.jpg
ADDED
Binary file
|
templates/smiling-300x200.jpg
ADDED
Binary file
|
templates/smiling.jpg
ADDED
Binary file
|
templates/video1_templates.php
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$small = '<object '.
|
3 |
+
'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '.
|
4 |
+
'codebase="http://www.apple.com/qtactivex/qtplugin.cab" '.
|
5 |
+
'width="128"'. 'height="96"> '.
|
6 |
+
'<param name="src" value="{FILELINK}" /> '.
|
7 |
+
'<param name="autoplay" value="no" /> '.
|
8 |
+
'<param name="controller" value="true" /> '.
|
9 |
+
'<embed src="{FILELINK}" '.
|
10 |
+
'width="128" height="96"'.
|
11 |
+
'autoplay="no" controller="true" '.
|
12 |
+
'type="video/quicktime" '.
|
13 |
+
'pluginspage="http://www.apple.com/quicktime/download/" '.
|
14 |
+
'width="128" height="110">'.
|
15 |
+
'</embed> '.
|
16 |
+
'</object>';
|
17 |
+
$medium = '<object '.
|
18 |
+
'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '.
|
19 |
+
'codebase="http://www.apple.com/qtactivex/qtplugin.cab" '.
|
20 |
+
'width="320"'. 'height="240"> '.
|
21 |
+
'<param name="src" value="{FILELINK}" /> '.
|
22 |
+
'<param name="autoplay" value="no" /> '.
|
23 |
+
'<param name="controller" value="true" /> '.
|
24 |
+
'<embed src="{FILELINK}" '.
|
25 |
+
'width="320" height="240"'.
|
26 |
+
'autoplay="no" controller="true" '.
|
27 |
+
'type="video/quicktime" '.
|
28 |
+
'pluginspage="http://www.apple.com/quicktime/download/" '.
|
29 |
+
'width="320" height="260">'.
|
30 |
+
'</embed> '.
|
31 |
+
'</object>';
|
32 |
+
$medium_widescreen = '<object '.
|
33 |
+
'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '.
|
34 |
+
'codebase="http://www.apple.com/qtactivex/qtplugin.cab" '.
|
35 |
+
'width="480"'. 'height="270"> '.
|
36 |
+
'<param name="src" value="{FILELINK}" /> '.
|
37 |
+
'<param name="autoplay" value="no" /> '.
|
38 |
+
'<param name="controller" value="true" /> '.
|
39 |
+
'<embed src="{FILELINK}" '.
|
40 |
+
'width="480" height="270"'.
|
41 |
+
'autoplay="no" controller="true" '.
|
42 |
+
'type="video/quicktime" '.
|
43 |
+
'pluginspage="http://www.apple.com/quicktime/download/" '.
|
44 |
+
'width="480" height="290">'.
|
45 |
+
'</embed> '.
|
46 |
+
'</object>';
|
47 |
+
$large = '<object '.
|
48 |
+
'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '.
|
49 |
+
'codebase="http://www.apple.com/qtactivex/qtplugin.cab" '.
|
50 |
+
'width="480"'. 'height="360"> '.
|
51 |
+
'<param name="src" value="{FILELINK}" /> '.
|
52 |
+
'<param name="autoplay" value="no" /> '.
|
53 |
+
'<param name="controller" value="true" /> '.
|
54 |
+
'<embed src="{FILELINK}" '.
|
55 |
+
'width="480" height="360"'.
|
56 |
+
'autoplay="no" controller="true" '.
|
57 |
+
'type="video/quicktime" '.
|
58 |
+
'pluginspage="http://www.apple.com/quicktime/download/" '.
|
59 |
+
'width="480" height="380">'.
|
60 |
+
'</embed> '.
|
61 |
+
'</object>';
|
62 |
+
$large_widescreen = '<object '.
|
63 |
+
'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '.
|
64 |
+
'codebase="http://www.apple.com/qtactivex/qtplugin.cab" '.
|
65 |
+
'width="640"'. 'height="360"> '.
|
66 |
+
'<param name="src" value="{FILELINK}" /> '.
|
67 |
+
'<param name="autoplay" value="no" /> '.
|
68 |
+
'<param name="controller" value="true" /> '.
|
69 |
+
'<embed src="{FILELINK}" '.
|
70 |
+
'width="640" height="360"'.
|
71 |
+
'autoplay="no" controller="true" '.
|
72 |
+
'type="video/quicktime" '.
|
73 |
+
'pluginspage="http://www.apple.com/quicktime/download/" '.
|
74 |
+
'width="640" height="380">'.
|
75 |
+
'</embed> '.
|
76 |
+
'</object>';
|
77 |
+
|
78 |
+
$simple_link = '<a href="{FILELINK}">{FILENAME}</a>';
|
79 |
+
|
80 |
+
$custom=$config['VIDEO1TEMPLATE'];
|
81 |
+
$video1Templates=serialize(compact('simple_link','small', 'medium',
|
82 |
+
'medium_widescreen', 'large','large_widescreen', 'custom'));
|
83 |
+
?>
|
templates/video2_templates.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
$small = '<object '.
|
3 |
+
'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '.
|
4 |
+
'codebase="http://www.apple.com/qtactivex/qtplugin.cab" '.
|
5 |
+
'width="128"'. 'height="96"> '.
|
6 |
+
'<param name="src" value="{FILELINK}" /> '.
|
7 |
+
'<param name="autoplay" value="no" /> '.
|
8 |
+
'<param name="controller" value="true" /> '.
|
9 |
+
'<embed src="{FILELINK}" '.
|
10 |
+
'width="128" height="96"'.
|
11 |
+
'autoplay="no" controller="true" '.
|
12 |
+
'type="video/quicktime" '.
|
13 |
+
'pluginspage="http://www.apple.com/quicktime/download/" '.
|
14 |
+
'width="128" height="110">'.
|
15 |
+
'</embed> '.
|
16 |
+
'</object>';
|
17 |
+
$medium = '<object '.
|
18 |
+
'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '.
|
19 |
+
'codebase="http://www.apple.com/qtactivex/qtplugin.cab" '.
|
20 |
+
'width="320"'. 'height="240"> '.
|
21 |
+
'<param name="src" value="{FILELINK}" /> '.
|
22 |
+
'<param name="autoplay" value="no" /> '.
|
23 |
+
'<param name="controller" value="true" /> '.
|
24 |
+
'<embed src="{FILELINK}" '.
|
25 |
+
'width="320" height="240"'.
|
26 |
+
'autoplay="no" controller="true" '.
|
27 |
+
'type="video/quicktime" '.
|
28 |
+
'pluginspage="http://www.apple.com/quicktime/download/" '.
|
29 |
+
'width="320" height="260">'.
|
30 |
+
'</embed> '.
|
31 |
+
'</object>';
|
32 |
+
$medium_widescreen = '<object '.
|
33 |
+
'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '.
|
34 |
+
'codebase="http://www.apple.com/qtactivex/qtplugin.cab" '.
|
35 |
+
'width="480"'. 'height="270"> '.
|
36 |
+
'<param name="src" value="{FILELINK}" /> '.
|
37 |
+
'<param name="autoplay" value="no" /> '.
|
38 |
+
'<param name="controller" value="true" /> '.
|
39 |
+
'<embed src="{FILELINK}" '.
|
40 |
+
'width="480" height="270"'.
|
41 |
+
'autoplay="no" controller="true" '.
|
42 |
+
'type="video/quicktime" '.
|
43 |
+
'pluginspage="http://www.apple.com/quicktime/download/" '.
|
44 |
+
'width="480" height="290">'.
|
45 |
+
'</embed> '.
|
46 |
+
'</object>';
|
47 |
+
$large = '<object '.
|
48 |
+
'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '.
|
49 |
+
'codebase="http://www.apple.com/qtactivex/qtplugin.cab" '.
|
50 |
+
'width="480"'. 'height="360"> '.
|
51 |
+
'<param name="src" value="{FILELINK}" /> '.
|
52 |
+
'<param name="autoplay" value="no" /> '.
|
53 |
+
'<param name="controller" value="true" /> '.
|
54 |
+
'<embed src="{FILELINK}" '.
|
55 |
+
'width="480" height="360"'.
|
56 |
+
'autoplay="no" controller="true" '.
|
57 |
+
'type="video/quicktime" '.
|
58 |
+
'pluginspage="http://www.apple.com/quicktime/download/" '.
|
59 |
+
'width="480" height="380">'.
|
60 |
+
'</embed> '.
|
61 |
+
'</object>';
|
62 |
+
$large_widescreen = '<object '.
|
63 |
+
'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" '.
|
64 |
+
'codebase="http://www.apple.com/qtactivex/qtplugin.cab" '.
|
65 |
+
'width="640"'. 'height="360"> '.
|
66 |
+
'<param name="src" value="{FILELINK}" /> '.
|
67 |
+
'<param name="autoplay" value="no" /> '.
|
68 |
+
'<param name="controller" value="true" /> '.
|
69 |
+
'<embed src="{FILELINK}" '.
|
70 |
+
'width="640" height="360"'.
|
71 |
+
'autoplay="no" controller="true" '.
|
72 |
+
'type="video/quicktime" '.
|
73 |
+
'pluginspage="http://www.apple.com/quicktime/download/" '.
|
74 |
+
'width="640" height="380">'.
|
75 |
+
'</embed> '.
|
76 |
+
'</object>';
|
77 |
+
$flv_embed = '[flv:{FILELINK} 480 270]';
|
78 |
+
|
79 |
+
$simple_link = '<a href="{FILELINK}">{FILENAME}</a>';
|
80 |
+
|
81 |
+
$custom=$config['VIDEO2TEMPLATE'];
|
82 |
+
$video2Templates=serialize(compact('simple_link','small', 'medium',
|
83 |
+
'medium_widescreen', 'large','large_widescreen', 'flv_embed', 'custom'));
|
84 |
+
?>
|
test_files/Test.gif
DELETED
Binary file
|
test_files/Test.jpg
DELETED
Binary file
|
test_files/Test.png
DELETED
Binary file
|