projects
/
platal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix some logging issues again.
[platal.git]
/
include
/
geoloc.inc.php
diff --git
a/include/geoloc.inc.php
b/include/geoloc.inc.php
index
51fc43c
..
28ffe51
100644
(file)
--- a/
include/geoloc.inc.php
+++ b/
include/geoloc.inc.php
@@
-326,8
+326,10
@@
function fix_cities_not_on_map($limit=false, $cityid=false)
$values .= ",($cityid, $map_id, '')";
}
}
$values .= ",($cityid, $map_id, '')";
}
}
- XDB::execute("REPLACE INTO geoloc_city_in_maps
- VALUES ".substr($values, 1));
+ if (strlen($values) > 1) {
+ XDB::execute("REPLACE INTO geoloc_city_in_maps
+ VALUES ".substr($values, 1));
+ }
} else {
return false;
}
} else {
return false;
}
@@
-416,7
+418,7
@@
function geoloc_getData_subcities($mapid, $SFields, &$cities, $direct=true)
$where . ($direct ? "gcim.infos = 'smallest'" : '1'),
'gc.id, gc.alias',
'pop DESC');
$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']);
if ($c['pop'] > 0) {
$city = $c;
$city['x'] = geoloc_to_x($c['x'], $c['y']);
@@
-494,8
+496,8
@@
function geoloc_getData_subcountries($mapid, $sin, $minentities)
'NULL');
$maxpop = 0;
'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']);
$c['latPop'] /= $c['nbPop'];
$c['lonPop'] /= $c['nbPop'];
$c['rad'] = size_of_territory($c['nbPop']);