Location: PHPKode > projects > FeedMeLinks, Social BookmarkingSince2002 > feedmelinks.com/rss-1.0.php
<%
	Header( "Content-type: text/xml");
%>
<% # $Id: rss-1.0.php,v 1.5 2005/01/02 21:07:03 hirokai Exp $ 
  include_once( "modules/utils.inc.php" );
	$site = getSiteUrl();
			
echo "<?xml version=\"1.0\"?>";

%>

<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">

  <channel>
    <title>Feed Me Links</title>
    <description>your portable public link suitcase</description>
		<managingEditor>all-of-hide@address.com</managingEditor>
		<webMaster>hide@address.com</webMaster>
    <link><%= $site %></link>
    <language>en-us</language>
  <image>
  <title>Feed Me Links</title>
    <url>http://www.jm3.net/img/linkbuttons/jm3.net-linkbutton-01</url>
    <link><%= $site %></link>
    <height>31</height>
    <width>88</width>
    <description> the land that time forgot </description>
  </image>
<%
	$MAX_LINKS = 15;
%>
<%
		$con_rss = mysql_connect();
		mysql_selectdb( getDBName() );
		$qs = "SELECT * from links WHERE isPrivate IS NULL ORDER BY createDate DESC";
		$q = mysql_query( $qs );
		$numRows = mysql_num_rows($q);
		if( $numRows ) {
			$i = 0;
			while ($i < $MAX_LINKS) {
				$id   = mysql_result($q,$i,"ID");
				$createDate   = formatTS( mysql_result($q,$i,"createDate") );
				$name = makeSafeName( mysql_result($q,$i,"name"));
				$name = str_replace ( "&", "&amp;", $name);
				$url = makeSafeName( mysql_result($q,$i,"url"));
				$url = str_replace ( "&", "&amp;", $url);
				$url = str_replace ( " ", "%20", $url);

				$submitter = makeSafeName( mysql_result($q,$i,"submitter"));
				$infoURL = "$site/users?who=" . $submitter;
%>

    <item>
      <title><%= $name %></title>
      <link><%= $url %></link>
      <description>link added on <%= $createDate %> by <%= $submitter %> ( <%= $infoURL %> )</description>
			<dc:date>2004-03-14T20:10:04+00:00</dc:date>
    </item>
<%
				$i++;
			}
			conClose( $con_rss );
			%>
			<%
		}
%>

  </channel>
</rss>
Return current item: FeedMeLinks, Social BookmarkingSince2002