Skip to content
Permalink
Browse files

validate GC waypoints; added explanations for waypoints; updates #334

  • Loading branch information...
following5 committed May 25, 2015
1 parent 1df52c4 commit e3af6ec2eec0ae201b8a54dac0bf53c422136901
@@ -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 ('2178', 'GC waypoint is invalid, must be GCXXX...', '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 ('2178', 'DE', 'ungültiger GC-Wegpunkt, Format ist GCXXX...', '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');
@@ -337,6 +337,12 @@ function getWaypoints($cacheid)
$error = true;
}
//check GC waypoint
$wpgc_not_ok = $wp_gc != "" && !preg_match("/^(?:GC|CX)[0-9A-Z]{3,6}$/", $wp_gc);
if ($wpgc_not_ok)
{
$error = true;
}
//check hidden_since
$hidden_date_not_ok = true;
@@ -428,7 +434,7 @@ function getWaypoints($cacheid)
if (isset($_POST['submit'])) // Ocprop
{
//all validations ok?
if (!($hidden_date_not_ok || $lat_not_ok || $lon_not_ok || $name_not_ok || $time_not_ok || $way_length_not_ok || $size_not_ok || $activate_date_not_ok || $status_not_ok || $diff_not_ok || $attribs_not_ok))
if (!($hidden_date_not_ok || $lat_not_ok || $lon_not_ok || $name_not_ok || $time_not_ok || $way_length_not_ok || $size_not_ok || $activate_date_not_ok || $status_not_ok || $diff_not_ok || $attribs_not_ok || $wpgc_not_ok))
{
$cache_lat = $coords_lat_h + $coords_lat_min / 60;
if ($coords_latNS == 'S') $cache_lat = -$cache_lat;
@@ -892,6 +898,7 @@ function getWaypoints($cacheid)
tpl_set_var('lat_message', ($lat_not_ok == true) ? $coords_message : '');
tpl_set_var('date_message', ($hidden_date_not_ok == true) ? $date_message : '');
tpl_set_var('size_message', ($size_not_ok == true) ? $sizemismatch_message : '');
tpl_set_var('wpgc_message', ($wpgc_not_ok == true) ? $bad_wpgc_message : '');
if($lon_not_ok || $lat_not_ok || $hidden_date_not_ok || $name_not_ok)
tpl_set_var('general_message', $error_general);
@@ -33,6 +33,7 @@
$status_change = '<br /><div style="margin-top:6px"><img src="lang/de/ocstyle/images/misc/hint.gif" border="0" width="15" height="11" >' . t('To change the state, you need to <a href="log.php?cacheid=%1">log</a> the new state.') . '</div>';
$diff_not_ok_message = '&nbsp;<span class="errormsg">' . t('Choose both valuations!') . '</span>';
$safari_not_allowed_message = '<span class="errormsg">' . t('Only virtual caches can be safari caches.') . '</span>';
$bad_wpgc_message = '<span class="errormsg">' . t('GC waypoint is invalid, must be GCXXX...') . '</span>';
$nopictures = '<tr><td colspan="2">' . t('No pictures available') . '</td></tr>';
$pictureline = '<tr><td colspan="2"><a href="{link}">{title}</a> [<a href="picture.php?action=edit&uuid={uuid}">' . t('Edit') . '</a>] [<a href="picture.php?action=delete&uuid={uuid}">' . t('Delete') . '</a>]</td></tr>';
// Ocprop: <a href=\"http://.*?\.opencaching\.de/images/uploads/.*?\">(.*?)<\/a>.*?\[<a href=\"picture\.php\?action=[a-z]*?\&uuid=(.*?)\">
@@ -224,7 +224,8 @@ function toggleAttr(id)
<tr>
<td>{t}Waypoints (optional):{/t}</td>
<!-- allow wp_gc copy&paste with leading spaces; will be trimmed later -->
<td>geocaching.com: <input type="text" name="wp_gc" value="{wp_gc}" maxlength="12" class="input50" />
<td>geocaching.com: <input type="text" name="wp_gc" value="{wp_gc}" maxlength="12" class="input70" />
{wpgc_message}
navicache.com: <input type="text" name="wp_nc" value="{wp_nc}" maxlength="6" class="input50" />
</td>
</tr>
@@ -35,6 +35,7 @@
$diff_not_ok_message = '&nbsp;<span class="errormsg">' . t('Choose both valuations!') . '</span>';
$sizemismatch_message = '&nbsp;<span class="errormsg">' . t('For virtual and webcam caches, the cache size has to be -no container-!') . '</span>';
$safari_not_allowed_message = '<span class="errormsg">' . t('Only virtual caches can be safari caches.') . '</span>';
$bad_wpgc_message = '<span class="errormsg">' . t('GC waypoint is invalid, must be GCXXX...') . '</span>';
$cache_submitted = t('Your cache is successfully added to the database. You will be redirected to the cache page, now.');
@@ -221,7 +221,8 @@ function toggleAttr(id)
<tr>
<td>{t}Waypoints:{/t}</td>
<!-- allow wp_gc copy&paste with leading spaces; will be trimmed later -->
<td>geocaching.com: <input type="text" name="wp_gc" value="{wp_gc}" maxlength="12" class="input50" />
<td>geocaching.com: <input type="text" name="wp_gc" value="{wp_gc}" maxlength="12" class="input70" />
{wpgc_message}
navicache.com: <input type="text" name="wp_nc" value="{wp_nc}" maxlength="6" class="input50" />
</td>
</tr>
@@ -58,6 +58,7 @@
tpl_set_var('desc_message', '');
tpl_set_var('effort_message', '');
tpl_set_var('size_message', '');
tpl_set_var('wpgc_message', '');
tpl_set_var('type_message', '');
tpl_set_var('diff_message', '');
tpl_set_var('safari_message', '');
@@ -682,6 +683,14 @@
$error = true;
}
//check GC waypoint
$wpgc_not_ok = $wp_gc != "" && !preg_match("/^(?:GC|CX)[0-9A-Z]{3,6}$/", $wp_gc);
if ($wpgc_not_ok)
{
tpl_set_var('wpgc_message', $bad_wpgc_message);
$error = true;
}
//check date_activate
$activation_date_not_ok = true;
if (is_numeric($activate_day) && is_numeric($activate_month) && is_numeric($activate_year) && is_numeric($activate_hour))
@@ -781,7 +790,7 @@
tpl_set_var('safari_message', '');
//no errors?
if (!($tos_not_ok || $name_not_ok || $hidden_date_not_ok || $activation_date_not_ok || $lon_not_ok || $lat_not_ok || $time_not_ok || $way_length_not_ok || $size_not_ok || $type_not_ok || $diff_not_ok || $attribs_not_ok))
if (!($tos_not_ok || $name_not_ok || $hidden_date_not_ok || $activation_date_not_ok || $lon_not_ok || $lat_not_ok || $time_not_ok || $way_length_not_ok || $size_not_ok || $type_not_ok || $diff_not_ok || $attribs_not_ok || $wpgc_not_ok))
{
//sel_status
$now = getdate();
@@ -141,6 +141,8 @@
erl&auml;utere den Aufwand in der Cachebeschreibung. Wenn du bei der
Sch&auml;tzung davon ausgehst, dass eine Teilstrecke mit Inline-Skates, dem Fahrrad oder dem Auto zur&uuml;ckgelegt wird, weise ebenfalls in der Beschreibung darauf hin.</p>

<p><b>Wegpunkte:</b> Falls du den Cache auch auf anderen Geocaching-Plattformen veröffentlicht hast, kannst du hier die entsprechenden Wegpunkte angeben. geocaching.com-Wegpunkte haben das Format GCXXXXX, wobei XXXXX für bis zu fünf Großbuchstaben und/oder Ziffern steht. Navicache-Wegpunkte haben das Format NXXXX.</p>

<p>
<b>Cacheattribute:</b> Mit den Cacheattributen kannst du genauere Angaben zu deinem Cache machen, die z.B. bei der <a href="search.php">Suche</a> als Kriterium angegeben werden k&ouml;nnen.
Viele Attribute sind dabei Erfahrungswerte (z.B. Zeckengefahr). Als Finder eines Geocaches kannst du gerne den Owner darauf hinweisen, dass er dem Geocache die entsprechenden Attribute zuordnen kann.
@@ -135,6 +135,8 @@

<p><a name="time"></a><b>Effort:</b> How much time and way is to be expected, beginning at the starting point or parking lot, to find the cache and return to the starting point? Please assume that the geocacher is experienced, but will struggle to solve the one or other puzzle or quest. If you cannot pin down the time needed, keep the default of 0&nbsp;h / 0&nbsp;min and describe the effort. If you estimated the time assuming use of inline skates, a bicycle or car, please mention it in the cache description.</p>

<p><b>Waypoints:</b> If you published this cache also at other geocaching websites, you are encouraged to enter the corresponding waypoints here. geocaching.com waypoints have the format GCXXXXX, with XXXXX being up to 5 capital letters and/or digits. Navicache waypoints have the format NXXXX.</p>

<p><b>Cache attributes:</b> Use the attributes to specify properties of your cache, which may be selected by the <a href="search.php">search function</a>. Attributes may be estimated and depend on your knowledge of the site (e.g. frequent occurance of ticks). As searcher and finder of a cache, you may tell the owner about the usage and helpfullness of attributes or make suggestions. When describing your caches, please assume normal, dry weather conditions.</p>
<p><a href="#attributedesc">See below</a> for a complete explanation of cache attributes.</p>

0 comments on commit e3af6ec

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