get_results(" SELECT * FROM $wpdb->links WHERE link_id IN (".implode(",",$_POST['link_ids']).") "); if (is_array($targets)) : foreach ($targets as $target) : $update_set[] = $target->link_rss; endforeach; else : // This should never happen FeedWordPress::critical_bug('fwp_syndication_manage_page::targets', $targets, __LINE__); endif; elseif (isset($_POST['update_uri'])) : $update_set[] = $_POST['update_uri']; endif; shuffle($update_set); // randomize order for load balancing purposes... if ($fwp_update_invoke != 'get' and count($update_set) > 0) : // Only do things with side-effects for HTTP POST or command line $feedwordpress =& new FeedWordPress; add_action('feedwordpress_check_feed', 'update_feeds_mention'); add_action('feedwordpress_check_feed_complete', 'update_feeds_finish', 10, 3); $crash_dt = (int) get_option('feedwordpress_update_time_limit'); if ($crash_dt > 0) : $crash_ts = time() + $crash_dt; else : $crash_ts = NULL; endif; if (fwp_test_wp_version(FWP_SCHEMA_25)) : echo "
\n"; else : echo "
\n"; endif; echo "\n"; if (!is_null($tdelta)) : $mesg = array(); if (isset($delta['new'])) : $mesg[] = ' '.$tdelta['new'].' new posts were syndicated'; endif; if (isset($delta['updated'])) : $mesg[] = ' '.$tdelta['updated'].' existing posts were updated'; endif; echo "

Update complete.".implode(' and', $mesg)."

"; echo "\n"; flush(); endif; echo "
\n"; elseif (fwp_test_wp_version(FWP_SCHEMA_25)) : ?>

Check currently scheduled feeds for new and updated posts.

Syndicated Sites

\n

\n"; wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); echo "

\n\n"; if ($links) : add_meta_box('feedwordpress_update_box', __('Update feeds now'), 'fwp_syndication_manage_page_update_box', /*page=*/ 'feedwordpress_syndication', /*context =*/ 'normal'); endif; add_meta_box('feedwordpress_feeds_box', __('Syndicated sources'), 'fwp_syndication_manage_page_links_box', /*page=*/ 'feedwordpress_syndication', /*context =*/ 'normal'); ?>

Add a new syndicated site:


Check currently scheduled feeds for new and updated posts.

Note: Automatic updates are currently turned off. New posts from your feeds will not be syndicated until you manually check for them here. You can turn on automatic updates under Syndication Options.


Syndicated Sites

get_row("SELECT * FROM $wpdb->links WHERE link_id='".$wpdb->escape($link_id)."'"); if (is_object($link)): if (is_null($lookup)) $lookup = $link->link_url; $name = wp_specialchars($link->link_name, 'both'); else: die (__("Cheatin' uh ?")); endif; else: $name = "".htmlspecialchars($lookup).""; $link_id = 0; endif; ?>

Feed Finder:

find(); if (count($feeds) > 0): foreach ($feeds as $key => $f): $rss = fetch_rss($f); if ($rss): $feed_title = isset($rss->channel['title'])?$rss->channel['title']:$rss->channel['link']; $feed_link = isset($rss->channel['link'])?$rss->channel['link']:''; else : // Give us some sucky defaults $uri_bits = parse_url($lookup); $uri_bits['host'] = preg_replace('/^www\./i', '', $uri_bits['host']); $display_uri = (isset($uri_bits['user'])?$uri_bits['user'].'@':'') .(isset($uri_bits['host'])?$uri_bits['host']:'') .(isset($uri_bits['port'])?':'.$uri_bits['port']:'') .(isset($uri_bits['path'])?$uri_bits['path']:'') .(isset($uri_bits['query'])?'?'.$uri_bits['query']:''); if (strlen($display_uri) > 32) : $display_uri = substr($display_uri, 0, 32).'…'; endif; $feed_title = $display_uri; $feed_link = $lookup; endif; ?>
feed_type; ?> feed_version; ?> feed
items) > 0): ?> items[0]; ?>

Sample Item

  • Title:
  • Date:

No Items

FeedWordPress found no posts on this feed.

Feed Information

  • Website: Unknown':$feed_title; ?>
  • Feed URI: (validate)
  • Encoding: encoding)?wp_specialchars($rss->encoding, 'both'):"Unknown"; ?>
  • Description: channel['description'])?wp_specialchars($rss->channel['description'], 'both'):"Unknown"; ?>
".__('Error').": ".__("I couldn't find any feeds at").' '.htmlspecialchars($lookup).''; if (!is_null($f->error())) : print " [".__('HTTP request error').": ".htmlspecialchars(trim($f->error()))."]"; endif; print ". ".__('Try another URL')."

"; endif; ?>

Use another feed

has been added as a contributing site, using the newsfeed at <>.

There was a problem adding the newsfeed. [SQL: ]

query(" UPDATE $wpdb->links SET link_rss = '".$wpdb->escape($_REQUEST['feed'])."' WHERE link_id = '".$wpdb->escape($_REQUEST['link_id'])."' "); if ($result): $result = $wpdb->get_row(" SELECT link_name, link_url FROM $wpdb->links WHERE link_id = '".$wpdb->escape($_REQUEST['link_id'])."' "); ?>

Feed for link_name, 'both'); ?> updated to <>.

Nothing was changed.

found()) : if (isset($GLOBALS['fwp_post']['save'])) : $alter = array (); // custom feed settings first foreach ($GLOBALS['fwp_post']['notes'] as $mn) : $mn['key0'] = trim($mn['key0']); $mn['key1'] = trim($mn['key1']); if (preg_match("\007^((" .implode(')|(',$special_settings) ."))$\007i", $mn['key1'])) : $mn['key1'] = 'user/'.$mn['key1']; endif; if (strlen($mn['key0']) > 0) : unset($link->settings[$mn['key0']]); // out with the old endif; if (($mn['action']=='update') and (strlen($mn['key1']) > 0)) : $link->settings[$mn['key1']] = $mn['value']; // in with the new endif; endforeach; // now stuff through the web form // hardcoded feed info if (isset($GLOBALS['fwp_post']['hardcode_name'])) : $link->settings['hardcode name'] = $GLOBALS['fwp_post']['hardcode_name']; if (FeedWordPress::affirmative($link->settings, 'hardcode name')) : $alter[] = "link_name = '".$wpdb->escape($GLOBALS['fwp_post']['name'])."'"; endif; endif; if (isset($GLOBALS['fwp_post']['hardcode_description'])) : $link->settings['hardcode description'] = $GLOBALS['fwp_post']['hardcode_description']; if (FeedWordPress::affirmative($link->settings, 'hardcode description')) : $alter[] = "link_description = '".$wpdb->escape($GLOBALS['fwp_post']['description'])."'"; endif; endif; if (isset($GLOBALS['fwp_post']['hardcode_url'])) : $link->settings['hardcode url'] = $GLOBALS['fwp_post']['hardcode_url']; if (FeedWordPress::affirmative($link->settings, 'hardcode url')) : $alter[] = "link_url = '".$wpdb->escape($GLOBALS['fwp_post']['linkurl'])."'"; endif; endif; // Update scheduling if (isset($GLOBALS['fwp_post']['update_schedule'])) : $link->settings['update/hold'] = $GLOBALS['fwp_post']['update_schedule']; endif; // Categories if (isset($GLOBALS['fwp_post']['post_category'])) : $link->settings['cats'] = array(); foreach ($GLOBALS['fwp_post']['post_category'] as $cat_id) : $link->settings['cats'][] = '{#'.$cat_id.'}'; endforeach; else : unset($link->settings['cats']); endif; // Tags if (isset($GLOBALS['fwp_post']['tags_input'])) : $link->settings['tags'] = array(); foreach (explode(',', $GLOBALS['fwp_post']['tags_input']) as $tag) : $link->settings['tags'][] = trim($tag); endforeach; endif; // Post status, comment status, ping status foreach (array('post', 'comment', 'ping') as $what) : $sfield = "feed_{$what}_status"; if (isset($GLOBALS['fwp_post'][$sfield])) : if ($GLOBALS['fwp_post'][$sfield]=='site-default') : unset($link->settings["{$what} status"]); else : $link->settings["{$what} status"] = $GLOBALS['fwp_post'][$sfield]; endif; endif; endforeach; // Unfamiliar author, unfamiliar categories foreach (array("author", "category") as $what) : $sfield = "unfamiliar_{$what}"; if (isset($GLOBALS['fwp_post'][$sfield])) : if ('site-default'==$GLOBALS['fwp_post'][$sfield]) : unset($link->settings["unfamiliar {$what}"]); elseif ('newuser'==$GLOBALS['fwp_post'][$sfield]) : $newuser_name = trim($GLOBALS['fwp_post']["{$sfield}_newuser"]); if (strlen($newuser_name) > 0) : $userdata = array(); $userdata['ID'] = NULL; $userdata['user_login'] = sanitize_user($newuser_name); $userdata['user_login'] = apply_filters('pre_user_login', $userdata['user_login']); $userdata['user_nicename'] = sanitize_title($newuser_name); $userdata['user_nicename'] = apply_filters('pre_user_nicename', $userdata['user_nicename']); $userdata['display_name'] = $wpdb->escape($newuser_name); $newuser_id = wp_insert_user($userdata); if (is_numeric($newuser_id)) : $link->settings["unfamiliar {$what}"] = $newuser_id; else : // TODO: Add some error detection and reporting endif; else : // TODO: Add some error reporting endif; else : $link->settings["unfamiliar {$what}"] = $GLOBALS['fwp_post'][$sfield]; endif; endif; endforeach; // Handle author mapping rules if (isset($GLOBALS['fwp_post']['author_rules_name']) and isset($GLOBALS['fwp_post']['author_rules_action'])) : unset($link->settings['map authors']); foreach ($GLOBALS['fwp_post']['author_rules_name'] as $key => $name) : // Normalize for case and whitespace $name = strtolower(trim($name)); $author_action = strtolower(trim($GLOBALS['fwp_post']['author_rules_action'][$key])); if (strlen($name) > 0) : if ('newuser' == $author_action) : $newuser_name = trim($GLOBALS['fwp_post']['author_rules_newuser'][$key]); if (strlen($newuser_name) > 0) : $userdata = array(); $userdata['ID'] = NULL; $userdata['user_login'] = sanitize_user($newuser_name); $userdata['user_login'] = apply_filters('pre_user_login', $userdata['user_login']); $userdata['user_nicename'] = sanitize_title($newuser_name); $userdata['user_nicename'] = apply_filters('pre_user_nicename', $userdata['user_nicename']); $userdata['display_name'] = $wpdb->escape($newuser_name); $newuser_id = wp_insert_user($userdata); if (is_numeric($newuser_id)) : $link->settings['map authors']['name'][$name] = $newuser_id; else : // TODO: Add some error detection and reporting endif; else : // TODO: Add some error reporting endif; else : $link->settings['map authors']['name'][$name] = $author_action; endif; endif; endforeach; endif; if (isset($GLOBALS['fwp_post']['add_author_rule_name']) and isset($GLOBALS['fwp_post']['add_author_rule_action'])) : $name = strtolower(trim($GLOBALS['fwp_post']['add_author_rule_name'])); $author_action = strtolower(trim($GLOBALS['fwp_post']['add_author_rule_action'])); if (strlen($name) > 0) : if ('newuser' == $author_action) : $newuser_name = trim($GLOBALS['fwp_post']['add_author_rule_newuser']); if (strlen($newuser_name) > 0) : $userdata = array(); $userdata['ID'] = NULL; $userdata['user_login'] = sanitize_user($newuser_name); $userdata['user_login'] = apply_filters('pre_user_login', $userdata['user_login']); $userdata['user_nicename'] = sanitize_title($newuser_name); $userdata['user_nicename'] = apply_filters('pre_user_nicename', $userdata['user_nicename']); $userdata['display_name'] = $wpdb->escape($newuser_name); $newuser_id = wp_insert_user($userdata); if (is_numeric($newuser_id)) : $link->settings['map authors']['name'][$name] = $newuser_id; else : // TODO: Add some error detection and reporting endif; else : // TODO: Add some error reporting endif; else : $link->settings['map authors']['name'][$name] = $author_action; endif; endif; endif; if (isset($GLOBALS['fwp_post']['cat_split'])) : if (strlen(trim($GLOBALS['fwp_post']['cat_split'])) > 0) : $link->settings['cat_split'] = trim($GLOBALS['fwp_post']['cat_split']); else : unset($link->settings['cat_split']); endif; endif; $alter[] = "link_notes = '".$wpdb->escape($link->settings_to_notes())."'"; $alter_set = implode(", ", $alter); // issue update query $result = $wpdb->query(" UPDATE $wpdb->links SET $alter_set WHERE link_id='$link_id' "); $updated_link = true; // reload link information from DB if (function_exists('clean_bookmark_cache')) : clean_bookmark_cache($link_id); endif; $link =& new SyndicatedLink($link_id); else : $updated_link = false; endif; $db_link = $link->link; $link_url = wp_specialchars($db_link->link_url, 1); $link_name = wp_specialchars($db_link->link_name, 1); $link_description = wp_specialchars($db_link->link_description, 'both'); $link_rss_uri = wp_specialchars($db_link->link_rss, 'both'); $post_status_global = get_option('feedwordpress_syndicated_post_status'); $comment_status_global = get_option('feedwordpress_syndicated_comment_status'); $ping_status_global = get_option('feedwordpress_syndicated_ping_status'); $status['post'] = array('publish' => '', 'private' => '', 'draft' => '', 'site-default' => ''); if (SyndicatedPost::use_api('post_status_pending')) : $status['post']['pending'] = ''; endif; $status['comment'] = array('open' => '', 'closed' => '', 'site-default' => ''); $status['ping'] = array('open' => '', 'closed' => '', 'site-default' => ''); foreach (array('post', 'comment', 'ping') as $what) : if (isset($link->settings["{$what} status"])) : $status[$what][$link->settings["{$what} status"]] = ' checked="checked"'; else : $status[$what]['site-default'] = ' checked="checked"'; endif; endforeach; $unfamiliar['author'] = array ('create' => '','default' => '','filter' => ''); $unfamiliar['category'] = array ('create'=>'','tag' => '','default'=>'','filter'=>''); foreach (array('author', 'category') as $what) : if (is_string($link->settings["unfamiliar {$what}"]) and array_key_exists($link->settings["unfamiliar {$what}"], $unfamiliar[$what])) : $key = $link->settings["unfamiliar {$what}"]; else: $key = 'site-default'; endif; $unfamiliar[$what][$key] = ' checked="checked"'; endforeach; if (is_array($link->settings['cats'])) : $cats = $link->settings['cats']; else : $cats = array(); endif; $dogs = SyndicatedPost::category_ids($cats, /*unfamiliar=*/ NULL); else : die( __('Link not found.') ); endif; ?>

Syndicated feed settings updated.

Edit a syndicated feed:

(validate)
: settings['update/last'])) : echo fwp_time_elapsed($link->settings['update/last'])." "; else : echo " none yet"; endif; ?>
Next update: settings['update/hold']) ? $link->settings['update/hold'] : 'scheduled'); ?>
= FWP_SCHEMA_25)) : fwp_option_box_opener('Syndicated Posts', 'syndicatedpostsdiv', 'postbox'); ?>
Publication:
Unfamiliar categories:

When one of the categories on a syndicated post is a category that FeedWordPress has not encountered before ...

Multiple categories:
Enter a Perl-compatible regular expression here if the feed provides multiple categories in a single category element. The regular expression should match the characters used to separate one category from the next. If the feed uses spaces (like del.icio.us), use the pattern "\s". If the feed does not provide multiple categories in a single element, leave this blank.
= FWP_SCHEMA_25) : fwp_tags_box($link->settings['tags']); fwp_linkedit_periodic_submit(); endif; ?> settings['map authors'])) : $i=0; foreach ($link->settings['map authors'] as $author_rules) : foreach ($author_rules as $author_name => $author_action) : $i++; ?>
For posts by authors that haven't been syndicated before:
Posts by new authors
Site-wide settings can be set in Syndication Options
named
For posts by specific authors. Blank out a name to delete the rule.
Posts by
named
Fill in to set up a new rule:
Posts by
named
:
:
settings as $key => $value) : if (!preg_match("\007^((".implode(')|(', $special_settings)."))$\007i", $key)) : ?>
Key Value Action
add new setting...
$what) : $do_it[$what][] = $link_id; endforeach; $alter = array(); if (count($do_it['hide']) > 0) : $hidem = "(".implode(', ', $do_it['hide']).")"; $alter[] = " UPDATE $wpdb->links SET link_visible = 'N' WHERE link_id IN {$hidem} "; endif; if (count($do_it['nuke']) > 0) : $nukem = "(".implode(', ', $do_it['nuke']).")"; // Make a list of the items syndicated from this feed... $post_ids = $wpdb->get_col(" SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'syndication_feed_id' AND meta_value IN {$nukem} "); // ... and kill them all if (count($post_ids) > 0) : foreach ($post_ids as $post_id) : wp_delete_post($post_id); endforeach; endif; $alter[] = " DELETE FROM $wpdb->links WHERE link_id IN {$nukem} "; endif; if (count($do_it['delete']) > 0) : $deletem = "(".implode(', ', $do_it['delete']).")"; // Make the items syndicated from this feed appear to be locally-authored $alter[] = " DELETE FROM $wpdb->postmeta WHERE meta_key = 'syndication_feed_id' AND meta_value IN {$deletem} "; // ... and delete the links themselves. $alter[] = " DELETE FROM $wpdb->links WHERE link_id IN {$deletem} "; endif; $errs = array(); $success = array (); foreach ($alter as $sql) : $result = $wpdb->query($sql); if (!$result): $errs[] = mysql_error(); endif; endforeach; if (count($alter) > 0) : echo "
\n"; if (count($errs) > 0) : echo "There were some problems processing your "; echo "unsubscribe request. [SQL: ".implode('; ', $errs)."]"; else : echo "Your unsubscribe request(s) have been processed."; endif; echo "
\n"; endif; return true; // Continue on to Syndicated Sites listing else : $targets = $wpdb->get_results(" SELECT * FROM $wpdb->links WHERE link_id IN (".implode(",",$link_ids).") "); ?>

Unsubscribe from Syndicated Links:

link_url, 1); $link_name = wp_specialchars($link->link_name, 1); $link_description = wp_specialchars($link->link_description, 'both'); $link_rss = wp_specialchars($link->link_rss, 'both'); ?>
Subscription :