]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/details.php
Merge pull request #436 from lonvia/remove-location-property-tables
[nominatim.git] / website / details.php
index 6f59d4dff1c225736c6afe9860c9270d06d1092c..5edef6f5001938505960cf0e6dffe5d35e05d952 100755 (executable)
@@ -1,7 +1,8 @@
 <?php
        @define('CONST_ConnectionBucket_PageType', 'Details');
 
 <?php
        @define('CONST_ConnectionBucket_PageType', 'Details');
 
-       require_once(dirname(dirname(__FILE__)).'/lib/init-website.php');
+       require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
+       require_once(CONST_BasePath.'/lib/init-website.php');
        require_once(CONST_BasePath.'/lib/log.php');
 
        $sOutputFormat = 'html';
        require_once(CONST_BasePath.'/lib/log.php');
 
        $sOutputFormat = 'html';
@@ -9,7 +10,7 @@
           $fLoadAvg = getLoadAverage();
           if ($fLoadAvg > 3)
           {
           $fLoadAvg = getLoadAverage();
           if ($fLoadAvg > 3)
           {
-          echo "Page temporarily blocked due to high server load\n";F
+          echo "Page temporarily blocked due to high server load\n";
           exit;
           }
         */
           exit;
           }
         */
 
        $iPlaceID = (int)$_GET['place_id'];
 
 
        $iPlaceID = (int)$_GET['place_id'];
 
-       $iParentPlaceID = $oDB->getOne('select parent_place_id from location_property_tiger where place_id = '.$iPlaceID);
-       if ($iParentPlaceID) $iPlaceID = $iParentPlaceID;
-       $iParentPlaceID = $oDB->getOne('select parent_place_id from location_property_aux where place_id = '.$iPlaceID);
-       if ($iParentPlaceID) $iPlaceID = $iParentPlaceID;
+       if (CONST_Use_US_Tiger_Data)
+       {
+               $iParentPlaceID = $oDB->getOne('select parent_place_id from location_property_tiger where place_id = '.$iPlaceID);
+               if ($iParentPlaceID) $iPlaceID = $iParentPlaceID;
+       }
+
+       if (CONST_Use_Aux_Location_data)
+       {
+               $iParentPlaceID = $oDB->getOne('select parent_place_id from location_property_aux where place_id = '.$iPlaceID);
+               if ($iParentPlaceID) $iPlaceID = $iParentPlaceID;
+       }
 
        $hLog = logStart($oDB, 'details', $_SERVER['QUERY_STRING'], $aLangPrefOrder);
 
 
        $hLog = logStart($oDB, 'details', $_SERVER['QUERY_STRING'], $aLangPrefOrder);