[med-svn] r493 - in trunk/community/website: . inc

hanska-guest at alioth.debian.org hanska-guest at alioth.debian.org
Tue Oct 2 11:10:26 UTC 2007


Author: hanska-guest
Date: 2007-10-02 11:10:26 +0000 (Tue, 02 Oct 2007)
New Revision: 493

Added:
   trunk/community/website/footer.html
   trunk/community/website/inc/
   trunk/community/website/inc/getrss.js
   trunk/community/website/inc/rss.php
   trunk/community/website/index.php
Removed:
   trunk/community/website/index.html
Log:
Implementing RSS reader


Copied: trunk/community/website/footer.html (from rev 490, trunk/community/website/index.html)
===================================================================
--- trunk/community/website/footer.html	                        (rev 0)
+++ trunk/community/website/footer.html	2007-10-02 11:10:26 UTC (rev 493)
@@ -0,0 +1,4 @@
+<hr />
+<address>$ SVN export - rev. #REV# - Last update by <a href="http://alioth.debian.org/users/#AUTHOR#">#AUTHOR#</a> - #DATE# $</address>
+</body>
+</html>

Added: trunk/community/website/inc/getrss.js
===================================================================
--- trunk/community/website/inc/getrss.js	                        (rev 0)
+++ trunk/community/website/inc/getrss.js	2007-10-02 11:10:26 UTC (rev 493)
@@ -0,0 +1,48 @@
+var xmlHttp
+
+function showRSS()
+{
+	xmlHttp = GetXmlHttpObject()
+	if (xmlHttp == null)
+	{
+		alert("Browser does not support HTTP Request")
+		return
+	}
+	
+	xmlHttp.onreadystatechange = stateChanged
+	xmlHttp.open("GET", "http://cia.vc/stats/project/Debian-Med/.rss", true)
+	xmlHttp.send(null)
+}
+
+function stateChanged()
+{
+	if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete")
+	{
+		document.getElementById("rssOutput").innerHTML = xmlHttp.responseText
+	}
+}
+
+function GetXmlHttpObject()
+{
+	var xmlHttp = null
+	
+	try
+	{
+		// Firefox, Opera 8.0+, Safari
+		xmlHttp = new XMLHttpRequest()
+	}
+	catch (e)
+	{
+		// Internet Explorer
+		try
+		{
+			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
+		}
+		catch (e)
+		{
+			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
+		}
+	}
+	
+	return xmlHttp;
+}

Added: trunk/community/website/inc/rss.php
===================================================================
--- trunk/community/website/inc/rss.php	                        (rev 0)
+++ trunk/community/website/inc/rss.php	2007-10-02 11:10:26 UTC (rev 493)
@@ -0,0 +1,30 @@
+<?php
+	$xml = "http://cia.vc/stats/project/Debian-Med/.rss";
+	
+	$xmlDoc = new DOMDocument();
+	$xmlDoc->load($xml);
+	
+	// get elements from <channel>
+	$channel = $xmlDoc->getElementsByTagName("channel")->item(0);
+	$channel_title = $channel->getElementsByTagName("title")->item(0)->childNodes->item(0)->nodeValue;
+	$channel_link = $channel->getElementsByTagName("link")->item(0)->childNodes->item(0)->nodeValue;
+	$channel_desc = $channel->getElementsByTagName("description")->item(0)->childNodes->item(0)->nodeValue;
+
+	// output elements from <channel>
+	echo "<p><a href=\"$channel_link\">$channel_title</a>";
+	echo "<br />";
+	echo "$channel_desc</p>";
+	
+	// get and output <item>s
+	$x = $xmlDoc->getElementsByTagName("item");
+	// show only last 10 messages
+	for ($i = 0; $i <= 9; $i++) {
+		$item_title = $x->item($i)->getElementsByTagName("title")->item(0)->childNodes->item(0)->nodeValue;
+		$item_link = $x->item($i)->getElementsByTagName("link")->item(0)->childNodes->item(0)->nodeValue;
+		$item_desc = $x->item($i)->getElementsByTagName("description")->item(0)->childNodes->item(0)->nodeValue;
+
+		echo "<p><a href=\"$item_link\">$item_title</a>";
+		echo "<br />";
+		echo "$item_desc</p>";
+	}
+?>

Deleted: trunk/community/website/index.html
===================================================================
--- trunk/community/website/index.html	2007-10-02 10:33:45 UTC (rev 492)
+++ trunk/community/website/index.html	2007-10-02 11:10:26 UTC (rev 493)
@@ -1,17 +0,0 @@
-<html>
-<head>
-<title>Debian-Med CDD</title>
-</head>
-<body>
-<div align="center">
-<h1>Debian-Med Project</h1>
-</div>
-<p>
-Please, take a look at our current <a href="http://wiki.debian.org/DebianMed">homepage</a>
-</p>
-<small>Please, note that this is a SVN export of our website. It might break during
-SVN commits.</small>
-<hr />
-<address>$ SVN export - rev. #REV# - Last update by <a href="http://alioth.debian.org/users/#AUTHOR#">#AUTHOR#</a> - #DATE# $</address>
-</body>
-</html>

Added: trunk/community/website/index.php
===================================================================
--- trunk/community/website/index.php	                        (rev 0)
+++ trunk/community/website/index.php	2007-10-02 11:10:26 UTC (rev 493)
@@ -0,0 +1,24 @@
+<html>
+<head>
+<title>Debian-Med CDD</title>
+<script language="javascript" src="inc/rssajax6.js"></script>
+</head>
+<body onload="showRSS();">
+<div align="center">
+<h1>Debian-Med Project</h1>
+</div>
+<p>
+Please, take a look at our current <a href="http://wiki.debian.org/DebianMed">homepage</a>
+</p>
+<hr width="50%" align="center" />
+<p>
+<div id="rssOutput">div</div>
+</p>
+<?php
+	include_once("inc/rss.php");
+?>
+<small>Please, note that this is a SVN export of our website. It might break during
+SVN commits.</small>
+<?php
+	include_once("footer.html")
+?>




More information about the debian-med-commit mailing list