function getFeedVars($bookmarksToParse) { include '../includes/convert_date.php'; $bookmarks = array(); $count = 0; foreach ($bookmarksToParse as $row) { $rec_id = "{$row["id"]}"; $rec_date = "{$row["formatted_time"]}"; $bookmarks[$count]['bTime'] = convert_date_feed($rec_date); $bookmarks[$count]['bTitle'] = "{$row["title"]}"; $bookmarks[$count]['bUrl'] = WEBSITE_ROOT . "redirect.php?id={$rec_id}"; $bookmarks[$count]['bDesc'] = "{$row["description"]}"; $bookmarks[$count]['bCreator'] = "{$row["name"]}"; $bookmarks[$count++]['allTagsArray'] = returnAllTagsArray($rec_id, "../"); } return $bookmarks; }
header('Content-Type: application/xml'); $writeStr = "<?xml version=\"1.0\" ?>\n"; $writeStr .= "<rss version=\"2.0\">\n"; $writeStr .= "<channel>\n"; $writeStr .= "<title>" . WEBSITE_NAME . " News</title>\n"; $writeStr .= "<description>News for " . WEBSITE_NAME . "!</description>\n"; $writeStr .= "<link>" . WEBSITE_ROOT . "</link>\n"; $writeStr .= "<language>" . WEBSITE_LOCALE . "</language>\n"; $builddate = date("D, d M Y H:i:s O"); $writeStr .= "<lastBuildDate>{$builddate}</lastBuildDate>\n\n"; include '../includes/convert_date.php'; $Query = "select newsID, date as formatted_time, author, title, date, msg from " . TABLE_PREFIX . "news order by formatted_time DESC"; //echo($Query . "<br>\n"); $dbResult = $dblink->query($Query); include '../includes/protection.php'; while ($row =& $dbResult->fetchRow(DB_FETCHMODE_ASSOC)) { $date = "{$row["formatted_time"]}"; $date2 = convert_date_feed($date); $writeStr .= "<item>\n"; $writeStr .= "<pubDate>{$date2}</pubDate>\n"; $writeStr .= "<title>{$row["title"]}</title>\n"; $desc = "{$row["msg"]}"; remhtml($desc); $writeStr .= "<description>{$desc}</description>\n"; $writeStr .= "<link>" . WEBSITE_ROOT . "newsdetails.php?id={$row["newsid"]}&src=f</link>\n"; $writeStr .= "<guid>" . WEBSITE_ROOT . "newsdetails.php?id={$row["newsid"]}&src=f</guid>\n"; $writeStr .= "</item>\n"; } $writeStr .= "</channel>\n"; $writeStr .= "</rss>\n"; echo $writeStr;