Upgrader task for syndication plugin (#196)
This commit is contained in:
parent
2439399c08
commit
ac24978984
@ -221,6 +221,11 @@ $tasks = array(array('version' => '0.5.1',
|
|||||||
'arguments' => array($dead_htmlarea_dirs),
|
'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>'),
|
'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.'),
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Fetch SQL files which needs to be run */
|
/* Fetch SQL files which needs to be run */
|
||||||
|
@ -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,
|
array('title' => INSTALL_CAT_FEEDS,
|
||||||
'description' => INSTALL_CAT_FEEDS_DESC,
|
'description' => INSTALL_CAT_FEEDS_DESC,
|
||||||
'items' => array(
|
'items' => array(
|
||||||
array('var' => 'fullfeed',
|
array('var' => 'feedFull',
|
||||||
'title' => SYNDICATION_PLUGIN_FULLFEED,
|
'title' => SYNDICATION_PLUGIN_FULLFEED,
|
||||||
'description' => '',
|
'description' => '',
|
||||||
'type' => 'list',
|
'type' => 'list',
|
||||||
|
2
rss.php
2
rss.php
@ -212,7 +212,7 @@ if (is_array($metadata['additional_fields'])) {
|
|||||||
$metadata['additional_fields'][$aid] = $af;
|
$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 ($metadata['fullFeed'] === 'client') {
|
||||||
if ($_GET['fullFeed'] || $serendipity['GET']['fullFeed']) {
|
if ($_GET['fullFeed'] || $serendipity['GET']['fullFeed']) {
|
||||||
$metadata['fullFeed'] = true;
|
$metadata['fullFeed'] = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user