@@ -2505,6 +2505,7 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2083', 'NEW', '
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2084', 'show archived', '2013-04-25 23:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2085', 'hide archived', '2013-04-25 23:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2086', 'unknown search type', '2013-04-25 23:00:00');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2087', 'Show on map', '2013-04-25 23:00:00');
|
||||
|
||||
-- Table sys_trans_ref
|
||||
SET NAMES 'utf8';
|
||||
@@ -6462,6 +6463,7 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2084', 'DE', 'archivierte einblenden', '2013-04-25 23:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2085', 'DE', 'archivierte ausblenden', '2013-04-25 23:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2086', 'DE', 'unbekannter Suchtyp', '2013-04-25 23:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2087', 'DE', 'auf Karte anzeigen', '2013-04-25 23:00:00');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'EN', 'Reorder IDs \r', '2010-09-02 00:15:30');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'EN', 'The database could not be reconnected.', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('3', 'EN', 'Testing – please do not login', '2010-08-28 11:48:07');
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
$search_in_gm_zip = '<a href="http://maps.google.de/maps?f=q&hl=de&q=' . urlencode("http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']."&output=kml&zip=1&count=max") . '" title="' . $translate->t('Show in Google Maps','','',0) . '">' . $translate->t('(in GM)','','',0) . '</a>';
|
||||
|
||||
$unknown_searchtype = t('unknown search type');
|
||||
$showonmap = t('Show on map');
|
||||
|
||||
|
||||
function dateDiff($interval, $dateTimeBegin, $dateTimeEnd)
|
||||
|
||||
@@ -27,14 +27,21 @@
|
||||
?>
|
||||
|
||||
<div class="content2-container bg-blue02" style="margin-top:20px;">
|
||||
<p class="content-title-noshade-size3">
|
||||
<img src="resource2/ocstyle/images/cacheicon/traditional.gif" width="32" height="32" style="align:left;" alt="{t}Search{/t}" />
|
||||
{t}{results_count} caches<span style="{search_headline_caches}"> matched</span>{/t}
|
||||
<span style="font-weight:normal;float:right;font-size:80%;" >
|
||||
[<a href="query.php?action=save&queryid={queryid}">{t}Save options{/t}</a>]
|
||||
[<a href="search.php?queryid={queryid}&showresult=0">{t}Edit options{/t}</a>]
|
||||
</span>
|
||||
</p>
|
||||
<table cellspacing="0" cellpadding="0" width="100%" border="0"><tr>
|
||||
<td style="white-space:nowrap">
|
||||
<p class="content-title-noshade-size15" style="padding:0; margin:4px;"> {t}{results_count} caches<span style="{search_headline_caches}"> matched</span>{/t} </p>
|
||||
</td>
|
||||
<td style="text-align:right; width:1px">
|
||||
<a href="search.php?queryid={queryid}&output=map2bounds&showresult=1&skipqueryid=1&expert=0&utf8=1" class="nooutline"><img src="resource2/ocstyle/images/misc/32x32-world.png"/></a>
|
||||
</td>
|
||||
<td style="white-space:nowrap; text-align:left; padding-bottom:2px">
|
||||
<p class="inheader"><a href="search.php?queryid={queryid}&output=map2bounds&showresult=1&skipqueryid=1&expert=0&utf8=1">{showonmap}</a></p>
|
||||
</td>
|
||||
<td style="text-align:right; padding-bottom:2px"><p class="inheader">
|
||||
<span style="white-space:nowrap">[<a href="query.php?action=save&queryid={queryid}">{t}Save options{/t}</a>]</span>
|
||||
<span style="white-space:nowrap">[<a href="search.php?queryid={queryid}&showresult=0">{t}Edit options{/t}</a>]</span></p>
|
||||
</td>
|
||||
</tr></table>
|
||||
</div>
|
||||
<div class="buffer" style="height:5px;"></div>
|
||||
|
||||
@@ -44,9 +51,9 @@
|
||||
<td class="header-small" colspan="2">
|
||||
<table width="98.5%">
|
||||
<tr>
|
||||
<td width="100%">{pages}</td>
|
||||
<td>{t}Download{/t}:</td>
|
||||
<td>
|
||||
<td rowspan="1" style="vertical-align:top; width:300px">{pages}</td>
|
||||
<td style="text-align:right;">{t}Download{/t}: </td>
|
||||
<td><nobr>
|
||||
<select name="wpdownload-page" class="wpdownload" onChange="location.href=this.options[this.selectedIndex].value">
|
||||
<option value="#">{t}Results on this page{/t}</option>
|
||||
<option value="search.php?queryid={queryid}&output=gpx&startat={startat}">GPX</option>
|
||||
@@ -56,8 +63,6 @@
|
||||
<option value="search.php?queryid={queryid}&output=ovl&startat={startat}">OVL</option>
|
||||
<option value="search.php?queryid={queryid}&output=txt&startat={startat}">TXT</option>
|
||||
</select>
|
||||
</td>
|
||||
<td style="width:120px">
|
||||
<select name="wpdownload-all" class="wpdownload" onChange="location.href=this.options[this.selectedIndex].value">
|
||||
<option value="#">{t}Result {startatp1} to {endat} (as zip){/t}</option>
|
||||
<option value="search.php?queryid={queryid}&output=gpx&startat={startat}&count=max&zip=1">GPX</option>
|
||||
@@ -66,7 +71,7 @@
|
||||
<option value="search.php?queryid={queryid}&output=ov2&startat={startat}&count=max&zip=1">OV2</option>
|
||||
<option value="search.php?queryid={queryid}&output=ovl&startat={startat}&count=max&zip=1">OVL</option>
|
||||
<option value="search.php?queryid={queryid}&output=txt&startat={startat}&count=max&zip=1">TXT</option>
|
||||
</select>
|
||||
</select></nobr>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -94,12 +99,12 @@
|
||||
<tr>
|
||||
<td colspan="2" class="header-small">{pages}</td>
|
||||
</tr>
|
||||
<tr><td class="spacer" colspan="2"> </td></tr>
|
||||
<tr><td style="height:0.6em"></td></tr>
|
||||
</table>
|
||||
<table class="content" width="100%">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td><b>{t}Download{/t}:</b></td>
|
||||
<td align="right" style="padding-right:20px;">
|
||||
<td style="text-align:right; width:50%">{t}Download{/t}: </td>
|
||||
<td align="right" style="padding-right:20px; white-space:nowrap">
|
||||
<b>{t}Results on this page:{/t}</b>
|
||||
<a href="search.php?queryid={queryid}&output=gpx&startat={startat}" title="{t}GPS Exchange Format .gpx{/t}">GPX</a>
|
||||
<a href="search.php?queryid={queryid}&output=loc&startat={startat}" title="{t}Waypointfile .loc{/t}">LOC</a>
|
||||
@@ -108,12 +113,7 @@
|
||||
<a href="search.php?queryid={queryid}&output=ov2&startat={startat}" title="{t}TomTom POI .ov2{/t}">OV2</a>
|
||||
<a href="search.php?queryid={queryid}&output=ovl&startat={startat}" title="{t}TOP50-Overlay .ovl{/t}">OVL</a>
|
||||
<a href="search.php?queryid={queryid}&output=txt&startat={startat}" title="{t}Textfile .txt{/t}">TXT</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="help">
|
||||
</td>
|
||||
<td align="right" style="padding-right:20px;">
|
||||
<br />
|
||||
<b>{t}Result {startatp1} to {endat} (as zip):{/t}</b>
|
||||
<a href="search.php?queryid={queryid}&output=gpx&startat={startat}&count=max&zip=1" title="{t}GPS Exchange Format .gpx{/t}">GPX</a>
|
||||
<a href="search.php?queryid={queryid}&output=loc&startat={startat}&count=max&zip=1" title="{t}Waypointfile .loc{/t}">LOC</a>
|
||||
|
||||
@@ -325,12 +325,13 @@
|
||||
//$caches_per_page
|
||||
//count($caches) - 1
|
||||
tpl_set_var('pages', $pages);
|
||||
tpl_set_var('showonmap', $showonmap);
|
||||
|
||||
// downloads
|
||||
tpl_set_var('queryid', $options['queryid']);
|
||||
tpl_set_var('startat', $startat);
|
||||
|
||||
tpl_set_var('startatp1', $startat + 1);
|
||||
tpl_set_var('startatp1', min($resultcount,$startat + 1));
|
||||
|
||||
if (($resultcount - $startat) < 500)
|
||||
tpl_set_var('endat', $startat + $resultcount - $startat);
|
||||
|
||||
@@ -10,8 +10,9 @@
|
||||
***************************************************************************/
|
||||
|
||||
global $dblink, $dbslaveid;
|
||||
$sqlchecksum = sprintf('%u', crc32($sqlFilter));
|
||||
|
||||
|
||||
$sqlchecksum = sprintf('%u', crc32($cachesFilter."\n".$sqlFilter));
|
||||
|
||||
/* config */
|
||||
$opt['map']['maxcacheage'] = 3600;
|
||||
|
||||
@@ -30,13 +31,42 @@
|
||||
sql_slave("CREATE TEMPORARY TABLE `tmpmapresult` (`cache_id` INT UNSIGNED NOT NULL, PRIMARY KEY (`cache_id`)) ENGINE=MEMORY");
|
||||
sql_slave("INSERT INTO `tmpmapresult` (`cache_id`) " . $sqlFilter);
|
||||
|
||||
sql("INSERT INTO `map2_result` (`slave_id`, `sqlchecksum`, `sqlquery`, `date_created`, `date_lastqueried`) VALUES ('&1', '&2', '&3', NOW(), NOW())", $dbslaveid, $sqlchecksum, $sqlFilter);
|
||||
sql("INSERT INTO `map2_result` (`slave_id`, `sqlchecksum`, `sqlquery`, `date_created`, `date_lastqueried`) VALUES ('&1', '&2', '&3', NOW(), NOW())", $dbslaveid, $sqlchecksum, $cachesFilter."\n".$sqlFilter);
|
||||
$resultId = mysql_insert_id($dblink);
|
||||
|
||||
sql_slave("INSERT IGNORE INTO `map2_data` (`result_id`, `cache_id`) SELECT '&1', `cache_id` FROM `tmpmapresult`", $resultId);
|
||||
sql_slave("DROP TEMPORARY TABLE `tmpmapresult`");
|
||||
}
|
||||
|
||||
echo $resultId;
|
||||
if ($map2_bounds)
|
||||
{
|
||||
$rs = sql_slave("SELECT MIN(`latitude`) AS `lat_min`,
|
||||
MAX(`latitude`) AS `lat_max`,
|
||||
MIN(`longitude`) AS `lon_min`,
|
||||
MAX(`longitude`) AS `lon_max`
|
||||
FROM `map2_data`, `caches`
|
||||
WHERE `result_id`='&1'
|
||||
AND `caches`.`cache_id`=`map2_data`.`cache_id`",
|
||||
$resultId);
|
||||
if (($rBounds = sql_fetch_assoc($rs)) && $rBounds['lat_min'] !== null /* >0 caches */)
|
||||
{
|
||||
if ($rBounds['lat_min'] == $rBounds['lat_max'] &&
|
||||
$rBounds['lon_min'] == $rBounds['lon_max']) // 1 Cache
|
||||
{
|
||||
$halfwin = 0.02;
|
||||
$rBounds['lat_min'] -= $halfwin;
|
||||
$rBounds['lat_max'] += $halfwin;
|
||||
$rBounds['lon_min'] -= $halfwin;
|
||||
$rBounds['lon_max'] += $halfwin;
|
||||
}
|
||||
$bounds_param = "&lat_min=" . round($rBounds['lat_min'],5) . "&lat_max=" . round($rBounds['lat_max'],5) . '&lon_min=' . round($rBounds['lon_min'],5) . '&lon_max=' . round($rBounds['lon_max'],5);
|
||||
}
|
||||
sql_free_result($rs);
|
||||
|
||||
tpl_redirect('map2.php?queryid=' . $options['queryid'] . '&resultid=' . $resultId . $bounds_param);
|
||||
}
|
||||
else
|
||||
echo $resultId;
|
||||
|
||||
exit;
|
||||
?>
|
||||
+27
-9
@@ -52,9 +52,10 @@
|
||||
$nLat2 = isset($_REQUEST['lat2']) ? $_REQUEST['lat2']+0 : 0;
|
||||
$cachenames = isset($_REQUEST['cachenames']) ? $_REQUEST['cachenames']+0 : 0;
|
||||
$smallmap = isset($_REQUEST['smallmap']) ? $_REQUEST['smallmap']+0 : 0;
|
||||
$showlockedcaches = isset($_REQUEST['locked']) ? $_REQUEST['locked']<>0 : true;
|
||||
|
||||
output_searchresult($nResultId, $compact, $nLon1, $nLon2, $nLat1, $nLat2,
|
||||
$cachenames, $smallmap);
|
||||
$cachenames, $smallmap, $showlockedcaches);
|
||||
}
|
||||
else if ($sMode == 'fullscreen' ||
|
||||
($sMode == '' &&
|
||||
@@ -70,6 +71,21 @@
|
||||
$fullscreen = false;
|
||||
}
|
||||
|
||||
// set queryid data for displaying search results on map
|
||||
$nQueryId = isset($_REQUEST['queryid']) ? $_REQUEST['queryid']+0 : 0;
|
||||
$nResultId = isset($_REQUEST['resultid']) ? $_REQUEST['resultid']+0 : 0;
|
||||
$tpl->assign('queryid',$nQueryId);
|
||||
|
||||
if (!isset($_REQUEST['lat_min']))
|
||||
$tpl->assign('lat_min',null);
|
||||
else
|
||||
{
|
||||
$tpl->assign('lat_min',$_REQUEST['lat_min']);
|
||||
$tpl->assign('lat_max',$_REQUEST['lat_max']);
|
||||
$tpl->assign('lon_min',$_REQUEST['lon_min']);
|
||||
$tpl->assign('lon_max',$_REQUEST['lon_max']);
|
||||
}
|
||||
|
||||
// save options
|
||||
if (isset($_REQUEST['submit']) && $_REQUEST['submit'] && $login->userid > 0)
|
||||
{
|
||||
@@ -386,7 +402,7 @@ function output_namesearch($sName, $nLat, $nLon, $nResultId)
|
||||
}
|
||||
|
||||
function output_searchresult($nResultId, $compact, $nLon1, $nLon2, $nLat1, $nLat2,
|
||||
$cachenames, $smallmap)
|
||||
$cachenames, $smallmap, $showlockedcaches)
|
||||
{
|
||||
global $login, $opt, $useragent_msie;
|
||||
|
||||
@@ -433,7 +449,8 @@ function output_searchresult($nResultId, $compact, $nLon1, $nLon2, $nLat1, $nLat
|
||||
{
|
||||
$namequery = ($cachenames ? ", `caches`.`name` AS `cachename`" : "");
|
||||
$rs = sql_slave("SELECT SQL_BUFFER_RESULT
|
||||
`caches`.`wp_oc`, `caches`.`longitude`, `caches`.`latitude`,
|
||||
distinct `caches`.`wp_oc`,
|
||||
`caches`.`longitude`, `caches`.`latitude`,
|
||||
`caches`.`type`,
|
||||
`caches`.`status`>1 AS `inactive`,
|
||||
`caches`.`type`=6 AND `caches`.`date_hidden`+INTERVAL 1 DAY < NOW() AS `oldevent`,
|
||||
@@ -444,19 +461,21 @@ function output_searchresult($nResultId, $compact, $nLon1, $nLon2, $nLat1, $nLat
|
||||
$namequery . "
|
||||
FROM `map2_data`
|
||||
INNER JOIN `caches` ON `map2_data`.`cache_id`=`caches`.`cache_id`
|
||||
LEFT JOIN `user` ON `user`.`user_id`=`caches`.`user_id`
|
||||
INNER JOIN `user` ON `user`.`user_id`=`caches`.`user_id`
|
||||
LEFT JOIN `cache_logs` `found_logs` ON `found_logs`.`cache_id`=`caches`.`cache_id` AND `found_logs`.`user_id`='&6' AND `found_logs`.`type` IN (1,7)
|
||||
LEFT JOIN `cache_logs` `notfound_logs` ON `notfound_logs`.`cache_id`=`caches`.`cache_id` AND `notfound_logs`.`user_id`='&6' AND `notfound_logs`.`type`=2
|
||||
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'
|
||||
AND `caches`.`status`<>6 /* hide vandalized listings, locked duplicates etc. */
|
||||
AND `caches`.`status`<>7 /* ... and locked/invisible caches */
|
||||
AND `caches`.`status`<>'&7' /* hide vandalized listings, locked duplicates etc. */
|
||||
AND `caches`.`status`<>7 /* ... and locked/invisible caches */
|
||||
ORDER BY `caches`.`status` DESC, `oconly` AND NOT (`found` OR `notfound`), NOT (`found` OR `notfound`), `caches`.`type`<>4, MD5(`caches`.`name`)
|
||||
LIMIT &7",
|
||||
LIMIT &8",
|
||||
// sort in reverse order, because last are on top of map;
|
||||
// fixed order avoids oscillations when panning;
|
||||
// MD5 pseudo-randomness gives equal changes for all kinds of caches to be on top
|
||||
$nResultId, $nLon1, $nLon2, $nLat1, $nLat2, $login->userid, $maxrecords);
|
||||
$nResultId, $nLon1, $nLon2, $nLat1, $nLat2, $login->userid,
|
||||
$showlockedcaches ? 0 : 6,
|
||||
$maxrecords);
|
||||
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
@@ -466,7 +485,6 @@ function output_searchresult($nResultId, $compact, $nLon1, $nLon2, $nLat1, $nLat
|
||||
if ($r['notfound']) $flags |= 4;
|
||||
if ($r['inactive'] || $r['oldevent']) $flags |= 8;
|
||||
if ($r['oconly']) $flags |= 16;
|
||||
|
||||
if ($compact)
|
||||
echo '<c d="' .
|
||||
xmlentities(
|
||||
|
||||
@@ -302,6 +302,7 @@ p.embed-caption {float: left; margin: 5px 0px 0px 0px; padding: 0px; font-style:
|
||||
div.cachedesc {font-size: 120%;}
|
||||
div.cachedesc p {font-size: 100%;}
|
||||
div.welcome p {line-height: 1.6em;}
|
||||
p.inheader {margin:4px; font-size:125%;}
|
||||
|
||||
/* Quote */
|
||||
p.quote {clear: left; margin: 0em 30px 0.6em 30px; line-height: 120%; font-size: 110%;}
|
||||
|
||||
+28
-8
@@ -445,10 +445,13 @@
|
||||
if (!isset($options['showresult'])) $options['showresult']='0';
|
||||
if ($options['showresult'] == 1)
|
||||
{
|
||||
|
||||
//===============================================================
|
||||
// X6. build SQL statement from search options
|
||||
//===============================================================
|
||||
|
||||
$cachesFilter = '';
|
||||
|
||||
if(!isset($options['output'])) $options['output']='';
|
||||
if ((mb_strpos($options['output'], '.') !== false) ||
|
||||
(mb_strpos($options['output'], '/') !== false) ||
|
||||
@@ -551,7 +554,8 @@
|
||||
$lon_rad = $lon * 3.14159 / 180;
|
||||
$lat_rad = $lat * 3.14159 / 180;
|
||||
|
||||
sql_slave('CREATE TEMPORARY TABLE result_caches ENGINE=MEMORY
|
||||
$cachesFilter =
|
||||
'CREATE TEMPORARY TABLE result_caches ENGINE=MEMORY
|
||||
SELECT
|
||||
(' . getSqlDistanceFormula($lon, $lat, $distance, $multiplier[$distance_unit]) . ') `distance`,
|
||||
`caches`.`cache_id` `cache_id`
|
||||
@@ -560,7 +564,8 @@
|
||||
AND `longitude` < ' . ($lon + $max_lon_diff) . '
|
||||
AND `latitude` > ' . ($lat - $max_lat_diff) . '
|
||||
AND `latitude` < ' . ($lat + $max_lat_diff) . '
|
||||
HAVING `distance` < ' . ($distance+0));
|
||||
HAVING `distance` < ' . ($distance+0);
|
||||
sql_slave($cachesFilter);
|
||||
sql_slave('ALTER TABLE result_caches ADD PRIMARY KEY ( `cache_id` )');
|
||||
|
||||
$sql_select[] = '`result_caches`.`cache_id`';
|
||||
@@ -691,7 +696,8 @@
|
||||
//TODO: check!!!
|
||||
$max_lon_diff = $distance * 180 / (abs(sin((90 - $lat) * 3.14159 / 180 )) * 6378 * $multiplier[$distance_unit] * 3.14159);
|
||||
|
||||
sql_slave('CREATE TEMPORARY TABLE result_caches ENGINE=MEMORY
|
||||
$cachesFilter =
|
||||
'CREATE TEMPORARY TABLE result_caches ENGINE=MEMORY
|
||||
SELECT
|
||||
(' . getSqlDistanceFormula($lon, $lat, $distance, $multiplier[$distance_unit]) . ') `distance`,
|
||||
`caches`.`cache_id` `cache_id`
|
||||
@@ -700,7 +706,8 @@
|
||||
AND `longitude` < ' . ($lon + $max_lon_diff) . '
|
||||
AND `latitude` > ' . ($lat - $max_lat_diff) . '
|
||||
AND `latitude` < ' . ($lat + $max_lat_diff) . '
|
||||
HAVING `distance` < ' . ($distance+0));
|
||||
HAVING `distance` < ' . ($distance+0);
|
||||
sql_slave($cachesFilter);
|
||||
sql_slave('ALTER TABLE result_caches ADD PRIMARY KEY ( `cache_id` )');
|
||||
|
||||
$sql_select[] = '`result_caches`.`cache_id`';
|
||||
@@ -805,7 +812,8 @@
|
||||
$lon_rad = $lon * 3.14159 / 180;
|
||||
$lat_rad = $lat * 3.14159 / 180;
|
||||
|
||||
sql_slave('CREATE TEMPORARY TABLE result_caches ENGINE=MEMORY
|
||||
$cachesFilter =
|
||||
'CREATE TEMPORARY TABLE result_caches ENGINE=MEMORY
|
||||
SELECT
|
||||
(' . getSqlDistanceFormula($lon, $lat, $distance, $multiplier[$distance_unit]) . ') `distance`,
|
||||
`caches`.`cache_id` `cache_id`
|
||||
@@ -814,7 +822,8 @@
|
||||
AND `longitude` < ' . ($lon + $max_lon_diff) . '
|
||||
AND `latitude` > ' . ($lat - $max_lat_diff) . '
|
||||
AND `latitude` < ' . ($lat + $max_lat_diff) . '
|
||||
HAVING `distance` < ' . ($distance+0));
|
||||
HAVING `distance` < ' . ($distance+0);
|
||||
sql_slave($cachesFilter);
|
||||
sql_slave('ALTER TABLE result_caches ADD PRIMARY KEY ( `cache_id` )');
|
||||
|
||||
$sql_select[] = '`result_caches`.`cache_id`';
|
||||
@@ -1054,11 +1063,22 @@
|
||||
// $options['sortby']
|
||||
// $options['orderRatingFirst']
|
||||
// $options['queryid']
|
||||
// $sqlFilter
|
||||
// $cachesFilter, $sqlFilter
|
||||
// $map2_bounds
|
||||
//=================================================================
|
||||
|
||||
$map2_bounds = ($options['output'] == 'map2bounds');
|
||||
if ($map2_bounds)
|
||||
$options['output'] = 'map2';
|
||||
|
||||
// Ocprop: HTML, gpx
|
||||
if (!file_exists($opt['rootpath'] . 'lib/search.' . mb_strtolower($options['output']) . '.inc.php'))
|
||||
if ($map2_bounds && $options['queryid'] == 0)
|
||||
{
|
||||
tpl_set_var('tplname', $tplname);
|
||||
$tplname = 'error';
|
||||
tpl_set_var('error_msg', 'map2bounds requires queryid');
|
||||
}
|
||||
elseif (!file_exists($opt['rootpath'] . 'lib/search.' . mb_strtolower($options['output']) . '.inc.php'))
|
||||
{
|
||||
tpl_set_var('tplname', $tplname);
|
||||
$tplname = 'error';
|
||||
|
||||
@@ -76,6 +76,7 @@ var msInitWaypoint = "{/literal}{$sGMInitWaypoint}{literal}";
|
||||
var msInitType = 'roadmap';
|
||||
var msInitSiderbarDisplay = 'none';
|
||||
var msInitAttribSelection = false;
|
||||
var miQueryID = {/literal}{$queryid}{literal};
|
||||
|
||||
/* home coordinates */
|
||||
var mnUserLat = {/literal}{$nUserLat}{literal};
|
||||
@@ -371,6 +372,19 @@ function mapLoad()
|
||||
moMap = new google.maps.Map(document.getElementById("googlemap"), myOptions);
|
||||
moMap.enableKeyDragZoom();
|
||||
|
||||
{/literal}
|
||||
{if $lat_min !== null}
|
||||
var lat_margin = ({$lat_max} - {$lat_min}) / 50;
|
||||
var lon_margin = ({$lon_max} - {$lon_min}) / 50;
|
||||
moMap.fitBounds(
|
||||
new google.maps.LatLngBounds(
|
||||
new google.maps.LatLng({$lat_min}-lat_margin ,{$lon_min}-lon_margin),
|
||||
new google.maps.LatLng({$lat_max}+lat_margin, {$lon_max}+lon_margin)
|
||||
)
|
||||
);
|
||||
{/if}
|
||||
{literal}
|
||||
|
||||
setMapType("OSM", "OpenStreetMap", "http://tile.openstreetmap.org/", 18);
|
||||
setMapType("MQ"," MapQuest", "http://otile1.mqcdn.com/tiles/1.0.0/osm/", 19);
|
||||
setMapType("OCM", "OpenCycleMap", "http://tile.opencyclemap.org/cycle/", 18);
|
||||
@@ -843,7 +857,13 @@ function data_clear_except(wpset)
|
||||
|
||||
function show_cachepopup_wp(sWaypoint, bAllowZoomChange)
|
||||
{
|
||||
show_cachepopup_url(msURLMapPHP + "?mode=wpsearch&wp=" + sWaypoint, sWaypoint, bAllowZoomChange);
|
||||
var $url = msURLMapPHP + "?mode=wpsearch&wp=" + sWaypoint;
|
||||
|
||||
// Locked caches normally are hidden on the map. As they are shown when searching,
|
||||
// we enable them on the map when displaying search results to avoid confusions:
|
||||
if (miQueryID > 0) $url += "&locked=1";
|
||||
|
||||
show_cachepopup_url($url, sWaypoint, bAllowZoomChange);
|
||||
}
|
||||
|
||||
function show_cachepopup_latlon(nLat, nLon, bAllowZoomChange)
|
||||
@@ -1934,6 +1954,9 @@ function get_searchfilter_params(output, skipqueryid, zip)
|
||||
if (zip)
|
||||
sPostBody += '&zip=1';
|
||||
|
||||
if (miQueryID > 0)
|
||||
return sPostBody + "&queryid=" + String(miQueryID);
|
||||
|
||||
if (sCacheName!='')
|
||||
sPostBody += '&searchto=searchbyname&cachename=' + encodeURIComponent(sCacheName);
|
||||
else
|
||||
@@ -2113,7 +2136,7 @@ function toggle_attribselection(bSaveCookies)
|
||||
{* login status *}
|
||||
<td rowspan="2"> </td>
|
||||
<td rowspan="2" class="maplogin">
|
||||
{if $username != ""}{t}Logged in as{/t}<br /><a href="myhome.php"><b>{$username}</b></a> <a href="map2.php?action=logout&mode=fullscreen"><img src="resource2/ocstyle/images/action/15x13-logout.png" style="margin-bottom:2px" alt="{t}Logout{/t}" title="{t}Logout{/t}"></a>{else}<a href="login.php?target=map2.php%3Fmode%3Dfullscreen">{t}Login{/t}...</a>{/if}
|
||||
{if $username != ""}{t}Logged in as{/t}<br /><a href="myhome.php"><b>{$username}</b></a> <a href="map2.php?action=logout&mode=fullscreen{if $queryid>0}&queryid={$queryid}{/if}"><img src="resource2/ocstyle/images/action/15x13-logout.png" style="margin-bottom:2px" alt="{t}Logout{/t}" title="{t}Logout{/t}"></a>{else}<a href="login.php?target=map2.php%3Fmode%3Dfullscreen{if $queryid>0}%26queryid%3D{$queryid}{/if}">{t}Login{/t}...</a>{/if}
|
||||
</td>
|
||||
<td rowspan="2"> </td>
|
||||
{/if}
|
||||
@@ -2146,9 +2169,9 @@ function toggle_attribselection(bSaveCookies)
|
||||
{* normal / full screen button *}
|
||||
<td rowspan="2">
|
||||
{if $bFullscreen}
|
||||
<a class="nooutline" href="map2.php?mode=normalscreen"><img src="resource2/{$opt.template.style}/images/map/35x35-normalscreen.png" align="right" style="margin-left:4px; margin-right:4px" height="35" width="35" alt="{t}Switch to small map{/t}" title="{t}Switch to small map{/t}" /></a>
|
||||
<a class="nooutline" href="map2.php?mode=normalscreen{if $queryid>0}&queryid={$queryid}{/if}"><img src="resource2/{$opt.template.style}/images/map/35x35-normalscreen.png" align="right" style="margin-left:4px; margin-right:4px" height="35" width="35" alt="{t}Switch to small map{/t}" title="{t}Switch to small map{/t}" /></a>
|
||||
{else}
|
||||
<a class="nooutline" href="map2.php?mode=fullscreen"><img src="resource2/{$opt.template.style}/images/map/35x35-fullscreen.png" align="right" style="margin-left:4px; margin-right:4px" height="35" width="35" alt="{t}Switch to full screen{/t}" title="{t}Switch to full screen{/t}" /></a>
|
||||
<a class="nooutline" href="map2.php?mode=fullscreen{if $queryid>0}&queryid={$queryid}{/if}"><img src="resource2/{$opt.template.style}/images/map/35x35-fullscreen.png" align="right" style="margin-left:4px; margin-right:4px" height="35" width="35" alt="{t}Switch to full screen{/t}" title="{t}Switch to full screen{/t}" /></a>
|
||||
{/if}
|
||||
</td>
|
||||
|
||||
@@ -2196,7 +2219,7 @@ function toggle_attribselection(bSaveCookies)
|
||||
<div class="mapversion">GM Version <script type="text/javascript">document.write(google.maps.version);</script></div>
|
||||
|
||||
<div id="mapoptions" class="mapoptions mapboxframe mapboxshadow" style="z-index:999; display:none">
|
||||
<form action="map2.php?mode={if $bFullscreen}full{else}normal{/if}screen" method="post" style="display:inline;">
|
||||
<form action="map2.php?mode={if $bFullscreen}full{else}normal{/if}screen{if $queryid>0}&queryid={$queryid}{/if}" method="post" style="display:inline;">
|
||||
<input type="hidden" name="submit" value="1" />
|
||||
<table>
|
||||
<tr><td><span style="font-size:1.2em; font-weight:bold">{t}Settings{/t}</strong></td><td style="text-align:right"><a href="javascript:toggle_settings()"><img src="resource2/ocstyle/images/navigation/19x19-close.png" style="opacity:0.7" /></a></tr>
|
||||
@@ -2232,7 +2255,14 @@ function toggle_attribselection(bSaveCookies)
|
||||
|
||||
{if $bFullscreen}
|
||||
{* the logo *}
|
||||
<a href="index.php"><img id="oclogo" src="resource2/ocstyle/images/oclogo/oc_logo_alpha3.png" style="position:absolute; left:32px; top:50px; z-index:2; border:0;"></a>
|
||||
<a href="index.php"><img id="oclogo" src="resource2/ocstyle/images/oclogo/oc_logo_alpha3.png" style="position:absolute; left:32px; top:50px; z-index:2; border:0"/></a>
|
||||
|
||||
{* back-to-searchoptions link *}
|
||||
{if $queryid>0}
|
||||
<div class="mapboxframe mapboxshadow" style="position:absolute; top:80px; right:5px; background:#fff; z-index:2">
|
||||
<a class="nooutline" href="search.php?queryid={$queryid}&showresult=0"><img src="resource2/{$opt.template.style}/images/misc/32x32-search.png" style="padding:2px" /></a>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{literal}
|
||||
<script language="javascript">
|
||||
@@ -2264,7 +2294,7 @@ function toggle_attribselection(bSaveCookies)
|
||||
{/literal}
|
||||
|
||||
{* frame for all sidebare contents: *}
|
||||
<div class="mapboxframe mapboxshadow" style="position:absolute; top: 80px; right:0px; margin: 0px; padding: 4px; background:#fff; opacity: .9; z-index:2">
|
||||
<div class="mapboxframe mapboxshadow" style="position:absolute; top: 80px; right:0px; margin: 0px; padding: 4px; background:#fff; opacity: .9; z-index:2; {if $queryid > 0}display:none;{/if}">
|
||||
{* sidebar hidden: '<' icon to open *}
|
||||
<a class="jslink nofocus" onclick="toggle_sidebar(true);" id='sidebar-toggle' style="width: 32px; height: 32px"><img id="sidbar-toggle-img" src="resource2/{$opt.template.style}/images/map/32x32-left.png"></a>
|
||||
{* sidebar visible: filter options table & '>' icon to close *}
|
||||
@@ -2273,17 +2303,18 @@ function toggle_attribselection(bSaveCookies)
|
||||
{* filter options header *}
|
||||
{* outer table es needed to use "width=100%" for inner table (to position the close
|
||||
icon right) without consuming whole screen width in MSIE *}
|
||||
<table cellspacing=0 cellpadding=0><tr><td>
|
||||
<table cellspacing="0" cellpadding="0"><tr><td>
|
||||
<table style="width:100%">
|
||||
<tr>
|
||||
<td style="width:3px"></td>
|
||||
<td id="filterboxtitle" class="content-title-noshade-size1">{t}Only show Geocaches with the following properties:{/t}</td>
|
||||
<td align="right""><a class="jslink" onclick="toggle_sidebar(true);"><img src="resource2/ocstyle/images/map/32x32-right.png"></a></td>
|
||||
<td align="right"><a class="jslink" onclick="toggle_sidebar(true);"><img src="resource2/ocstyle/images/map/32x32-right.png"></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
{else}
|
||||
<div class="buffer" style="width: 500px; height: 2px;"> </div>
|
||||
<div style="width:770px;text-align:right;"><span id="mapstat_caches">{t}Caches displayed{/t} <span id="statCachesCount">0</span></span>, {t}Time to load{/t} <span id="statLoadTime">0</span> {t}Sec.{/t}</div>
|
||||
<div style="{if $queryid > 0}display:none{/if}">
|
||||
<p id="filterboxtitle" class="content-title-noshade-size1">{t}Only show Geocaches with the following properties:{/t}</p>
|
||||
<div class="buffer" style="width: 500px; height: 5px;"> </div>
|
||||
{/if}
|
||||
@@ -2505,6 +2536,8 @@ function toggle_attribselection(bSaveCookies)
|
||||
</td></tr></td></table>
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user