Rearrange php libs/includes and produce sitemap.xml
[busui.git] / trip.php
blob:a/trip.php -> blob:b/trip.php
--- a/trip.php
+++ b/trip.php
@@ -24,6 +24,7 @@
 	$routetrips = json_decode(getPage($url));
 }
 include_header("Stops on " . $trips[1]->route_short_name . ' ' . $trips[1]->route_long_name, "trip");
+trackEvent("Route/Trip View","View Route", $trips[1]->route_short_name . ' ' . $trips[1]->route_long_name, $trips[1]->route_id);
 $url = $APIurl . "/json/tripstoptimes?trip=" . $tripid;
 $json = json_decode(getPage($url));
 $stops = $json[0];
@@ -40,7 +41,7 @@
 	echo '<a href="trip.php?tripid=' . $othertrip[1] . "&routeid=" . $routeid . '">' . midnight_seconds_to_time($othertrip[0]) . '</a> ';
 }
 echo '</p><p><h2>Other directions/timing periods:</h2> ';
-$url = $APIurl . "/json/routesearch?routeshortname=" . $trips[1]->route_short_name;
+$url = $APIurl . "/json/routesearch?routeshortname=" . rawurlencode($trips[1]->route_short_name);
 $json = json_decode(getPage($url));
 foreach ($json as $row) {
 	if ($row[0] != $routeid) echo '<a href="trip.php?routeid=' . $row[0] . '">' . $row[2] . ' (' . ucwords($row[3]) . ')</a> ';