Rearrange includes so session can act on GET/POST variables
Rearrange includes so session can act on GET/POST variables

--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -30,10 +30,11 @@
 include_once ("common-geo.inc.php");
 include_once ("common-net.inc.php");
 include_once ("common-transit.inc.php");
+include_once ("common-db.inc.php");
+
+include_once ("common-request.inc.php");
 include_once ("common-session.inc.php");
-include_once ("common-db.inc.php");
 include_once ("common-template.inc.php");
-include_once ("common-request.inc.php");
 
 function isDebugServer()
 {

--- a/sitemap.xml.php
+++ b/sitemap.xml.php
@@ -8,15 +8,19 @@
 foreach (scandir("./") as $file) {
       if (strpos($file,".php") !== false && $file != "index.php" && $file != "sitemap.xml.php") echo " <url><loc>".curPageURL()."$file</loc><priority>0.3</priority></url>\n";
 }
-foreach (getStops() as $stop) {
-      echo " <url><loc>".curPageURL()."stop.php?stopid=".htmlspecialchars ($stop["stop_id"])."</loc>";
+$url = $APIurl . "/json/stops";         
+$stops = json_decode(getPage($url));
+foreach ($stops as $stop) {
+      echo " <url><loc>".curPageURL()."stop.php?stopid=".htmlspecialchars ($stop[0])."</loc>";
 	echo "<lastmod>" . $last_updated . "</lastmod>";
 	echo "<changefreq>monthly</changefreq>";
 	echo "<priority>0.9</priority>";
 	echo "</url>\n";
  }
-foreach (getRoutes() as $route) {
-      echo " <url><loc>".curPageURL()."trip.php?routeid=".htmlspecialchars ($route["route_id"])."</loc>";
+$url = $APIurl . "/json/routes";         
+$routes = json_decode(getPage($url));
+foreach ($routes as $route) {
+      echo " <url><loc>".curPageURL()."trip.php?routeid=".htmlspecialchars ($route[0])."</loc>";
 	echo "<lastmod>" . $last_updated . "</lastmod>";
 	echo "<changefreq>monthly</changefreq>";
 	echo "<priority>0.9</priority>";