]> git.vanrenterghem.biz Git - www.vanrenterghem.biz.git/blobdiff - phppages/class.myRSS.php
Verwijder verouderde bestanden.
[www.vanrenterghem.biz.git] / phppages / class.myRSS.php
diff --git a/phppages/class.myRSS.php b/phppages/class.myRSS.php
deleted file mode 100644 (file)
index 96ace0d..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-<?php
-class myRSS
-{
-// Create our channel variables
-var $channelTitle;
-var $channelLink;
-var $channelDesc;
-
-// Create our image variables
-var $imageTitle;
-var $imageLink;
-var $imageURL;
-
-function checkValues()
-{
-// Make sure all channel and image values are set
-if($this->channelTitle == "")
-die("Please specify a channel title");
-
-if(ereg("$http://", $this->channelLink) == false)
-die("Please specify a channel link");
-
-if($this->channelDesc == "")
-die("Please specify a channel description");
-
-if($this->imageTitle == "")
-die("Please specify an image title");
-
-if(ereg("$http://", $this->imageLink) == false)
-die("Please specify an image link");
-
-if(ereg("$http://", $this->imageURL) == false)
-die("Please specify an image URL");
-}
-
-// Connect to the database, generate the RSS XML and return it
-function GetRSS($dbServer, $dbUser, $dbPass, $dbName, $tableName,
-$titleFieldName, $descFieldName, $linkFieldName, $linkTemplate)
-{
-// Make sure all channel/image values have been set
-$this->checkValues();
-
-$rssValue = "<?xml version=\"1.0\"?> \r \n";
-$rssValue .= "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\" \"../rss-0.91.dtd\">\r\n";
-$rssValue .= "<rss version=\"0.91\">\r\n";
-
-// Build the channel tag
-$rssValue .= "<channel>\r\n";
-$rssValue .= "<title>" . $this->channelTitle . "</title>\r\n";
-$rssValue .= "<link>" . $this->channelLink . "</link>\r\n";
-$rssValue .= "<description>" . $this->channelDesc . "</description>\r\n";
-$rssValue .= "<language>en-us</language>\r\n";
-$rssValue .= "</channel>\r\n";
-
-// Build the image tag
-$rssValue .= "<image>\r\n";
-$rssValue .= "<title>" . $this->imageTitle . "</title>\r\n";
-$rssValue .= "<url>" . $this->imageURL . "</url>\r\n";
-$rssValue .= "<link>" . $this->imageLink . "</link>\r\n";
-$rssValue .= "</image>\r\n";
-
-// -- Table structure for table 'newsContent'
-// --
-//
-// CREATE TABLE newsContent (
-//   title varchar(40) default NULL,
-//   date date default NULL,
-//   body text
-// )
-
-
-// Connect to the database and build the <item> tags
-$svrConn = @mysql_connect($dbServer, $dbUser, $dbPass) or die("Couldn't
-connect to database");
-$dbConn = @mysql_select_db($dbName, $svrConn) or die("Couldn't select
-database");
-
-// Make sure the table exists
-$tableExists = false;
-$tResult = mysql_list_tables($dbName);
-
-while($tRow = mysql_fetch_row($tResult))
-{
-if(strtolower($tableName) == strtolower($tRow[0]))
-{
-$tableExists = true;
-break;
-}
-}
-
-if(!$tableExists)
-die("Table $tableName doesn't exist in the database!");
-
-$rResult = mysql_query("select $titleFieldName, $descFieldName,
-$linkFieldName from $tableName order by $linkFieldName desc limit 10") or
-die ('An error occured while retrieving data from the database. Please <a
-href="/About/index.shtml">contact the webmaster</a> if this problem
-persists.');
-
-// The records were retrieved OK, let's start building the item tags
-while($rRow = mysql_fetch_array($rResult))
-{
-$rssValue .= "<item>\r\n";
-$rssValue .= "<title>" . $rRow[$titleFieldName] . "</title>\r\n";
-$rssValue .= "<description>" . $rRow[$descFieldName] . "</description>\r\n";
-$rssValue .= "<link>" . str_replace("{linkId}", $rRow[$linkFieldName],
-$linkTemplate) . "</link>\r\n";
-$rssValue .= "</item>\r\n";
-}
-
-// Add the closing rss tag and return the value
-$rssValue .= "</rss>\r\n";
-return $rssValue;
-// end tag of GetRSS function
-}
-// end tag of the class
-}
-?>
\ No newline at end of file