Skip to content

Commit

Permalink
hide coordinate historiy of quiz and safari caches; updates #958
Browse files Browse the repository at this point in the history
  • Loading branch information
following5 committed Sep 4, 2017
1 parent ffce1e2 commit 1add3fd
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions htdocs/lib2/logic/cache.class.php
Expand Up @@ -456,14 +456,26 @@ public static function getLogsArray($cacheId, $start, $count, $deleted = false,
return [];
}

$rsCoords = sql(
"SELECT `date_created` `date`, `latitude`, `longitude`
FROM `cache_coordinates`
WHERE `cache_id`='&1'
ORDER BY `date_created` DESC",
$is_quiz_or_safari = sql_value(
"SELECT `type`=7 OR `type`=8 OR `attrib_id` IS NOT NULL
FROM `caches`
LEFT JOIN `caches_attributes` `ca` ON `ca`.`cache_id`=`caches`.`cache_id` AND `attrib_id`=61
WHERE `caches`.`cache_id`='&1'",
0,
$cacheId
);
$coords = sql_fetch_assoc_table($rsCoords);
if ($is_quiz_or_safari) {
$coords = [];
} else {
$rsCoords = sql(
"SELECT `date_created` `date`, `latitude`, `longitude`
FROM `cache_coordinates`
WHERE `cache_id`='&1'
ORDER BY `date_created` DESC",
$cacheId
);
$coords = sql_fetch_assoc_table($rsCoords);
}

if ($coords) {
$lastcoorddate = $coords[count($coords)-1]['date'];
Expand Down

0 comments on commit 1add3fd

Please sign in to comment.