Skip to content
Permalink
Browse files

update #76: catch new caches with duplicate coordinates

  • Loading branch information...
following5 committed May 25, 2015
1 parent 1df52c4 commit 5604b2b176d53c54159bdc15860ab8fd792e8074
Showing with 15 additions and 0 deletions.
  1. +2 −0 htdocs/doc/sql/static-data/data.sql
  2. +1 −0 htdocs/lang/de/ocstyle/newcache.inc.php
  3. +12 −0 htdocs/newcache.php
@@ -2599,6 +2599,7 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2171', 'Please
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2172', 'Yes, I want to recieve mailings about news and actions on opencaching.de. (max. 2-5 per year)', '2013-11-03 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2173', 'No, I dont\'t want any mailings about news and actions on opencaching.de.', '2013-11-03 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2174', 'Newsletter:', '2013-11-03 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2177', 'Another cache exists at these coords. Maybe you pressed \"submit cache\" twice. To publish a cache with identical coords, enter other coords first, then edit the listing and change coords.', '2013-11-03 10:09:14');

-- Table sys_trans_ref
SET NAMES 'utf8';
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2172', 'DE', 'Ja, ich möchte Informationen zu Neuigkeiten und Aktionen auf opencaching.de per Email erhalten. (max. 2-5 pro Jahr)', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2173', 'DE', 'Nein, ich möchte keine Informationen zu Neuigkeiten und Aktionen auf opencaching.de per Email erhalten.', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2174', 'DE', 'Newsletter:', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2177', 'DE', 'An diesen Koordinaten befindet sich bereits ein Cache. Vielleicht hast du mehrfach auf \"Cache senden\" geklickt. Wenn du tatsächlich einen weiteren Cache mit identischen Koordinaten veröffentlichen möchtest, lege ihn zunächst mit abweichenden Koordinaten an, bearbeite dann das Listing und ändere die Koordinaten.', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'EN', 'Reorder IDs', '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');
@@ -25,6 +25,7 @@
$error_general = "<tr><td class='error' colspan='2'><b>" . t('Some errors occured, please check the marked fields.') . "</b></td></tr>";
$error_coords_not_ok = '<span class="errormsg">' . t('Your chosen coordinated are invalid') . '</span>';
$error_duplicate_coords = '<span class="errormsg">' . t('Another cache exists at these coords. Maybe you pressed "submit cache" twice. To publish a cache with identical coords, enter other coords first, then edit the listing and change coords.') . '</span>';
$time_not_ok_message = '<span class="errormsg">' . t('The entered time is invalid.') . '</span>';
$way_length_not_ok_message = '<span class="errormsg">' . t('The entered distance is invalid, Format: aa.aaa') . '</span>';
$date_not_ok_message = '<span class="errormsg">' . t('Invalid date, format:DD-MM-JJJJ') . '</span>';
@@ -647,6 +647,18 @@
$lon_not_ok = $lon_min_not_ok || $lon_h_not_ok;
$lat_not_ok = $lat_min_not_ok || $lat_h_not_ok;
// check for duplicate coords
if (!($lon_not_ok || $lat_not_ok) &&
sqlValue("SELECT COUNT(*) FROM `caches`
WHERE `status`=1
AND `longitude`=" . sql_escape($longitude) . "
AND `latitude`=" . sql_escape($latitude),
0) > 0)
{
tpl_set_var('lon_message', $error_duplicate_coords);
$lon_not_ok = true;
}
//check effort
$time_not_ok = true;
if (is_numeric($search_time) || ($search_time == ''))

0 comments on commit 5604b2b

Please sign in to comment.
You can’t perform that action at this time.