Changeset 1732

Show
Ignore:
Timestamp:
06/09/07 23:29:34 (16 months ago)
Author:
mdodoo
Message:

Adds an auto-discoverable Atom feed and an Atom link in the footer. The auto-discovery in the header seems to be causing Firefox
2 to only list the Atom feed (IE7 and Firefox 3.0alpha5 properly detect both feeds); pretty sure that this is a bug.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/gregarius/plugins/rssview.php

    r1443 r1732  
    3030/// Author: Marco Bonetti 
    3131/// Description: Adds a RSS link to the header and the footer of each page 
    32 /// Version: 0.6 
     32/// Version: 0.7 
    3333 
    3434/** 
     
    3737 * 0.5 - Adapted to the new theme model 
    3838 * 0.6 - Don't put a link in admin and other locations 
     39 * 0.7 - Show ATOM link as well. 
    3940 */ 
    4041 
    41 function __rss_view_url() { 
     42function __rss_view_url($type = "rss") { 
    4243    $url    = guessTransportProto() . $_SERVER['HTTP_HOST']; 
    4344    $url .= $_SERVER["REQUEST_URI"]; 
    4445 
    4546    if (strstr($_SERVER['REQUEST_URI'],"?") !== FALSE) { 
    46         $url .= "&media=rss"; 
     47        $url .= "&media=$type"; 
    4748    } else { 
    48         $url .= "?media=rss"; 
     49        $url .= "?media=$type"; 
    4950    } 
    5051    $url .= __rss_view_post2get(); 
     
    6970    if (!defined('RSS_FILE_LOCATION')) { 
    7071        echo "<span><a href=\"".__rss_view_url()."\">RSS</a></span>\n"; 
     72        echo "<span><a href=\"".__rss_view_url("atom")."\">Atom</a></span>\n"; 
    7173    } 
    7274    return $dummy; 
     
    7678    if (!defined('RSS_FILE_LOCATION')) { 
    7779        echo "\t<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS\" href=\"".__rss_view_url()."\" />\n"; 
     80        echo "\t<link rel=\"alternate\" type=\"application/atom+xml\" title=\"Atom\" href=\"".__rss_view_url("atom")."\" />\n"; 
    7881    } 
    7982    return $dummy;