getArray('search_prefs'); $search_handlers['news'] = ADLAN_0; $search_handlers['comments'] = SEALAN_6; $search_handlers['users'] = SEALAN_7; $search_handlers['downloads'] = ADLAN_24; $search_handlers['pages'] = SEALAN_39; preg_match("/^(.*?)($|-)/", mysql_get_server_info(), $mysql_version); if (version_compare($mysql_version[1], '4.0.1', '<')) { $mysql_supported = false; } else { $mysql_supported = true; } foreach($pref['e_search_list'] as $file) { if (is_readable(e_PLUGIN.$file."/e_search.php") && !isset($search_prefs['plug_handlers'][$file])) { $search_prefs['plug_handlers'][$file] = array('class' => 0, 'pre_title' => 1, 'pre_title_alt' => '', 'chars' => 150, 'results' => 10); $save_search = TRUE; } if (is_readable(e_PLUGIN.$file.'/search/search_comments.php') && !isset($search_prefs['comments_handlers'][$file])) { include_once(e_PLUGIN.$file.'/search/search_comments.php'); $search_prefs['comments_handlers'][$file] = array('id' => $comments_type_id, 'class' => '0', 'dir' => $file); unset($comments_type_id); $save_search = TRUE; } } if (!isset($search_prefs['boundary'])) { $search_prefs['boundary'] = 1; $save_search = TRUE; } if ($save_search) { $serialpref = addslashes(serialize($search_prefs)); $sql -> db_Update("core", "e107_value='".$serialpref."' WHERE e107_name='search_prefs'"); } if (isset($_POST['update_main'])) { foreach($search_handlers as $s_key => $s_value) { $search_prefs['core_handlers'][$s_key]['class'] = $_POST['core_handlers'][$s_key]['class']; $search_prefs['core_handlers'][$s_key]['order'] = $_POST['core_handlers'][$s_key]['order']; } foreach ($search_prefs['plug_handlers'] as $plug_dir => $active) { $search_prefs['plug_handlers'][$plug_dir]['class'] = $_POST['plug_handlers'][$plug_dir]['class']; $search_prefs['plug_handlers'][$plug_dir]['order'] = $_POST['plug_handlers'][$plug_dir]['order']; } foreach ($search_prefs['comments_handlers'] as $key => $value) { $search_prefs['comments_handlers'][$key]['class'] = $_POST['comments_handlers'][$key]['class']; } $search_prefs['google'] = $_POST['google']; $tmp = addslashes(serialize($search_prefs)); admin_update($sql -> db_Update("core", "e107_value='".$tmp."' WHERE e107_name='search_prefs'")); } if (isset($_POST['update_handler'])) { if ($query[1] == 'c') { $handler_type = 'core_handlers'; } else if ($query[1] == 'p') { $handler_type = 'plug_handlers'; } $search_prefs[$handler_type][$query[2]]['class'] = $_POST['class']; $search_prefs[$handler_type][$query[2]]['chars'] = $tp -> toDB($_POST['chars']); $search_prefs[$handler_type][$query[2]]['results'] = $tp -> toDB($_POST['results']); $search_prefs[$handler_type][$query[2]]['pre_title'] = $_POST['pre_title']; $search_prefs[$handler_type][$query[2]]['pre_title_alt'] = $tp -> toDB($_POST['pre_title_alt']); $tmp = addslashes(serialize($search_prefs)); admin_update($sql -> db_Update("core", "e107_value='".$tmp."' WHERE e107_name='search_prefs'")); } if (isset($_POST['update_prefs'])) { $search_prefs['relevance'] = $_POST['relevance']; $search_prefs['user_select'] = $_POST['user_select']; $search_prefs['multisearch'] = $_POST['multisearch']; $search_prefs['selector'] = $_POST['selector']; $search_prefs['time_restrict'] = $_POST['time_restrict']; $search_prefs['time_secs'] = $_POST['time_secs'] > 300 ? 300 : $tp -> toDB($_POST['time_secs']); if ($_POST['search_sort'] == 'mysql') { if ($mysql_supported) { $search_prefs['mysql_sort'] = TRUE; } else { $search_prefs['mysql_sort'] = FALSE; $ns -> tablerender(LAN_ERROR, "
".SEALAN_33."
".SEALAN_34." ".$mysql_version[1]."
"); } } else { $search_prefs['mysql_sort'] = FALSE; } $search_prefs['php_limit'] = $tp -> toDB($_POST['php_limit']); $search_prefs['boundary'] = $_POST['boundary']; $tmp = addslashes(serialize($search_prefs)); admin_update($sql -> db_Update("core", "e107_value='".$tmp."' WHERE e107_name='search_prefs'")); $pref['search_restrict'] = $_POST['search_restrict']; $pref['search_highlight'] = $_POST['search_highlight']; save_prefs(); } require_once(e_HANDLER."form_handler.php"); $rs = new form; $handlers_total = count($search_prefs['core_handlers']) + count($search_prefs['plug_handlers']); if ($query[0] == 'settings') { $text = "
"; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= "
".SEALAN_20."
".SEALAN_15.": ".r_userclass("search_restrict", $pref['search_restrict'], "off", "public,guest,nobody,member,admin,classes")."
".SEALAN_30." ".SEALAN_16."   ".SEALAN_17."
".SEALAN_10." ".SEALAN_16."   ".SEALAN_17."
".SEALAN_11." ".SEALAN_16."   ".SEALAN_17."
".SEALAN_19." ".SEALAN_16."   ".SEALAN_17."
".SEALAN_35." ".SEALAN_36."   ".SEALAN_37."   ".SEALAN_38."
".SEALAN_12." ".SEALAN_17."   ".SEALAN_13." ".$rs -> form_text("time_secs", 3, $tp -> toForm($search_prefs['time_secs']), 3)." ".SEALAN_14."
".SEALAN_3."
".SEALAN_49."
".$rs -> form_radio('search_sort', 'mysql', ($search_prefs['mysql_sort'] == TRUE ? 1 : 0), 'MySql', ($mysql_supported ? "" : "disabled='true'"))."MySql
".$rs -> form_radio('search_sort', 'php', ($search_prefs['mysql_sort'] == TRUE ? 0 : 1)).SEALAN_31." ".$rs -> form_text("php_limit", 5, $tp -> toForm($search_prefs['php_limit']), 5)." ".SEALAN_32."
".SEALAN_47."
".SEALAN_48."
".SEALAN_16."   ".SEALAN_17."
".$rs -> form_button("submit", "update_prefs", LAN_UPDATE)."
"; } else if ($query[0] == 'edit') { if ($query[1] == 'c') { $handlers = $search_handlers; $handler_type = 'core_handlers'; } else if ($query[1] == 'p') { $handlers = $search_prefs['plug_handlers']; $handler_type = 'plug_handlers'; } $text = "
"; $text .= ""; $text .= ""; $text .= ""; $text .= "
".SEALAN_43.": ".$handlers[$query[2]]."
".SEALAN_44.": "; $text .= r_userclass("class", $search_prefs[$handler_type][$query[2]]['class'], "off", "public,guest,nobody,member,admin,classes"); $text .= "
".SEALAN_45.": ".$rs -> form_text("results", 4, $tp -> toForm($search_prefs[$handler_type][$query[2]]['results']), 4)."
".SEALAN_46.": ".$rs -> form_text("chars", 4, $tp -> toForm($search_prefs[$handler_type][$query[2]]['chars']), 4)."
".SEALAN_26.": ".SEALAN_22."
".SEALAN_17."
".SEALAN_23."   ".$rs -> form_text("pre_title_alt", 20, $tp -> toForm($search_prefs[$handler_type][$query[2]]['pre_title_alt']))."
".$rs -> form_button("submit", "update_handler", LAN_UPDATE)."
"; } else { $text = "
"; $text .= ""; $text .= ""; foreach($search_handlers as $key => $value) { $text .= ""; $text .= ""; } foreach ($search_prefs['plug_handlers'] as $plug_dir => $active) { if(is_readable(e_PLUGIN.$plug_dir."/e_search.php")){ require_once(e_PLUGIN.$plug_dir."/e_search.php"); } $text .= ""; $text .= ""; } $text .= ""; $text .= ""; $text .= "
".SEALAN_21."
".SEALAN_24." ".SEALAN_25." ".LAN_ORDER." ".LAN_EDIT."
".$value." "; $text .= r_userclass("core_handlers[".$key."][class]", $search_prefs['core_handlers'][$key]['class'], "off", "public,guest,nobody,member,admin,classes"); $text .= ""; $text .= " ".ADMIN_EDIT_ICON."
".$search_info[0]['qtype']." "; $text .= r_userclass("plug_handlers[".$plug_dir."][class]", $search_prefs['plug_handlers'][$plug_dir]['class'], "off", "public,guest,nobody,member,admin,classes"); unset($search_info); $text .= ""; $text .= " ".ADMIN_EDIT_ICON."
Google "; $sel = (isset($search_prefs['google']) && $search_prefs['google']) ? " checked='checked'" : ""; $text .= r_userclass("google", $search_prefs['google'], "off", "public,guest,nobody,member,admin,classes"); $text .= "
".$rs -> form_button("submit", "update_main", LAN_UPDATE)."

"; $text .= "
"; $text .= ""; $text .= ""; foreach ($search_prefs['comments_handlers'] as $key => $value) { $path = ($value['dir'] == 'core') ? e_HANDLER.'search/comments_'.$key.'.php' : e_PLUGIN.$value['dir'].'/search/search_comments.php'; if(is_readable($path)){ require_once($path); } $text .= ""; unset($comments_title); } $text .= ""; $text .= "
".SEALAN_18."
".SEALAN_24." ".SEALAN_25."
".$comments_title." "; $text .= r_userclass("comments_handlers[".$key."][class]", $search_prefs['comments_handlers'][$key]['class'], "off", "public,guest,nobody,member,admin,classes"); $text .= "
".$rs -> form_button("submit", "update_main", LAN_UPDATE)."
"; } $ns -> tablerender(SEALAN_1, $text); require_once("footer.php"); function search_adminmenu() { global $query; if ($query[0] == '' || $query[0] == 'main') { $action = "main"; } else if ($query[0] == 'settings') { $action = "settings"; } $var['main']['text'] = SEALAN_41; $var['main']['link'] = e_SELF; $var['settings']['text'] = SEALAN_42; $var['settings']['link'] = e_SELF."?settings"; show_admin_menu(SEALAN_40, $action, $var); } ?>