From cd90f63d7832aa9fdde1c3f6cc40dfb2959cea67 Mon Sep 17 00:00:00 2001 From: following Date: Mon, 4 Mar 2013 06:54:40 +0100 Subject: [PATCH] fixed searchfilter-bug introduced with advanced map filtering; fixed table def --- htdocs/doc/sql/tables/profile_options.sql | 2 +- htdocs/search.php | 4 ---- htdocs/templates2/ocstyle/map2.tpl | 4 ++++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/doc/sql/tables/profile_options.sql b/htdocs/doc/sql/tables/profile_options.sql index 20028b08..44480938 100644 --- a/htdocs/doc/sql/tables/profile_options.sql +++ b/htdocs/doc/sql/tables/profile_options.sql @@ -9,6 +9,6 @@ CREATE TABLE `profile_options` ( `check_regex` varchar(255) default NULL, `option_order` int(11) NOT NULL default '100', `option_input` varchar(20) NOT NULL default 'text', - `optionset`, tinyint(2) NOT NULL default '1', + `optionset` tinyint(2) NOT NULL default '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='static content' ; diff --git a/htdocs/search.php b/htdocs/search.php index 2ee80aa8..7237443b 100644 --- a/htdocs/search.php +++ b/htdocs/search.php @@ -920,8 +920,6 @@ $sql_where[] = '`caches`.`type` IN (' . implode(',', $types) . ')'; } } - else - $sql_where[] = '0'; if($options['cachesize'] != '') { @@ -932,8 +930,6 @@ $sql_where[] = '`caches`.`size` IN (' . implode(',', $sizes) . ')'; } } - else - $sql_where[] = '0'; if ($options['difficultymin'] != 0) { diff --git a/htdocs/templates2/ocstyle/map2.tpl b/htdocs/templates2/ocstyle/map2.tpl index d9864368..b6c2a1c8 100644 --- a/htdocs/templates2/ocstyle/map2.tpl +++ b/htdocs/templates2/ocstyle/map2.tpl @@ -1270,6 +1270,9 @@ function get_searchfilter_params(output, skipqueryid, zip) sCacheTypes += i; } } + // search.php will traditionally ignore 'cachetype' option if it is empty, + // so we must force it to find nothing if nothing is selected here: + if (sCacheTypes == '') sCacheTypes = 'none'; sPostBody += '&cachetype=' + sCacheTypes; /* cachesize @@ -1283,6 +1286,7 @@ function get_searchfilter_params(output, skipqueryid, zip) sCacheSizes += i; } } + if (sCacheSizes == '') sCacheSizes = 'none'; sPostBody += '&cachesize=' + sCacheSizes; /* hide options