View Issue Details

IDProjectCategoryView StatusLast Update
0000218WackoWikixmlpublic2008-08-20 17:46
Reporterebal Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status acknowledgedResolutionopen 
Summary0000218: Atom Rss Feed
Descriptioni made an atom rss for recent changes : wacko.php

   // ATOM
   function WriteRecentChangesATOM() {
    $xml = "<?xml version=\"1.0\" encoding=\"".$this->GetCharset()."\"?>\n";
    $xml .= "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n\n";
    $xml .= "<title>".$this->GetConfigValue("wakka_name").$this->GetResourceValue("RecentChangesTitleXML")."</title>\n";
    $xml .= "<subtitle>".$this->GetResourceValue("RecentChangesXML").$this->GetConfigValue("wakka_name")." </subtitle>\n";
    $page = "RecentChanges";
    $xml .= "<id>".$this->href("show", $page["tag"], "time=".urlencode($page["time"]))."</id>\n";
    $xml .= "<logo>\n".$this->GetConfigValue("root_url")."files/wacko4.gif"."</logo>\n";
    $xml .= "<link href=\"".$this->GetConfigValue("root_url")."\"/>\n";
    $xml .= "<updated>".date('c', strtotime($page['time']))."</updated>\n";

      if ( $pages = $this->LoadRecentlyChanged() ) {
         foreach ($pages as $i => $page) {
            if ( $this->config["hide_locked"] ) $access =$this->HasAccess("read",$page["tag"],"guest@wacko");
            if ( $access && ($count < 30) ) {
               $count++;
        $xml .= "<entry>\n";
        $xml .= "<title>".$page["tag"]."</title>\n";
        $xml .= "<link href=\"".$this->href("show", $page["tag"], "time=".urlencode($page["time"]))."\"/>\n";
        $xml .= "<id>".$this->href("show", $page["tag"], "time=".urlencode($page["time"]))."</id>\n";
        $xml .= "<author><name>".$page["user"]."</name></author>\n";
        $xml .= "<updated>".date('c', strtotime($page['time']))."</updated>\n";
        $xml .= "<summary>".$page["time"]." by ".$page["user"]."</summary>\n";
        $xml .= "</entry>\n";
            }
         }
      }
    $xml .= "</feed>\n";
      $filename = "xml/recentchanges_".preg_replace("/[^a-zA-Z0-9]/", "", strtolower($this->GetConfigValue("wakka_name")))."_atom.xml";

      $fp = @fopen($filename, "w");
      if ( $fp ) {
         fwrite($fp, $xml);
         fclose($fp);
      }
   } // end of ATOM

Additional Informationand at action/changes.php

from :

if ($root=="" && !(int)$noxml) print("<a href=\"".$this->GetConfigValue("root_url")."xml/recentchanges_".preg_replace("/[^a-zA-Z0-9]/", "", strtolower($this->GetConfigValue("wakka_name"))).".xml\"><img src=\"".$this->GetConfigValue("theme_url")."icons/xml.gif"."\" title=\"".$this->GetResourceValue("RecentChangesXMLTip")."\" alt=\"XML\" /></a>

");

TO:

if ($root=="" && !(int)$noxml) {

print("<a href=\"".$this->GetConfigValue("root_url")."xml/recentchanges_".preg_replace("/[^a-zA-Z0-9]/", "", strtolower($this->GetConfigValue("wakka_name"))).".xml\"><img src=\"".$this->GetConfigValue("theme_url")."icons/xml.gif"."\" title=\"".$this->GetResourceValue("RecentChangesXMLTip")."\" alt=\"XML\" /></a>

");

// ATOM
print("<a href=\"".$this->GetConfigValue("root_url")."xml/recentchanges_".preg_replace("/[^a-zA-Z0-9]/", "", strtolower($this->GetConfigValue("wakka_name")))."_atom.xml\"><img src=\"".$this->GetConfigValue("theme_url")."icons/xml.gif"."\" title=\"".$this->GetResourceValue("RecentChangesXMLTip")."\" alt=\"ATOM\" /></a>

");

}

---

of course we should add an icons/atom.gif and a new RecentChangesATOMTip in wakka.xy.php
TagsNo tags attached.

Activities

ebal

2008-08-13 07:26

developer   ~0000470

I forgot this :

classes/wacko.php

BEFORE:
$this->WriteRecentChangesXML();

AFTER:
$this->WriteRecentChangesXML();
$this->WriteRecentChangesATOM();

administrator

2008-08-13 15:44

administrator   ~0000471

Last edited: 2008-08-13 15:45

to offer (and write) both (and then for every case) is a bit of overkill and will produce the same result, most RSS readers support at least RSS 2.0 and Atom

"Every time you provide an option, you’re asking the user to make a decision."

For now RSS serves the purpose. In this case less is more.

administrator

2008-08-20 17:36

administrator   ~0000475

Replacing the RSS 2.0 with the Atom 1.0 (RFC 4287), both free and more modern format in a later release > R4.3

Issue History

Date Modified Username Field Change
2008-08-12 22:28 ebal New Issue
2008-08-12 22:28 ebal Legacy => NEW
2008-08-13 07:26 ebal Note Added: 0000470
2008-08-13 15:44 administrator Note Added: 0000471
2008-08-13 15:45 administrator Note Edited: 0000471
2008-08-20 17:36 administrator Note Added: 0000475
2008-08-20 17:37 administrator Status new => acknowledged
2008-08-20 17:46 administrator Category RSS => XML
2010-03-08 10:24 administrator Category XML => xml