Skip to content
Permalink
Browse files

geokret filter options in search and map; updates #41, updates #730

  • Loading branch information...
following5 committed Jun 24, 2015
1 parent 0fabac2 commit 44e2e1f9cf9a184d6c32bdc5539de8493d7c14a5
@@ -2605,6 +2605,7 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2176', 'Planned
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2177', 'Another cache (<a href=\"viewcache.php?wp=%1\">%1</a>) 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');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2178', 'GC waypoint is invalid, must be GCXXX...', '2013-11-03 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2179', 'Safari caches list', '2013-11-03 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2250', 'without Geokrets', '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 ('2177', 'DE', 'An diesen Koordinaten befindet sich bereits der Cache <a href=\"viewcache.php?wp=%1\">%1</a>. 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 ('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 ('2179', 'DE', 'Safari-Cache-Liste', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2250', 'DE', 'ohne Geokrets', '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');
@@ -241,6 +241,7 @@
// external searches.
$options['f_ignored'] = isset($_REQUEST['f_ignored']) ? $_REQUEST['f_ignored'] : 1;
$options['f_otherPlatforms'] = isset($_REQUEST['f_otherPlatforms']) ? $_REQUEST['f_otherPlatforms'] : 0;
$options['f_geokrets'] = isset($_REQUEST['f_geokrets']) ? $_REQUEST['f_geokrets'] : 0;
$options['expert'] = isset($_REQUEST['expert']) ? $_REQUEST['expert'] : 0; // Ocprop: 0
$options['showresult'] = isset($_REQUEST['showresult']) ? $_REQUEST['showresult'] : 0;
$options['output'] = isset($_REQUEST['output']) ? $_REQUEST['output'] : 'HTML'; // Ocprop: HTML
@@ -479,6 +480,7 @@
if (!isset($options['cachesize'])) $options['cachesize'] = '';
if (!isset($options['bbox'])) $options['bbox'] = false;
if (!isset($options['f_disabled'])) $options['f_disabled'] = 0;
if (!isset($options['f_geokrets'])) $options['f_geokrets'] = 0;
if (!isset($options['showresult'])) $options['showresult'] = 0;
if ($options['showresult'] == 1)
@@ -1017,6 +1019,12 @@
$sql_where[] = "`caches`.`wp_gc_maintained`=''";
}
if (!isset($options['f_geokrets'])) $options['f_geokrets']='0';
if ($options['f_geokrets'] != 0)
{
$sql_where[] = "(SELECT COUNT(*) FROM `gk_item_waypoint` WHERE `wp`=`caches`.`wp_oc`)";
}
if (!isset($options['country'])) $options['country']='';
if ($options['country'] != '')
{
@@ -1478,6 +1486,9 @@ function outputSearchForm($options)
$tpl->assign('f_otherPlatforms_checked', $options['f_otherPlatforms'] == 1);
$tpl->assign('hidopt_otherPlatforms', ($options['f_otherPlatforms'] == 1) ? '1' : '0');
$tpl->assign('f_geokrets_checked', $options['f_geokrets'] == 1);
$tpl->assign('hidopt_geokrets', ($options['f_geokrets'] == 1) ? '1' : '0');
if (isset($options['country']))
{
$tpl->assign('country', htmlspecialchars($options['country'], ENT_COMPAT, 'UTF-8'));
@@ -217,6 +217,7 @@ function eval_filtercookies(aValues)
document.getElementById('f_inactive').checked = fs[1].indexOf('D') >= 0;
// disabled and archived options have strange names and IDs for backward compatibility
document.getElementById('f_otherPlatforms').checked = fs[1].indexOf('M') >= 0;
document.getElementById('f_geokrets').checked = fs[1].indexOf('G') >= 0;
}
else if (fs[0] == 'rated')
{
@@ -304,6 +305,7 @@ function cookieSave(permanent_filter)
if (document.getElementById('f_disabled').checked) sFilter += 'T';
if (document.getElementById('f_inactive').checked) sFilter += 'D';
if (document.getElementById('f_otherPlatforms').checked) sFilter += 'M';
if (document.getElementById('f_geokrets').checked) sFilter += 'G';
sFilter += '/rated:' +
document.getElementById('terrainmin').value + ',' +
@@ -1928,6 +1930,7 @@ function reset_filter_values()
document.getElementById('f_disabled').checked = "";
document.getElementById('f_inactive').checked = "checked";
document.getElementById('f_otherPlatforms').checked = "";
document.getElementById('f_geokrets').checked = "";
document.getElementById('terrainmin').value = "0";
document.getElementById('terrainmax').value = "0";
@@ -2019,6 +2022,7 @@ function get_searchfilter_params(output, skipqueryid, zip)
sPostBody += document.getElementById('f_disabled').checked ? '&f_disabled=1' : '&f_disabled=0';
sPostBody += document.getElementById('f_inactive').checked ? '&f_inactive=1' : '&f_inactive=0';
sPostBody += document.getElementById('f_otherPlatforms').checked ? '&f_otherPlatforms=1' : '&f_otherPlatforms=0';
sPostBody += document.getElementById('f_geokrets').checked ? '&f_geokrets=1' : '&f_geokrets=0';
/* rating options
*/
@@ -2436,6 +2440,12 @@ function toggle_attribselection(bSaveCookies)
for compatiblity with old stored or external queries *}
</td>
</tr>
<tr>
<td style="white-space:nowrap">
<input type="checkbox" id="f_geokrets" name="f_geokrets" value="1" onchange="filter_changed()" class="checkbox" />
<label for="f_geokrets">{t}without Geokrets{/t}</label>
</td>
</tr>
</table>
</td>
@@ -193,6 +193,7 @@ function sync_options(element)
document.forms[formnames[i]].f_disabled.value = document.optionsform.f_disabled.checked ? 1 : 0;
document.forms[formnames[i]].f_ignored.value = document.optionsform.f_ignored.checked ? 1 : 0;
document.forms[formnames[i]].f_otherPlatforms.value = document.optionsform.f_otherPlatforms.checked ? 1 : 0;
document.forms[formnames[i]].f_geokrets.value = document.optionsform.f_geokrets.checked ? 1 : 0;
document.forms[formnames[i]].country.value = document.optionsform.country.value;
document.forms[formnames[i]].difficultymin.value = document.optionsform.difficultymin.value;
document.forms[formnames[i]].difficultymax.value = document.optionsform.difficultymax.value;
@@ -321,7 +322,8 @@ function switchAttributeCat2()
<input type="checkbox" name="f_disabled" value="1" id="l_disabled" class="checkbox" onclick="sync_options(this)" {if $f_disabled_checked}checked="checked"{/if} /> <label for="l_disabled">{t}disabled[pl]{/t}</label> &nbsp;
<nobr><input type="checkbox" name="f_inactive" value="1" id="l_inactive" class="checkbox" onclick="sync_options(this)" {if $f_inactive_checked}checked="checked"{/if} /> <label for="l_inactive">{t}archived[pl]{/t}</label></nobr> &nbsp;
<br />
<nobr><input type="checkbox" name="f_otherPlatforms" value="1" id="l_otherPlatforms" class="checkbox" onclick="sync_options(this)" {if $f_otherPlatforms_checked}checked="checked"{/if} /> <label for="l_otherPlatforms">{t}also listed at GC.com{/t}</label></nobr>
<nobr><input type="checkbox" name="f_otherPlatforms" value="1" id="l_otherPlatforms" class="checkbox" onclick="sync_options(this)" {if $f_otherPlatforms_checked}checked="checked"{/if} /> <label for="l_otherPlatforms">{t}also listed at GC.com{/t}</label></nobr> &nbsp;
<nobr><input type="checkbox" name="f_geokrets" value="1" id="l_geokrets" class="checkbox" onclick="sync_options(this)" {if $f_geokrets_checked}checked="checked"{/if} /> <label for="l_geokrets">{t}without Geokrets{/t}</label></nobr>
</td>
</tr>
@@ -488,6 +490,7 @@ function switchAttributeCat2()
<input type="hidden" name="f_disabled" value="{$hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{$hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{$hidopt_otherPlatforms}" />
<input type="hidden" name="f_geokrets" value="{$hidopt_geokrets}" />
<input type="hidden" name="country" value="{$country}" />
<input type="hidden" name="difficultymin" value="{$difficultymin}" />
<input type="hidden" name="difficultymax" value="{$difficultymax}" />
@@ -521,6 +524,7 @@ function switchAttributeCat2()
<input type="hidden" name="f_disabled" value="{$hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{$hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{$hidopt_otherPlatforms}" />
<input type="hidden" name="f_geokrets" value="{$hidopt_geokrets}" />
<input type="hidden" name="country" value="{$country}" />
<input type="hidden" name="cachetype" value="{$cachetype}" />
<input type="hidden" name="cachesize" value="{$cachesize}" />
@@ -556,6 +560,7 @@ function switchAttributeCat2()
<input type="hidden" name="f_disabled" value="{$hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{$hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{$hidopt_otherPlatforms}" />
<input type="hidden" name="f_geokrets" value="{$hidopt_geokrets}" />
<input type="hidden" name="country" value="{$country}" />
<input type="hidden" name="cachetype" value="{$cachetype}" />
<input type="hidden" name="cachesize" value="{$cachesize}" />
@@ -615,6 +620,7 @@ function switchAttributeCat2()
<input type="hidden" name="f_disabled" value="{$hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{$hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{$hidopt_otherPlatforms}" />
<input type="hidden" name="f_geokrets" value="{$hidopt_geokrets}" />
<input type="hidden" name="country" value="{$country}" />
<input type="hidden" name="cachetype" value="{$cachetype}" />
<input type="hidden" name="cachesize" value="{$cachesize}" />
@@ -649,6 +655,7 @@ function switchAttributeCat2()
<input type="hidden" name="f_disabled" value="{$hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{$hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{$hidopt_otherPlatforms}" />
<input type="hidden" name="f_geokrets" value="{$hidopt_geokrets}" />
<input type="hidden" name="country" value="{$country}" />
<input type="hidden" name="difficultymin" value="{$difficultymin}" />
<input type="hidden" name="difficultymax" value="{$difficultymax}" />
@@ -693,6 +700,7 @@ function switchAttributeCat2()
<input type="hidden" name="f_disabled" value="{$hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{$hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{$hidopt_otherPlatforms}" />
<input type="hidden" name="f_geokrets" value="{$hidopt_geokrets}" />
<input type="hidden" name="country" value="{$country}" />
<input type="hidden" name="difficultymin" value="{$difficultymin}" />
<input type="hidden" name="difficultymax" value="{$difficultymax}" />
@@ -727,6 +735,7 @@ function switchAttributeCat2()
<input type="hidden" name="f_disabled" value="{$hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{$hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{$hidopt_otherPlatforms}" />
<input type="hidden" name="f_geokrets" value="{$hidopt_geokrets}" />
<input type="hidden" name="country" value="{$country}" />
<input type="hidden" name="difficultymin" value="{$difficultymin}" />
<input type="hidden" name="difficultymax" value="{$difficultymax}" />
@@ -772,6 +781,7 @@ function switchAttributeCat2()
<input type="hidden" name="f_disabled" value="{$hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{$hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{$hidopt_otherPlatforms}" />
<input type="hidden" name="f_geokrets" value="{$hidopt_geokrets}" />
<input type="hidden" name="country" value="{$country}" />
<input type="hidden" name="difficultymin" value="{$difficultymin}" />
<input type="hidden" name="difficultymax" value="{$difficultymax}" />

0 comments on commit 44e2e1f

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