2124: mark own, found, inactive and oconly caches on map
@ -287,7 +287,7 @@ function output_namesearch($sName, $nLat, $nLon, $nResultId)
|
||||
|
||||
function output_searchresult($nResultId, $nLon1, $nLat1, $nLon2, $nLat2)
|
||||
{
|
||||
global $opt;
|
||||
global $opt, $login;
|
||||
|
||||
// check if data is available and connect the right slave server
|
||||
$nSlaveId = sql_value("SELECT `slave_id` FROM `map2_result` WHERE `result_id`='&1' AND DATE_ADD(`date_created`, INTERVAL '&2' SECOND)>NOW()", -2, $nResultId, $opt['map']['maxcacheage']);
|
||||
@ -313,10 +313,28 @@ function output_searchresult($nResultId, $nLon1, $nLat1, $nLon2, $nLat2)
|
||||
|
||||
if ($bMaxRecordReached == false)
|
||||
{
|
||||
$rs = sql_slave("SELECT SQL_BUFFER_RESULT `caches`.`wp_oc`, `caches`.`longitude`, `caches`.`latitude`, `caches`.`type` FROM `map2_data` INNER JOIN `caches` ON `map2_data`.`cache_id`=`caches`.`cache_id` WHERE `map2_data`.`result_id`='&1' AND `caches`.`longitude`>'&2' AND `caches`.`longitude`<'&3' AND `caches`.`latitude`>'&4' AND `caches`.`latitude`<'&5' LIMIT " . ($opt['map']['maxrecords']+0), $nResultId, $nLon1, $nLon2, $nLat1, $nLat2);
|
||||
$rs = sql_slave("SELECT SQL_BUFFER_RESULT
|
||||
`caches`.`wp_oc`, `caches`.`longitude`, `caches`.`latitude`,
|
||||
`caches`.`type`,
|
||||
`caches`.`status`>1 AS `inactive`,
|
||||
`user`.`user_id`='&6' AS `owned`,
|
||||
IF(`cache_logs`.`id` IS NULL, 0, 1) AS `found`,
|
||||
IF(`caches_attributes`.`attrib_id` IS NULL, 0, 1) AS `oconly`
|
||||
FROM `map2_data`
|
||||
INNER JOIN `caches` ON `map2_data`.`cache_id`=`caches`.`cache_id`
|
||||
LEFT JOIN `user` ON `user`.`user_id`=`caches`.`user_id`
|
||||
LEFT JOIN `cache_logs` ON `cache_logs`.`cache_id`=`caches`.`cache_id` AND `cache_logs`.`user_id`='&6' AND `cache_logs`.`type` IN (1,7)
|
||||
LEFT JOIN `caches_attributes` ON `caches_attributes`.`cache_id`=`caches`.`cache_id` AND `caches_attributes`.`attrib_id`=6
|
||||
WHERE `map2_data`.`result_id`='&1' AND `caches`.`longitude`>'&2' AND `caches`.`longitude`<'&3' AND `caches`.`latitude`>'&4' AND `caches`.`latitude`<'&5' LIMIT " . ($opt['map']['maxrecords']+0),
|
||||
$nResultId, $nLon1, $nLon2, $nLat1, $nLat2, $login->userid);
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
echo '<cache wp="' . xmlentities($r['wp_oc']) . '" lon="' . xmlentities($r['longitude']) . '" lat="' . xmlentities($r['latitude']) . '" type="' . xmlentities($r['type']) . '" />' . "\n";
|
||||
$flags = 0;
|
||||
if ($r['owned']) $flags |= 1;
|
||||
if ($r['found']) $flags |= 2;
|
||||
if ($r['inactive']) $flags |= 4;
|
||||
if ($r['oconly']) $flags |= 8;
|
||||
echo '<cache wp="' . xmlentities($r['wp_oc']) . '" lon="' . xmlentities($r['longitude']) . '" lat="' . xmlentities($r['latitude']) . '" type="' . xmlentities($r['type']) . '" flags="' . xmlentities($flags) . '" />' . "\n";
|
||||
}
|
||||
sql_free_result($rs);
|
||||
}
|
||||
|
@ -1,8 +1,18 @@
|
||||
function CacheMarker(latlng, wp, type)
|
||||
function CacheMarker(latlng, wp, type, flags)
|
||||
{
|
||||
this.latlng = latlng;
|
||||
this.wp_ = wp;
|
||||
this.image_ = 'resource2/ocstyle/images/map/24x24-cachetype-' + type + '.png';
|
||||
|
||||
if (flags & 4) state = '-inactive';
|
||||
else if (flags & 8) state = '-oconly';
|
||||
else state = '';
|
||||
|
||||
if (flags & 1)
|
||||
this.image_ = 'resource2/ocstyle/images/map/24x24-owned' + state + '.png';
|
||||
else if (flags & 2)
|
||||
this.image_ = 'resource2/ocstyle/images/map/24x24-found' + state + '.png';
|
||||
else
|
||||
this.image_ = 'resource2/ocstyle/images/map/24x24-cachetype-' + type + state + '.png';
|
||||
this.height_ = 24;
|
||||
this.width_ = 24;
|
||||
}
|
||||
|
After Width: | Height: | Size: 630 B |
BIN
htdocs/resource2/ocstyle/images/map/24x24-cachetype-1-oconly.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 753 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 751 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 657 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 761 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 805 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 600 B |
BIN
htdocs/resource2/ocstyle/images/map/24x24-cachetype-2-oconly.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 684 B |
BIN
htdocs/resource2/ocstyle/images/map/24x24-cachetype-3-oconly.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 681 B |
BIN
htdocs/resource2/ocstyle/images/map/24x24-cachetype-4-oconly.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 636 B |
BIN
htdocs/resource2/ocstyle/images/map/24x24-cachetype-5-oconly.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 735 B |
BIN
htdocs/resource2/ocstyle/images/map/24x24-cachetype-6-oconly.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 641 B |
BIN
htdocs/resource2/ocstyle/images/map/24x24-cachetype-7-oconly.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 759 B |
BIN
htdocs/resource2/ocstyle/images/map/24x24-cachetype-8-oconly.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 583 B |
BIN
htdocs/resource2/ocstyle/images/map/24x24-cachetype-9-oconly.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
htdocs/resource2/ocstyle/images/map/24x24-found-inactive.png
Normal file
After Width: | Height: | Size: 700 B |
BIN
htdocs/resource2/ocstyle/images/map/24x24-found-oconly.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
htdocs/resource2/ocstyle/images/map/24x24-owned-inactive.png
Normal file
After Width: | Height: | Size: 562 B |
BIN
htdocs/resource2/ocstyle/images/map/24x24-owned-oconly.png
Normal file
After Width: | Height: | Size: 986 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 943 B |
@ -1099,8 +1099,9 @@
|
||||
var nLon = oCachesList[nIndex].getAttribute("lon");
|
||||
var nLat = oCachesList[nIndex].getAttribute("lat");
|
||||
var nType = oCachesList[nIndex].getAttribute("type");
|
||||
var nFlags = oCachesList[nIndex].getAttribute("flags");
|
||||
|
||||
addCacheToMap(sWaypoint, nLon, nLat, nType);
|
||||
addCacheToMap(sWaypoint, nLon, nLat, nType, nFlags);
|
||||
}
|
||||
|
||||
document.getElementById('statCachesCount').firstChild.nodeValue = oCachesList.length;
|
||||
@ -1121,7 +1122,7 @@
|
||||
return ((dTime2-dTime1)/1000).toFixed(1);
|
||||
}
|
||||
|
||||
function addCacheToMap(sWaypoint, nLon, nLat, nType)
|
||||
function addCacheToMap(sWaypoint, nLon, nLat, nType, nFlags)
|
||||
{
|
||||
if (sWaypoint == msPopupMarkerWP)
|
||||
{
|
||||
@ -1133,7 +1134,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
var oMarker = new CacheMarker(new GLatLng(nLat, nLon), sWaypoint, nType);
|
||||
var oMarker = new CacheMarker(new GLatLng(nLat, nLon), sWaypoint, nType, nFlags);
|
||||
GEvent.addListener(oMarker, "click", function(wp){CacheMarker_click(wp);});
|
||||
moMap.addOverlay(oMarker);
|
||||
|
||||
|