From 06df222b7962dd5b71b34ec1dd078276d7327dbc Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sat, 19 Jul 2008 15:23:19 +0200 Subject: [PATCH] Should fix geoloc. Signed-off-by: Florent Bruneau --- include/geoloc.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/geoloc.inc.php b/include/geoloc.inc.php index 51fc43c..8511a4e 100644 --- a/include/geoloc.inc.php +++ b/include/geoloc.inc.php @@ -416,7 +416,7 @@ function geoloc_getData_subcities($mapid, $SFields, &$cities, $direct=true) $where . ($direct ? "gcim.infos = 'smallest'" : '1'), 'gc.id, gc.alias', 'pop DESC'); - while ($c = $cityres->next()) { + foreach($cityres as $c) { if ($c['pop'] > 0) { $city = $c; $city['x'] = geoloc_to_x($c['x'], $c['y']); @@ -494,8 +494,8 @@ function geoloc_getData_subcountries($mapid, $sin, $minentities) 'NULL'); $maxpop = 0; - $nbentities = $nbcities + $countryres->total(); - while ($c = $countryres->next()) { + $nbentities = $nbcities + count($countryres); + foreach ($countryres as $c) { $c['latPop'] /= $c['nbPop']; $c['lonPop'] /= $c['nbPop']; $c['rad'] = size_of_territory($c['nbPop']); -- 2.1.4