submitted_link(); endif; parent::__construct('feedwordpresspostspage', $link); $this->dispatch = 'feedwordpress_admin_page_posts'; $this->filename = __FILE__; $this->updatedPosts = new UpdatedPostsControl($this); $this->pagenames = array( 'default' => 'Posts', 'settings-update' => 'Syndicated posts', 'open-sheet' => 'Syndicated Posts & Links', ); } /* FeedWordPressPostsPage constructor */ function save_settings ($post) { // custom post settings $custom_settings = $this->custom_post_settings(); foreach ($post['notes'] as $mn) : if (isset($mn['key0'])) : $mn['key0'] = trim($mn['key0']); if (strlen($mn['key0']) > 0) : unset($custom_settings[$mn['key0']]); // out with the old endif; endif; if (isset($mn['key1'])) : $mn['key1'] = trim($mn['key1']); if (($mn['action']=='update') and (strlen($mn['key1']) > 0)) : $custom_settings[$mn['key1']] = $mn['value']; // in with the new endif; endif; endforeach; $this->updatedPosts->accept_POST($post); if ($this->for_feed_settings()) : $alter = array (); $this->link->settings['postmeta'] = serialize($custom_settings); if (isset($post['resolve_relative'])) : $this->link->settings['resolve relative'] = $post['resolve_relative']; endif; if (isset($post['munge_permalink'])) : $this->link->settings['munge permalink'] = $post['munge_permalink']; endif; if (isset($post['munge_comments_feed_links'])) : $this->link->settings['munge comments feed links'] = $post['munge_comments_feed_links']; endif; // Post status, comment status, ping status foreach (array('post', 'comment', 'ping') as $what) : $sfield = "feed_{$what}_status"; if (isset($post[$sfield])) : if ($post[$sfield]=='site-default') : unset($this->link->settings["{$what} status"]); else : $this->link->settings["{$what} status"] = $post[$sfield]; endif; endif; endforeach; if (isset($post['syndicated_post_type'])) : if ($post['syndicated_post_type']=='default') : unset($this->link->settings['syndicated post type']); else : $this->link->settings['syndicated post type'] = $post['syndicated_post_type']; endif; endif; else : // update_option ... if (isset($post['feed_post_status'])) : update_option('feedwordpress_syndicated_post_status', $post['feed_post_status']); endif; update_option('feedwordpress_custom_settings', serialize($custom_settings)); update_option('feedwordpress_munge_permalink', $_REQUEST['munge_permalink']); update_option('feedwordpress_use_aggregator_source_data', $_REQUEST['use_aggregator_source_data']); update_option('feedwordpress_formatting_filters', $_REQUEST['formatting_filters']); if (isset($post['resolve_relative'])) : update_option('feedwordpress_resolve_relative', $post['resolve_relative']); endif; if (isset($post['munge_comments_feed_links'])) : update_option('feedwordpress_munge_comments_feed_links', $post['munge_comments_feed_links']); endif; if (isset($_REQUEST['feed_comment_status']) and ($_REQUEST['feed_comment_status'] == 'open')) : update_option('feedwordpress_syndicated_comment_status', 'open'); else : update_option('feedwordpress_syndicated_comment_status', 'closed'); endif; if (isset($_REQUEST['feed_ping_status']) and ($_REQUEST['feed_ping_status'] == 'open')) : update_option('feedwordpress_syndicated_ping_status', 'open'); else : update_option('feedwordpress_syndicated_ping_status', 'closed'); endif; if (isset($post['syndicated_post_type'])) : update_option('feedwordpress_syndicated_post_type', $post['syndicated_post_type']); endif; endif; parent::save_settings($post); } /** * Outputs "Publication" settings box. * * @since 2009.0713 * @param object $page of class FeedWordPressPostsPage tells us whether this is * a page for one feed's settings or for global defaults * @param array $box * * @uses FeedWordPressPostsPage::these_posts_phrase() * @uses FeedWordPress::syndicated_status() * @uses SyndicatedLink::syndicated_status() */ /*static*/ function publication_box ($page, $box = NULL) { $thesePosts = $page->these_posts_phrase(); $postSelector = array( 'publish' => "Publish %s immediately", 'pending' => "Hold %s for review; mark as Pending", 'draft' => "Save %s as drafts", 'private' => "Save %s as private posts", ); $labels = array(); foreach ($postSelector as $index => $value) : $postSelector[$index] = sprintf(__($value), $thesePosts); $labels[$index] = __(str_replace(' %s', '', strtolower(strtok($value, ';')))); endforeach; $params = array( 'input-name' => 'feed_post_status', 'setting-default' => NULL, 'global-setting-default' => 'publish', 'labels' => $labels, ); // Hey ho, let's go... ?>
| setting_radio_control( 'post status', 'syndicated_post_status', $postSelector, $params ); ?> |
| Formatting filters: |
If you have trouble getting plugins to work that are supposed to insert
elements after posts (like relevant links or a social networking
|
|---|---|
| Relative URIs: | If link or image in a syndicated post from '.$url.'/contact is rewritten as '.$url.'/contact',
'no' => 'Leave relative URIs unchanged, so they point to this site/contact is left as /contact',
);
$params = array(
'setting-default' => 'default',
'global-setting-default' => 'yes',
'labels' => array(
'yes' => __('resolve relative URIs'),
'no' => __('leave relative URIs unresolved'),
),
'default-input-value' => 'default',
);
$this->setting_radio_control(
'resolve relative', 'resolve_relative',
$options, $params
);
?>
|
| Permalinks point to: | 'default', 'global-setting-default' => 'yes', 'default-input-value' => 'default', ); $this->setting_radio_control( 'munge permalink', 'munge_permalink', $setting['munge_permalink'], $params ); ?> |
|---|---|
| Posts from aggregator feeds: |
Some feeds (for example, those produced by FeedWordPress) aggregate content from several different sources, and include information about the original source of the post. This setting controls what FeedWordPress will give as the source of posts from such an aggregator feed. |
| : | setting_radio_control( "$what status", "syndicated_${what}_status", $settings[$what], $params[$what] ); ?> |
|---|---|
When WordPress feeds and templates link to comments feeds for these_posts_phrase(); ?>, the URLs for the feeds should... setting_radio_control( "munge comments feed links", "munge_comments_feed_links", $mcflSettings, $mcflParams ); ?> |
Custom fields can be used to add extra metadata to a post that you can use in your theme.
| Key | Value | Action |
|---|---|---|
|
Enter a text value, or a path to a data element from the syndicated item. |
add new setting... |
Incoming syndicated posts should be stored in the posts database as... setting_radio_control( 'syndicated post type', 'syndicated_post_type', $ul, $params ); ?> |