--- a/stop.php +++ b/stop.php @@ -108,12 +108,12 @@ sktimesort($allStopsTrips, "arrival_time", true); $trips = $allStopsTrips; } else { - $trips = getStopTripsWithTimes($stopid); + $trips = getStopTripsWithTimes($stopid,"","","",(isset($filterIncludeRoutes) || isset($filterHasStop)?"75":"")); } echo "
"; // if we have too many trips, cut down to size. -if (sizeof($trips) > 10) { +if (!isset($filterIncludeRoutes) && !isset($filterHasStop) && sizeof($trips) > 10) { $trips = array_splice($trips, 0,10); } @@ -141,6 +141,11 @@ echo "
  • No trips in the near future.
  • "; } else { foreach ($trips as $trip) { + if ( + isset($filterHasStop) && (getTripHasStop($trip['trip_id'],$filterHasStop) == 1) + || (isset($filterIncludeRoutes) && in_array($trip["route_short_name"], $filterIncludeRoutes)) + || (!isset($filterIncludeRoutes) && !isset($filterHasStop)) + ) { echo '
  • '; $destination = getTripDestination($trip['trip_id']); @@ -164,6 +169,7 @@ echo '
  • '; flush(); @ob_flush(); + } } } echo '';