--- a/include/common-template.inc.php
+++ b/include/common-template.inc.php
@@ -5,6 +5,7 @@
function googleAnalyticsGetImageUrl()
{
global $GA_ACCOUNT, $GA_PIXEL;
+ //if (stristr($_SERVER['HTTP_USER_AGENT'], 'Googlebot') return "";
$url = "";
$url.= $GA_PIXEL . "?";
$url.= "utmac=" . $GA_ACCOUNT;
@@ -24,112 +25,68 @@
}
function include_header($pageTitle, $pageType, $opendiv = true, $geolocate = false, $datepicker = false)
{
+ global $labsPath,$serviceAlertsEnabled;
echo '
- ' . $pageTitle . '
- ';
- if ($datepicker) echo '';
+
+' . $pageTitle . ' - Canberra Bus Timetable
+
+
+
+ ';
if (isDebugServer()) {
- echo '
-
-
-
+
- ';
- }
- else {
- echo '
-
-
- ';
- }
- if ($datepicker) {
- echo '
- ';
- }
- echo '';
- if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPod')) {
+
+
+
+
+
+
+
+ ';
+ echo '';
+ echo '';
+ if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPod') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
echo '
@@ -141,8 +98,11 @@
function success(position) {
$('#error').val('Location now detected. Please wait for data to load.');
$('#geolocate').val(position.coords.latitude+','+position.coords.longitude);
-$.ajax({ url: \"include/common.inc.php?geolocate=yes&lat=\"+position.coords.latitude+\"&lon=\"+position.coords.longitude });
-location.reload(true);
+$.ajax({ async: false,
+success: function(){
+ location.reload(true);
+ },
+url: \"include/common.inc.php?geolocate=yes&lat=\"+position.coords.latitude+\"&lon=\"+position.coords.longitude });
}
function error(msg) {
$('#error').val('Error: '+msg);
@@ -160,7 +120,7 @@
}
$(document).ready(function() {
$('#here').click(function(event) { $('#geolocate').val(geolocate()); return false;});
-$('#here').show();
+ $('#here').show();
});
";
if (!isset($_SESSION['lat']) || $_SESSION['lat'] == "") echo "geolocate();";
@@ -172,6 +132,7 @@
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-22173039-1']);
_gaq.push(['_trackPageview']);
+ _gaq.push(['_trackPageLoadTime']);
";
echo '
@@ -184,26 +145,33 @@
';
$overrides = getServiceOverride();
if ($overrides['service_id']) {
- if ($overrides['service_id'] == "noservice") {
- echo '
';
- }
- else {
- echo '
';
- }
+ }
+ else {
+ echo '
';
}
}
-
+ if ($GTFSREnabled) {
+ $serviceAlerts = getServiceAlertsAsArray("agency","0");
+ foreach ($serviceAlerts['entity'] as $entity) {
+ echo "
".date("F j, g:i a",strtotime($entity['alert']['active_period'][0]['start']))." to ". date("F j, g:i a", strtotime($entity['alert']['active_period'][0]['end']))."{$entity['alert']['header_text']['translation'][0]['text']}
Warning: {$entity['alert']['description_text']['translation'][0]['text']}
+
Source ";
+ }
+ }
+ }
}
function include_footer()
{
- echo '
";
-}
-function timePlaceSettings($geolocate = false)
+ }
+ echo "\n