From: garvinhicking Date: Thu, 20 Apr 2006 08:58:04 +0000 (+0000) Subject: Allow to force feedburner service X-Git-Tag: 1.0~41 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=9d67cc4fe2f7324991f3c5deddf810b505eb909f;p=s9y.git Allow to force feedburner service --- diff --git a/docs/NEWS b/docs/NEWS index beb22c3..49bba2c 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,10 @@ Version 1.0 () ------------------------------------------------------------------------ + * Support "Force Feedburner" option to the syndication plugin to + let rss.php only be accessible to feedburner and no clients. + (garvinhicking) + * Add Akismet antispam support (garvinhicking) * Saving special crafterd configuration data as Admin superuser diff --git a/include/plugin_internal.inc.php b/include/plugin_internal.inc.php index 3871d4f..902a224 100644 --- a/include/plugin_internal.inc.php +++ b/include/plugin_internal.inc.php @@ -655,7 +655,7 @@ class serendipity_syndication_plugin extends serendipity_plugin { $propbag->add('description', SHOWS_RSS_BLAHBLAH); $propbag->add('stackable', true); $propbag->add('author', 'Serendipity Team'); - $propbag->add('version', '1.0'); + $propbag->add('version', '1.1'); $propbag->add('configuration', array( 'fullfeed', 'show_0.91', @@ -733,7 +733,7 @@ class serendipity_syndication_plugin extends serendipity_plugin { case 'show_atom1.0': $propbag->add('type', 'boolean'); - $propbag->add('name', SYNDICATION_PLUGIN_ATOM10); + $propbag->add('name', sprintf(SYNDICATION_PLUGIN_GENERIC_FEED, 'Atom 1.0')); $propbag->add('description', ''); $propbag->add('default', 'true'); break; @@ -746,7 +746,19 @@ class serendipity_syndication_plugin extends serendipity_plugin { break; case 'show_feedburner': - $propbag->add('type', 'boolean'); + $radio = array(); + $radio['value'][] = 'false'; + $radio['desc'][] = NO; + + $radio['value'][] = 'true'; + $radio['desc'][] = YES; + + $radio['value'][] = 'force'; + $radio['desc'][] = FORCE; + + $propbag->add('type', 'radio'); + $propbag->add('radio_per_row', '3'); + $propbag->add('radio', $radio); $propbag->add('name', sprintf(SYNDICATION_PLUGIN_GENERIC_FEED, 'FeedBurner')); $propbag->add('description', ''); $propbag->add('default', 'false'); @@ -916,7 +928,7 @@ class serendipity_syndication_plugin extends serendipity_plugin { get_config('show_feedburner', false))) { + if (serendipity_db_bool($this->get_config('show_feedburner', false)) || $this->get_config('show_feedburner', false) === 'force') { $alt = $this->get_config('fb_alt'); $url = 'http://feeds.feedburner.com/' . $this->get_config('fb_id'); $img = $this->get_config('fb_img'); diff --git a/rss.php b/rss.php index 05777a0..1ea9982 100644 --- a/rss.php +++ b/rss.php @@ -129,6 +129,12 @@ if (is_array($plugins)) { } } $metadata['fullFeed'] = $plugin->get_config('fullfeed', false); + + if ($plugin->get_config('show_feedburner') === 'force' && !preg_match('@Mozilla@i', $_SERVER['HTTP_USER_AGENT'])) { + $url = 'http://feeds.feedburner.com/' . $plugin->get_config('fb_id'); + header('Location: ' . $url); + exit; + } $metadata['showMail'] = serendipity_db_bool($plugin->get_config('show_mail', $metadata['showMail'])); break; }