dispatch = 'feedwordpress_posts_settings'; $this->filename = __FILE__; $this->updatedPosts = new UpdatedPostsControl($this); } /* FeedWordPressPostsPage constructor */ function accept_POST ($post) { global $wpdb; // User mashed a Save Changes button if (isset($post['save']) or isset($post['submit'])) : // custom post settings $custom_settings = $this->custom_post_settings(); foreach ($post['notes'] as $mn) : $mn['key0'] = trim($mn['key0']); $mn['key1'] = trim($mn['key1']); if (strlen($mn['key0']) > 0) : unset($custom_settings[$mn['key0']]); // out with the old endif; if (($mn['action']=='update') and (strlen($mn['key1']) > 0)) : $custom_settings[$mn['key1']] = $mn['value']; // in with the new 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; // Save settings $this->link->save_settings(/*reload=*/ true); $this->updated = true; // Reset, reload $link_id = $this->link->id; unset($this->link); $this->link = new SyndicatedLink($link_id); 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; $this->updated = true; endif; // Probably a "Go" button for the drop-down else : $this->updated = false; endif; } /** * 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() * @uses SyndicatedPost::use_api() */ /*static*/ function publication_box ($page, $box = NULL) { global $fwp_path; $post_status_global = FeedWordPress::syndicated_status('post', /*default=*/ 'publish'); $thesePosts = $page->these_posts_phrase(); // Set up array for selector $setting = array( 'publish' => array ('label' => "Publish %s immediately", 'checked' => ''), 'draft' => array('label' => "Save %s as drafts", 'checked' => ''), 'private' => array('label' => "Save %s as private posts", 'checked' => ''), ); if (SyndicatedPost::use_api('post_status_pending')) : $setting['pending'] = array('label' => "Hold %s for review; mark as Pending", 'checked' => ''); endif; if ($page->for_feed_settings()) : $href = $fwp_path.'/'.basename(__FILE__); $currently = str_replace('%s', '', strtolower(strtok($setting[$post_status_global]['label'], ';'))); $setting['site-default'] = array('label' => "Use site-wide setting", 'checked' => ''); $setting['site-default']['label'] .= " (currently: ${currently})"; $checked = $page->link->syndicated_status('post', 'site-default', /*fallback=*/ false); else : $checked = $post_status_global; endif; // Re-order appropriately $selector = array(); $order = array( 'site-default', 'publish', 'pending', 'draft', 'private', ); foreach ($order as $line) : if (isset($setting[$line])) : $selector[$line] = $setting[$line]; endif; endforeach; $selector[$checked]['checked'] = ' checked="checked"'; // Hey ho, let's go... ?> updatedPosts->display(); ?>
    $li) : ?>
these_posts_phrase(); $global_resolve_relative = get_option('feedwordpress_resolve_relative', 'yes'); if ($page->for_feed_settings()) : $formatting_filters = null; $resolve_relative = $page->link->setting('resolve relative', NULL, 'default'); $url = preg_replace('|/+$|', '', $page->link->homepage()); $setting = array( 'yes' => __('resolve relative URIs'), 'no' => __('leave relative URIs unresolved'), ); $href = $fwp_path.'/'.basename(__FILE__); else : $formatting_filters = get_option('feedwordpress_formatting_filters', 'no'); $resolve_relative = $global_resolve_relative; $url = 'http://example.com'; endif; ?>
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 Share This button), try changing this option to see if it fixes your problem.

Relative URIs: If link or image in a syndicated post from refers to a partial URI like /about, where should the syndicated copy point to?

    for_feed_settings()) : ?>
array( 'yes' => 'the copy on the original website', 'no' => 'the local copy on this website', ), ); $global_munge_permalink = get_option('feedwordpress_munge_permalink'); if ($page->for_feed_settings()) : $munge_permalink = $page->link->setting('munge permalink', NULL); else : $munge_permalink = $global_munge_permalink; $use_aggregator_source_data = get_option('feedwordpress_use_aggregator_source_data'); endif; ?> for_feed_settings()) : ?>
Permalinks point to:
    for_feed_settings()) : ?>
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.

array('label' => __('Comments'), 'accept' => 'Allow comments'), 'ping' => array('label' => __('Pings'), 'accept' => 'Accept pings'), ); $onThesePosts = 'on '.$page->these_posts_phrase(); $selected = array( 'munge_comments_feed_links' => array('yes' => '', 'no' => '') ); $globalMungeCommentsFeedLinks = get_option('feedwordpress_munge_comments_feed_links', 'yes'); if ($page->for_feed_settings()) : $selected['munge_comments_feed_links']['default'] = ''; $sel = $page->link->setting('munge comments feed links', NULL, 'default'); else : $sel = $globalMungeCommentsFeedLinks; endif; $selected['munge_comments_feed_links'][$sel] = ' checked="checked"'; if ($globalMungeCommentsFeedLinks != 'no') : $siteWide = __('comment feeds from the original website'); else : $siteWide = __('local comment feeds on this website'); endif; foreach ($whatsits as $what => $how) : $whatsits[$what]['default'] = FeedWordPress::syndicated_status($what, /*default=*/ 'closed'); // Set up array for selector $setting = array( 'open' => array ('label' => "{$how['accept']} %s", 'checked' => ''), 'closed' => array('label' => "Don't ".strtolower($how['accept'])." %s", 'checked' => ''), ); if ($page->for_feed_settings()) : $href = $fwp_path.'/'.basename(__FILE__); $currently = trim(str_replace('%s', '', strtolower(strtok($setting[$whatsits[$what]['default']]['label'], ';')))); $setting['site-default'] = array('label' => "Use site-wide setting", 'checked' => ''); $setting['site-default']['label'] .= " (currently: ${currently})"; $checked = $page->link->syndicated_status($what, 'site-default', /*fallback=*/ false); else : $checked = $whatsits[$what]['default']; endif; // Re-order appropriately $selector[$what] = array(); $order = array( 'site-default', 'open', 'closed', ); foreach ($order as $line) : if (isset($setting[$line])) : $selector[$what][$line] = $setting[$line]; endif; endforeach; $selector[$what][$checked]['checked'] = ' checked="checked"'; endforeach; // Hey ho, let's go... ?> $how) : ?>
:
    $li) : ?>

When WordPress feeds and templates link to comments feeds for these_posts_phrase(); ?>, the URLs for the feeds should...

for_feed_settings()) : $custom_settings = $page->link->settings["postmeta"]; else : $custom_settings = get_option('feedwordpress_custom_settings'); endif; if ($custom_settings and !is_array($custom_settings)) : $custom_settings = unserialize($custom_settings); endif; if (!is_array($custom_settings)) : $custom_settings = array(); endif; return $custom_settings; } /* FeedWordPressPostsPage::custom_post_settings() */ /** * Output "Custom Post Settings" 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 */ /*static*/ function custom_post_settings_box ($page, $box = NULL) { $custom_settings = FeedWordPressPostsPage::custom_post_settings($page); ?>

Custom fields can be used to add extra metadata to a post that you can use in your theme.

$value) : ?>
Key Value Action

Enter a text value, or a path to a data element from the syndicated item.
For data elements, you can use an XPath-like syntax wrapped in $( ... ).
hello = the text value hello
$(author/email) = the contents of <author><email>...</email></author>
$(media:content/@url) = the contents of <media:content url="...">...</media:content>

add new setting...
accept_POST($fwp_post); do_action('feedwordpress_admin_page_posts_save', $fwp_post, $postsPage); endif; $postsPage->ajax_interface_js(); if ($postsPage->updated) : ?>

Syndicated posts settings updated.

open_sheet('Syndicated Posts & Links'); ?>
__('Syndicated Posts'), 'links_box' => __('Links'), 'formatting_box' => __('Formatting'), 'comments_and_pings_box' => __('Comments & Pings'), 'custom_post_settings_box' => __('Custom Post Settings (to apply to each syndicated post)'), ); foreach ($boxes_by_methods as $method => $title) : fwp_add_meta_box( /*id=*/ 'feedwordpress_'.$method, /*title=*/ $title, /*callback=*/ array('FeedWordPressPostsPage', $method), /*page=*/ $postsPage->meta_box_context(), /*context=*/ $postsPage->meta_box_context() ); endforeach; do_action('feedwordpress_admin_page_posts_meta_boxes', $postsPage); ?>
meta_box_context(), $postsPage->meta_box_context(), $postsPage); ?>
close_sheet(); } /* function fwp_posts_page () */ fwp_posts_page();