[Gnucash-changes] r14310 - htdocs/trunk - Migrate RSS feed to Atom.
HTTP redirect, new linkage, feed-icons.
Joshua Sled
jsled at cvs.gnucash.org
Sat Jun 3 18:31:43 EDT 2006
Author: jsled
Date: 2006-06-03 18:31:42 -0400 (Sat, 03 Jun 2006)
New Revision: 14310
Trac: http://svn.gnucash.org/trac/changeset/14310
Added:
htdocs/trunk/images/feed-icon-12x12.png
htdocs/trunk/images/feed-icon-32x32.png
Removed:
htdocs/trunk/images/rss.gif
htdocs/trunk/rss-feed.phtml
Modified:
htdocs/trunk/.htaccess
htdocs/trunk/externals/footer.phtml
htdocs/trunk/externals/menu.phtml
Log:
Migrate RSS feed to Atom. HTTP redirect, new linkage, feed-icons.
Modified: htdocs/trunk/.htaccess
===================================================================
--- htdocs/trunk/.htaccess 2006-06-03 21:20:52 UTC (rev 14309)
+++ htdocs/trunk/.htaccess 2006-06-03 22:31:42 UTC (rev 14310)
@@ -1,3 +1,5 @@
Options MultiViews
DirectoryIndex index.phtml index.php index.html
AddType application/x-httpd-php .phtml
+Redirect permanent /rss-feed.phtml http://www.gnucash.org/atom.php
+
Modified: htdocs/trunk/externals/footer.phtml
===================================================================
--- htdocs/trunk/externals/footer.phtml 2006-06-03 21:20:52 UTC (rev 14309)
+++ htdocs/trunk/externals/footer.phtml 2006-06-03 22:31:42 UTC (rev 14310)
@@ -1,6 +1,6 @@
<div id="tail">
<p id="validation"><a href="http://validator.w3.org/check/referer"><img src="<?=$top_dir?>/images/valid-html40.png" alt="valid HTML" width="88" height="31" /></a></p>
-<p id="rss"><a href="<?=$home?>/rss-feed.phtml"><img src="<?=$top_dir?>/images/rss.gif" alt="rss logo" width="36" height="14" /></a></p>
+<p id="rss"><a href="<?=$home?>/atom.php"><img src="<?=$top_dir?>/images/feed-icon-32x32.png" alt="[atom syndication feed]" width="32" height="32" /></a></p>
<p style="text-align:center;"><b>Copyright © 2001-2006 The GnuCash Project</b></p>
<p style="text-align:center;"><?= _("Server & email outage reports to: ")?><a href="mailto:gnucash-devel at gnucash.org"><b>gnucash-devel at gnucash.org</b></a></p>
<p style="text-align:center;"><?= _("Translation problems? Contact: <a href=\"mailto:gnucash-devel at gnucash.org\"><b>gnucash-devel at gnucash.org</b></a>");?></p>
Modified: htdocs/trunk/externals/menu.phtml
===================================================================
--- htdocs/trunk/externals/menu.phtml 2006-06-03 21:20:52 UTC (rev 14309)
+++ htdocs/trunk/externals/menu.phtml 2006-06-03 22:31:42 UTC (rev 14310)
@@ -11,7 +11,8 @@
<b><?= _("Information")?></b>
</span>
<ul>
- <li><a href="<?=$home?>/index.phtml"><?= _("About / News")?></a></li>
+ <li><a href="<?=$home?>/index.phtml"><?= _("About / News")?></a><li>
+ <li><a href="<?=$home?>/atom.php"><img src="<?=$home?>/images/feed-icon-12x12.png" width="12" height="12" alt="[atom feed]" /> News Feed</a></li>
<li><a href="<?=$home?>/features.phtml"><?=_("Features")?></a></li>
<li><a href="http://wiki.gnucash.org/wiki/Development"><?= _("How to help")?></a></li>
</ul>
Added: htdocs/trunk/images/feed-icon-12x12.png
===================================================================
(Binary files differ)
Property changes on: htdocs/trunk/images/feed-icon-12x12.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: htdocs/trunk/images/feed-icon-32x32.png
===================================================================
(Binary files differ)
Property changes on: htdocs/trunk/images/feed-icon-32x32.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: htdocs/trunk/images/rss.gif
===================================================================
(Binary files differ)
Deleted: htdocs/trunk/rss-feed.phtml
===================================================================
--- htdocs/trunk/rss-feed.phtml 2006-06-03 21:20:52 UTC (rev 14309)
+++ htdocs/trunk/rss-feed.phtml 2006-06-03 22:31:42 UTC (rev 14310)
@@ -1,141 +0,0 @@
-<?php include("../emulate_globals_on.php"); ?>
-<?php
- // This file reads the news items in the /news directory and turns
- // them into Dave Winer RSS-2.0 specification news items.
- //
- // The only tricky bits are that you can't embed html in the RSS feed,
- // and our news posts have html in them. So I've gotta strip that out.
- // the other tricky part is that I strip out blank lines in the feed.
- // so that people who write stories with lots of blank lines at the
- // begining aren't screwd.
- //
- // tested, works with straw-0.22
- // tested, does not work with evolution-1.4 (because it wants RSS-1.0 maybe ??)
- //
- // Created by Linas Vepstas 2003, 2004
-
- header("Content-Type: application/rss+xml; charset=iso-8859-1");
- echo ("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
-?>
-
- <rss version="2.0" encoding="iso-8859-1">
- <channel>
- <!-- <channel rdf:about="http://www.xml.com/xml/news.rss"> -->
- <title>GnuCash News</title>
- <link>http://www.gnucash.org/</link>
- <description>News and Announces concerning the GnuCash Project</description>
- <language>en-us</language>
- <ttl>360</ttl>
- <generator>Why, exactly, do you think this field is interesting? version 99</generator>
- <copyright>Copyright 2001-2004, The GnuCash Project</copyright>
- <image>
- <url>http://www.gnucash.org/favicon.png</url>
- <title>GnuCash News</title>
- <link>http://www.gnucash.org/</link>
- </image>
-
-<?php
- function whack ($line, $item) {
- $n = strlen ($item);
- $s = strstr ($line, $item);
- while ($s) {
- $pos = strpos ($line, $item);
- for ($i=0; $i<$n; $i++) {
- $line[$pos+$i] = ' ';
- }
- $s = strstr ($line, $item);
- }
- return $line;
- }
-
- $newspath = "$topdir/news/";
- $newsfile = array();
- $hd = dir($newspath);
- while( $filename = $hd->read() ) {
- $s=strtolower($filename);
- if (strstr($s, ".txt")) {
- // Determine last modification date
- $lastchanged=filemtime($newspath.$filename);
- $newsfile[$filename] = $lastchanged;
- }
- }
-
- // Sort files in descending order
- arsort($newsfile);
-
- // Output files to browser
- for(reset($newsfile); $key = key($newsfile); next($newsfile))
- {
- $fa = file($newspath.$key);
-
- // echo("<item rdf:about=\"http://xml.com/pub/2000/08/09/xslt/xslt.html\">"\n);
- echo("<item>\n");
- echo("<title>");
-
- // Straw won't take <b> tags in the title, and they get into
- // the news by default. We've got to eliminate them.
- // do this with ultra-low-brow hack: over-write with blanks
- $line = $fa[0];
- $line = whack ($line, "<b>");
- $line = whack ($line, "</b>");
-
- print $line;
-
- // print " - (". date( "Y-m-d ", $newsfile[$key]) ;
- // print date( "H:i:s",$newsfile[$key]). ")";
-
- echo("</title>\n");
- echo("<description>");
-
- // count number of lines, limit to first 5 ...
- // which means we have to find and skip blank lines
- $n=count($fa);
-
- $i=1;
- $nonblank=0;
- while (($i<$n) && ($nonblank < 5)) {
- // dammit agreagators are real picky We have to strip out all the html
- $line = $fa[$i];
- $line = whack ($line, "<p>");
- $line = whack ($line, "<b>");
- $line = whack ($line, "</b>");
- $line = whack ($line, "<i>");
- $line = whack ($line, "</i>");
- $line = whack ($line, "<br>");
- $line = whack ($line, "<tt>");
- $line = whack ($line, "</tt>");
- $line = whack ($line, "<big>");
- $line = whack ($line, "</big>");
- $line = whack ($line, "</a>");
-
- $ref = strpos ($line, "<a href");
- if ($ref !== false) {
- $start = substr ($line, 0, $ref);
- print $start;
- $ref = strpos ($line, ">");
- $end = substr ($line, $ref+1, strlen ($line));
- print $end;
- $i ++;
- continue;
- }
- $non = strspn ($line, " \n");
- if ($non != strlen($line)) {
- print $line;
- $nonblank ++;
- }
- $i ++;
- }
- echo("</description>\n");
- echo("<link>");
- echo("http://www.gnucash.org/#");
- print $key;
- echo("</link>\n");
- // print "<pubDate>". date( "Y m d ", $newsfile[$key]). date( "H:i:s",$newsfile[$key]). " CST</pubDate>\n";
- print "<pubDate>". date( "r", $newsfile[$key]). "</pubDate>\n";
- echo("</item>\n");
- }
-
- $hd->close();
- ?>
- </channel>
-</rss>
More information about the gnucash-changes
mailing list