substr_count($sql, ')'))?') ': '') . "\nUNION ALL ( SELECT") . " `id`,`title`,`category`,`dts`,'" . str_pad($tablename,32) . "' AS 'nav'$url$filesize FROM `$tablename`"; // $sql = $sql . (($first) ? 'SELECT SQL_CALC_FOUND_ROWS ':((substr_count($sql, '(') > substr_count($sql, ')'))?') ': '') . "\nUNION ALL ( SELECT") . " `id`,`title`,`category`,`dts`,'" . str_pad($tablename,32) . "' AS 'nav'$url$filesize FROM `$tablename`"; $first = false; } } $sql = "SELECT * FROM `$temp_table` ORDER BY `dts` DESC LIMIT 10"; $result = db_query($sql, $dbcn); $items = array(); while($row = mysql_fetch_assoc($result)) { $items[] = $row; } $mime = "application/xml"; if(stristr($_SERVER["HTTP_ACCEPT"],"application/rss+xml")) { # if there's a Q value for "application/rss+xml" then also # retrieve the Q value for "application/xml" if(preg_match("/application\/rss\+xml;q=0(\.[1-9]+)/i", $_SERVER["HTTP_ACCEPT"], $matches)) { $rss_q = $matches[1]; if(preg_match("/application\/xml;q=0(\.[1-9]+)/i", $_SERVER["HTTP_ACCEPT"], $matches)) { $xml_q = $matches[1]; # if the Q value for RSS is greater than or equal to that # for XML then use the "application/rss+xml" mimetype if($rss_q >= $xml_q) { $mime = "application/rss+xml"; } } # if there was no Q value, then just use the # "application/rss+xml" mimetype } else { $mime = "application/rss+xml"; } } header("Content-Type: $mime;charset=iso-8859-1"); echo << ednash.com http://www.ednash.com The online home of o-geeking ednash.com Ed Nash en-gb $date Copyright © 1997-$year Ed Nash ENDSTATIC; foreach ($items as $row) { $url = "http://www.ednash.com/index.php?nav=" . urlencode($row['nav']) . "&category=" . urlencode($row['category']) . "&id=" . $row['id']; echo(" \n"); } echo << ednash.com http://www.ednash.com/rsslogo.jpg http://www.ednash.com 144 22 The online home of o-geeking ENDSTATIC; foreach ($items as $row) { $url = "http://www.ednash.com/index.php?nav=" . urlencode($row['nav']) . "&category=" . urlencode($row['category']) . "&id=" . $row['id']; echo(" \n"); echo(" " . htmlentities($row['title'], ENT_QUOTES) . "\n"); echo(" $url\n"); echo(" " . htmlentities("A " . $row['category'] . " " . $row['nav'] . " item inserted on " . strtolower(date("l j F Y")), ENT_QUOTES) . "\n"); echo(" \n"); } echo(""); ?>