' . "\n"; } else { $done = TRUE; $args = func_get_args(); return plugin_search_search_form('', '', $args); } } function plugin_search_action() { global $post, $vars, $_title_result, $_title_search, $_msg_searching; if (PLUGIN_SEARCH_DISABLE_GET_ACCESS) { $s_word = isset($post['word']) ? htmlsc($post['word']) : ''; } else { $s_word = isset($vars['word']) ? htmlsc($vars['word']) : ''; } if (strlen($s_word) > PLUGIN_SEARCH_MAX_LENGTH) { unset($vars['word']); // Stop using $_msg_word at lib/html.php die_message('Search words too long'); } $type = isset($vars['type']) ? $vars['type'] : ''; $base = isset($vars['base']) ? $vars['base'] : ''; if ($s_word != '') { // Search $msg = str_replace('$1', $s_word, $_title_result); $body = do_search($vars['word'], $type, FALSE, $base); } else { // Init unset($vars['word']); // Stop using $_msg_word at lib/html.php $msg = $_title_search; $body = '
' . "\n" . $_msg_searching . "\n"; } // Show search form $bases = ($base == '') ? array() : array($base); $body .= plugin_search_search_form($s_word, $type, $bases); return array('msg'=>$msg, 'body'=>$body); } function plugin_search_search_form($s_word = '', $type = '', $bases = array()) { global $script, $_btn_and, $_btn_or, $_btn_search; global $_search_pages, $_search_all; $and_check = $or_check = ''; if ($type == 'OR') { $or_check = ' checked="checked"'; } else { $and_check = ' checked="checked"'; } $base_option = ''; if (!empty($bases)) { $base_msg = ''; $_num = 0; $check = ' checked="checked"'; foreach($bases as $base) { ++$_num; if (PLUGIN_SEARCH_MAX_BASE < $_num) break; $label_id = '_p_search_base_id_' . $_num; $s_base = htmlsc($base); $base_str = '' . $s_base . ''; $base_label = str_replace('$1', $base_str, $_search_pages); $base_msg .=<< EOD; $check = ''; } $base_msg .=<< EOD; $base_option = '
' . $base_msg . '
'; } return <<
 
$base_option EOD; } ?>