--- a/stopList.php +++ b/stopList.php @@ -17,15 +17,24 @@ */ include ('include/common.inc.php'); $stops = Array(); - +function stopCompare($stopName) { + return substr(trim(preg_replace("/\(Platform.*/", "", $stopName)),0,9); +} +function stopGroupTitle($stopName,$stopdesc) { + if (preg_match("/Dr |Cct |Cir |Av |St |Cr |Parade |Way |Bank /",$stopName)) { + $descParts = explode("
",$stopdesc); + return trim(str_replace("Street: ","",$descParts[0])); + } else { + return trim(preg_replace("/\(Platform.*/", "",$stopName)); + } +} function navbar() { echo '
'; @@ -50,12 +59,7 @@ echo ''; } else { // Timing Points / All stops - if (isset($allstops)) { - $listType = 'allstops=yes'; - $stops = getStops(); - include_header("All Stops", "stopList"); - navbar(); - } else if (isset($nearby)) { + if (isset($nearby)) { $listType = 'nearby=yes'; include_header("Nearby Stops", "stopList", true, true); trackEvent("Stop Lists", "Stops Nearby", $_SESSION['lat'] . "," . $_SESSION['lon']); @@ -77,7 +81,7 @@ $sub_stop["stop_lon"] ); } - echo staticmap($stopPositions, 0, "iconb", true, true); + echo staticmap($stopPositions, true, true); placeSettings(); echo ''; } else if (isset($suburb)) { @@ -86,10 +90,11 @@ navbar(); trackEvent("Stop Lists", "Stops By Suburb", $suburb); } else { - $stops = getStops(true, $firstLetter); - include_header("Timing Points / Major Stops", "stopList"); + $listType = 'allstops=yes'; + $stops = getStops($firstLetter); + include_header("Stops by Name", "stopList"); navbar(); - } + } echo '