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; if (is_object($link) and $link->found()) : $alter = array (); $link->settings['postmeta'] = serialize($custom_settings); // 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; $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 : // update_option ... if (isset($GLOBALS['fwp_post']['feed_post_status'])) : update_option('feedwordpress_syndicated_post_status', $GLOBALS['fwp_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($_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; $updated_link = true; endif; else : $updated_link = false; endif; //////////////////////////////////////////////// // Get defaults from database ////////////////// //////////////////////////////////////////////// $post_status_global = get_option('feedwordpress_syndicated_post_status'); if (!$post_status_global) : $post_status_global = 'publish'; endif; $comment_status_global = get_option('feedwordpress_syndicated_comment_status'); if (!$comment_status_global) : $comment_status_global = 'closed'; endif; $ping_status_global = get_option('feedwordpress_syndicated_ping_status'); if (!$ping_status_global) : $ping_status_global = 'closed'; endif; $status['post'] = array('publish' => '', 'private' => '', 'draft' => ''); if (SyndicatedPost::use_api('post_status_pending')) : $status['post']['pending'] = ''; endif; $status['comment'] = array('open' => '', 'closed' => ''); $status['ping'] = array('open' => '', 'closed' => ''); if (is_object($link) and $link->found()) : $thePostsPhrase = __('posts from this feed'); foreach (array('post', 'comment', 'ping') as $what) : $status[$what]['site-default'] = ''; if (isset($link->settings["{$what} status"])) : $status[$what][$link->settings["{$what} status"]] = ' checked="checked"'; else : $status[$what]['site-default'] = ' checked="checked"'; endif; endforeach; $custom_settings = $link->settings["postmeta"]; if ($custom_settings) : $custom_settings = unserialize($custom_settings); endif; if (!is_array($custom_settings)) : $custom_settings = array(); endif; else : $thePostsPhrase = __('syndicated posts'); $status['post'][$post_status_global] = ' checked="checked"'; $status['comment'][$comment_status_global] = ' checked="checked"'; $status['ping'][$ping_status_global] = ' checked="checked"'; $munge_permalink = get_option('feedwordpress_munge_permalink'); $formatting_filters = get_option('feedwordpress_formatting_filters'); $use_aggregator_source_data = get_option('feedwordpress_use_aggregator_source_data'); $custom_settings = get_option('feedwordpress_custom_settings'); if ($custom_settings) : $custom_settings = unserialize($custom_settings); endif; if (!is_array($custom_settings)) : $custom_settings = array(); endif; endif; ?>
Syndicated posts settings updated.