]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/polygons.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / website / polygons.php
old mode 100755 (executable)
new mode 100644 (file)
index 0f49183..29fc5c2
@@ -1,6 +1,5 @@
 <?php
 
-require_once(dirname(dirname(__FILE__)).'/settings/settings.php');
 require_once(CONST_BasePath.'/lib/init-website.php');
 require_once(CONST_BasePath.'/lib/log.php');
 require_once(CONST_BasePath.'/lib/output.php');
@@ -13,9 +12,10 @@ $iDays = $oParams->getInt('days', false);
 $bReduced = $oParams->getBool('reduced', false);
 $sClass = $oParams->getString('class', false);
 
-$oDB =& getDB();
+$oDB = new Nominatim\DB();
+$oDB->connect();
 
-$iTotalBroken = (int) chksql($oDB->getOne('select count(*) from import_polygon_error'));
+$iTotalBroken = (int) $oDB->getOne('select count(*) from import_polygon_error');
 
 $aPolygons = array();
 while ($iTotalBroken && empty($aPolygons)) {
@@ -37,7 +37,7 @@ while ($iTotalBroken && empty($aPolygons)) {
     }
 
     $sSQL .= ' order by updated desc limit 1000';
-    $aPolygons = chksql($oDB->getAll($sSQL));
+    $aPolygons = $oDB->getAll($sSQL);
 }
 
 if (CONST_Debug) {
@@ -120,7 +120,7 @@ foreach ($aPolygons as $aRow) {
                 }
                 break;
             case 'id':
-                echo '<td>'.osmLink($aRow).'</td>';
+                echo '<td>'.osmLink(array('osm_type' => $aRow['type'], 'osm_id' => $aRow['id'])).'</td>';
                 break;
             default:
                 echo '<td>'.($sVal?$sVal:'&nbsp;').'</td>';