View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000218 | WackoWiki | xml | public | 2008-08-12 22:28 | 2008-08-20 17:46 |
Reporter | ebal | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | always |
Status | acknowledged | Resolution | open | ||
Summary | 0000218: Atom Rss Feed | ||||
Description | i 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 Information | and 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 | ||||
Tags | No tags attached. | ||||
|
I forgot this : classes/wacko.php BEFORE: $this->WriteRecentChangesXML(); AFTER: $this->WriteRecentChangesXML(); $this->WriteRecentChangesATOM(); |
|
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. |
|
Replacing the RSS 2.0 with the Atom 1.0 (RFC 4287), both free and more modern format in a later release > R4.3 |
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 |