From 10620c71bb7999ed89ca45e545d9ce611a5e1476 Mon Sep 17 00:00:00 2001 From: Brian Quinion Date: Wed, 2 Feb 2011 12:01:26 +0000 Subject: [PATCH] lots of little bug fixes and missing files --- lib/lib.php | 2 + lib/log.php | 69 +- lib/template/address-jsonv2.php | 5 + lib/template/search-html.php | 2 +- settings/settings.php | 5 + website/details.php | 8 +- website/js/img/blank.gif | Bin 0 -> 42 bytes website/js/img/cloud-popup-relative.png | Bin 0 -> 2564 bytes website/js/img/drag-rectangle-off.png | Bin 0 -> 1202 bytes website/js/img/drag-rectangle-on.png | Bin 0 -> 1218 bytes website/js/img/east-mini.png | Bin 0 -> 451 bytes website/js/img/layer-switcher-maximize.png | Bin 0 -> 451 bytes website/js/img/layer-switcher-minimize.png | Bin 0 -> 249 bytes website/js/img/marker-blue.png | Bin 0 -> 992 bytes website/js/img/marker-gold.png | Bin 0 -> 831 bytes website/js/img/marker-green.png | Bin 0 -> 967 bytes website/js/img/marker.png | Bin 0 -> 606 bytes website/js/img/measuring-stick-off.png | Bin 0 -> 3343 bytes website/js/img/measuring-stick-on.png | Bin 0 -> 3816 bytes website/js/img/north-mini.png | Bin 0 -> 484 bytes website/js/img/panning-hand-off.png | Bin 0 -> 3875 bytes website/js/img/panning-hand-on.png | Bin 0 -> 3977 bytes website/js/img/slider.png | Bin 0 -> 285 bytes website/js/img/south-mini.png | Bin 0 -> 481 bytes website/js/img/west-mini.png | Bin 0 -> 453 bytes website/js/img/zoom-minus-mini.png | Bin 0 -> 359 bytes website/js/img/zoom-plus-mini.png | Bin 0 -> 489 bytes website/js/img/zoom-world-mini.png | Bin 0 -> 1072 bytes website/js/img/zoombar.png | Bin 0 -> 463 bytes website/js/prototype-1.6.0.3.js | 4320 +++++++++++++++++ website/js/theme/default/framedCloud.css | 0 website/js/theme/default/google.css | 9 + website/js/theme/default/ie6-style.css | 7 + .../js/theme/default/img/add_point_off.png | Bin 0 -> 1616 bytes website/js/theme/default/img/add_point_on.png | Bin 0 -> 1464 bytes website/js/theme/default/img/blank.gif | Bin 0 -> 42 bytes website/js/theme/default/img/close.gif | Bin 0 -> 1078 bytes .../theme/default/img/drag-rectangle-off.png | Bin 0 -> 1202 bytes .../theme/default/img/drag-rectangle-on.png | Bin 0 -> 1218 bytes .../js/theme/default/img/draw_line_off.png | Bin 0 -> 1567 bytes website/js/theme/default/img/draw_line_on.png | Bin 0 -> 1399 bytes .../js/theme/default/img/draw_point_off.png | Bin 0 -> 1612 bytes .../js/theme/default/img/draw_point_on.png | Bin 0 -> 1460 bytes .../js/theme/default/img/draw_polygon_off.png | Bin 0 -> 1546 bytes .../js/theme/default/img/draw_polygon_on.png | Bin 0 -> 1407 bytes .../js/theme/default/img/editing_tool_bar.png | Bin 0 -> 3901 bytes .../js/theme/default/img/move_feature_off.png | Bin 0 -> 1543 bytes .../js/theme/default/img/move_feature_on.png | Bin 0 -> 1379 bytes .../theme/default/img/navigation_history.png | Bin 0 -> 7021 bytes .../default/img/overview_replacement.gif | Bin 0 -> 79 bytes .../theme/default/img/pan-panel-NOALPHA.png | Bin 0 -> 566 bytes website/js/theme/default/img/pan-panel.png | Bin 0 -> 1287 bytes website/js/theme/default/img/pan_off.png | Bin 0 -> 1696 bytes website/js/theme/default/img/pan_on.png | Bin 0 -> 1568 bytes .../js/theme/default/img/panning-hand-off.png | Bin 0 -> 3875 bytes .../js/theme/default/img/panning-hand-on.png | Bin 0 -> 3977 bytes .../js/theme/default/img/remove_point_off.png | Bin 0 -> 1612 bytes .../js/theme/default/img/remove_point_on.png | Bin 0 -> 1464 bytes website/js/theme/default/img/ruler.png | Bin 0 -> 1211 bytes .../theme/default/img/save_features_off.png | Bin 0 -> 357 bytes .../js/theme/default/img/save_features_on.png | Bin 0 -> 364 bytes .../js/theme/default/img/view_next_off.png | Bin 0 -> 1644 bytes website/js/theme/default/img/view_next_on.png | Bin 0 -> 1686 bytes .../theme/default/img/view_previous_off.png | Bin 0 -> 1553 bytes .../js/theme/default/img/view_previous_on.png | Bin 0 -> 1592 bytes .../theme/default/img/zoom-panel-NOALPHA.png | Bin 0 -> 1173 bytes website/js/theme/default/img/zoom-panel.png | Bin 0 -> 1624 bytes website/js/theme/default/style.css | 343 ++ website/reverse.php | 119 +- website/search.php | 7 +- 70 files changed, 4813 insertions(+), 83 deletions(-) create mode 100755 website/js/img/blank.gif create mode 100755 website/js/img/cloud-popup-relative.png create mode 100755 website/js/img/drag-rectangle-off.png create mode 100755 website/js/img/drag-rectangle-on.png create mode 100755 website/js/img/east-mini.png create mode 100755 website/js/img/layer-switcher-maximize.png create mode 100755 website/js/img/layer-switcher-minimize.png create mode 100755 website/js/img/marker-blue.png create mode 100755 website/js/img/marker-gold.png create mode 100755 website/js/img/marker-green.png create mode 100755 website/js/img/marker.png create mode 100755 website/js/img/measuring-stick-off.png create mode 100755 website/js/img/measuring-stick-on.png create mode 100755 website/js/img/north-mini.png create mode 100755 website/js/img/panning-hand-off.png create mode 100755 website/js/img/panning-hand-on.png create mode 100755 website/js/img/slider.png create mode 100755 website/js/img/south-mini.png create mode 100755 website/js/img/west-mini.png create mode 100755 website/js/img/zoom-minus-mini.png create mode 100755 website/js/img/zoom-plus-mini.png create mode 100755 website/js/img/zoom-world-mini.png create mode 100755 website/js/img/zoombar.png create mode 100755 website/js/prototype-1.6.0.3.js create mode 100755 website/js/theme/default/framedCloud.css create mode 100755 website/js/theme/default/google.css create mode 100755 website/js/theme/default/ie6-style.css create mode 100755 website/js/theme/default/img/add_point_off.png create mode 100755 website/js/theme/default/img/add_point_on.png create mode 100755 website/js/theme/default/img/blank.gif create mode 100755 website/js/theme/default/img/close.gif create mode 100755 website/js/theme/default/img/drag-rectangle-off.png create mode 100755 website/js/theme/default/img/drag-rectangle-on.png create mode 100755 website/js/theme/default/img/draw_line_off.png create mode 100755 website/js/theme/default/img/draw_line_on.png create mode 100755 website/js/theme/default/img/draw_point_off.png create mode 100755 website/js/theme/default/img/draw_point_on.png create mode 100755 website/js/theme/default/img/draw_polygon_off.png create mode 100755 website/js/theme/default/img/draw_polygon_on.png create mode 100755 website/js/theme/default/img/editing_tool_bar.png create mode 100755 website/js/theme/default/img/move_feature_off.png create mode 100755 website/js/theme/default/img/move_feature_on.png create mode 100755 website/js/theme/default/img/navigation_history.png create mode 100755 website/js/theme/default/img/overview_replacement.gif create mode 100755 website/js/theme/default/img/pan-panel-NOALPHA.png create mode 100755 website/js/theme/default/img/pan-panel.png create mode 100755 website/js/theme/default/img/pan_off.png create mode 100755 website/js/theme/default/img/pan_on.png create mode 100755 website/js/theme/default/img/panning-hand-off.png create mode 100755 website/js/theme/default/img/panning-hand-on.png create mode 100755 website/js/theme/default/img/remove_point_off.png create mode 100755 website/js/theme/default/img/remove_point_on.png create mode 100755 website/js/theme/default/img/ruler.png create mode 100755 website/js/theme/default/img/save_features_off.png create mode 100755 website/js/theme/default/img/save_features_on.png create mode 100755 website/js/theme/default/img/view_next_off.png create mode 100755 website/js/theme/default/img/view_next_on.png create mode 100755 website/js/theme/default/img/view_previous_off.png create mode 100755 website/js/theme/default/img/view_previous_on.png create mode 100755 website/js/theme/default/img/zoom-panel-NOALPHA.png create mode 100755 website/js/theme/default/img/zoom-panel.png create mode 100755 website/js/theme/default/style.css diff --git a/lib/lib.php b/lib/lib.php index 2359c930..9ee93105 100644 --- a/lib/lib.php +++ b/lib/lib.php @@ -719,6 +719,7 @@ if ($aTypeLabel && ($aLine['localname'] || $aLine['housenumber'])) { $sTypeLabel = strtolower(isset($aTypeLabel['simplelabel'])?$aTypeLabel['simplelabel']:$aTypeLabel['label']); + $sTypeLabel = str_replace(' ','_',$sTypeLabel); if (!isset($aAddress[$sTypeLabel]) && $aLine['localname']) $aAddress[$sTypeLabel] = $aLine['localname']?$aLine['localname']:$aLine['housenumber']; } } @@ -768,6 +769,7 @@ if ($aTypeLabel && ($aLine['localname'] || $aLine['housenumber'])) { $sTypeLabel = strtolower(isset($aTypeLabel['simplelabel'])?$aTypeLabel['simplelabel']:$aTypeLabel['label']); + $sTypeLabel = str_replace(' ','_',$sTypeLabel); if (!isset($aAddress[$sTypeLabel]) && $aLine['localname']) $aAddress[$sTypeLabel] = $aLine['localname']?$aLine['localname']:$aLine['housenumber']; } $iMinRank = $aLine['rank_address']; diff --git a/lib/log.php b/lib/log.php index 12e2953c..8b5f00fd 100644 --- a/lib/log.php +++ b/lib/log.php @@ -12,16 +12,35 @@ $sQuery ); - // Log - if ($sType == 'search') + if (CONST_Log_DB) { - $oDB->query('insert into query_log values ('.getDBQuoted($hLog[0]).','.getDBQuoted($hLog[3]).','.getDBQuoted($hLog[1]).')'); + // Log + if ($sType == 'search') + { + $oDB->query('insert into query_log values ('.getDBQuoted($hLog[0]).','.getDBQuoted($hLog[3]).','.getDBQuoted($hLog[1]).')'); + } + + $sSQL = 'insert into new_query_log (type,starttime,query,ipaddress,useragent,language,format)'; + $sSQL .= ' values ('.getDBQuoted($sType).','.getDBQuoted($hLog[0]).','.getDBQuoted($hLog[2]); + $sSQL .= ','.getDBQuoted($hLog[1]).','.getDBQuoted($_SERVER['HTTP_USER_AGENT']).','.getDBQuoted(join(',',$aLanguageList)).','.getDBQuoted($_GET['format']).')'; + $oDB->query($sSQL); } - $sSQL = 'insert into new_query_log (type,starttime,query,ipaddress,useragent,language,format)'; - $sSQL .= ' values ('.getDBQuoted($sType).','.getDBQuoted($hLog[0]).','.getDBQuoted($hLog[2]); - $sSQL .= ','.getDBQuoted($hLog[1]).','.getDBQuoted($_SERVER['HTTP_USER_AGENT']).','.getDBQuoted(join(',',$aLanguageList)).','.getDBQuoted($_GET['format']).')'; - $oDB->query($sSQL); + if ($sType == 'reverse') + { + $aStartTime = explode('.',$hLog[0]); + file_put_contents('/data/mapquest/opentile_http/logs/nominatimreverse', + $aStartTime[0].','.$aStartTime[1].','. + php_uname('n').','. + '"'.addslashes(isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:'').'",'. + '"'.addslashes($hLog[1]).'",'. + $_GET['lat'].','. + $_GET['lon'].','. + $_GET['zoom'].','. + '"'.addslashes($_SERVER['HTTP_USER_AGENT']).'",'. + '"'.addslashes($_GET['format']).'"'."\n", + FILE_APPEND); + } return $hLog; @@ -33,15 +52,31 @@ if (!$aEndTime[1]) $aEndTime[1] = '0'; $sEndTime = date('Y-m-d H:i:s',$aEndTime[0]).'.'.$aEndTime[1]; - $sSQL = 'update query_log set endtime = '.getDBQuoted($sEndTime).', results = '.$iNumResults; - $sSQL .= ' where starttime = '.getDBQuoted($hLog[0]); - $sSQL .= ' and ipaddress = '.getDBQuoted($hLog[1]); - $sSQL .= ' and query = '.getDBQuoted($hLog[3]); - $oDB->query($sSQL); + if (CONST_Log_DB) + { + $sSQL = 'update query_log set endtime = '.getDBQuoted($sEndTime).', results = '.$iNumResults; + $sSQL .= ' where starttime = '.getDBQuoted($hLog[0]); + $sSQL .= ' and ipaddress = '.getDBQuoted($hLog[1]); + $sSQL .= ' and query = '.getDBQuoted($hLog[3]); + $oDB->query($sSQL); + + $sSQL = 'update new_query_log set endtime = '.getDBQuoted($sEndTime).', results = '.$iNumResults; + $sSQL .= ' where starttime = '.getDBQuoted($hLog[0]); + $sSQL .= ' and ipaddress = '.getDBQuoted($hLog[1]); + $sSQL .= ' and query = '.getDBQuoted($hLog[2]); + $oDB->query($sSQL); + } + + $aStartTime = explode('.',$hLog[0]); + file_put_contents('/data/mapquest/opentile_http/logs/nominatimsearch', + $aStartTime[0].','.$aStartTime[1].','. + php_uname('n').','. + '"'.addslashes(isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:'').'",'. + '"'.addslashes($hLog[1]).'",'. + '"'.addslashes($hLog[3]).'",'. + '"'.addslashes($_SERVER['HTTP_USER_AGENT']).'",'. + '"'.addslashes($_GET['format']).'",'. + $iNumResults."\n", + FILE_APPEND); - $sSQL = 'update new_query_log set endtime = '.getDBQuoted($sEndTime).', results = '.$iNumResults; - $sSQL .= ' where starttime = '.getDBQuoted($hLog[0]); - $sSQL .= ' and ipaddress = '.getDBQuoted($hLog[1]); - $sSQL .= ' and query = '.getDBQuoted($hLog[2]); - $oDB->query($sSQL); } diff --git a/lib/template/address-jsonv2.php b/lib/template/address-jsonv2.php index 3176da54..b6fa58fe 100644 --- a/lib/template/address-jsonv2.php +++ b/lib/template/address-jsonv2.php @@ -21,7 +21,12 @@ $aFilteredPlaces['osm_type'] = $sOSMType; $aFilteredPlaces['osm_id'] = $aPlace['osm_id']; } + $aFilteredPlaces['category'] = $aPlace['class']; + $aFilteredPlaces['type'] = $aPlace['type']; + $aFilteredPlaces['addresstype'] = strtolower($aPlace['addresstype']); + $aFilteredPlaces['display_name'] = $aPlace['langaddress']; + $aFilteredPlaces['name'] = $aPlace['placename']; $aFilteredPlaces['address'] = $aAddress; } diff --git a/lib/template/search-html.php b/lib/template/search-html.php index be98fa4a..3b664e54 100644 --- a/lib/template/search-html.php +++ b/lib/template/search-html.php @@ -10,7 +10,7 @@ - +