diff --git a/search.php b/search.php index 8063d7b5c..5b31bd6b0 100644 --- a/search.php +++ b/search.php @@ -150,30 +150,36 @@ class search_front extends e_shortcode } // Shortcodes ----------------------- - - function sc_search_main($parm = '') + + /** + * @param null $parm + * @example {SEARCH_MAIN: mode=basic} + * @return string + */ + function sc_search_main($parm = null) { $tp = e107::getParser(); $value = isset($_GET['q']) ? $tp->post_toForm($_GET['q']) : ""; - - $text = "
- - "; - if(defined('BOOTSTRAP') && BOOTSTRAP !== 4) + if(empty($parm['mode'])) { - $text .= ""; + $text .= ""; + } + + $text .= ''; } - $text .= ''; - $text .= "
@@ -273,7 +279,7 @@ class search_front extends e_shortcode { $dropdown .= ""; } - } + } foreach($this->search_info as $key => $value) @@ -296,7 +302,7 @@ class search_front extends e_shortcode else if ($this->search_prefs['selector'] == 1) { $checkboxes .= $PRE_CHECKBOXES."".$value['qtype'].$POST_CHECKBOXES; - } + } else { $checkboxes .= $PRE_CHECKBOXES."".$value['qtype'].$POST_CHECKBOXES; @@ -367,7 +373,25 @@ class search_front extends e_shortcode { $hiddenBlock = (!empty($_GET['t'])) ? "" : "class='e-hideme'"; $text = "
"; - $text .= $this->sc_search_advanced_block(vartrue($_GET['t'])); + + if(!empty($_GET['t']) ) + { + if(is_array($_GET['t'])) + { + foreach($_GET['t'] as $type => $tmp) + { + $text .= $this->sc_search_advanced_block($type); + } + + } + else + { + $text .= $this->sc_search_advanced_block($_GET['t']); + } + + } + + $text .= "
"; return $text; @@ -1074,7 +1098,7 @@ foreach ($search_info as $key => $value) } } -if (isset($_GET['t']) && isset($search_info[$_GET['t']]['advanced'])) +if (isset($_GET['t']) && is_string($_GET['t']) && isset($search_info[$_GET['t']]['advanced'])) { $SEARCH_VARS->SEARCH_TYPE_DISPLAY = ""; }