]> git.mjollnir.org Git - s9y.git/commitdiff
Allow to force feedburner service
authorgarvinhicking <garvinhicking>
Thu, 20 Apr 2006 08:58:01 +0000 (08:58 +0000)
committergarvinhicking <garvinhicking>
Thu, 20 Apr 2006 08:58:01 +0000 (08:58 +0000)
docs/NEWS
include/plugin_internal.inc.php
rss.php

index 3778be164f7e869fd6af2839390f88d9fd41f81a..95a583a405c9c2a27bcbd6c8087d7b91e225c020 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -35,6 +35,11 @@ Version 1.1-alpha4()
          - Enhanced media filter for keywords
 
      TODO:
+         - Use entered comments in the "You choose..." picking page
+
+         - Deleting an image shall redirect back to originating screen,
+           not empty acknowledge page
+
          - Search/Filter for specific properties/keywords:
             Search by: custom property fields. Evaluate input data from
             serendipity_getImageFields(): 'date', 'intrange', 'text'
@@ -103,6 +108,10 @@ Version 1.1-alpha4()
 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
index f8c75104111ceecee5ee50fd52da36d207fc7561..db1f76871d4ccd1fc6bc1e845428697490ee71fc 100644 (file)
@@ -660,7 +660,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',
@@ -738,7 +738,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;
@@ -751,7 +751,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');
@@ -921,7 +933,7 @@ class serendipity_syndication_plugin extends serendipity_plugin {
 <?php
         }
 
-        if (serendipity_db_bool($this->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 8078300964c713c678735e1eec7a522e032246ae..6b260b3e1d033c13a8e63e6a41c1a6f8ea1ae0d1 100644 (file)
--- a/rss.php
+++ b/rss.php
@@ -137,6 +137,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;
         }