preview picturs in map view; other map detail improvements and fixes

This commit is contained in:
following 2013-03-10 09:51:16 +01:00
parent 9694bc9b1b
commit f87389362a
22 changed files with 474 additions and 208 deletions

View File

@ -121,7 +121,7 @@ List of third party components:
URI : http://www.prototypejs.org/
License : MIT
18. In his hands: Font
18. In his hands: Font in old OC logo
URI : http://www.fontdownloadsfree.com/fonts/1/22/inhishands_inhishan.html
Licence : *** UNKNOWN ***
@ -156,9 +156,11 @@ List of third party components:
URI : http://code.google.com/p/opencaching-pl/source/browse/#svn%2Ftrunk%2Fokapi%2Fstatic%2Ftilemap
License : MIT
25. OpenIcons
Path : htdocs/resource2/ocstyle/images/openicons/
URI : http://openiconlibrary.sourceforge.net/
25. OpenIcons 'system-help' and 'preferences-other'
Path : htdocs/resource2/ocstyle/images/misc/
htdocs/resource2/ocstyle/images/map/
URI : http://openiconlibrary.sourceforge.net/gallery2/?./Icons/categories/system-help-3.png
http://openiconlibrary.sourceforge.net/gallery2/?./Icons/categories/preferences-other-3.png
License : Creative Commons BY-SA 3.0
26. 16x16 Icons 'flag-checker' and 'footprints'

View File

@ -496,7 +496,7 @@
$opt['map']['maxrecords'] = 2500;
}
else
$opt['map']['maxrecords'] = 250;
$opt['map']['maxrecords'] = 200;
// ... selectable by user:
$opt['map']['min_maxrecords'] = 100;
$opt['map']['max_maxrecords'] = 4000;

View File

@ -47,3 +47,4 @@ date commit ID change
cache_logs_archived, all new tables and to triggers
removed table listing_restored
added index cache_logs_archived:user_id
2013-03-10 added field 'mappreview' in pictures and pictures_modified

View File

@ -562,6 +562,7 @@ INSERT INTO `helppages` (`ocpage`, `language`, `helppage`) VALUES ('viewlogs', '
INSERT INTO `helppages` (`ocpage`, `language`, `helppage`) VALUES ('viewprofile', 'DE', 'Benutzerprofil');
INSERT INTO `helppages` (`ocpage`, `language`, `helppage`) VALUES ('additional_waypoints', 'DE', 'Zusätzliche Wegpunkte');
INSERT INTO `helppages` (`ocpage`, `language`, `helppage`) VALUES ('usernote', 'DE', 'Persönliche Notiz');
INSERT INTO `helppages` (`ocpage`, `language`, `helppage`) VALUES ('previewpics', 'DE', 'Vorschaubilder');
-- Table languages
SET NAMES 'utf8';
@ -705,6 +706,7 @@ INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `defaul
INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `default_value`, `check_regex`, `option_order`, `option_input`, `optionset`) VALUES ('7', 'Show overview map', '1870', '1', '0', '^[0-1]$', '120', 'checkbox', '2');
INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `default_value`, `check_regex`, `option_order`, `option_input`, `optionset`) VALUES ('8', 'Maximum caches on map<br />(%1-%2, 0=automatic)', '1871', '1', '0', '^[1-9][0-9]{2,3}$', '130', 'text', '2');
INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `default_value`, `check_regex`, `option_order`, `option_input`, `optionset`) VALUES ('9', 'Cache icons', '1872', '1', '1', '^[1-9]$', '140', 'select:1=classic OC,', '2');
INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `default_value`, `check_regex`, `option_order`, `option_input`, `optionset`) VALUES ('10', 'Show %1preview pictures</a><br />(% of map area, 0=off)', '1928', '1', '7', '^[0-5]?[0-9]$', '150', 'text', '2');
-- Table replication_overwritetypes
SET NAMES 'utf8';
@ -1680,7 +1682,7 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('789', 'Contact
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('792', 'Mark as finished', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('793', 'Action', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('794', 'Prior to reporting a cache to your Opencaching team you should try to contact the owner, to solve possible problems immediate user to user. This does not apply for caches violating the Opencaching terms of use in a way, that requires immediate action of an Opencaching administrator.', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('795', 'Do not display this picture (only used in HTML description)', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('795', 'Do not separately display this picture (used in HTML description etc.)', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('796', 'No information on user details found.', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('797', 'Coordinates', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('798', 'Geokrets', '2010-08-28 11:48:04');
@ -2367,6 +2369,9 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1924', 'The cac
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1925', 'The cache has an %2additional waypoint%3.', '2013-03-03 00:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1926', 'Path', '2013-03-03 00:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1927', 'Final', '2013-03-03 00:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1928', 'Show %1preview pictures</a><br />(% of map area, 0=off)', '2013-03-03 00:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1929', 'Preview picture for map \&ndash; is shown when this cache is selected on the map. You can have only <em>one</em> preview picture per cache.', '2013-03-03 00:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1930', 'Max. %1 caches can be displayed with Microsoft Internet Explorer.', '2013-03-03 00:00:00');
-- Table sys_trans_ref
SET NAMES 'utf8';
@ -5271,7 +5276,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 ('792', 'DE', 'Als erledigt markieren', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('793', 'DE', 'Aktion', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('794', 'DE', 'Bevor du einen Cache an das Opencaching-Team meldest, solltest du versuchen, Kontakt mit dem Owner aufzunehmen, um mögliche Probleme direkt untereinander zu klären. Davon ausgenommen sind Caches, die durch ihre Beschreibung oder das Versteck eine sofortige Archivierung notwendig machen.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('795', 'DE', 'Dieses Bild nicht anzeigen (Hintergrundbild in HTML Beschreibung o.ä.)', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('795', 'DE', 'Dieses Bild nicht separat anzeigen (Hintergrundbild in HTML-Beschreibung o.ä.)', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('796', 'DE', 'Es wurden keine Benutzerdetails eingegeben.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('797', 'DE', 'Koordinaten', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('798', 'DE', 'Geokrets', '2010-08-28 11:48:07');
@ -5956,6 +5961,9 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1925', 'DE', 'Der Cache hat einen %1zusätzlichen Wegpunkt%2.', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1926', 'DE', 'Pfad', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1927', 'DE', 'Ziel', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1928', 'DE', '%1Vorschaubilder</a> anzeigen<br />(% der Kartenfläche, 0=aus)', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1929', 'DE', 'Kartenvorschaubild \&ndash; wird angezeigt, wenn dieser Cache auf der Karte angeklickt wird. Es ist maximal <em>ein</em> Vorschaubild pro Cache wählbar.', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1930', 'DE', 'Mit dem Microsoft Internet Explorer werden<br />maximal %1 Caches angezeigt.', '2012-10-11 00: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');
@ -6733,7 +6741,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 ('792', 'EN', 'Mark as done', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('793', 'EN', 'Action', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('794', 'EN', 'Prior to reporting a cache to the Opencaching team, you should try to contact the owner and try to solve the presumed problems yourself. This does not apply for caches violating the Opencaching terms of use in a way that requires immediate action of an Opencaching administrator.', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('795', 'EN', 'Do not display this picture (which is only used in HTML description etc.)', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('795', 'EN', 'Do not separately display this picture (which is only used in HTML description etc.)', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('796', 'EN', 'No information on user details found.', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('797', 'EN', 'Coordinates', '2010-08-28 11:48:08');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('798', 'EN', 'Geokrets', '2010-08-28 11:48:08');
@ -7420,6 +7428,9 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1925', 'EN', 'The cache has an %2additional waypoint%3.', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1926', 'EN', 'Path', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1927', 'EN', 'Final', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1928', 'EN', 'Show %1preview pictures</a><br />(% of map area, 0=off)', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1929', 'EN', 'Preview picture for map \&ndash; is shown when this cache is selected on the map. You can have only <em>one</em> preview picture per cache.', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1930', 'EN', 'Max. %1 caches can be displayed with Microsoft Internet Explorer.', '2012-10-11 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'ES', 'Reordenar ID', '2010-12-09 00:17:55');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'ES', 'La base de datos no se pudo conectar.', '2010-12-09 00:17:55');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('3', 'ES', 'En pruebas - por favor, no entre.', '2010-12-09 00:17:55');
@ -11902,4 +11913,4 @@ TRUNCATE TABLE `watches_waitingtypes`;
INSERT INTO `watches_waitingtypes` (`id`, `watchtype`) VALUES ('1', 'ownerlog');
INSERT INTO `watches_waitingtypes` (`id`, `watchtype`) VALUES ('2', 'cache_watches');
INSERT INTO `sysconfig` (`name`, `value`) VALUES ('datasql_checksum', 'bdff93f2b9d8559f5a29e0d8e6bd1170') ON DUPLICATE KEY UPDATE `value`='bdff93f2b9d8559f5a29e0d8e6bd1170';
INSERT INTO `sysconfig` (`name`, `value`) VALUES ('datasql_checksum', '92a5fe8a1694cd46efbcb9992bce66b4') ON DUPLICATE KEY UPDATE `value`='92a5fe8a1694cd46efbcb9992bce66b4';

View File

@ -1012,6 +1012,7 @@
(SELECT `status` FROM `caches` WHERE `caches`.`cache_id`=OLD.`object_id`) != 5 AND
(NEW.`title` != OLD.`title` OR NEW.`spoiler` != OLD.`spoiler` OR NEW.`display` != OLD.`display`) THEN
INSERT IGNORE INTO `pictures_modified` (`id`, `date_modified`, `operation`, `date_created`, `url`, `title`, `object_id`, `object_type`, `spoiler`, `unknown_format`, `display`, `restored_by`) VALUES (OLD.`id`, NOW(), 'U', OLD.`date_created`, OLD.`url`, OLD.`title`, OLD.`object_id`, OLD.`object_type`, OLD.`spoiler`, OLD.`unknown_format`, OLD.`display`, IFNULL(@restoredby,0));
/* mappreview is not archived, can be safely set to 0 on restore */
END IF;
END;");
@ -1028,6 +1029,7 @@
(SELECT `status` FROM `caches` WHERE `caches`.`cache_id`=OLD.`object_id`) != 5
)) THEN
INSERT IGNORE INTO `pictures_modified` (`id`, `date_modified`, `operation`, `date_created`, `url`, `title`, `object_id`, `object_type`, `spoiler`, `unknown_format`, `display`, `restored_by`) VALUES (OLD.`id`, NOW(), 'D', OLD.`date_created`, OLD.`url`, OLD.`title`, OLD.`object_id`, OLD.`object_type`, OLD.`spoiler`, OLD.`unknown_format`, OLD.`display`, IFNULL(@restoredby,0));
/* mappreview is not archived, can be safely set to 0 on restore */
END IF;
IF OLD.`object_type`=1 THEN
CALL sp_update_cachelog_picturestat(OLD.`object_id`, TRUE);

View File

@ -17,6 +17,7 @@ CREATE TABLE `pictures` (
`local` tinyint(1) NOT NULL default '1',
`unknown_format` tinyint(1) NOT NULL default '0',
`display` tinyint(1) NOT NULL default '1',
`mappreview` tinyint(2) NOT NULL default '7',
PRIMARY KEY (`id`),
UNIQUE KEY `uuid` (`uuid`),
KEY `last_modified` (`last_modified`),

View File

@ -7,11 +7,11 @@ CREATE TABLE `pictures_modified` (
`date_created` datetime NOT NULL,
`url` varchar(255) NOT NULL,
`title` varchar(250) NOT NULL,
`object_id` int(10) unsigned NOT NULL default '0',
`object_type` tinyint(3) unsigned NOT NULL default '0',
`spoiler` tinyint(1) NOT NULL default '0',
`unknown_format` tinyint(1) NOT NULL default '0',
`display` tinyint(1) NOT NULL default '1',
`object_id` int(10) unsigned NOT NULL,
`object_type` tinyint(3) unsigned NOT NULL,
`spoiler` tinyint(1) NOT NULL,
`unknown_format` tinyint(1) NOT NULL,
`display` tinyint(1) NOT NULL,
`original_id` int(10) NOT NULL,
`restored_by` int(10) NOT NULL,
UNIQUE KEY `id` (`id`,`operation`),

View File

@ -465,7 +465,7 @@ function mnu_EchoHelpLink($tplname)
{
$helplink = helppagelink($tplname);
if ($helplink != "")
echo $helplink . '<img src="resource2/ocstyle/images/openicons/35x35-system-help.png" /></a>';
echo $helplink . '<img src="resource2/ocstyle/images/misc/32x32-help.png" /></a>';
}
?>

View File

@ -54,6 +54,7 @@ class picture
$this->rePicture->addInt('local', 0, false);
$this->rePicture->addInt('unknown_format', 0, false);
$this->rePicture->addInt('display', 1, false);
$this->rePicture->addInt('mappreview', 0, false);
$this->nPictureId = $nNewPictureId+0;
@ -186,6 +187,14 @@ class picture
{
return $this->rePicture->setValue('display', $value ? 1 : 0);
}
function getMapPreview()
{
return $this->rePicture->getValue('mappreview') != 0;
}
function setMapPreview($value)
{
return $this->rePicture->setValue('mappreview', $value ? 1 : 0);
}
function getFilename()
{
global $opt;
@ -293,7 +302,13 @@ class picture
$bRetVal = $this->rePicture->save();
if ($bRetVal)
{
$this->nPictureId = $this->rePicture->getValue('id');
if ($this->getObjectType() == OBJECT_CACHE && $this->getMapPreview())
sql("UPDATE `pictures` SET `mappreview`=0 WHERE `object_type`='&1' AND `object_id`='&2' AND `id`!='&3'",
OBJECT_CACHE, $this->getObjectId(), $this->getPictureId());
sql_slave_exclude();
}
return $bRetVal;
}

View File

@ -14,22 +14,11 @@
* 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;
}
// check for peculiar browsers
$msie = preg_match('/MSIE [1-9]+.[0-9]+/',$_SERVER['HTTP_USER_AGENT']) &&
!strpos($user_agent,"Opera");
$old_msie = $msie && preg_match('/MSIE [1-6].[0-9]+/',$_SERVER['HTTP_USER_AGENT']);
$sMode = isset($_REQUEST['mode']) ? $_REQUEST['mode'] : '';
if ($sMode == 'locate')
@ -63,12 +52,10 @@
$nLat1 = isset($_REQUEST['lat1']) ? $_REQUEST['lat1']+0 : 0;
$nLat2 = isset($_REQUEST['lat2']) ? $_REQUEST['lat2']+0 : 0;
$cachenames = isset($_REQUEST['cachenames']) ? $_REQUEST['cachenames']+0 : 0;
$smallmap = isset($_REQUEST['smallmap']) ? $_REQUEST['smallmap']+0 : 0;
if (isset($_REQUEST['smallmap']) && $_REQUEST['smallmap'] &&
$user_maxrecords == 0 && $maxrecords > 1000)
$maxrecords = floor($maxrecords*0.65);
output_searchresult($nResultId, $compact, $nLon1, $nLon2, $nLat1, $nLat2, $cachenames);
output_searchresult($nResultId, $compact, $nLon1, $nLon2, $nLat1, $nLat2,
$cachenames, $smallmap);
}
else if ($sMode == 'fullscreen' ||
($sMode == '' &&
@ -95,28 +82,25 @@
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);
$login->userid, 7, 0, isset($_REQUEST['opt_overview']) ? min(max(round($_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']) );
$login->userid, 8, 0, $_REQUEST['opt_maxcaches'] == 0 ? 0 : min(max(round($_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) );
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, 10, 0, min(max($_REQUEST['opt_pictures']+0, 0), 50) );
}
$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]))
@ -237,19 +221,26 @@
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;
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;
case 10: $tpl->assign('opt_pictures', $r['value']); break;
}
sql_free_result($rs);
$tpl->assign('maxrecords',$opt['map']['maxrecords'] + 0);
$tpl->assign('min_maxrecords', $opt['map']['min_maxrecords']);
$tpl->assign('max_maxrecords', $opt['map']['max_maxrecords']);
$tpl->assign('msie',$msie);
$tpl->assign('old_msie',$old_msie);
$tpl->assign('help_oconly', helppagelink("OConly"));
$tpl->assign('help_map', helppagelink("*map2"));
$tpl->assign('help_wps', helppagelink("additional_waypoints"));
$tpl->assign('help_note', helppagelink("usernote"));
$tpl->assign('help_previewpics', helppagelink("previewpics"));
$tpl->display();
@ -299,7 +290,9 @@ function output_cachexml($sWaypoint)
IFNULL(`stat_caches`.`toprating`, 0) AS `toprating`,
IF(`caches`.`user_id`='&1', 1, 0) AS `owner`,
`user`.`username`, `user`.`user_id`,
IF(`caches_attributes`.`attrib_id` IS NULL, 0, 1) AS `oconly`
IF(`caches_attributes`.`attrib_id` IS NULL, 0, 1) AS `oconly`,
IFNULL(`pictures`.`url`,'') AS `picurl`,
IFNULL(`pictures`.`title`,'') AS `pictitle`
FROM `caches`
INNER JOIN `cache_type` ON `caches`.`type`=`cache_type`.`id`
INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`
@ -313,9 +306,11 @@ function output_cachexml($sWaypoint)
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
LEFT JOIN `pictures` ON `pictures`.`object_id`=`caches`.`cache_id` AND `pictures`.`object_type`='&4' AND `pictures`.`mappreview`=1
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);
(`cache_status`.`allow_user_view`=1 OR `caches`.`user_id`='&1')",
$login->userid, $opt['template']['locale'], $sWaypoint, OBJECT_CACHE);
$rCache = sql_fetch_assoc($rsCache);
sql_free_result($rsCache);
@ -358,7 +353,9 @@ function output_cachexml($sWaypoint)
echo 'oconly="' . xmlentities($rCache['oconly']) . '" ';
echo 'owner="' . xmlentities($rCache['owner']) . '" ';
echo 'username="' . xmlentities($rCache['username']) . '" ';
echo 'userid="' . xmlentities($rCache['user_id']) . '" >' . "\n";
echo 'userid="' . xmlentities($rCache['user_id']) . '" ';
echo 'picurl="' . xmlentities($rCache['picurl']) . '" ';
echo 'pictitle="' . xmlentities(trim($rCache['pictitle'])) . '" >\n';
foreach ($waypoints as $waypoint)
{
@ -407,9 +404,10 @@ function output_namesearch($sName, $nLat, $nLon, $nResultId)
exit;
}
function output_searchresult($nResultId, $compact, $nLon1, $nLon2, $nLat1, $nLat2, $cachenames)
function output_searchresult($nResultId, $compact, $nLon1, $nLon2, $nLat1, $nLat2,
$cachenames, $smallmap)
{
global $login, $opt, $maxrecords;
global $login, $opt, $maxrecords, $msie;
// 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']);
@ -427,15 +425,32 @@ function output_searchresult($nResultId, $compact, $nLon1, $nLon2, $nLat1, $nLat
$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 > $maxrecords)
$bMaxRecordReached = true;
$namequery = ($cachenames ? ", `caches`.`name` AS `cachename`" : "");
echo '<searchresult count="' . $nRecordCount . '" available="1" maxrecordreached="' . ($bMaxRecordReached ? '1' : '0') . '">' . "\n";
if ($bMaxRecordReached == false)
// determine max. number of records to send
$maxrecords = $opt['map']['maxrecords'] + 0;
if ($login->userid > 0)
{
$user_maxrecords =
sql_value("SELECT option_value FROM user_options WHERE user_id='&1' AND option_id=8",
$opt['map']['maxrecords'] + 0, $login->userid);
if ($user_maxrecords > 0 && (!$msie || $user_maxrecords < $maxrecords))
$maxrecords = min(max($user_maxrecords, $opt['map']['min_maxrecords']),
$opt['map']['max_maxrecords']);
}
else
$user_maxrecords = 0;
if ($smallmap && $user_maxrecords == 0 && $maxrecords > 1000)
$maxrecords = floor($maxrecords*0.65);
$bMaxRecordReached = ($nRecordCount > $maxrecords);
// output data
echo '<searchresult count="' . xmlentities($nRecordCount) . '" available="1"' .
' maxrecordreached="' . ($bMaxRecordReached ? '1' : '0') . '">' . "\n";
if (!$bMaxRecordReached)
{
$namequery = ($cachenames ? ", `caches`.`name` AS `cachename`" : "");
$rs = sql_slave("SELECT SQL_BUFFER_RESULT
`caches`.`wp_oc`, `caches`.`longitude`, `caches`.`latitude`,
`caches`.`type`,

View File

@ -77,6 +77,7 @@
$picture->setSpoiler(isset($_REQUEST['spoiler']) && $_REQUEST['spoiler']=='1');
$picture->setDisplay((isset($_REQUEST['notdisplay']) && $_REQUEST['notdisplay']=='1') == false);
$picture->setMapPreview(isset($_REQUEST['mappreview']) && $_REQUEST['mappreview']=='1');
$title = isset($_REQUEST['title']) ? $_REQUEST['title'] : '';
if ($title == '')
@ -164,6 +165,7 @@
// overwrite values
$picture->setSpoiler(isset($_REQUEST['spoiler']) && $_REQUEST['spoiler']=='1');
$picture->setDisplay((isset($_REQUEST['notdisplay']) && $_REQUEST['notdisplay']=='1') == false);
$picture->setMapPreview(isset($_REQUEST['mappreview']) && $_REQUEST['mappreview']=='1');
$title = isset($_REQUEST['title']) ? $_REQUEST['title'] : $picture->getTitle();
if ($title == '')
@ -212,6 +214,7 @@
$tpl->assign('title', $picture->getTitle());
$tpl->assign('spoilerchecked', $picture->getSpoiler());
$tpl->assign('displaychecked', $picture->getDisplay());
$tpl->assign('mappreviewchecked', $picture->getMapPreview());
$tpl->display();
?>

View File

@ -923,8 +923,8 @@ a.info:hover span{ /*the span will display just on :hover state*/
div.tplhelp
{
position:absolute;
top:135px;
right:12px;
top:136px;
right:13px;
}
/* lists at hompage */
@ -1136,7 +1136,6 @@ td.mapheader_spacer {
position:absolute;
z-index:999;
background-color:white;
border:solid 1px darkblue;
padding:10px;
right:15px;
opacity:0.9;
@ -1199,6 +1198,10 @@ table.mappopup td {
white-space: nowrap;
}
.mapboxframe {
border:1px solid #777777;
}
.mapboxshadow {
box-shadow: 1px 2px 3px #555;
-moz-box-shadow: 1px 2px 3px #555;
@ -1260,7 +1263,6 @@ 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;

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -20,8 +20,9 @@
<li><a href="map2.php?mode=fullscreen">Vollbildkarte</a> mit ausklappbaren Filtereinstellungen</li>
<li><a href="http://wiki.opencaching.de/index.php/Zusätzliche_Wegpunkte" target="_blank">zusätzliche Wegpunkte</a> des gewählten Caches werden angezeigt</li>
<li>bis zu 4000 Caches auf einer Karte</li>
<li>alternative Cachesymbole wählbar (Opencaching.pl-Stil)</li>
<li>Home-Button springt zu den im <a href="myprofile.php">Profil</a> eingetragenen Heimkoordinaten</li>
<li>alternative Cachesymbole wählbar (Opencaching.pl-Stil)</li>
<li>pro Cache ist ein <a href="http://wiki.opencaching.de/index.php?title=Vorschaubilder" target="_blank">Vorschaubild</a> einstellbar, das bei Auswahl des Caches auf der Karte erscheint</li>
<li>Verbesserungen bei der Cacheauswahl / Filter:
<ul>
<li>komfortablere Auswahl von einzelnen Cachetypen oder -größen</li>

File diff suppressed because it is too large Load Diff

View File

@ -90,7 +90,11 @@
</tr>
<tr>
<td align="right"><input class="checkbox" type="checkbox" name="notdisplay" value="1" {if $displaychecked==false}checked="checked"{/if}></td>
<td>{t}Do not display this picture (only used in HTML description){/t}</td>
<td>{t}Do not separately display this picture (used in HTML description etc.){/t}</td>
</tr>
<tr>
<td align="right"><input class="checkbox" type="checkbox" name="mappreview" value="1" {if $mappreviewchecked==true}checked="checked"{/if}></td>
<td>{t}Preview picture for map &ndash; is shown when this cache is selected on the map. You can have only <em>one</em> preview picture per cache.{/t}</td>
</tr>
{/if}
{if $action=='add'}
@ -106,11 +110,13 @@
<tr><td class="spacer" colspan="2"></td></tr>
<tr>
<td colspan="2">
{t}By submitting I accept the <a href="articles.php?page=impressum#tos" target="_blank">Opencaching.de Terms of Service</a> and the <a href="articles.php?page=impressum#datalicense" target="_blank">Opencaching.de Datalicense</a>{/t}
</td>
</tr>
{if $action == "add"}
<tr>
<td colspan="2">
{t}By submitting I accept the <a href="articles.php?page=impressum#tos" target="_blank">Opencaching.de Terms of Service</a> and the <a href="articles.php?page=impressum#datalicense" target="_blank">Opencaching.de Datalicense</a>{/t}
</td>
</tr>
{/if}
<tr><td class="spacer" colspan="2"></td></tr>

View File

@ -191,7 +191,7 @@
{/if}
{if $helplink != ""}
<div class="tplhelp">{$helplink}<img src="resource2/ocstyle/images/openicons/35x35-system-help.png" /></a></div>
<div class="tplhelp">{$helplink}<img src="resource2/ocstyle/images/misc/32x32-help.png" /></a></div>
{/if}
{* <!-- NAVIGATION --> *}

View File

@ -45,11 +45,13 @@ class ChildWp_Handler
public function getChildWps($cacheid, $include_usernote=false)
{
global $login;
if ($include_usernote)
$type2 = Coordinate_Type::UserNote;
else
$type2 = 0;
$rs = sql("SELECT id, cache_id, type, subtype, latitude, longitude, description FROM coordinates WHERE cache_id = &1 AND type IN (&2,&3)", $cacheid, Coordinate_Type::ChildWaypoint, $type2);
$rs = sql("SELECT id, cache_id, type, subtype, latitude, longitude, description FROM coordinates WHERE cache_id = &1 AND type IN (&2,&3) AND (type='&2' OR (user_id='&4' and latitude!=0 and longitude!=0))", $cacheid, Coordinate_Type::ChildWaypoint, $type2, $login->userid);
$ret = array();
while ($r = sql_fetch_array($rs))