Upgrader task for syndication plugin ()

This commit is contained in:
onli 2014-07-07 01:36:45 +02:00
parent 2439399c08
commit ac24978984
4 changed files with 37 additions and 2 deletions

@ -220,6 +220,11 @@ $tasks = array(array('version' => '0.5.1',
'title' => 'Removal of obsolete and dead htmlarea directories',
'arguments' => array($dead_htmlarea_dirs),
'desc' => 'Serendipity 2.0 replaces old WYSIWYG-Editors in htmlarea directory with CKEDITOR. The following dead directories will be completely removed from "/htmlarea".<br /><pre>' . implode(', ', $dead_htmlarea_dirs) . '</pre>'),
array('version' => '2.0-beta3',
'function' => 'serendipity_upgrader_move_syndication_config',
'title' => 'Export syndication plugin options',
'desc' => 'Serendipity 2.0 moved the more generic feed option from the syndication plugin into the core. They will be set equivalent to their old configuration.'),
);

@ -368,3 +368,33 @@ function serendipity_upgrader_rename_plugins() {
}
}
function serendipity_upgrader_move_syndication_config() {
global $serendipity;
$optionsToPort = array( 'bannerURL' => 'feedBannerURL',
'fullfeed' => 'feedFull',
'bannerWidth' => 'feedBannerWidth',
'bannerHeight' => 'feedBannerHeight',
'show_mail' => 'feedShowMail',
'field_managingEditor' => 'feedManagingEditor',
'field_webMaster' => 'feedWebmaster',
'field_ttl' => 'feedTtl',
'field_pubDate' => 'feedPubDate'
);
foreach ($optionsToPort as $oldPluginOption => $newGeneralOption) {
$value = serendipity_db_query("SELECT value FROM {$serendipity['dbPrefix']}config WHERE NAME LIKE 'serendipity_plugin_syndication%{$oldPluginOption}'", true);
if (is_array($value)) {
$value = $value[0];
}
serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}config('name', 'value') VALUES ('$newGeneralOption', '". serendipity_db_escape_string($value) ."')");
}
$fbid = serendipity_db_query("SELECT value FROM {$serendipity['dbPrefix']}config WHERE NAME LIKE 'serendipity_plugin_syndication%fb_id'");
$show_feedburner = serendipity_db_query("SELECT value FROM {$serendipity['dbPrefix']}config WHERE NAME LIKE 'serendipity_plugin_syndication%show_feedburner'");
if ($show_feedburner == "force") {
if (! empty($fbid) ) {
$fburl = 'http://feeds.feedburner.com/' . $fbid;
serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}config('name', 'value') VALUES ('feedCustom', '" . serendipity_db_escape_string($fburl) ."')");
}
}
}

@ -542,7 +542,7 @@
array('title' => INSTALL_CAT_FEEDS,
'description' => INSTALL_CAT_FEEDS_DESC,
'items' => array(
array('var' => 'fullfeed',
array('var' => 'feedFull',
'title' => SYNDICATION_PLUGIN_FULLFEED,
'description' => '',
'type' => 'list',

@ -212,7 +212,7 @@ if (is_array($metadata['additional_fields'])) {
$metadata['additional_fields'][$aid] = $af;
}
}
$metadata['fullFeed'] = serendipity_get_config_var('fullfeed', false);
$metadata['fullFeed'] = serendipity_get_config_var('feedFull', false);
if ($metadata['fullFeed'] === 'client') {
if ($_GET['fullFeed'] || $serendipity['GET']['fullFeed']) {
$metadata['fullFeed'] = true;