Skip to content
Permalink
Browse files

search form redesign; updates #35

and fixed fulltext options selection bug
  • Loading branch information...
following5 committed Jul 18, 2013
1 parent a7879a0 commit b7f8d0f1ae3ad0f8cf110c064e8ffa33d489d837

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -114,7 +114,7 @@
<a href="search1.php?queryid={queryid}&output=ovl&startat={startat}" title="{t}TOP50-Overlay .ovl{/t}">OVL</a>
<a href="search1.php?queryid={queryid}&output=txt&startat={startat}" title="{t}Textfile .txt{/t}">TXT</a>
<br />
<b>{t}Result {startatp1} to {endat} (as zip):{/t}</b>
<b>{t}Result {startatp1} to {endat} (as zip){/t}:</b>
<a href="search1.php?queryid={queryid}&output=gpx&startat={startat}&count=max&zip=1" title="{t}GPS Exchange Format .gpx{/t}">GPX</a>
<a href="search1.php?queryid={queryid}&output=loc&startat={startat}&count=max&zip=1" title="{t}Waypointfile .loc{/t}">LOC</a>
<a href="search1.php?queryid={queryid}&output=kml&startat={startat}&count=max&zip=1" title="{t}Google Earth .kml{/t}">KML</a>
@@ -20,6 +20,7 @@
sql_fetch_array($rs) ... mysql_fetch_array with charset conversion
sql_fetch_assoc($rs) ... mysql_fetch_assoc with charset conversion
sql_fetch_row($rs) ... mysql_fetch_row with charset conversion
sql_fetch_column($rs) ... fetch column with charset conversion
sql_fetch_assoc_table($rs) ... fetch_assoc for all rows
sql_temp_table($table) ... registers an placeholder for use as temporary
table and drop's temporary tables if
@@ -569,6 +570,19 @@ function sql_fetch_row($rs)
return $retval;
}
function sql_fetch_column($rs)
{
global $opt;
$result = array();
while ($r = mysql_fetch_row($rs))
if ($opt['charset']['iconv'] != 'UTF-8')
$result[] = iconv($opt['charset']['iconv'], 'UTF-8', $r[0]);
else
$result[] = $r[0];
mysql_free_result($rs);
return $result;
}
function sql_affected_rows()
{
global $db;
@@ -1374,6 +1374,7 @@ tr.searchresult td {
border-top: solid 1px black;
margin-bottom: 5px;
}

div.searchdiv {
width: 94%;
margin: 5px;
@@ -1384,6 +1385,29 @@ div.searchdiv {
border-radius: 5px;
}

div.searchdiv2 {
margin: 12px 22px 12px 4px;
padding: 5px;
border: solid 1px #cfdfed;
border-radius: 5px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}

div.searchdiv2 td {
line-height:1.8em;
}
div.searchdiv2 td.separator {
height: 0.5em;
}
div.searchdiv2 td.fieldlabel {
line-height: 1.4em;
padding-top: 0.3em;
padding-bottom: 0.3em;
vertical-align: top;
}

.pad5 { padding: 5px; }
.pad10 { padding: 10px; }
.pad15 { padding: 15px; }
@@ -1474,3 +1498,4 @@ p.editlog { font-weight: 400; display:inline; }
.newsymbol { background:#ff9d11; color:#fff; font-size:0.9em;}

label.disabled { color:grey; }
.formlabel { color:#555; font-weight:bold; line-height:1.5em !important}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -32,6 +32,7 @@
searchbynofilter
searchbycacheid
searchbywp
searchall
output options:
html display browsable search results list
@@ -219,6 +220,7 @@
unset($_REQUEST['searchbyort']);
unset($_REQUEST['searchbyfulltext']);
unset($_REQUEST['searchbynofilter']);
unset($_REQUEST['searchall']);
$_REQUEST[$_REQUEST['searchto']] = "hoho";
}
@@ -372,6 +374,10 @@
{
$options['searchtype'] = 'bynofilter';
}
elseif (isset($_REQUEST['searchall']))
{
$options['searchtype'] = 'all';
}
else
{
if (isset($_REQUEST['showresult']))
@@ -921,6 +927,12 @@
$sql_select[] = '`caches`.`cache_id` `cache_id`';
$sql_from = '`caches`';
}
else if ($options['searchtype'] == 'all')
{
$sql_select[] = '`caches`.`cache_id` `cache_id`';
$sql_from = '`caches`';
$sql_where[] = 'TRUE';
}
else
{
$tpl->error($unknown_searchtype);
@@ -1354,7 +1366,7 @@ function outputSearchForm($options)
$tpl->assign('formmethod', 'get');
// checkboxen
$tpl->assign('disable_nologin', !$login->logged_in());
$tpl->assign('logged_in', $login->logged_in());
$homecoords = ($login->logged_in() && sql_value_slave("SELECT `latitude`+`longitude` FROM user WHERE `user_id`='&1'", $login->userid) <> 0);
if (!$homecoords && isset($options['sort']) && $options['sort'] == 'bydistance')
@@ -1396,12 +1408,10 @@ function outputSearchForm($options)
$tpl->assign('orderRatingFirst_checked', $options['orderRatingFirst']);
$tpl->assign('hidopt_orderRatingFirst', $options['orderRatingFirst'] ? '1' : '0');
$tpl->assign('f_userfound_disabled', !$login->logged_in());
$tpl->assign('f_userfound_checked', $login->logged_in() && ($options['f_userfound'] == 1));
$tpl->assign('hidopt_userfound', ($options['f_userfound'] == 1) ? '1' : '0');
$tpl->assign('f_userowner_disabled', !$login->logged_in());
$tpl->assign('f_userowner_disabled', $login->logged_in() &&($options['f_userowner'] == 1));
$tpl->assign('f_userowner_checked', $login->logged_in() &&($options['f_userowner'] == 1));
$tpl->assign('hidopt_userowner', ($options['f_userowner'] == 1) ? '1' : '0');
$tpl->assign('f_inactive_checked', $options['f_inactive'] == 1);
@@ -1410,7 +1420,6 @@ function outputSearchForm($options)
$tpl->assign('f_disabled_checked', $options['f_disabled'] == 1);
$tpl->assign('hidopt_disabled', ($options['f_disabled'] == 1) ? '1' : '0');
$tpl->assign('f_ignored_disabled', !$login->logged_in());
$tpl->assign('f_ignored_checked', $login->logged_in() && ($options['f_ignored'] == 1));
$tpl->assign('hidopt_ignored', ($options['f_ignored'] == 1) ? '1' : '0');
@@ -1534,17 +1543,24 @@ function outputSearchForm($options)
$tpl->assign_rs('countryoptions',$rs);
sql_free_result($rs);
// cachetype + cachesize
$nCount = sql_value("SELECT COUNT(*) FROM `cache_type`", 0);
for ($n = 1; $n <= $nCount; $n++)
$tpl->assign('cachetype' . $n . 'checked', (strpos(';' . $options['cachetype'] . ';', ';' . $n . ';') !== false) || ($options['cachetype']==''));
$nCount = sql_value("SELECT COUNT(*) FROM `cache_size`", 0);
$tpl->assign('cachesizes', $nCount);
for ($n = 1; $n <= $nCount; $n++)
$tpl->assign('cachesize' . $n . 'checked', (strpos(';' . $options['cachesize'] . ';', ';' . $n . ';') !== false) || ($options['cachesize']==''));
// cachetype
$rs = sql("SELECT `id` FROM `cache_type` ORDER BY `ordinal`");
$rCachetypes = sql_fetch_assoc_table($rs);
foreach ($rCachetypes as &$rCachetype)
{
$rCachetype['checked'] = ($options['cachetype']=='') || (strpos(';' . $options['cachetype'] . ';', ';' . $rCachetype['id'] . ';') !== false);
$rCachetype['unchecked'] = !$rCachetype['checked'];
}
$tpl->assign('cachetypes',$rCachetypes);
$tpl->assign('cachetype', $options['cachetype']);
// cachesize
$cachesizes = array();
$rs = sql("SELECT `id` FROM `cache_size`");
while ($r = sql_fetch_assoc($rs))
$cachesizes[$r['id']]['checked'] = (strpos(';' . $options['cachesize'] . ';', ';' . $r['id'] . ';') !== false) || ($options['cachesize']=='');
sql_free_result($rs);
$tpl->assign('cachesizes', $cachesizes);
$tpl->assign('cachesize', $options['cachesize']);
// difficulty + terrain
@@ -1750,28 +1766,28 @@ function outputSearchForm($options)
$tpl->assign('hidopt_attribs_not', isset($options['cache_attribs_not']) ? implode(';', $options['cache_attribs_not']) : '');
$tpl->assign('fulltext', '');
$tpl->assign('ft_desc_checked', true);
$tpl->assign('ft_name_checked', true);
$tpl->assign('ft_desc_checked', false);
$tpl->assign('ft_logs_checked', false);
$tpl->assign('ft_pictures_checked', false);
$tpl->assign('ft_logs_checked', false);
// fulltext options
if ($options['searchtype'] == 'byfulltext')
{
if (!isset($options['fulltext'])) $options['fulltext'] = '';
$tpl->assign('fulltext', htmlspecialchars($options['fulltext'], ENT_COMPAT, 'UTF-8'));
if (isset($options['ft_name']) && $options['ft_name']==1)
$tpl->assign('ft_name_checked',true);
if (isset($options['ft_name']))
$tpl->assign('ft_name_checked',$options['ft_name']==1);
if (isset($options['ft_desc']) && $options['ft_desc']==1)
$tpl->assign('ft_desc_checked',true);
if (isset($options['ft_desc']))
$tpl->assign('ft_desc_checked',$options['ft_desc']==1);
if (isset($options['ft_logs']) && $options['ft_logs']==1)
$tpl->assign('ft_logs_checked',true);
if (isset($options['ft_logs']))
$tpl->assign('ft_logs_checked',$options['ft_logs']==1);
if (isset($options['ft_pictures']) && $options['ft_pictures']==1)
$tpl->assign('ft_pictures_checked',true);
if (isset($options['ft_pictures']))
$tpl->assign('ft_pictures_checked',$options['ft_pictures']==1);
}
// errormeldungen
@@ -7,25 +7,25 @@
{*cachetype=1 status=1 logtype=0 owner=false small=false*}

{if $cachetype==1}
<img src="resource2/{$opt.template.style}/images/cacheicon/unknown.gif" alt="{t}Unknown Geocache{/t}" title="{t}Unknown Geocache{/t}" border="0" width="32" height="32" class="icon32" id="viewcache-cacheicon" />
<img src="resource2/{$opt.template.style}/images/cacheicon/unknown{if $greyed}-grey{/if}.gif" alt="{t}Unknown Geocache{/t}" title="{t}Unknown Geocache{/t}" border="0" width="32" height="32" class="icon32" id="{if $typeid}cacheicon{$cachetype}{else}viewcache-cacheicon{/if}" onclick="{$onclick}"/>
{elseif $cachetype==2}
<img src="resource2/{$opt.template.style}/images/cacheicon/traditional.gif" alt="{t}Traditional Geocache{/t}" title="{t}Traditional Geocache{/t}" border="0" width="32" height="32" class="icon32" id="viewcache-cacheicon" />
<img src="resource2/{$opt.template.style}/images/cacheicon/traditional{if $greyed}-grey{/if}.gif" alt="{t}Traditional Geocache{/t}" title="{t}Traditional Geocache{/t}" border="0" width="32" height="32" class="icon32" id="{if $typeid}cacheicon{$cachetype}{else}viewcache-cacheicon{/if}" onclick="{$onclick}" />
{elseif $cachetype==3} {* Ocprop: \/cacheicon\/multi\.gif"\s+alt="Multicache" *}
<img src="resource2/{$opt.template.style}/images/cacheicon/multi.gif" alt="{t}Multicache{/t}" title="{t}Multicache{/t}" border="0" width="32" height="32" class="icon32" id="viewcache-cacheicon" />
<img src="resource2/{$opt.template.style}/images/cacheicon/multi{if $greyed}-grey{/if}.gif" alt="{t}Multicache{/t}" title="{t}Multicache{/t}" border="0" width="32" height="32" class="icon32" id="{if $typeid}cacheicon{$cachetype}{else}viewcache-cacheicon{/if}" onclick="{$onclick}" />
{elseif $cachetype==4}
<img src="resource2/{$opt.template.style}/images/cacheicon/virtual.gif" alt="{t}Virtual Geocache{/t}" title="{t}Virtual Geocache{/t}" border="0" width="32" height="32" class="icon32" id="viewcache-cacheicon" />
<img src="resource2/{$opt.template.style}/images/cacheicon/virtual{if $greyed}-grey{/if}.gif" alt="{t}Virtual Geocache{/t}" title="{t}Virtual Geocache{/t}" border="0" width="32" height="32" class="icon32" id="{if $typeid}cacheicon{$cachetype}{else}viewcache-cacheicon{/if}" onclick="{$onclick}" />
{elseif $cachetype==5}
<img src="resource2/{$opt.template.style}/images/cacheicon/webcam.gif" alt="{t}Webcam Geocache{/t}" title="{t}Webcam Geocache{/t}" border="0" width="32" height="32" class="icon32" id="viewcache-cacheicon" />
<img src="resource2/{$opt.template.style}/images/cacheicon/webcam{if $greyed}-grey{/if}.gif" alt="{t}Webcam Geocache{/t}" title="{t}Webcam Geocache{/t}" border="0" width="32" height="32" class="icon32" id="{if $typeid}cacheicon{$cachetype}{else}viewcache-cacheicon{/if}" onclick="{$onclick}" />
{elseif $cachetype==6}
<img src="resource2/{$opt.template.style}/images/cacheicon/event.gif" alt="{t}Event Geocache{/t}" title="{t}Event Geocache{/t}" border="0" width="32" height="32" class="icon32" id="viewcache-cacheicon" />
<img src="resource2/{$opt.template.style}/images/cacheicon/event{if $greyed}-grey{/if}.gif" alt="{t}Event Geocache{/t}" title="{t}Event Geocache{/t}" border="0" width="32" height="32" class="icon32" id="{if $typeid}cacheicon{$cachetype}{else}viewcache-cacheicon{/if}" onclick="{$onclick}" />
{elseif $cachetype==7}
<img src="resource2/{$opt.template.style}/images/cacheicon/mystery.gif" alt="{t}Quizcache{/t}" title="{t}Quizcache{/t}" border="0" width="32" height="32" class="icon32" id="viewcache-cacheicon" />
<img src="resource2/{$opt.template.style}/images/cacheicon/mystery{if $greyed}-grey{/if}.gif" alt="{t}Quizcache{/t}" title="{t}Quizcache{/t}" border="0" width="32" height="32" class="icon32" id="{if $typeid}cacheicon{$cachetype}{else}viewcache-cacheicon{/if}" onclick="{$onclick}" />
{elseif $cachetype==8}
<img src="resource2/{$opt.template.style}/images/cacheicon/mathe.gif" alt="{t}Math/Physics Geocache{/t}" title="{t}Math/Physics Geocache{/t}" border="0" width="32" height="32" class="icon32" id="viewcache-cacheicon" />
<img src="resource2/{$opt.template.style}/images/cacheicon/mathe{if $greyed}-grey{/if}.gif" alt="{t}Math/Physics Geocache{/t}" title="{t}Math/Physics Geocache{/t}" border="0" width="32" height="32" class="icon32" id="{if $typeid}cacheicon{$cachetype}{else}viewcache-cacheicon{/if}" onclick="{$onclick}" />
{elseif $cachetype==9}
<img src="resource2/{$opt.template.style}/images/cacheicon/moving.gif" alt="{t}Moving Geocache{/t}" title="{t}Moving Geocache{/t}" border="0" width="32" height="32" class="icon32" id="viewcache-cacheicon" />
<img src="resource2/{$opt.template.style}/images/cacheicon/moving{if $greyed}-grey{/if}.gif" alt="{t}Moving Geocache{/t}" title="{t}Moving Geocache{/t}" border="0" width="32" height="32" class="icon32" id="{if $typeid}cacheicon{$cachetype}{else}viewcache-cacheicon{/if}" onclick="{$onclick}" />
{elseif $cachetype==10}
<img src="resource2/{$opt.template.style}/images/cacheicon/drivein.gif" alt="{t}Drive-In Geocache{/t}" title="{t}Drive-In Geocache{/t}" border="0" width="32" height="32" class="icon32" id="viewcache-cacheicon" />
<img src="resource2/{$opt.template.style}/images/cacheicon/drivein{if $greyed}-grey{/if}.gif" alt="{t}Drive-In Geocache{/t}" title="{t}Drive-In Geocache{/t}" border="0" width="32" height="32" class="icon32" id="{if $typeid}cacheicon{$cachetype}{else}viewcache-cacheicon{/if}" onclick="{$onclick}" />
{else}
&nbsp;
{/if}
Oops, something went wrong.

0 comments on commit b7f8d0f

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