]> git.mjollnir.org Git - s9y.git/commitdiff
feedburner patch by anders clerwall
authorgarvinhicking <garvinhicking>
Mon, 13 Jun 2005 19:45:48 +0000 (19:45 +0000)
committergarvinhicking <garvinhicking>
Mon, 13 Jun 2005 19:45:48 +0000 (19:45 +0000)
docs/NEWS
include/plugin_internal.inc.php

index 6ae2576196e02971ff27d215b76bb7d6ce43f33b..c5e845052de9b2a3efc0f87555cee81f8f8e31d8 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,8 @@
 Version 0.9 ()
 ------------------------------------------------------------------------
 
+    * Apply patch to allow usage of Feedburner RSS feeds, by Anders Clerwall
+
     * Fixed using "_" instead of "-" in the approve trackback/comments 
       URLs. (garvinhicking)
 
index 3b8893c7d58ad63fd0daa7be8cd4faeea8d9104d..231f934d690a46bdf17c69165ae239fa90829cf7 100644 (file)
@@ -465,6 +465,7 @@ class serendipity_syndication_plugin extends serendipity_plugin {
                                         'show_2.0c',
                                         'show_atom0.3',
                                         'show_opml1.0',
+                                        'show_feedburner',
                                         'seperator',
                                         'show_mail',
                                         'field_managingEditor',
@@ -475,6 +476,11 @@ class serendipity_syndication_plugin extends serendipity_plugin {
                                         'bannerURL',
                                         'bannerWidth',
                                         'bannerHeight',
+                                        'seperator',
+                                        'fb_id',
+                                        'fb_title',
+                                        'fb_alt',
+                                        'fb_img',
                                        )
         );
     }
@@ -531,6 +537,13 @@ class serendipity_syndication_plugin extends serendipity_plugin {
                 $propbag->add('default',     'false');
                 break;
 
+            case 'show_feedburner':
+                $propbag->add('type',        'boolean');
+                $propbag->add('name',        sprintf(SYNDICATION_PLUGIN_GENERIC_FEED, 'FeedBurner'));
+                $propbag->add('description', '');
+                $propbag->add('default',     'false');
+                break;
+
             case 'seperator':
                 $propbag->add('type',        'seperator');
                 break;
@@ -591,6 +604,35 @@ class serendipity_syndication_plugin extends serendipity_plugin {
                 $propbag->add('default',     '');
                 break;
 
+            case 'fb_id':
+                $propbag->add('type',        'string');
+                $propbag->add('name',        SYNDICATION_PLUGIN_FEEDBURNERID);
+                $propbag->add('description', SYNDICATION_PLUGIN_FEEDBURNERID_DESC);
+                $propbag->add('default',     '');
+                break;
+
+            case 'fb_img':
+                $propbag->add('type',        'string');
+                $propbag->add('name',        SYNDICATION_PLUGIN_FEEDBURNERIMG);
+                $propbag->add('description', SYNDICATION_PLUGIN_FEEDBURNERIMG_DESC);
+                $propbag->add('default',     'fbapix.gif');
+                break;
+
+            case 'fb_title':
+                $propbag->add('type',        'string');
+                $propbag->add('name',        SYNDICATION_PLUGIN_FEEDBURNERTITLE);
+                $propbag->add('description', SYNDICATION_PLUGIN_FEEDBURNERTITLE_DESC);
+                $propbag->add('default',     '');
+                break;
+
+            case 'fb_alt':
+                $propbag->add('type',        'string');
+                $propbag->add('name',        SYNDICATION_PLUGIN_FEEDBURNERALT);
+                $propbag->add('description', SYNDICATION_PLUGIN_FEEDBURNERALT_DESC);
+                $propbag->add('default',     '');
+                break;
+
+
             default:
                 return false;
         }
@@ -656,6 +698,27 @@ class serendipity_syndication_plugin extends serendipity_plugin {
         </div>
 <?php
         }
+
+        if (serendipity_db_bool($this->get_config('show_feedburner', false))) {
+                       $alt = $this->get_config('fb_alt');
+                       $url = 'http://feeds.feedburner.com/' . $this->get_config('fb_id');
+                       $img = $this->get_config('fb_img');
+                       if (strlen($img) == 0) {
+                               $img = 'http://feeds.feedburner.com/~fc/'.$this->get_config('fb_id').'?bg=99CCFF&amp;fg=444444&amp;anim=0';
+                       } else {
+                               $img = 'http://www.feedburner.com/fb/images/pub/'.$img;
+                       }
+?>
+        <div style="padding-bottom: 2px;">
+                       <a href="<?php echo $url; ?>"<?php if (strlen($alt) > 0) echo " title=\"$alt\""; ?>><img src="<?php echo $img; ?>" alt="" style="border:0"/></a>
+            <?php
+                       $mytitle = $this->get_config('fb_title');
+                       if (strlen($mytitle) > 0) { ?>
+                       <a href="<?php echo $url; ?>"><?php echo $mytitle; ?></a>
+            <?php } ?>
+               </div>
+<?php
+               }
     }
 
     function generate_rss_fields(&$title, &$description, &$entries) {
@@ -852,7 +915,7 @@ class serendipity_html_nugget_plugin extends serendipity_plugin {
         } else {
             $desc        = HOLDS_A_BLAHBLAH;
         }
-        
+
         $propbag->add('name',          HTML_NUGGET);
         $propbag->add('description',   $desc);
         $propbag->add('stackable',     true);
@@ -979,7 +1042,7 @@ class serendipity_categories_plugin extends serendipity_plugin {
                 $propbag->add('description',  CATEGORIES_ALLOW_SELECT_DESC);
                 $propbag->add('default',      true);
                 break;
-            
+
             case 'sort_order':
                 $select = array();
                 $select['category_name']        = CATEGORY;
@@ -1042,7 +1105,7 @@ class serendipity_categories_plugin extends serendipity_plugin {
             $categories = serendipity_walkRecursive($categories, 'categoryid', 'parentid', VIEWMODE_THREADED);
             foreach ( $categories as $cat ) {
                 $html .= '<div style="padding-bottom: 2px;">';
-                
+
                 if ($is_form) {
                     $html .= '<input style="width: 15px" type="checkbox" name="serendipity[multiCat][]" value="' . $cat['categoryid'] . '" />';
                 }