Changeset 911152
- Timestamp:
- 05/09/2014 04:00:05 PM (12 years ago)
- Location:
- post-via-dropbox/trunk
- Files:
-
- 2 edited
-
pvd.php (modified) (10 diffs)
-
readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
post-via-dropbox/trunk/pvd.php
r808984 r911152 4 4 Plugin URI: http://paolo.bz/post-via-dropbox 5 5 Description: Post to WordPress blog via Dropbox 6 Version: 2. 006 Version: 2.10 7 7 Author: Paolo Bernardi 8 8 Author URI: http://paolo.bz … … 30 30 31 31 if (!get_option('pvd_options')) { 32 add_option('pvd_options', array('interval' => 3600, 'ext' => 'txt', 'markdown' => 1, 'status' => 'publish' ));32 add_option('pvd_options', array('interval' => 3600, 'ext' => 'txt', 'markdown' => 1, 'status' => 'publish', 'post_type' => 'post')); 33 33 } 34 34 if (!get_option('pvd_errors')) { … … 75 75 $newValues['cat'] = intval($input['cat']); 76 76 $newValues['ext'] = preg_replace('#[^A-z0-9]#', '', $input['ext']); 77 78 $post_types = get_post_types(); 79 $post_type = 'post'; 80 foreach ($post_types as $post_type_) { 81 if ($input['post_type'] == $post_type_) { 82 $post_type = $input['post_type']; 83 break; 84 } 85 } 86 87 $newValues['post_type'] = $post_type; 77 88 78 89 $statuses = array('publish', 'draft', 'private', 'pending', 'future'); … … 118 129 if (isset($_GET['pvd_manual']) && is_admin()) { 119 130 if ($_GET['pvd_manual'] == sha1($this->encryptkey)) { 131 if (version_compare($wp_version, '3.9', '>=') >= 0) { #workaround for manual posting (since wp 3.9) 132 include_once(ABSPATH . WPINC . '/pluggable.php'); 133 } 134 global $wp_rewrite; 135 $wp_rewrite = new WP_Rewrite(); 120 136 $this->init(); 121 137 } … … 274 290 </tr> 275 291 292 <tr valign='top'> 293 <th scope='row'><laber for=''> Default Post Type </label> </th> 294 <td> 295 <select name='pvd_options[post_type]'> 296 <?php 297 $post_types = get_post_types(); 298 foreach ($post_types as $post_type) { 299 echo '<option value=\''.$post_type.'\''.($options['post_type'] == $post_type ? ' selected' : null).'>'.$post_type.'</option>'; 300 } 301 302 ?> 303 </select> 304 </td> 305 </tr> 276 306 277 307 <tr valign='top'> … … 384 414 <p> 385 415 <strong>Where do I put my text files?</strong><br /> 386 Text files must be uploaded inside <strong>Dropbox/Apps/Post_via_Dropbox/</strong> . The text file may have whatever extensions you want (default .txt) and it is strongly recommended that it hasUTF-8 encoding.416 Text files must be uploaded inside <strong>Dropbox/Apps/Post_via_Dropbox/</strong> . The text file may have whatever extensions you want (default .txt) and it should have UTF-8 encoding. 387 417 </p> 388 418 … … 417 447 <li><strong>[comment]</strong> comments status (use word 'open' or 'closed') <strong>[/comment]</strong></li> 418 448 <li><strong>[ping]</strong> ping status (use word 'open' or 'closed') <strong>[/ping]</strong></li> 449 <li><strong>[post_type]</strong> Post Type (e.g. 'post', 'page', etc) <strong>[/post_type]</strong></li> 419 450 </ul> 420 451 The only necessary tags are <strong>[title]</strong> and <strong>[content]</strong> 421 452 <br /><br /> 422 453 423 424 425 454 </div> 426 455 <?php … … 533 562 'post_name' => ( $slug ? $slug : null), 534 563 'comment_status' => ( $comment == 'open' ? 'open' : ($comment == 'closed' ? 'closed' : null) ), 535 'ping_status' => ( $ping == 'open' ? 'open' : ($ping == 'closed' ? 'closed' : null) ) 564 'ping_status' => ( $ping == 'open' ? 'open' : ($ping == 'closed' ? 'closed' : null) ), 565 'post_type' => ( in_array($post_type, get_post_types()) ? $post_type : ($options['post_type'] ? $options['post_type'] : 'post')) 536 566 ); 537 567 … … 607 637 'comment' => '#\[comment\](.*?)\[/comment\]#s', 608 638 'ping' => '#\[ping\](.*?)\[/ping\]#s', 639 'post_type' => '#\[post_type\](.*?)\[/post_type\]#s' 609 640 ); 610 641 foreach ($tag as $key => $value) { … … 715 746 // Where all starts! :-) 716 747 $Post_via_Dropbox = new Post_via_Dropbox(); 717 718 748 ?> -
post-via-dropbox/trunk/readme.txt
r903583 r911152 3 3 Tags: dropbox, post via dropbox, remote update, post, posting, remote 4 4 Requires at least: 3.0.0 5 Tested up to: 3.9 6 Stable tag: 2. 005 Tested up to: 3.9.1 6 Stable tag: 2.10 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 42 42 There're many ways of using it: text files are very flexible and they can adapt without much efforts. 43 43 44 = Where do I uploadmy text files? =44 = Where do I put my text files? = 45 45 46 Text files must be uploaded inside **Dropbox/Apps/Post_via_Dropbox/** . Once posted, the text files is moved into subidirectory "posted", if you have not selected "delete" option. 46 Text files must be uploaded inside **Dropbox/Apps/Post_via_Dropbox/** . Once posted, the text files is moved into subidirectory "posted", if you have not selected "delete" option. The text file may have whatever extensions you want (default .txt) and it should have UTF-8 encoding. 47 47 48 48 = How should be the text files? = … … 55 55 56 56 You need to specify the ID of the post, there're two ways: 1) using [id] tag or 2) prepend to filename the ID (example: 500-filename.txt). 57 The quickest way to edit an existing post, already posted via Dropbox, is move the file from the subfolder 'posted' to the principal folder.57 The quickest way to edit an existing post, already posted via Dropbox, is to move the file from the subfolder 'posted' to the principal folder. 58 58 59 59 = This is the list of the tags that you can use (if you have not selected "Simplified posting"): = … … 73 73 * **[comment]** comments status (use word 'open' or 'closed') **[/comment]** 74 74 * **[ping]** ping status (use word 'open' or 'closed') **[/ping]** 75 * **[post_type]** Post Type (e.g. 'post', 'page'..) **[/post_type]** 75 76 76 77 The only necessary tags are [title] and [content] … … 82 83 == Changelog == 83 84 85 = 2.10 = 86 * Added Post Type support 87 * Fixed minor bug in manual mode for WP 3.9+ 88 84 89 = 2.00 = 85 90 * Added Markdown support 86 91 * Added new feature (Simplified posting) 87 * Fixed minor bu s92 * Fixed minor bug 88 93 89 94 = 1.10 =
Note: See TracChangeset
for help on using the changeset viewer.