reworked map, especially GM3 and fullscreen map

This commit is contained in:
following
2013-03-04 01:45:51 +01:00
parent 683bc37fa6
commit c5057c884a
155 changed files with 13059 additions and 14081 deletions
+1
View File
@@ -100,6 +100,7 @@
$opt['locale']['DE']['country'] = 'DE';
$opt['locale']['DE']['page']['subtitle1'] = 'Geocaching in Deutschland,';
$opt['locale']['DE']['page']['subtitle2'] = 'Österreich und der Schweiz';
$opt['locale']['DE']['helpwiki'] = "http://wiki.opencaching.de/index.php/";
$opt['locale']['FR']['timezone'] = 'Europe/Berlin';
$opt['locale']['FR']['format']['date'] = '%x';
+2 -1
View File
@@ -108,9 +108,10 @@
$opt['logic']['pictures']['url'] = $opt['page']['absolute_url'] . '/images/uploads';
$opt['logic']['pictures']['thumb_url'] = $opt['logic']['pictures']['url'] . '/thumbs';
/* cachemaps
/* maps
*/
$opt['logic']['cachemaps']['wmsurl'] = 'http://www.opencaching.de/cachemaps.php?wp={wp_oc}';
$opt['map']['disablefullscreen'] = false;
/* E-Mail for notification about news (newstopic.php)
*/
+14 -2
View File
@@ -441,11 +441,23 @@
$opt['map']['maxcachereducedsize'] = 10 * 1048576; // = 10MB
// max number of caches displayed in google maps
$opt['map']['maxrecords'] = 180;
if (isset($_SERVER['HTTP_USER_AGENT']))
{
$user_agent = " " . $_SERVER['HTTP_USER_AGENT'];
if (strpos($user_agent,"MSIE") && !strpos($user_agent,"Opera"))
$opt['map']['maxrecords'] = 200;
else
$opt['map']['maxrecords'] = 2500;
}
else
$opt['map']['maxrecords'] = 250;
// ... selectable by user:
$opt['map']['min_maxrecords'] = 100;
$opt['map']['max_maxrecords'] = 4000;
// the full screen mode requires a GIS server at the moment
// has to be migrated to map2.php
$opt['map']['disablefullscreen'] = true;
// $opt['map']['disablefullscreen'] = true; no longer used
/* external binaries
*/
+2
View File
@@ -20,3 +20,5 @@ date commit ID change
UPDATE cache_rating SET rating_date = (SELECT MIN(`date`) FROM cache_logs WHERE cache_logs.cache_id=cache_rating.cache_id AND cache_logs.user_id=cache_rating.user_id AND cache_logs.type IN (1,7))
added trigger cacheRatingBeforeInsert
2012-08-27 9bc361c3 changed trigger cacheRatingBeforeInsert
2013-03-01 added caches.short2 und .short2_trans_id
2013-03-03 added profile_options.optionset
File diff suppressed because it is too large Load Diff
+6 -4
View File
@@ -5,10 +5,12 @@ CREATE TABLE `cache_type` (
`name` varchar(80) NOT NULL,
`trans_id` int(10) NOT NULL,
`ordinal` tinyint(3) unsigned NOT NULL,
`short` varchar(10) NOT NULL COMMENT 'obsolete',
`de` varchar(60) NOT NULL COMMENT 'obsolete',
`en` varchar(60) NOT NULL COMMENT 'obsolete',
`icon_large` varchar(60) NOT NULL COMMENT 'obsolete',
`short` varchar(10) NOT NULL,
`de` varchar(60) NOT NULL,
`en` varchar(60) NOT NULL,
`icon_large` varchar(60) NOT NULL,
`short2` varchar(15) NOT NULL,
`short2_trans_id` int(10) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='static content' ;
@@ -9,5 +9,6 @@ CREATE TABLE `profile_options` (
`check_regex` varchar(255) default NULL,
`option_order` int(11) NOT NULL default '100',
`option_input` varchar(20) NOT NULL default 'text',
`optionset`, tinyint(2) NOT NULL default '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='static content' ;
+6
View File
@@ -70,6 +70,11 @@
'spring' => 'resource2/ocstyle/css/seasons/style_spring.css',
'summer' => 'resource2/ocstyle/css/seasons/style_summer.css',
'autumn' => 'resource2/ocstyle/css/seasons/style_autumn.css');
$seasons_stripe
= array('winter' => 'resource2/ocstyle/css/seasons/style_langstripe_winter.css',
'spring' => 'resource2/ocstyle/css/seasons/style_langstripe_spring.css',
'summer' => 'resource2/ocstyle/css/seasons/style_langstripe_summer.css',
'autumn' => 'resource2/ocstyle/css/seasons/style_langstripe_autumn.css');
$smarty_dummy = 0;
?>
var nWindowWidth = 9999;
@@ -79,6 +84,7 @@
nWindowWidth = screen.availWidth;
if (nWindowWidth > 970)
document.writeln('<link rel="stylesheet" type="text/css" media="screen,projection" href="<?php echo smarty_function_season($seasons, $smarty_dummy); ?>">');
document.writeln('<link rel="stylesheet" type="text/css" media="screen,projection" href="<?php echo smarty_function_season($seasons_stripe, $smarty_dummy); ?>">');
function usercountry_change()
{
+15
View File
@@ -305,4 +305,19 @@ function fix_magic_quotes_gpc()
}
}
}
// prelminary wiki help embedding; needs translation table
//
// pay attention to use only ' quotes in $text (escape other ')
function helppagelink($pagename)
{
global $opt;
if (isset($opt['locale'][$opt['template']['locale']]['helpwiki']))
return "<a class='nooutline' href='" . $opt['locale'][$opt['template']['locale']]['helpwiki'] .
str_replace(' ','_',$pagename) . "' target='_blank'>";
else
return $text;
}
?>
+11 -4
View File
@@ -43,6 +43,7 @@ class attribute
{
$attr = array();
$bFirst = true;
$bSearchGroupDefault = false;
if ($cacheId == 0)
{
@@ -51,20 +52,22 @@ class attribute
$sAddWhereSql = ' AND `cache_attrib`.`selectable`=1';
$rsAttr = sql("SELECT `cache_attrib`.`id`, IFNULL(`tt1`.`text`, `cache_attrib`.`name`) AS `name`,
IFNULL(`tt2`.`text`, `cache_attrib`.`html_desc`) AS `html_desc`, `cache_attrib`.`icon`
IFNULL(`tt2`.`text`, `cache_attrib`.`html_desc`) AS `html_desc`,
`cache_attrib`.`icon`, `cache_attrib`.`search_default`
FROM `cache_attrib`
LEFT JOIN `sys_trans` AS `t1` ON `cache_attrib`.`trans_id`=`t1`.`id` AND `cache_attrib`.`name`=`t1`.`text`
LEFT JOIN `sys_trans_text` AS `tt1` ON `t1`.`id`=`tt1`.`trans_id` AND `tt1`.`lang`='&1'
LEFT JOIN `sys_trans` AS `t2` ON `cache_attrib`.`html_desc_trans_id`=`t2`.`id`
LEFT JOIN `sys_trans_text` AS `tt2` ON `t2`.`id`=`tt2`.`trans_id` AND `tt2`.`lang`='&1'
WHERE `cache_attrib`.`group_id`='&2'
WHERE `cache_attrib`.`group_id`='&2'" . $sAddWhereSql . "
AND NOT IFNULL(`cache_attrib`.`hidden`, 0)=1
ORDER BY `cache_attrib`.`group_id` ASC", $opt['template']['locale'], $rAttrGroup['id']);
}
else
{
$rsAttr = sql("SELECT `cache_attrib`.`id`, IFNULL(`tt1`.`text`, `cache_attrib`.`name`) AS `name`,
IFNULL(`tt2`.`text`, `cache_attrib`.`html_desc`) AS `html_desc`, `cache_attrib`.`icon`
IFNULL(`tt2`.`text`, `cache_attrib`.`html_desc`) AS `html_desc`,
`cache_attrib`.`icon`, `cache_attrib`.`search_default`
FROM `caches_attributes`
INNER JOIN `cache_attrib` ON `caches_attributes`.`attrib_id`=`cache_attrib`.`id`
LEFT JOIN `sys_trans` AS `t1` ON `cache_attrib`.`trans_id`=`t1`.`id` AND `cache_attrib`.`name`=`t1`.`text`
@@ -80,13 +83,17 @@ class attribute
if ($firstLetterUppercase)
$rAttr['name'] = mb_strtoupper(mb_substr($rAttr['name'],0,1)) . mb_substr($rAttr['name'],1);
$attr[] = $rAttr;
if ($rAttr['search_default'])
$bSearchGroupDefault = true;
}
sql_free_result($rsAttr);
if (count($attr) > 0)
$attributes[] = array('name' => $rAttrGroup['name'],
$attributes[] = array('id' => $rAttrGroup['id'],
'name' => $rAttrGroup['name'],
'color' => $rAttrGroup['color'],
'category' => $rAttrGroup['category'],
'search_default' => $bSearchGroupDefault,
'attr' => $attr);
}
sql_free_result($rsAttrGroup);
+9 -4
View File
@@ -17,13 +17,13 @@ class useroptions
var $nUserId = 0;
var $nOptions;
function __construct($nUserId=ID_NEW)
function __construct($nUserId=ID_NEW, $optionset=1)
{
$this->nUserId = $nUserId+0;
if ($nUserId == ID_NEW)
{
$rs = sqll('SELECT `id`, `name`, `default_value`, `check_regex`, `option_order`, 0 AS `option_visible`, `internal_use`, `default_value` AS `option_value`
$rs = sqll('SELECT `id`, `name`, `default_value`, `check_regex`, `option_order`, 0 AS `option_visible`, `internal_use`, `default_value` AS `option_value`, `optionset`
FROM `profile_options`');
}
else
@@ -31,12 +31,13 @@ class useroptions
$rs = sqll("SELECT `p`.`id`, `p`.`name`, `p`.`default_value`, `p`.`check_regex`, `p`.`option_order`, IFNULL(`u`.`option_visible`, 0) AS `option_visible`, `p`.`internal_use`, IFNULL(`u`.`option_value`, `p`.`default_value`) AS `option_value`
FROM `profile_options` AS `p`
LEFT JOIN `user_options` AS `u` ON `p`.`id`=`u`.`option_id` AND (`u`.`user_id` IS NULL OR `u`.`user_id`='&1')
WHERE `optionset`='&2'
UNION
SELECT `u`.`option_id` AS `id`, `p`.`name`, `p`.`default_value`, `p`.`check_regex`, `p`.`option_order`, `u`.`option_visible`, `p`.`internal_use`, IFNULL(`u`.`option_value`, `p`.`default_value`) AS `option_value`
FROM `user_options` AS `u`
LEFT JOIN `profile_options` AS `p` ON `p`.`id`=`u`.`option_id`
WHERE `u`.`user_id`='&1'",
$this->nUserId);
$this->nUserId, $optionset);
}
while($record = sql_fetch_array($rs))
@@ -51,6 +52,10 @@ class useroptions
{
return $this->nUserId;
}
function getOptSet()
{
return $this->nOptions[$pId]['optionset'];
}
function getOptName($pId)
{
return $this->nOptions[$pId]['name'];
@@ -128,7 +133,7 @@ class useroptions
function tidy_html_description($text)
{
$options = array("input-encoding" => "utf8", "output-encoding" => "utf8", "output-xhtml" => true, "doctype" => "omit", "show-body-only" => true, "char-encoding" => "utf8", "quote-ampersand" => true, "quote-nbsp" => true, "wrap" => 0);
$options = array("input-encoding" => "utf8", "output-encoding" => "utf8", "output-xhtml" => true, "doctype" => "omit", "show-body-only" => true, "char-encoding" => "utf8", "quote-ampersand" => true, "quote-nbsp" => true, "wrap" => 0);
$config = HTMLPurifier_Config::createDefault();
$cssDefinition = $config->getCSSDefinition();
+152 -28
View File
@@ -14,6 +14,22 @@
* ignored caches, we need to verify the login data
*/
$login->verify();
if ($login->userid > 0)
{
$user_maxrecords = $maxrecords =
sql_value("SELECT option_value FROM user_options WHERE user_id='&1' AND option_id=8",
$opt['map']['maxrecords'] + 0, $login->userid);
if ($maxrecords == 0)
$maxrecords = $opt['map']['maxrecords'] + 0;
else
$maxrecords = min(max($maxrecords, $opt['map']['min_maxrecords']), $opt['map']['max_maxrecords']);
}
else
{
$maxrecords = $opt['map']['maxrecords'] + 0;
$user_maxrecords = 0;
}
$sMode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
if ($sMode == 'locate')
@@ -41,23 +57,66 @@
else if ($sMode == 'searchresult')
{
$nResultId = isset($_REQUEST['resultid']) ? $_REQUEST['resultid']+0 : 0;
$compact = isset($_REQUEST['compact']) && $_REQUEST['compact'];
$nLon1 = isset($_REQUEST['lon1']) ? $_REQUEST['lon1']+0 : 0;
$nLon2 = isset($_REQUEST['lon2']) ? $_REQUEST['lon2']+0 : 0;
$nLat1 = isset($_REQUEST['lat1']) ? $_REQUEST['lat1']+0 : 0;
$nLat2 = isset($_REQUEST['lat2']) ? $_REQUEST['lat2']+0 : 0;
$cachenames = isset($_REQUEST['cachenames']) ? $_REQUEST['cachenames']+0 : 0;
if (isset($_REQUEST['smallmap']) && $_REQUEST['smallmap'] &&
$user_maxrecords == 0 && $maxrecords > 1000)
$maxrecords = floor($maxrecords*0.65);
output_searchresult($nResultId, $nLon1, $nLat1, $nLon2, $nLat2);
output_searchresult($nResultId, $compact, $nLon1, $nLon2, $nLat1, $nLat2, $cachenames);
}
else if ($sMode == 'fullscreen')
else if ($sMode == 'fullscreen' ||
($sMode == '' &&
sql_value("SELECT option_value FROM user_options
INNER JOIN user ON user_options.user_id=user.user_id
WHERE option_id=6 AND user.user_id='&1'", true, $login->userid)))
{
$tpl->popup = true;
$fullscreen = true;
$tpl->popup = true; // disables page header and -framefrapage
$tpl->popupmargin = false;
}
else
{
$fullscreen = false;
}
// save options
if (isset($_REQUEST['submit']) && $_REQUEST['submit'] && $login->userid > 0)
{
sql("INSERT INTO `user_options` (`user_id`, `option_id`, `option_visible`, `option_value`)
VALUES ('&1', '&2', '&3', '&4')
ON DUPLICATE KEY UPDATE `option_value`='&4'",
$login->userid, 6, 0, min(max($_REQUEST['opt_menumap']+0, 0), 1) );
sql("INSERT INTO `user_options` (`user_id`, `option_id`, `option_visible`, `option_value`)
VALUES ('&1', '&2', '&3', '&4')
ON DUPLICATE KEY UPDATE `option_value`='&4'",
$login->userid, 7, 0, isset($_REQUEST['opt_overview']) ? min(max($_REQUEST['opt_overview']+0, 0), 1) : 0);
sql("INSERT INTO `user_options` (`user_id`, `option_id`, `option_visible`, `option_value`)
VALUES ('&1', '&2', '&3', '&4')
ON DUPLICATE KEY UPDATE `option_value`='&4'",
$login->userid, 8, 0, $_REQUEST['opt_maxcaches'] == 0 ? 0 : min(max($_REQUEST['opt_maxcaches']+0, $opt['map']['min_maxrecords']), $opt['map']['max_maxrecords']) );
sql("INSERT INTO `user_options` (`user_id`, `option_id`, `option_visible`, `option_value`)
VALUES ('&1', '&2', '&3', '&4')
ON DUPLICATE KEY UPDATE `option_value`='&4'",
$login->userid, 9, 0, min(max($_REQUEST['opt_cacheicons']+0, 1), 2) );
}
$tpl->name = 'map2';
$tpl->menuitem = MNU_MAP;
$tpl->nowpsearch = true;
// check for browser compatibility
if (preg_match('/MSIE [1-9]+.[0-9]+/',$_SERVER['HTTP_USER_AGENT']))
$tpl->assign('msie',true);
if (preg_match('/MSIE [1-6].[0-9]+/',$_SERVER['HTTP_USER_AGENT']))
$tpl->assign('old_msie',true);
$tpl->assign('maxrecords',$maxrecords);
// get the correct mapkey
$sHost = strtolower($_SERVER['HTTP_HOST']);
if (isset($opt['lib']['google']['mapkey'][$sHost]))
@@ -65,11 +124,11 @@
else
$tpl->error($translate->t('There is no google maps key registered for this domain.', '', '', 0));
//$tpl->add_header_javascript('https://maps.googleapis.com/maps/api/js?key=' . urlencode($sGMKey) . '&amp;sensor=false');
$tpl->add_header_javascript('https://maps.googleapis.com/maps/api/js?sensor=false&key=' . urlencode($sGMKey));
$tpl->add_header_javascript('resource2/misc/map/CacheMarker.js');
$tpl->add_header_javascript('http://maps.googleapis.com/maps/api/js?sensor=false&key=' . urlencode($sGMKey));
// https is supported by google, but may make problems in some environments,
// e.g. does not work with MSIE 7 on WinXP
$tpl->add_body_load('mapLoad()');
$tpl->add_body_unload('GUnload()');
$tpl->add_body_unload('mapUnload()');
// process start params
$bGMInitCookiePos = true;
@@ -116,7 +175,7 @@
{
$nGMInitLon = $cache->getLongitude();
$nGMInitLat = $cache->getLatitude();
$nGMInitZoom = 13;
$nGMInitZoom = -1;
$bGMInitCookiePos = false;
}
else
@@ -126,12 +185,15 @@
$nUserLon = 0;
$nUserLat = 0;
if( $login->userid != 0 )
if ($login->userid != 0 )
{
$user = new user($login->userid);
$nUserLat = $user->getLatitude();
$nUserLon = $user->getLongitude();
$tpl->assign('username',$user->getUsername());
}
else
$tpl->assign('username',"");
$tpl->assign('nUserLon', $nUserLon);
$tpl->assign('nUserLat', $nUserLat);
@@ -140,26 +202,52 @@
$tpl->assign('nGMInitZoom', $nGMInitZoom);
$tpl->assign('bGMInitCookiePos', ($bGMInitCookiePos ? 1 : 0));
$tpl->assign('sGMInitWaypoint', $sGMInitWaypoint);
$tpl->assign('bFullscreen', ($sMode == 'fullscreen' ? 1 : 0));
$tpl->assign('bDisableFullscreen', $opt['map']['disablefullscreen']);
$tpl->assign('bFullscreen', $fullscreen ? 1 : 0);
$rsCacheType = sql("SELECT `cache_type`.`id`, IFNULL(`sys_trans_text`.`text`, `cache_type`.`name`) AS `text` FROM `cache_type` LEFT JOIN `sys_trans` ON `cache_type`.`trans_id`=`sys_trans`.`id` LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&1' ORDER BY `cache_type`.`ordinal` ASC", $opt['template']['locale']);
$rsCacheType = sql("SELECT `cache_type`.`id`, IFNULL(`sys_trans_text`.`text`, `cache_type`.`short2`) AS `text` FROM `cache_type` LEFT JOIN `sys_trans_text` ON `cache_type`.`short2_trans_id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&1' ORDER BY `cache_type`.`ordinal` ASC", $opt['template']['locale']);
$tpl->assign_rs('aCacheType', $rsCacheType);
sql_free_result($rsCacheType);
$rsCacheSize = sql("SELECT `cache_size`.`id`, IFNULL(`sys_trans_text`.`text`, `cache_size`.`name`) AS `text` FROM `cache_size` LEFT JOIN `sys_trans` ON `cache_size`.`trans_id`=`sys_trans`.`id` LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&1' ORDER BY `cache_size`.`ordinal` ASC", $opt['template']['locale']);
$rsCacheSize = sql("SELECT `cache_size`.`id`, IFNULL(`sys_trans_text`.`text`, `cache_size`.`name`) AS `text` FROM `cache_size` LEFT JOIN `sys_trans_text` ON `cache_size`.`trans_id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&1' ORDER BY `cache_size`.`ordinal` ASC", $opt['template']['locale']);
$tpl->assign_rs('aCacheSize', $rsCacheSize);
sql_free_result($rsCacheSize);
/* assign attributes */
$tpl->assign('aAttributes', attribute::getAttrbutesListArray());
$tpl->assign('aAttributes', attribute::getSelectableAttrbutesListArray());
$aAttributesDisabled = array();
$maxaid = 0;
$rs = sql("SELECT `id` FROM `cache_attrib`");
while ($r = sql_fetch_assoc($rs))
{
$aAttributesDisabled[] = $r['id'];
if ($r['id'] > $maxaid) $maxaid = $r['id'];
}
sql_free_result($rs);
$tpl->assign('aAttributesDisabled', $aAttributesDisabled);
$tpl->assign('maxAttributeId', $maxaid);
// options
$rs = sql("SELECT `profile_options`.`id`,
IF(`option_value` IS NULL, `default_value`, `option_value`) AS `value`
FROM `profile_options`
LEFT JOIN `user_options` ON `profile_options`.`id`=`user_options`.`option_id` AND `user_id`='&1'
WHERE `optionset`=2",
$login->userid);
while ($r = sql_fetch_assoc($rs))
switch ($r['id'])
{
case 6: $tpl->assign('opt_menumap', $r['value']); break;
case 7: $tpl->assign('opt_overview', $r['value']); break;
case 8: $tpl->assign('opt_maxcaches', $r['value']); break;
case 9: $tpl->assign('opt_cacheicons', $r['value']); break;
}
sql_free_result($rs);
$tpl->assign('min_maxrecords', $opt['map']['min_maxrecords']);
$tpl->assign('max_maxrecords', $opt['map']['max_maxrecords']);
$tpl->assign('help_oconly', helppagelink("OConly"));
$tpl->assign('help_map', helppagelink("Cachekarte"));
$tpl->display();
@@ -200,15 +288,16 @@ function output_cachexml($sWaypoint)
$rsCache = sql_slave("SELECT `caches`.`name`, `caches`.`wp_oc`, `caches`.`cache_id`, `caches`.`type`,
`caches`.`longitude`, `caches`.`latitude`,
IF(`caches`.`status`=2, 1, 0) AS `tna`,
IF(`caches`.`status` IN (2,3,6), 1, 0) AS `tna`,
IFNULL(`trans_status_text`.`text`, `cache_status`.`name`) AS `statustext`,
IFNULL(`trans_type_text`.`text`, `cache_type`.`name`) AS `type_text`, `cache_type`.`id` AS `type_id`,
IFNULL(`trans_size_text`.`text`, `cache_size`.`name`) AS `size`,
`caches`.`difficulty`, `caches`.`terrain`,
`caches`.`date_created`,
`caches`.`date_created`, `caches`.`is_publishdate`,
IFNULL(`stat_caches`.`toprating`, 0) AS `toprating`,
IF(`caches`.`user_id`='&1', 1, 0) AS `owner`,
`user`.`username`, `user`.`user_id`
`user`.`username`, `user`.`user_id`,
IF(`caches_attributes`.`attrib_id` IS NULL, 0, 1) AS `oconly`
FROM `caches`
INNER JOIN `cache_type` ON `caches`.`type`=`cache_type`.`id`
INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`
@@ -221,6 +310,7 @@ function output_cachexml($sWaypoint)
LEFT JOIN `sys_trans_text` AS `trans_type_text` ON `trans_type`.`id`=`trans_type_text`.`trans_id` AND `trans_type_text`.`lang`='&2'
LEFT JOIN `sys_trans` AS `trans_size` ON `cache_size`.`trans_id`=`trans_size`.`id` AND `cache_size`.`name`=`trans_size`.`text`
LEFT JOIN `sys_trans_text` AS `trans_size_text` ON `trans_size`.`id`=`trans_size_text`.`trans_id` AND `trans_size_text`.`lang`='&2'
LEFT JOIN `caches_attributes` ON `caches_attributes`.`cache_id`=`caches`.`cache_id` AND `caches_attributes`.`attrib_id`=6
WHERE (`caches`.`wp_oc`='&3' OR (`caches`.`wp_oc`!='&3' AND `caches`.`wp_gc`='&3') OR (`caches`.`wp_oc`!='&3' AND `caches`.`wp_nc`='&3')) AND
(`cache_status`.`allow_user_view`=1 OR `caches`.`user_id`='&1')",
$login->userid, $opt['template']['locale'], $sWaypoint);
@@ -254,11 +344,13 @@ function output_cachexml($sWaypoint)
echo 'difficulty="' . xmlentities($rCache['difficulty']/2) . '" ';
echo 'terrain="' . xmlentities($rCache['terrain']/2) . '" ';
echo 'listed_since="' . xmlentities(strftime($opt['locale'][$opt['template']['locale']]['format']['date'], strtotime($rCache['date_created']))) . '" ';
echo 'is_publishdate="' . xmlentities($rCache['is_publishdate']) . '" ';
echo 'toprating="' . xmlentities($rCache['toprating']) . '" ';
echo 'geokreties="' . xmlentities($nGeokretyCount) . '" ';
echo 'found="' . xmlentities(($nFoundCount>0) ? 1 : 0) . '" ';
echo 'notfound="' . xmlentities(($nNotFoundCount>0) ? 1 : 0) . '" ';
echo 'attended="' . xmlentities(($nAttendedCount>0) ? 1 : 0) . '" ';
echo 'oconly="' . xmlentities($rCache['oconly']) . '" ';
echo 'owner="' . xmlentities($rCache['owner']) . '" ';
echo 'username="' . xmlentities($rCache['username']) . '" ';
echo 'userid="' . xmlentities($rCache['user_id']) . '" />' . "\n";
@@ -295,9 +387,9 @@ function output_namesearch($sName, $nLat, $nLon, $nResultId)
exit;
}
function output_searchresult($nResultId, $nLon1, $nLat1, $nLon2, $nLat2)
function output_searchresult($nResultId, $compact, $nLon1, $nLon2, $nLat1, $nLat2, $cachenames)
{
global $login, $opt;
global $login, $opt, $maxrecords;
// 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']);
@@ -316,23 +408,55 @@ function output_searchresult($nResultId, $nLon1, $nLat1, $nLon2, $nLat2)
// TODO: SQL_CALC_FOUND_ROWS + $nRecordCount = sql_value_slave("SELECT FOUND_ROWS()", 0);
$bMaxRecordReached = false;
if ($nRecordCount > $opt['map']['maxrecords'])
if ($nRecordCount > $maxrecords)
$bMaxRecordReached = true;
$namequery = ($cachenames ? ", `caches`.`name` AS `cachename`" : "");
echo '<searchresult count="' . $nRecordCount . '" available="1" maxrecordreached="' . ($bMaxRecordReached ? '1' : '0') . '">' . "\n";
if ($bMaxRecordReached == false)
{
$foundQuery = "(SELECT COUNT(*) FROM `cache_logs` WHERE `cache_logs`.`cache_id`=`caches`.`cache_id` AND `user_id`='" . $login->userid . "' AND `cache_logs`.`type` IN (1,7))";
$ownedQuery = "IF(`caches`.`user_id`='" . $login->userid . "', 1, 0 )";
$rs = sql_slave("SELECT SQL_BUFFER_RESULT `caches`.`wp_oc`, `caches`.`longitude`, `caches`.`latitude`, `caches`.`type`, " . $ownedQuery . " AS `owned`, " . $foundQuery . " AS `found` 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`" .
$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`
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'
ORDER BY `caches`.`status` DESC, `oconly` AND NOT `found`, NOT `found`, `caches`.`type`<>4, MD5(`caches`.`name`)
LIMIT &7",
// 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);
while ($r = sql_fetch_assoc($rs))
{
$oc_wp = xmlentities($r['wp_oc']);
$owned = xmlentities($r['owned']);
$found = (xmlentities($r['found']) > 0 ? 1 : 0);
echo '<cache wp="' . $oc_wp . '" lon="' . xmlentities($r['longitude']) . '" lat="' . xmlentities($r['latitude']) . '" type="' . xmlentities($r['type']) . '" owned="' . $owned . '" found="' . $found . '" />' . "\n";
$flags = 0;
if ($r['owned']) $flags |= 1;
if ($r['found']) $flags |= 2;
if ($r['inactive']) $flags |= 4;
if ($r['oconly']) $flags |= 8;
if ($compact)
echo '<c d="' . xmlentities($r['wp_oc']) . '/' .
xmlentities(round($r['longitude'],5)) . '/' .
xmlentities(round($r['latitude'],5)) . '/' .
xmlentities($r['type']) . '/' . xmlentities($flags) . '"' .
(isset($r['cachename']) ? ' n="' . xmlentities($r['cachename']) . '"' : '') .
' />';
else
echo '<cache wp="' . xmlentities($r['wp_oc']) . '"' .
' lon="' . xmlentities(round($r['longitude'],5)) . '"' .
' lat="' . xmlentities(round($r['latitude'],5)) . '"' .
' type="' . xmlentities($r['type']) . '"' .
(isset($r['cachename']) ? ' n="' . xmlentities($r['cachename']) . '"' : '') .
' f="' . xmlentities($flags) . '" />' . "\n";
}
sql_free_result($rs);
}
-343
View File
@@ -1,343 +0,0 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************/
require('./lib2/web.inc.php');
require_once('./lib2/logic/cache.class.php');
require_once('./lib2/logic/user.class.php');
require_once('./lib2/logic/attribute.class.php');
/* because the map does access some private info like
* ignored caches, we need to verify the login data
*/
$login->verify();
$sMode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
if ($sMode == 'locate')
{
$nLat = isset($_REQUEST['lat']) ? $_REQUEST['lat']+0 : 0;
$nLon = isset($_REQUEST['lon']) ? $_REQUEST['lon']+0 : 0;
$nDistance = isset($_REQUEST['distance']) ? $_REQUEST['distance']+0 : 5;
if ($nDistance > 150) $nDistance = 150;
cache_locate($nLat, $nLon, $nDistance);
}
else if ($sMode == 'wpsearch')
{
$sWaypoint = isset($_REQUEST['wp']) ? $_REQUEST['wp'] : '';
output_cachexml($sWaypoint);
}
else if ($sMode == 'namesearch')
{
$sName = isset($_REQUEST['name']) ? $_REQUEST['name'] : '';
$nLat = isset($_REQUEST['lat']) ? $_REQUEST['lat']+0 : 0;
$nLon = isset($_REQUEST['lon']) ? $_REQUEST['lon']+0 : 0;
$nResultId = isset($_REQUEST['resultid']) ? $_REQUEST['resultid']+0 : 0;
output_namesearch($sName, $nLat, $nLon, $nResultId);
}
else if ($sMode == 'searchresult')
{
$nResultId = isset($_REQUEST['resultid']) ? $_REQUEST['resultid']+0 : 0;
$nLon1 = isset($_REQUEST['lon1']) ? $_REQUEST['lon1']+0 : 0;
$nLon2 = isset($_REQUEST['lon2']) ? $_REQUEST['lon2']+0 : 0;
$nLat1 = isset($_REQUEST['lat1']) ? $_REQUEST['lat1']+0 : 0;
$nLat2 = isset($_REQUEST['lat2']) ? $_REQUEST['lat2']+0 : 0;
output_searchresult($nResultId, $nLon1, $nLat1, $nLon2, $nLat2);
}
else if ($sMode == 'fullscreen')
{
$tpl->popup = true;
$tpl->popupmargin = false;
}
$tpl->name = 'map2full';
$tpl->menuitem = MNU_MAP;
$tpl->nowpsearch = true;
// get the correct mapkey
$sHost = strtolower($_SERVER['HTTP_HOST']);
if (isset($opt['lib']['google']['mapkey'][$sHost]))
$sGMKey = $opt['lib']['google']['mapkey'][$sHost];
else
$tpl->error($translate->t('There is no google maps key registered for this domain.', '', '', 0));
//$tpl->add_header_javascript('https://maps.googleapis.com/maps/api/js?key=' . urlencode($sGMKey) . '&amp;sensor=false');
$tpl->add_header_javascript('https://maps.googleapis.com/maps/api/js?sensor=false&key=' . urlencode($sGMKey));
$tpl->add_header_javascript('resource2/misc/map/CacheMarker.js');
$tpl->add_body_load('mapLoad()');
$tpl->add_body_unload('GUnload()');
// process start params
$bGMInitCookiePos = true;
if (isset($_REQUEST['lat']) &&
isset($_REQUEST['lon']) &&
isset($_REQUEST['zoom']))
{
$nGMInitLat = $_REQUEST['lat']+0;
$nGMInitLon = $_REQUEST['lon']+0;
$nGMInitZoom = $_REQUEST['zoom']+0;
$bGMInitCookiePos = false;
}
else
{
// init GM from user country selection
$rsCoords = sql("SELECT `gmLat`, `gmLon`, `gmZoom` FROM `countries_options` WHERE `country`='&1'", $login->getUserCountry());
$rCoord = sql_fetch_assoc($rsCoords);
sql_free_result($rsCoords);
if ($rCoord !== false)
{
$nGMInitLat = $rCoord['gmLat'];
$nGMInitLon = $rCoord['gmLon'];
$nGMInitZoom = $rCoord['gmZoom'];
}
else
{
// europe is the last fallback
$nGMInitLat = 52.74959372674114;
$nGMInitLon = 10.01953125;
$nGMInitZoom = 4;
}
}
$sGMInitWaypoint = isset($_REQUEST['wp']) ? $_REQUEST['wp'] : '';
if ($sGMInitWaypoint != '')
{
$cache = cache::fromWP($sGMInitWaypoint);
if ($cache == null)
$sGMInitWaypoint = '';
else
{
if ($cache->allowView())
{
$nGMInitLon = $cache->getLongitude();
$nGMInitLat = $cache->getLatitude();
$nGMInitZoom = 13;
$bGMInitCookiePos = false;
}
else
$sGMInitWaypoint = '';
}
}
$nUserLon = 0;
$nUserLat = 0;
if( $login->userid != 0 )
{
$user = new user($login->userid);
$nUserLat = $user->getLatitude();
$nUserLon = $user->getLongitude();
}
$tpl->assign('nUserLon', $nUserLon);
$tpl->assign('nUserLat', $nUserLat);
$tpl->assign('nGMInitLon', $nGMInitLon);
$tpl->assign('nGMInitLat', $nGMInitLat);
$tpl->assign('nGMInitZoom', $nGMInitZoom);
$tpl->assign('bGMInitCookiePos', ($bGMInitCookiePos ? 1 : 0));
$tpl->assign('sGMInitWaypoint', $sGMInitWaypoint);
$tpl->assign('bFullscreen', ($sMode == 'fullscreen' ? 1 : 0));
$tpl->assign('bDisableFullscreen', $opt['map']['disablefullscreen']);
$rsCacheType = sql("SELECT `cache_type`.`id`, IFNULL(`sys_trans_text`.`text`, `cache_type`.`name`) AS `text` FROM `cache_type` LEFT JOIN `sys_trans` ON `cache_type`.`trans_id`=`sys_trans`.`id` LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&1' ORDER BY `cache_type`.`ordinal` ASC", $opt['template']['locale']);
$tpl->assign_rs('aCacheType', $rsCacheType);
sql_free_result($rsCacheType);
$rsCacheSize = sql("SELECT `cache_size`.`id`, IFNULL(`sys_trans_text`.`text`, `cache_size`.`name`) AS `text` FROM `cache_size` LEFT JOIN `sys_trans` ON `cache_size`.`trans_id`=`sys_trans`.`id` LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&1' ORDER BY `cache_size`.`ordinal` ASC", $opt['template']['locale']);
$tpl->assign_rs('aCacheSize', $rsCacheSize);
sql_free_result($rsCacheSize);
/* assign attributes */
$tpl->assign('aAttributes', attribute::getAttrbutesListArray());
$aAttributesDisabled = array();
$rs = sql("SELECT `id` FROM `cache_attrib`");
while ($r = sql_fetch_assoc($rs))
$aAttributesDisabled[] = $r['id'];
sql_free_result($rs);
$tpl->assign('aAttributesDisabled', $aAttributesDisabled);
$tpl->display();
function cache_locate($nLat, $nLon, $nDistance)
{
global $login;
$rsCache = sql_slave("SELECT " . geomath::getSqlDistanceFormula($nLon, $nLat, $nDistance) . " AS `distance`,
`caches`.`wp_oc`
FROM `caches`
INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`
WHERE `caches`.`latitude`>'&1' AND
`caches`.`latitude`<'&2' AND
`caches`.`longitude`>'&3' AND
`caches`.`longitude`<'&4' AND
(`cache_status`.`allow_user_view`=1 OR `caches`.`user_id`='&1')
ORDER BY `distance` ASC LIMIT 1",
geomath::getMinLat($nLon, $nLat, $nDistance),
geomath::getMaxLat($nLon, $nLat, $nDistance),
geomath::getMinLon($nLon, $nLat, $nDistance),
geomath::getMaxLon($nLon, $nLat, $nDistance),
$login->userid);
$rCache = sql_fetch_assoc($rsCache);
sql_free_result($rsCache);
if ($rCache === false)
{
echo '<caches></caches>';
exit;
}
output_cachexml($rCache['wp_oc']);
}
function output_cachexml($sWaypoint)
{
global $opt, $login;
$rsCache = sql_slave("SELECT `caches`.`name`, `caches`.`wp_oc`, `caches`.`cache_id`, `caches`.`type`,
`caches`.`longitude`, `caches`.`latitude`,
IF(`caches`.`status`=2, 1, 0) AS `tna`,
IFNULL(`trans_status_text`.`text`, `cache_status`.`name`) AS `statustext`,
IFNULL(`trans_type_text`.`text`, `cache_type`.`name`) AS `type_text`, `cache_type`.`id` AS `type_id`,
IFNULL(`trans_size_text`.`text`, `cache_size`.`name`) AS `size`,
`caches`.`difficulty`, `caches`.`terrain`,
`caches`.`date_created`,
IFNULL(`stat_caches`.`toprating`, 0) AS `toprating`,
IF(`caches`.`user_id`='&1', 1, 0) AS `owner`,
`user`.`username`, `user`.`user_id`
FROM `caches`
INNER JOIN `cache_type` ON `caches`.`type`=`cache_type`.`id`
INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`
INNER JOIN `user` ON `caches`.`user_id`=`user`.`user_id`
INNER JOIN `cache_size` ON `caches`.`size`=`cache_size`.`id`
LEFT JOIN `stat_caches` ON `caches`.`cache_id`=`stat_caches`.`cache_id`
LEFT JOIN `sys_trans` AS `trans_status` ON `cache_status`.`trans_id`=`trans_status`.`id` AND `cache_status`.`name`=`trans_status`.`text`
LEFT JOIN `sys_trans_text` AS `trans_status_text` ON `trans_status`.`id`=`trans_status_text`.`trans_id` AND `trans_status_text`.`lang`='&2'
LEFT JOIN `sys_trans` AS `trans_type` ON `cache_type`.`trans_id`=`trans_type`.`id` AND `cache_type`.`name`=`trans_type`.`text`
LEFT JOIN `sys_trans_text` AS `trans_type_text` ON `trans_type`.`id`=`trans_type_text`.`trans_id` AND `trans_type_text`.`lang`='&2'
LEFT JOIN `sys_trans` AS `trans_size` ON `cache_size`.`trans_id`=`trans_size`.`id` AND `cache_size`.`name`=`trans_size`.`text`
LEFT JOIN `sys_trans_text` AS `trans_size_text` ON `trans_size`.`id`=`trans_size_text`.`trans_id` AND `trans_size_text`.`lang`='&2'
WHERE (`caches`.`wp_oc`='&3' OR (`caches`.`wp_oc`!='&3' AND `caches`.`wp_gc`='&3') OR (`caches`.`wp_oc`!='&3' AND `caches`.`wp_nc`='&3')) AND
(`cache_status`.`allow_user_view`=1 OR `caches`.`user_id`='&1')",
$login->userid, $opt['template']['locale'], $sWaypoint);
$rCache = sql_fetch_assoc($rsCache);
sql_free_result($rsCache);
if ($rCache === false)
{
echo '<caches></caches>';
exit;
}
$nGeokretyCount = sql_value_slave("SELECT COUNT(*) FROM `gk_item_waypoint` WHERE `wp`='&1'", 0, $sWaypoint);
$nNotFoundCount = $nAttendedCount = 0;
$nFoundCount = sql_value_slave("SELECT COUNT(*) FROM `cache_logs` WHERE `user_id`='&1' AND `cache_id`='&2' AND `type`=1", 0, $login->userid, $rCache['cache_id']);
if ($nFoundCount == 0)
$nNotFoundCount = sql_value_slave("SELECT COUNT(*) FROM `cache_logs` WHERE `user_id`='&1' AND `cache_id`='&2' AND `type`=2", 0, $login->userid, $rCache['cache_id']);
if ($rCache['type'] == 6)
$nAttendedCount = sql_value_slave("SELECT COUNT(*) FROM `cache_logs` WHERE `user_id`='&1' AND `cache_id`='&2' AND `type`=7", 0, $login->userid, $rCache['cache_id']);
echo '<caches>' . "\n";
echo ' <cache ';
echo 'name="' . xmlentities($rCache['name']) . '" ';
echo 'wpoc="' . xmlentities($rCache['wp_oc']) . '" ';
echo 'coords="' . $rCache['longitude'] . ',' . $rCache['latitude'] . '" ';
echo 'status_tna="' . xmlentities($rCache['tna']) . '" ';
echo 'status_text="' . xmlentities($rCache['statustext']) . '" ';
echo 'type_id="' . xmlentities($rCache['type_id']) . '" ';
echo 'type_text="' . xmlentities($rCache['type_text']) . '" ';
echo 'size="' . xmlentities($rCache['size']) . '" ';
echo 'difficulty="' . xmlentities($rCache['difficulty']/2) . '" ';
echo 'terrain="' . xmlentities($rCache['terrain']/2) . '" ';
echo 'listed_since="' . xmlentities(strftime($opt['locale'][$opt['template']['locale']]['format']['date'], strtotime($rCache['date_created']))) . '" ';
echo 'toprating="' . xmlentities($rCache['toprating']) . '" ';
echo 'geokreties="' . xmlentities($nGeokretyCount) . '" ';
echo 'found="' . xmlentities(($nFoundCount>0) ? 1 : 0) . '" ';
echo 'notfound="' . xmlentities(($nNotFoundCount>0) ? 1 : 0) . '" ';
echo 'attended="' . xmlentities(($nAttendedCount>0) ? 1 : 0) . '" ';
echo 'owner="' . xmlentities($rCache['owner']) . '" ';
echo 'username="' . xmlentities($rCache['username']) . '" ';
echo 'userid="' . xmlentities($rCache['user_id']) . '" />' . "\n";
echo '</caches>';
exit;
}
function output_namesearch($sName, $nLat, $nLon, $nResultId)
{
global $login;
$sName = '%' . $sName . '%';
echo '<caches>' . "\n";
$rs = sql_slave("SELECT " . geomath::getSqlDistanceFormula($nLon, $nLat, 0) . " AS `distance`,
`caches`.`name`, `caches`.`wp_oc`
FROM `map2_data`
INNER JOIN `caches` ON `map2_data`.`cache_id`=`caches`.`cache_id`
INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`
WHERE `caches`.`name` LIKE '&1'
AND (`cache_status`.`allow_user_view`=1 OR `caches`.`user_id`='&3')
AND `map2_data`.`result_id`='&2'
ORDER BY `distance` ASC LIMIT 30",
$sName,
$nResultId,
$login->userid);
while ($r = sql_fetch_assoc($rs))
{
echo '<cache name="' . xmlentities($r['name']) . '" wpoc="' . xmlentities($r['wp_oc']) . '" />' . "\n";
}
sql_free_result($rs);
echo '</caches>';
exit;
}
function output_searchresult($nResultId, $nLon1, $nLat1, $nLon2, $nLat2)
{
global $login, $opt;
// 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']);
if ($nSlaveId == -2)
{
echo '<searchresult count="0" available="0">';
echo '</searchresult>';
exit;
}
sql_connect_slave($nSlaveId);
sql("UPDATE `map2_result` SET `request_counter`=`request_counter`+1, `date_lastqueried`=NOW() WHERE `result_id`='&1'", $nResultId);
// execute query and return search result
$nRecordCount = sql_value_slave("SELECT COUNT(*) 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'", 0, $nResultId, $nLon1, $nLon2, $nLat1, $nLat2);
// TODO: SQL_CALC_FOUND_ROWS + $nRecordCount = sql_value_slave("SELECT FOUND_ROWS()", 0);
$bMaxRecordReached = false;
if ($nRecordCount > $opt['map']['maxrecords'])
$bMaxRecordReached = true;
echo '<searchresult count="' . $nRecordCount . '" available="1" maxrecordreached="' . ($bMaxRecordReached ? '1' : '0') . '">' . "\n";
if ($bMaxRecordReached == false)
{
$foundQuery = "(SELECT COUNT(*) FROM `cache_logs` WHERE `cache_logs`.`cache_id`=`caches`.`cache_id` AND `user_id`='" . $login->userid . "' AND `cache_logs`.`type` IN (1,7))";
$ownedQuery = "IF(`caches`.`user_id`='" . $login->userid . "', 1, 0 )";
$rs = sql_slave("SELECT SQL_BUFFER_RESULT `caches`.`wp_oc`, `caches`.`longitude`, `caches`.`latitude`, `caches`.`type`, " . $ownedQuery . " AS `owned`, " . $foundQuery . " AS `found` 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);
while ($r = sql_fetch_assoc($rs))
{
$oc_wp = xmlentities($r['wp_oc']);
$owned = xmlentities($r['owned']);
$found = (xmlentities($r['found']) > 0 ? 1 : 0);
echo '<cache wp="' . $oc_wp . '" lon="' . xmlentities($r['longitude']) . '" lat="' . xmlentities($r['latitude']) . '" type="' . xmlentities($r['type']) . '" owned="' . $owned . '" found="' . $found . '" />' . "\n";
}
sql_free_result($rs);
}
echo '</searchresult>';
exit;
}
?>
+2 -2
View File
@@ -42,8 +42,7 @@ function change()
if (isset($_REQUEST['save']))
{
$rs = sql('SELECT `id` FROM `profile_options` ORDER BY `id`');
$rs = sql('SELECT `id` FROM `profile_options` WHERE `optionset`=1 ORDER BY `id`');
$bError = false;
$error = ': ';
$errorlen = ': ';
@@ -109,6 +108,7 @@ function assignFromDB($userid)
LEFT JOIN `user_options` AS `u` ON `p`.`id`=`u`.`option_id` AND (`u`.`user_id` IS NULL OR `u`.`user_id`='&1')
LEFT JOIN `sys_trans` AS `st` ON `p`.`trans_id`=`st`.`id` AND `p`.`name`=`st`.`text`
LEFT JOIN `sys_trans_text` AS `tt` ON `st`.`id`=`tt`.`trans_id` AND `tt`.`lang`='&2'
WHERE `optionset`=1
ORDER BY `p`.`internal_use` DESC, `p`.`option_order`",
$userid+0,
$opt['template']['locale']);
+14 -13
View File
@@ -1,18 +1,19 @@
function CacheMarker(latlng, wp, type, owned, found, map)
function CacheMarker(latlng, wp, type, flags, map)
{
this.latlng = latlng;
this.wp_ = wp;
if(found) {
this.image_ = 'resource2/ocstyle/images/map/24x24-found.png';
}
/*
else if(owned) {
this.image_ = 'resource2/ocstyle/images/map/24x24-owned.png';
}
*/
else {
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;
this.map_ = map;
@@ -45,7 +46,7 @@ CacheMarker.prototype.onAdd = function() {
google.maps.event.trigger(me, "click", me.wp_);
});
//map.getPane(G_MAP_MARKER_PANE).appendChild(div);
var pane = this.getPanes().overlayImage;
var pane = this.getPanes().overlayMouseTarget;
pane.appendChild(div);
this.div_ = div;
Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

@@ -25,10 +25,6 @@ div#bg2 {
background-position: top right;
}
div#langstripe {
background: #e17f28 url(bg-langstripe-autumn.png) 0 100% repeat-x;
}
/* Hack for Internet 'Exploder' */
html {
overflow-x:hidden;
@@ -0,0 +1,10 @@
div#langstripe {
background: #e17f28 url(bg-langstripe-autumn.png) 0 100% repeat-x;
}
div#maplangstripe {
background: #e17f28 url(bg-langstripe-autumn-map.png) 0 100% repeat-x;
}
.faintseasoncolor {
background: #f9ede1;
}
@@ -0,0 +1,11 @@
div#langstripe {
background: #9fbc00 url(bg-langstripe-spring.png) 0 100% repeat-x;
}
div#maplangstripe {
background: #9fbc00 url(bg-langstripe-spring-map.png) 0 100% repeat-x;
}
.faintseasoncolor {
background: #f2f5dd;
}
@@ -0,0 +1,11 @@
div#langstripe {
background: #9db820 url(bg-langstripe-summer.png) 0 100% repeat-x;
}
div#maplangstripe {
background: #9db820 url(bg-langstripe-summer-map.png) 0 100% repeat-x;
}
.faintseasoncolor {
background: #f2f5dd;
}
@@ -0,0 +1,11 @@
div#langstripe {
background: #fff url(bg-langstripe-winter.png) 0 100% repeat-x;
}
div#maplangstripe {
background: #fff url(bg-langstripe-winter-map.png) 0 100% repeat-x;
}
.faintseasoncolor {
background: #e1eef9;
}
@@ -25,10 +25,6 @@ div#bg2 {
background-position: top right;
}
div#langstripe {
background: #9fbc00 url(bg-langstripe-spring.png) 0 100% repeat-x;
}
/* Hack for Internet 'Exploder' */
html {
overflow-x:hidden;
@@ -25,10 +25,6 @@ div#bg2 {
background-position: top right;
}
div#langstripe {
background: #9db820 url(bg-langstripe-summer.png) 0 100% repeat-x;
}
/* Hack for Internet 'Exploder' */
html {
overflow-x:hidden;
@@ -25,10 +25,6 @@ div#bg2 {
background-position: top right;
}
div#langstripe {
background: #fff url(bg-langstripe-winter.png) 0 100% repeat-x;
}
/* Hack for Internet 'Exploder' */
html {
overflow-x:hidden;
+178 -66
View File
@@ -308,6 +308,9 @@ ul.linklist-indent {margin: -0.3em 0px 0.5em 0px; padding: 0px 0px 0px 10px; lis
.img-right-border-notopmargin {float: right; margin: 0px 0px 0px 10px; border: solid 1px rgb(150,150,150);}
.img-right-border-topmargin {float: right; margin: 3px 0px 0px 10px; border: solid 1px rgb(150,150,150);}
/* Links */
a.nooutline:focus { outline: 0; }
/*--------------------*/
/* 6.2 - Sidebar Area */
/*--------------------*/
@@ -329,7 +332,7 @@ ul.linklist-indent {margin: -0.3em 0px 0.5em 0px; padding: 0px 0px 0px 10px; lis
/*-------------------*/
/* 6.4 - Hyperlinks */
/*-------------------*/
.content1 a, .content2 a, .content3 a, .sidebar-txtbox-noshade a, .sidebar-txtbox-shade a {color: rgb(75,75,75); text-decoration: underline;}
.content1 a, .content2 a, .content3 a, .sidebar-txtbox-noshade a, .sidebar-txtbox-shade a, .popup a {color: rgb(75,75,75); text-decoration: underline;}
.content1 a:hover, .content2 a:hover, .content3 a:hover, .sidebar-txtbox-noshade a:hover, .sidebar-txtbox-shade a:hover {color: rgb(0,0,0); text-decoration: none;}
.content1 a:visited, .content2 a:visited, .content3 a:visited, .sidebar-txtbox-noshade a:visited, .sidebar-txtbox-shade a:visited {color: rgb(130,75,150);}
.footer a {color: rgb(255,255,255); text-decoration: underline;}
@@ -570,7 +573,7 @@ input.radio {border:0px; border-width: 0px; width:12px; height:12px; background-
select {border:1px solid black; background-color:white; padding:1px; font-size:12px; color: black;}
input.formbuttons {background-color:rgb(219,230,241); width:120px; border:1px solid black; padding:0px; color: #000000; }
input.formbuttons {background-color:rgb(219,230,241); width:120px; border:1px solid black; padding:0px; color: #000000;}
.menuBar
{
@@ -841,6 +844,7 @@ a.info:hover span{ /*the span will display just on :hover state*/
line-height:3ex;
text-indent:1ex;
}
#breadcrumb_fullsize
{
position: absolute;
@@ -889,7 +893,11 @@ ul.nodot li {
/* internal links without symbol */
#ocmain a[href^="http://www.opencaching"], #ocmain a[href^="http://blog.opencaching"],#ocmain a[href^="http://opencaching"], #ocmain a[href^="http://leute.geocaching.de"], #ocmain a[href^="http://geocaching.de"], #ocmain a[href^="http://cms.opencaching"], #ocmain a[href^="http://cms.geocaching.de"], #ocmain a[href^="http://oc-devel"], #ocmain a[href^="http://www.dietz"]
/* This setting is especially important for popup InfoWindows on google maps,
as the right-padding is not correctly calculated into the GM InfoWindow
content size. */
#googlemap a[href], #ocmain a[href^="http://www.opencaching"], #ocmain a[href^="http://blog.opencaching"], #ocmain a[href^="http://wiki.opencaching"], #ocmain a[href^="http://opencaching"], #ocmain a[href^="http://test.opencaching"], #ocmain a[href^="http://local.opencaching"], #ocmain a[href^="http://oc-devel"]
{
padding-right: 0;
background-image: none;
@@ -970,100 +978,105 @@ div.attribgroup table {
padding-top: 2px;
}
/* Searchfield Cachemap */
/* Cachemap */
.maploading {
position: absolute;
float:left;
left: 120px;
top: 80px;
font-size: 1.6em;
z-index:0;
}
.mapversion {
position: absolute;
right:5px;
bottom:5px;
z-index:0;
}
.maplogin {
text-align:left;
white-space:nowrap;
line-height:1.3em;
}
#ocmain div.mapform {
/*width: 570px;*/
height: 30px;
height: 40px;
text-align: center;
vertical-align: middle;
margin-left: 100px;
margin-right: 100px;
}
}
#ocmain table.mapsearch {
border-collapse: collapse;
margin-left:auto;
margin-right:auto;
width: 100%;
height:100%;
}
#ocmain table.mapsearch td {
padding: 0;
margin: 0;
border-collapse: collapse;
height:40px;
}
td.mapsearch-a {
width: 300px;
height: 30px;
margin: 0;
padding: 0;
text-align:left;
border-top: solid 2px grey;
border-left: solid 2px grey;
border-bottom: solid 2px grey;
-moz-border-radius-topleft: 6;
-moz-border-radius-bottomleft: 6;
td.mapheader_spacer {
width:40%;
}
td.mapsearch-b {
height: 30px;
margin: 0;
padding: 0;
border-top: solid 2px grey;
border-right: solid 2px grey;
border-bottom: solid 2px grey;
-moz-border-radius-topright: 6;
-moz-border-radius-bottomright: 6;
}
td.mapsearch-c {
width: 185px;
margin: 0;
padding: 0;
border: 0;
}
.mapfilter {
#fullmap .mapfilter, #smallmap .mapfilter {
border: solid 1px rgb(219,230,241);
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
margin: 3px;
}
#fullmap .pad10, #smallmap .pad10 { padding: 5px; }
.mapfiltertopic {
margin: 0px 0px 10px 0px;
padding: 3px 5px 2px 13px;
padding: 3px 14px 2px 12px;
background-color: rgb(156,186,214);
color: rgb(255,255,255);
text-transform: uppercase;
font-weight: bold;
font-size: 120%;
font-size: 110%;
width: 100%;
white-space:nowrap;
}
.mapfiltertopic_add {
text-transform: none;
font-weight: normal;
font-size: 1em;
}
.mft_withcheckbox {
padding-left: 1px;
}
#ocmain input.searchfield {
font:15px arial, sans-serif;
background-position:bottom;
color:#000;
cursor:text;
width: 285px;
margin-left: 4px;
vertical-align:top;
border: none;
font-size:13px;
width: 340px;
}
#ocmain input.searchfield_fullscreen {
font-size:12px;
width: 290px;
}
#ocmain input.searchbutton {
font:15px arial, sans-serif;
background-position:bottom;
background: #ccc;
color:#000;
cursor:pointer;
width: 70;
height:30px;
margin:0;
vertical-align:top;
border: none;
font-size:13px;
border: 1px solid black;
}
#ocmain input.searchbutton {
font-size:12px;
border: 1px solid black;
}
#ocmain input.searchbutton:hover {
@@ -1077,23 +1090,28 @@ td.mapsearch-c {
background-color:white;
border:solid 1px darkblue;
padding:10px;
margin-left:375px;
margin-top:10px;
right:15px;
opacity:0.9;
}
#ocmain div.mapselectgeocode {
position:absolute;
position:relative;
z-index:998;
margin-left:147px;
margin-top:5px;
width:376px;
margin-top:0px;
width:390px;
background-color:white;
}
#ocmain select.mapselectlist {
display:none;
width:100%;
font-size:medium;
font-size:13px;
}
#ocmain select.mapselectlist_fullscreen {
display:none;
width:100%;
}
#ocmain option.resultitem {
@@ -1122,6 +1140,94 @@ td.mapsearch-c {
width: 380px;
}
div.mappopup {
overflow:hidden; /* avoids double-scrollbars in MSIE; 'visible' wont work */
}
table.mappopup td {
font-size: 11px;
white-space: nowrap;
}
.mapboxshadow {
box-shadow: 1px 2px 3px #555;
-moz-box-shadow: 1px 2px 3px #555;
-webkit-box-shadow: 1px 2px 3px #555;
}
div.mapcoord_normalscreen {
position: absolute;
top: 176px;
right: 25px;
text-align: right;
margin-top: 8px;
color: grey;
}
div.mapcoord_fullscreen {
position: absolute;
top: 2px;
right: 0px;
padding: 1px 4px 1px 4px;
}
div.mapstat_fullscreen {
position:relative;
top:21px;
padding-right:5px;
background:none;
text-align:right;
}
#fullmap div.toomanycaches {
position:absolute;
left: 140px;
top: 80px;
border: 1px solid rgb(0,0,60);
opacity: 0.7;
background: #0035FF;
padding:5px 5px 5px 5px;
}
#smallmap div.toomanycaches {
position:absolute;
left: 60px;
top: 30px;
border: 1px solid rgb(0,0,60);
opacity: 0.7;
background: #0035FF;
padding:5px 5px 5px 5px;
}
div.toomanycaches td {
width: 250px;
color: white;
text-align:center;
font-size:13px;
line-height:1.3em;
}
div.mapoptions {
position:absolute;
right:100px;
top: 80px;
border: 1px solid rgb(0,0,60);
opacity: 0.9;
background: #FFFFFF;
padding:10px 10px 10px 10px;
}
div.mapoptions td {
padding:6px;
}
/* GM POI InfoWindows */
div.gm-stars { display:none; }
div.gm-rev:after { content:" (Google)"; line-height:1.3em; }
.gm-iw, .gm-iw-table { font-size:11px; }
/* end of cache map */
div.logs {
border: 1px solid #ccc;
margin: 0 0 10px 0;
@@ -1182,3 +1288,9 @@ div#havefound {
* html div#havefound {top: 230px;}
*+html div#havefound {top: 230px;}
/* a / no href / onclick=javascript:... */
.jslink {
cursor:pointer;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 621 B

After

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 621 B

After

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 912 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1009 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 930 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 621 B

After

Width:  |  Height:  |  Size: 979 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Some files were not shown because too many files have changed in this diff Show More