| @@ -3,9 +3,26 @@ | ||
| 3 | 3 | if (fwp_test_wp_version(FWP_SCHEMA_25, FWP_SCHEMA_27)) : |
| 4 | 4 | ?> |
| 5 | 5 | <div class="submitbox" id="submitlink"> |
| 6 | 6 | <div id="previewview"></div> |
| 7 | -<div class="inside"></div> | |
| 7 | +<div class="inside"> | |
| 8 | +<?php if (!is_null($status)) : ?> | |
| 9 | + <p><strong>Publication</strong></p> | |
| 10 | + <p>When a new post is syndicated from this feed...</p> | |
| 11 | + <select name="feed_post_status"> | |
| 12 | + <option value="site-default" <?php echo $status['post']['site-default']; ?>> Use | |
| 13 | + Syndication Options setting</option> | |
| 14 | + <option value="publish" <?php echo $status['post']['publish']; ?>>Publish it immediately</option> | |
| 15 | + | |
| 16 | + <?php if (SyndicatedPost::use_api('post_status_pending')) : ?> | |
| 17 | + <option value="pending" <?php echo $status['post']['pending']; ?>>Hold it Pending Review</option> | |
| 18 | + <?php endif; ?> | |
| 19 | + | |
| 20 | + <option value="draft" <?php echo $status['post']['draft']; ?>>Save it as a draft</option> | |
| 21 | + <option value="private" <?php echo $status['post']['private']; ?>>Keep it private</option> | |
| 22 | + </select> | |
| 23 | +<?php endif; ?> | |
| 24 | +</div> | |
| 8 | 25 | |
| 9 | 26 | <p class="submit"> |
| 10 | 27 | <input type="submit" name="submit" value="<?php _e('Save') ?>" /> |
| 11 | 28 | </p> |
| @@ -114,16 +131,14 @@ | ||
| 114 | 131 | </p> |
| 115 | 132 | </div> |
| 116 | 133 | |
| 117 | 134 | <ul id="category-tabs"> |
| 118 | - <?php /* ui-tabs-selected in WP 2.7 CSS = tabs in WP 2.8 CSS. Thank you, o brilliant wordsmiths of the WordPress 2.8 stylesheet... */ ?> | |
| 119 | - <li class="ui-tabs-selected tabs"><a href="#categories-all" tabindex="3"><?php _e( 'All posts' ); ?></a> | |
| 135 | + <li class="ui-tabs-selected"><a href="#categories-all" tabindex="3"><?php _e( 'All posts' ); ?></a> | |
| 120 | 136 | <p style="font-size:smaller;font-style:bold;margin:0">Give <?php print $object; ?> these categories</p> |
| 121 | 137 | </li> |
| 122 | 138 | </ul> |
| 123 | 139 | |
| 124 | -<?php /* ui-tabs-panel in WP 2.7 CSS = tabs-panel in WP 2.8 CSS. Thank you, o brilliant wordsmiths of the WordPress 2.8 stylesheet... */ ?> | |
| 125 | -<div id="categories-all" class="ui-tabs-panel tabs-panel"> | |
| 140 | +<div id="categories-all" class="ui-tabs-panel"> | |
| 126 | 141 | <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> |
| 127 | 142 | <?php fwp_category_checklist(NULL, false, $checked) ?> |
| 128 | 143 | </ul> |
| 129 | 144 | </div> |
| @@ -185,97 +200,5 @@ | ||
| 185 | 200 | endforeach; |
| 186 | 201 | endif; |
| 187 | 202 | return $ret; |
| 188 | 203 | } |
| 189 | - | |
| 190 | -class FeedWordPressSettingsUI { | |
| 191 | - function instead_of_posts_box ($link_id = null) { | |
| 192 | - fwp_option_box_opener('Syndicated Posts, Comments & Pings', 'syndicatedpostsdiv', 'postbox'); | |
| 193 | - if (!is_null($link_id)) : | |
| 194 | - $from_this_feed = 'from this feed'; | |
| 195 | - $by_default = ''; | |
| 196 | - $id_param = "&link_id=".$link_id; | |
| 197 | - else : | |
| 198 | - $from_this_feed = 'from syndicated feeds'; | |
| 199 | - $by_default = " by default"; | |
| 200 | - $id_param = ""; | |
| 201 | - endif; | |
| 202 | -?> | |
| 203 | -<p>Use the <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/posts-page.php<?php print $id_param; ?>"><?php _e('Posts'); ?></a> | |
| 204 | -settings page to set up how new posts <?php print $from_this_feed; ?> will be published<?php $by_default; ?>, whether they will accept | |
| 205 | -comments and pings, any custom fields that should be set on each post, etc.</p> | |
| 206 | -<?php | |
| 207 | - fwp_option_box_closer(); | |
| 208 | - } /* FeedWordPressSettingsUI::instead_of_posts_box () */ | |
| 209 | - | |
| 210 | - function instead_of_authors_box ($link_id = null) { | |
| 211 | - if (!is_null($link_id)) : | |
| 212 | - $from_this_feed = 'from this feed'; | |
| 213 | - $by_default = ''; | |
| 214 | - $id_param = "&link_id=".$link_id; | |
| 215 | - else : | |
| 216 | - $from_this_feed = 'from syndicated feeds'; | |
| 217 | - $by_default = " by default"; | |
| 218 | - $id_param = ""; | |
| 219 | - endif; | |
| 220 | - | |
| 221 | - fwp_option_box_opener('Syndicated Authors', 'authordiv', 'postbox') | |
| 222 | -?> | |
| 223 | -<p>Use the <a | |
| 224 | -href="admin.php?page=<?php print $GLOBALS['fwp_path'] | |
| 225 | -?>/authors-page.php<?php print $id_param; ?>"><?php _e('Authors'); | |
| 226 | -?></a> settings page to set up how new posts | |
| 227 | -<?php print $from_this_feed; ?> will be assigned to | |
| 228 | -authors.</p> | |
| 229 | -<?php | |
| 230 | - fwp_option_box_closer(); | |
| 231 | - } /* FeedWordPressSettingsUI::instead_of_authors_box () */ | |
| 232 | - | |
| 233 | - function instead_of_categories_box ($link_id = null) { | |
| 234 | - if (!is_null($link_id)) : | |
| 235 | - $from_this_feed = 'from this feed'; | |
| 236 | - $by_default = ''; | |
| 237 | - $id_param = "&link_id=".$link_id; | |
| 238 | - else : | |
| 239 | - $from_this_feed = 'from syndicated feeds'; | |
| 240 | - $by_default = " by default"; | |
| 241 | - $id_param = ""; | |
| 242 | - endif; | |
| 243 | - | |
| 244 | - fwp_option_box_opener(__('Categories & Tags'), 'categorydiv', 'postbox'); | |
| 245 | -?> | |
| 246 | -<p>Use the <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/categories-page.php<?php print $id_param; ?>"><?php _e('Categories & Tags'); ?></a> | |
| 247 | -settings page to set up how new posts <?php print $from_this_feed; ?> are assigned categories or tags<?php print $by_default; ?>.</p> | |
| 248 | -<?php | |
| 249 | - fwp_option_box_closer(); | |
| 250 | - } /* FeedWordPressSettingsUI::instead_of_categories_box () */ | |
| 251 | - | |
| 252 | -} /* class FeedWordPressSettingsUI */ | |
| 253 | - | |
| 254 | -function fwp_insert_new_user ($newuser_name) { | |
| 255 | - global $wpdb; | |
| 256 | - | |
| 257 | - $ret = null; | |
| 258 | - if (strlen($newuser_name) > 0) : | |
| 259 | - $userdata = array(); | |
| 260 | - $userdata['ID'] = NULL; | |
| 261 | - | |
| 262 | - $userdata['user_login'] = sanitize_user($newuser_name); | |
| 263 | - $userdata['user_login'] = apply_filters('pre_user_login', $userdata['user_login']); | |
| 264 | - | |
| 265 | - $userdata['user_nicename'] = sanitize_title($newuser_name); | |
| 266 | - $userdata['user_nicename'] = apply_filters('pre_user_nicename', $userdata['user_nicename']); | |
| 267 | - | |
| 268 | - $userdata['display_name'] = $wpdb->escape($newuser_name); | |
| 269 | - | |
| 270 | - $newuser_id = wp_insert_user($userdata); | |
| 271 | - if (is_numeric($newuser_id)) : | |
| 272 | - $ret = $newuser_id; | |
| 273 | - else : | |
| 274 | - // TODO: Add some error detection and reporting | |
| 275 | - endif; | |
| 276 | - else : | |
| 277 | - // TODO: Add some error reporting | |
| 278 | - endif; | |
| 279 | - return $ret; | |
| 280 | -} /* fwp_insert_new_user () */ | |
| 281 | 204 | |