Semantic web markup.
--- a/include/common-geo.inc.php
+++ b/include/common-geo.inc.php
@@ -56,15 +56,23 @@
}
}
$output = '';
- if ($collapsible)
- $output.= '<div class="map" data-role="collapsible" data-collapsed="true"><h3>Open Map...</h3>';
- if (isIOSDevice())
+ if ($collapsible) {
+ $output.= '<div class="map geo" itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates" data-role="collapsible" data-collapsed="true"><h3>Open Map...</h3>
+ <meta itemprop="latitude" content="'.$mapPoints[0][0].'" />
+ <abbr class="latitude" title="'.$mapPoints[0][0].'"></abbr>
+ <abbr class="longitude" title="'.$mapPoints[0][1].'"></abbr>
+ <meta itemprop="longitude" content="'.$mapPoints[0][1].'" />';
+ }
+ if (isIOSDevice()) {
$output.= '<img class="hiresmap" src="http://maps.googleapis.com/maps/api/staticmap?size=' . $width . 'x' . $height . '&' . $markers . '&scale=2&sensor=true" width=' . $width . ' height=' . $height . '" alt="map of stop location">';
- else
+ }
+ else {
$output.= '<img class="lowresmap" src="http://maps.googleapis.com/maps/api/staticmap?size=' . $width . 'x' . $height . '&' . $markers . '&scale=1&format=jpg&sensor=true" width=' . $width . ' height=' . $height . '" alt="map of stop location">';
-
- if ($collapsible)
+ }
+
+ if ($collapsible) {
$output.= '</div>';
+ }
return $output;
}
--- a/include/common-template.inc.php
+++ b/include/common-template.inc.php
@@ -46,7 +46,7 @@
echo '
<!DOCTYPE html>
<html lang="en">
- <head>
+ <head profile="http://microformats.org/profile/hcalendar http://microformats.org/profile/geo http://vocab.org/transit/terms">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>' . $pageTitle . ' - Canberra Bus Timetable</title>
@@ -161,11 +161,11 @@
</div>
';
if ($opendiv) {
- echo '<div data-role="page">
- <div data-role="header" data-position="inline">
+ echo '<div data-role="page"'. (isset($stopid) ? 'itemscope itemtype="http://schema.org/BusStop"':'').'>';
+ echo '<div data-role="header" data-position="inline">
<a href="' . (isset($_SERVER["HTTP_REFERER"]) ? $_SERVER["HTTP_REFERER"] : "javascript:history.go(-1)") . '" data-icon="arrow-l" data-rel="back" class="ui-btn-left">Back</a>
- <h1>' . $pageTitle . '</h1>
- <a href="' . $basePath . '/index.php" data-icon="home" class="ui-btn-right">Home</a>
+ <h1 itemprop="name">' . $pageTitle . '</h1>
+ <a href="' . $basePath . '/index.php" data-icon="home" class="ui-btn-right" rel="home">Home</a>
</div><!-- /header -->
<a name="maincontent" id="maincontent"></a>
<div data-role="content"> ';
@@ -215,7 +215,8 @@
function include_footer() {
global $basePath;
echo '<div id="footer"><a href="' . $basePath . 'about.php">About/Contact Us</a> <a href="' . $basePath . 'feedback.php">Feedback/Bug Report</a> <a href="' . $basePath . 'privacy.php">Privacy Policy</a>';
- echo '</div>';
+ echo '<br><small>
+ <a rel="license" href="http://creativecommons.org/licenses/by/3.0/au/"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/au/80x15.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/au/">Creative Commons Attribution 3.0 Australia License</a>.</div></small>';
if (isAnalyticsOn()) {
echo "<script> (function() {
var ga = document.createElement('script'); ga.type =
--- a/stop.php
+++ b/stop.php
@@ -48,7 +48,13 @@
foreach ($stops as $key => $sub_stop) {
$stopNames[$key] = $sub_stop["stop_name"];
- $stopLinks.= '<a href="stop.php?stopid=' . $sub_stop["stop_id"] . '&stopcode=' . $sub_stop["stop_code"] . '">' . $sub_stop["stop_name"] . '</a> ';
+ $stopLinks.= '<span itemscope itemtype="http://schema.org/BusStop">
+ <a itemprop="url" href="stop.php?stopid=' . $sub_stop["stop_id"] .
+ '&stopcode=' . $sub_stop["stop_code"] . '">' . $sub_stop["stop_name"]
+ . '</a><meta itemprop="latitude" content="'.$sub_stop["stop_lat"].'" />
+ <abbr class="latitude" title="'.$sub_stop["stop_lat"].'"></abbr>
+ <abbr class="longitude" title="'.$sub_stop["stop_lon"].'"></abbr>
+ <meta itemprop="longitude" content="'.$sub_stop["stop_lon"].'" /></span>';
$stopPositions[$key] = Array(
$sub_stop["stop_lat"],
@@ -86,7 +92,7 @@
echo '<div id="servicewarning">'.$serviceAlert['alert']['description']['translation'].'</div>';
} */
-echo '<div class="content-secondary">';
+echo '<div class="content-secondary"><br>';
echo $stopLinks;
if (sizeof($stops) > 0) {
trackEvent("View Stops", "View Combined Stops", $stop["stop_name"], $stop["stop_id"]);
@@ -110,6 +116,7 @@
$trips = $allStopsTrips;
} else {
$trips = getStopTripsWithTimes($stopid, "", "", "", (isset($filterIncludeRoutes) || isset($filterHasStop) ? "75" : ""));
+
}
echo "<div class='ui-header' style='overflow: visible; height: 2.5em'>";
@@ -171,10 +178,10 @@
|| (isset($filterIncludeRoutes) && in_array($trip["route_short_name"], $filterIncludeRoutes))
|| (!isset($filterIncludeRoutes) && !isset($filterHasStop))
) {
- echo '<li>';
+ echo '<li class="vevent">';
$destination = getTripDestination($trip['trip_id']);
- echo '<a href="trip.php?stopid=' . $stopid . '&tripid=' . $trip['trip_id'] . '"><h3>' . $trip['route_short_name'] . " towards " . $destination['stop_name'] . "</h3><p>";
+ echo '<a href="trip.php?stopid=' . $stopid . '&tripid=' . $trip['trip_id'] . '"><h3 class="summary">' . $trip['route_short_name'] . " towards " . $destination['stop_name'] . "</h3><p>";
$viaPoints = viaPointNames($trip['trip_id'], $trip['stop_sequence']);
if (isset($labs)) {
echo '<br><span class="eta">ETA: ' . $tripETA[$trip['trip_id']] . '</span>';
@@ -193,7 +200,7 @@
echo '</small>';
}
echo '</p>';
- echo '<p class="ui-li-aside"><strong>' . $trip['arrival_time'] . '</strong></p>';
+ echo '<p class="ui-li-aside"><time class="dtstart" datetime="'.date("c",strtotime($trip['arrival_time'])).'">' . $trip['arrival_time'] . '</time></p>';
echo '</a></li>';
flush();
@ob_flush();
--- a/trip.php
+++ b/trip.php
@@ -91,13 +91,13 @@
// subsequent duplicates
$stopsGrouped["stop_ids"][] = $tripStopTime['stop_id'];
$stopsGrouped["endTime"] = $tripStopTime['arrival_time'];
- echo '<a href="stop.php?stopids=' . implode(",", $stopsGrouped['stop_ids']) . '">';
- echo '<p class="ui-li-aside">' . $stopsGrouped['startTime'] . ' to ' . $stopsGrouped['endTime'];
+ echo '<a class="vevent" href="stop.php?stopids=' . implode(",", $stopsGrouped['stop_ids']) . '">';
+ echo '<p class="ui-li-aside"> <time class="dtstart" datetime="'.date("c",strtotime($stopsGrouped['startTime'])).'">' . $stopsGrouped['startTime'] . '</time> to <time class="dtend" datetime="'.date("c",strtotime($stopsGrouped['endTime'])).'">' . $stopsGrouped['endTime'] . '</time>';
if (isset($_SESSION['lat']) && isset($_SESSION['lon'])) {
echo '<br>' . distance($tripStopTime['stop_lat'], $tripStopTime['stop_lon'], $_SESSION['lat'], $_SESSION['lon'], true) . 'm away';
}
- echo '</p>';
- echo stopGroupTitle($tripStopTime['stop_name'], $tripStopTime['stop_desc']) . '<br><small>' . sizeof($stopsGrouped["stop_ids"]) . ' stops</small>';
+ echo '</p><span class="summary">';
+ echo stopGroupTitle($tripStopTime['stop_name'], $tripStopTime['stop_desc']) . '</span><br><small>' . sizeof($stopsGrouped["stop_ids"]) . ' stops</small>';
echo '</a></li>';
flush();
@@ -105,14 +105,17 @@
$stopsGrouped = Array();
} else {
// just a normal stop
- echo '<a href="stop.php?stopid=' . $tripStopTime['stop_id'] . (startsWith($tripStopTime['stop_code'], "Wj") ? '&stopcode=' . $tripStopTime['stop_code'] : "") . '">';
- echo '<p class="ui-li-aside">' . $tripStopTime['arrival_time'];
+ echo '<span itemscope itemtype="http://schema.org/BusStop" class="vevent"> <a itemprop="url" href="stop.php?stopid=' . $tripStopTime['stop_id'] . (startsWith($tripStopTime['stop_code'], "Wj") ? '&stopcode=' . $tripStopTime['stop_code'] : "") . '">';
+ echo '<p class="ui-li-aside geo"><time class="dtstart" datetime="'.date("c",strtotime($trip['arrival_time'])).'">' . $tripStopTime['arrival_time'].'</time>';
+ echo '<abbr class="latitude" title="'.$tripStopTime['stop_lat'].'"></abbr>
+ <abbr class="longitude" title="'.$tripStopTime['stop_lon'].'"></abbr><meta itemprop="latitude" content="'.$tripStopTime['stop_lat'].'" />
+ <meta itemprop="longitude" content="'.$tripStopTime['stop_lon'].'" />';
if (isset($_SESSION['lat']) && isset($_SESSION['lon'])) {
echo '<br>' . distance($tripStopTime['stop_lat'], $tripStopTime['stop_lon'], $_SESSION['lat'], $_SESSION['lon'], true) . 'm away';
}
- echo '</p>';
+ echo '</p><span class="summary" itemprop="name">';
echo $tripStopTime['stop_name'];
- echo '</a></li>';
+ echo '</span></a></li>';
flush();
@ob_flush();
}