\n"; echo "\n"; for ($i = 0; $i < sizeof($GLOBALS['PageData']); $i++) { echo "\n"; if ($GLOBALS['PageData'][$i]['Location'] != "") echo "" . htmlentities($GLOBALS['PageData'][$i]['Location']) . "\n"; if ($GLOBALS['PageData'][$i]['ChangeFrequency'] != "") echo "" . htmlentities($GLOBALS['PageData'][$i]['ChangeFrequency']) . "\n"; if ($GLOBALS['PageData'][$i]['LastMod'] != "") echo "" . $GLOBALS['PageData'][$i]['LastMod'] . "\n"; if ($GLOBALS['PageData'][$i]['Priority'] != "") echo "" . $GLOBALS['PageData'][$i]['Priority'] . "\n"; echo "\n"; } echo "\n"; } // Connect to the database.. $GLOBALS['MySQL']['Connection'] = mysql_connect("[YOURSERVER]", "[YOURUSERNAME]", "[YOURPASSWORD]"); $GLOBALS['MySQL']['DB'] = mysql_select_db("[YOURDATABASE]"); // Google is finicky about the www. prefix, so we'll fix that and then create some priorities.. $GLOBALS['WebsiteURL'] = "http://" . ((strpos($_SERVER['HTTP_HOST'], "www.") !== FALSE) ? "www." : "") . "endseven.net"; $GLOBALS['Priorities'] = array("Home" => "1.0", "RSSFeed" => "0.9", "Permalink" => "0.8", "ArticleCategory" => "0.7", "ArticleTag" => "0.6", "PhotoGallery" => "0.5"); $GLOBALS['PageData'] = array(); // Holds the dynamic page data.. // Add any pages that aren't automatically generated by the database.. jAddURL($GLOBALS['WebsiteURL'] , "daily", date("Y-m-d"), $GLOBALS['Priorities']['Home']); jAddURL($GLOBALS['WebsiteURL'] . "/xml/rss.php", "daily", date("Y-m-d"), $GLOBALS['Priorities']['RSSFeed']); jAddURL($GLOBALS['WebsiteURL'] . "/?sPageID=PhotoGallery", "weekly", date("Y-m-d"), $GLOBALS['Priorities']['PhotoGallery']); // Retrieve the articles from the database.. $oQuery = mysql_query("SELECT `Stamp`, `Hash` FROM `blog_articles` ORDER BY `Stamp` DESC;"); while ($oResults = mysql_fetch_assoc($oQuery)) { jAddURL($GLOBALS['WebsiteURL'] . "/?sPermalinkID=" . urlencode($oResults['Hash']), "monthly", date("Y-m-d", strtotime($oResults['Stamp'])), $GLOBALS['Priorities']['Permalink']); } // Retrieve the categories from the database.. $oQuery = mysql_query("SELECT `Name` FROM `blog_categories` ORDER BY `Name` ASC;"); while ($oResults = mysql_fetch_assoc($oQuery)) { jAddURL($GLOBALS['WebsiteURL'] . "/?sCategory=" . urlencode($oResults['Name']), "daily", date("Y-m-d", strtotime($oResults['Stamp'])), $GLOBALS['Priorities']['ArticleCategory']); } // Retrieve the tags from the database.. $oQuery = mysql_query("SELECT `Name` FROM `blog_tags` ORDER BY `Name` ASC;"); while ($oResults = mysql_fetch_assoc($oQuery)) { jAddURL($GLOBALS['WebsiteURL'] . "/?sTag=" . urlencode($oResults['Name']), "daily", date("Y-m-d", strtotime($oResults['Stamp'])), $GLOBALS['Priorities']['ArticleTag']); } // Disconnect from the database, output the xml.. mysql_close($GLOBALS['MySQL']['Connection']); jOutputPageDataXML(); ?>