Misc formatting fixes like only show iOS stuff on those devices, don't show letters on nearby when have no nearby stuff
[busui.git] / stopList.php
blob:a/stopList.php -> blob:b/stopList.php
--- a/stopList.php
+++ b/stopList.php
@@ -1,5 +1,5 @@
 <?php
-include ('common.inc.php');
+include ('include/common.inc.php');
 function filterByFirstLetter($var)
 {
 	return $var[1][0] == $_REQUEST['firstLetter'];
@@ -31,6 +31,7 @@
 		foreach ($suburbs as $suburb) {
 			if (startsWith($suburb, $_REQUEST['firstLetter'])) {
 				echo '<li><a href="stopList.php?suburb=' . urlencode($suburb) . '">' . $suburb . '</a></li>';
+				flush(); @ob_flush();
 			}
 		}
 	}
@@ -48,7 +49,7 @@
 	else if ($_REQUEST['nearby']) {
 		$listType = 'nearby=yes';
 		$url = $APIurl . "/json/neareststops?lat={$_SESSION['lat']}&lon={$_SESSION['lon']}&limit=15";
-		include_header("Nearby Stops", "stopList");
+		include_header("Nearby Stops", "stopList", true, true);
 		navbar();
 		timePlaceSettings(true);
 		if (!isset($_SESSION['lat']) || !isset($_SESSION['lat']) || $_SESSION['lat'] == "" || $_SESSION['lon'] == "") {
@@ -62,6 +63,7 @@
 		$url = $APIurl . "/json/stopzonesearch?q=" . $suburb;
 		include_header("Stops in " . ucwords($suburb) , "stopList");
 		navbar();
+	       trackEvent("Stop Lists","Stops By Suburb", $suburb);
 	}
 	else {
 		$url = $APIurl . "/json/timingpoints";
@@ -100,6 +102,7 @@
 					}
 					echo bracketsMeanNewLine(trim(preg_replace("/\(Platform.*/", "", $row[1])) . '(' . sizeof($stopsGrouped["stop_ids"]) . ' stops)');
 					echo "</a></li>\n";
+					flush(); @ob_flush();
 					$stopsGrouped = Array();
 				}
 				else {
@@ -112,6 +115,7 @@
 					}
 					echo bracketsMeanNewLine($row[1]);
 					echo "</a></li>\n";
+					flush(); @ob_flush();
 				}
 			}
 			else {