From: maxious Date: Sun, 10 Apr 2011 09:57:41 +0000 Subject: DB fixes X-Git-Url: http://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=bd1648c7e216962fd37858e5b48662d382fcf787 --- DB fixes --- --- a/about.php +++ b/about.php @@ -12,7 +12,7 @@ href="https://github.com/maxious/ACTBus-data">transit feed and this site available from github.
-Uses jQuery Mobile, PHP, Ruby, Python, Google Transit Feed Specification tools, OpenTripPlanner, OpenLayers, OpenStreetMap, Cloudmade Geocoder and Tile Service
+Uses jQuery Mobile, PHP, PostgreSQL, OpenTripPlanner, OpenLayers, OpenStreetMap, Cloudmade Geocoder and Tile Service

Feedback encouraged; contact maxious@lambdacomplex.org

--- a/aws/awsStartup.sh +++ b/aws/awsStartup.sh @@ -1,5 +1,5 @@ #!/bin/bash -#this script should be run from a fresh git checkout from http://maxious.lambdacomplex.org +#this script should be run from a fresh git checkout from github #ami base must have yum install lighttpd-fastcgi, git, tomcat6 #screen php-cli php-gd tomcat6-webapps tomcat6-admin-webapps svn maven2 #http://www.how2forge.org/installing-lighttpd-with-php5-and-mysql-support-on-fedora-12 @@ -12,10 +12,18 @@ chmod -R 777 /var/www/lib/staticmaplite/cache wget http://s3-ap-southeast-1.amazonaws.com/busresources/cbrfeed.zip \ -O /var/www/cbrfeed.zip -easy_install transitfeed -easy_install simplejson -screen -S viewsh -X quit -screen -S viewsh -d -m /var/www/view.sh + +createdb transitdata +createlang -d transitdata plpgsql +psql -d transitdata -f /var/www/lib/postgis.sql +# curl https://github.com/maxious/ACTBus-ui/raw/master/transitdata.cbrfeed.sql.gz -o transitdata.cbrfeed.sql.gz +#made with pg_dump transitdata | gzip -c > transitdata.cbrfeed.sql.gz +gunzip /var/www/transitdata.cbrfeed.sql.gz +psql -d transitdata -f /var/www/transitdata.cbrfeed.sql +#createuser transitdata -SDRP +#password transitdata +#psql -d transitdata -c \"GRANT SELECT ON TABLE agency,calendar,calendar_dates,routes,stop_times,stops,trips TO transitdata;\" +php /var/www/updatedb.php wget http://s3-ap-southeast-1.amazonaws.com/busresources/Graph.obj \ -O /tmp/Graph.obj @@ -26,4 +34,3 @@ -O /usr/share/tomcat6/webapps/opentripplanner-api-webapp.war /etc/init.d/tomcat6 restart - --- /dev/null +++ b/include/common-db.inc.php @@ -1,1 +1,16 @@ - + --- a/include/common-geo.inc.php +++ b/include/common-geo.inc.php @@ -70,6 +70,7 @@ else return round($km,2)."k"; } else return floor($km * 1000); } + function decodePolylineToArray($encoded) { // source: http://latlongeeks.com/forum/viewtopic.php?f=4&t=5 --- a/include/common-session.inc.php +++ b/include/common-session.inc.php @@ -9,7 +9,7 @@ $_SESSION['time'] = filter_var($_REQUEST['time'], FILTER_SANITIZE_STRING); sessionUpdated(); } -if (isset($_REQUEST['geolocate'])) { +if (isset($_REQUEST['geolocate']) && $_REQUEST['geolocate'] != "Enter co-ordinates or address here") { $geocoded = false; if (isset($_REQUEST['lat']) && isset($_REQUEST['lon'])) { $_SESSION['lat'] = trim(filter_var($_REQUEST['lat'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION)); @@ -17,7 +17,6 @@ } else { $geolocate = filter_var($_REQUEST['geolocate'], FILTER_SANITIZE_URL); - echo $_REQUEST['geolocate']; if (startsWith($geolocate, "-")) { $locateparts = explode(",", $geolocate); $_SESSION['lat'] = $locateparts[0]; --- a/include/common-template.inc.php +++ b/include/common-template.inc.php @@ -1,28 +1,27 @@ '; if ($datepicker) echo ''; - if (isDebugServer()) echo ' + if (isDebugServer()) { + echo ' + '; - else echo ' + } + else { + echo ' - '; - if ($datepicker) echo ''; + } + if ($datepicker) { + echo ' '; + } echo '