📄 init.inc
字号:
} if ($site) udm_set_agent_param($udm_agent, UDM_PARAM_SITEID, $site); $detectclones = strtolower($detectclones); if ($detectclones == 'yes') { udm_set_agent_param($udm_agent, UDM_PARAM_DETECT_CLONES, UDM_ENABLED); } else { udm_set_agent_param($udm_agent, UDM_PARAM_DETECT_CLONES, UDM_DISABLED); } if ($m == 'any') { udm_set_agent_param($udm_agent, UDM_PARAM_SEARCH_MODE, UDM_MODE_ANY); } elseif ($m == 'all') { udm_set_agent_param($udm_agent, UDM_PARAM_SEARCH_MODE, UDM_MODE_ALL); } elseif ($m == 'bool') { udm_set_agent_param($udm_agent, UDM_PARAM_SEARCH_MODE, UDM_MODE_BOOL); } elseif ($m == 'phrase') { udm_set_agent_param($udm_agent, UDM_PARAM_SEARCH_MODE, UDM_MODE_PHRASE); } else { udm_set_agent_param($udm_agent, UDM_PARAM_SEARCH_MODE, UDM_MODE_ALL); } if ($wm == 'wrd') { udm_set_agent_param($udm_agent, UDM_PARAM_WORD_MATCH, UDM_MATCH_WORD); } elseif ($wm == 'beg') { udm_set_agent_param($udm_agent, UDM_PARAM_WORD_MATCH, UDM_MATCH_BEGIN); } elseif ($wm == 'end') { udm_set_agent_param($udm_agent, UDM_PARAM_WORD_MATCH, UDM_MATCH_END); } elseif ($wm == 'sub') { udm_set_agent_param($udm_agent, UDM_PARAM_WORD_MATCH, UDM_MATCH_SUBSTR); } else { udm_set_agent_param($udm_agent, UDM_PARAM_WORD_MATCH, UDM_MATCH_WORD); } if ($minwordlength > 0) { udm_set_agent_param($udm_agent, UDM_PARAM_MIN_WORD_LEN, $minwordlength); } else { udm_set_agent_param($udm_agent, UDM_PARAM_MIN_WORD_LEN, 1); } if ($maxwordlength > 0) { udm_set_agent_param($udm_agent, UDM_PARAM_MAX_WORD_LEN, $maxwordlength); } else { udm_set_agent_param($udm_agent, UDM_PARAM_MAX_WORD_LEN, 32); } if ($vardir != '') udm_set_agent_param($udm_agent, UDM_PARAM_VARDIR, $vardir); if ($datadir != '') udm_set_agent_param($udm_agent, UDM_PARAM_VARDIR, $datadir); if ($wf != '') { udm_set_agent_param($udm_agent, UDM_PARAM_WEIGHT_FACTOR, $wf); } for ($i = 0; $i < count($ul_arr); $i += 1) { $temp_ul = $ul_arr[$i]; if ($temp_ul != '') { $auto_wild = strtolower($auto_wild); if (($auto_wild == 'yes') || ($auto_wild == '')) { if ((substr($temp_ul, 0, 7) == 'http://') || (substr($temp_ul, 0, 8) == 'https://') || (substr($temp_ul, 0, 7) == 'news://') || (substr($temp_ul, 0, 6) == 'ftp://')) { udm_add_search_limit($udm_agent, UDM_LIMIT_URL, "$temp_ul%"); } else { udm_add_search_limit($udm_agent, UDM_LIMIT_URL, "%$temp_ul%"); } } else { udm_add_search_limit($udm_agent, UDM_LIMIT_URL, $temp_ul); } } } for ($i = 0; $i < count($tag_arr); $i += 1) { $temp_tag = $tag_arr[$i]; if ($temp_tag != '') udm_add_search_limit($udm_agent, UDM_LIMIT_TAG, $temp_tag); } for ($i = 0; $i < count($type_arr); $i += 1) { $temp_type = $type_arr[$i]; if ($temp_type != '') udm_add_search_limit($udm_agent, UDM_LIMIT_TYPE, $temp_type); } for ($i = 0; $i < count($cat_arr); $i += 1) { $temp_cat = $cat_arr[$i]; if ($temp_cat != '') udm_add_search_limit($udm_agent, UDM_LIMIT_CAT, $temp_cat); } for ($i = 0; $i < count($lang_arr); $i += 1) { $temp_lang = $lang_arr[$i]; if ($temp_lang != '') udm_add_search_limit($udm_agent, UDM_LIMIT_LANG, $temp_lang); } if (function_exists('udm_set_agent_param_ex')) { if ($excerptsize > 0) udm_set_agent_param_ex($udm_agent, 'ExcerptSize', $excerptsize); if ($excerptpadding > 0) udm_set_agent_param_ex($udm_agent, 'ExcerptPadding', $excerptpadding); if ($dateformat != '') udm_set_agent_param_ex($udm_agent, 'DateFormat', $dateformat); if ($s != '') udm_set_agent_param_ex($udm_agent, 's', $s); if ($resultslimit > 0) udm_set_agent_param_ex($udm_agent, 'resultslimit', $resultslimit); if (($dt == 'back') || ($dt == 'er') || ($dt == 'range')) { udm_set_agent_param_ex($udm_agent, 'dt', $dt); udm_set_agent_param_ex($udm_agent, 'dx', $dx); udm_set_agent_param_ex($udm_agent, 'dm', $dm); udm_set_agent_param_ex($udm_agent, 'dy', $dy); udm_set_agent_param_ex($udm_agent, 'dd', $dd); udm_set_agent_param_ex($udm_agent, 'dp', $dp); udm_set_agent_param_ex($udm_agent, 'db', $db); udm_set_agent_param_ex($udm_agent, 'de', $de); } $suggest = strtolower($suggest); if ($suggest == 'yes') udm_set_agent_param_ex($udm_agent, 'suggest', 'yes'); } if (($dt == 'back') && ($dp != '0')) { $recent_time = format_dp($dp); if ($recent_time != 0) { $dl = time() - $recent_time; udm_add_search_limit($udm_agent, UDM_LIMIT_DATE, ">$dl"); } } elseif ($dt == 'er') { $recent_time = mktime(0, 0, 0, ($dm +1), $dd, $dy); if ($dx == -1) { udm_add_search_limit($udm_agent, UDM_LIMIT_DATE, "<$recent_time"); } elseif ($dx == 1) { udm_add_search_limit($udm_agent, UDM_LIMIT_DATE, ">$recent_time"); } } elseif ($dt == 'range') { $begin_time = format_userdate($db); if ($begin_time) udm_add_search_limit($udm_agent, UDM_LIMIT_DATE, ">$begin_time"); $end_time = format_userdate($de); if ($end_time) udm_add_search_limit($udm_agent, UDM_LIMIT_DATE, "<$end_time"); } print_template('top'); flush(); $ispellmode = strtolower($ispellmode); if ($ispellmode == 'db') { if (!udm_load_ispell_data($udm_agent, UDM_ISPELL_TYPE_DB, '', '', 1)) { print_error_local(udm_error($udm_agent)); } else $have_spell_flag = 1; } elseif ($ispellmode == 'server') { if (!udm_load_ispell_data($udm_agent, UDM_ISPELL_TYPE_SERVER, $spell_host, '', 1)) { print_error_local("Error loading ispell data from server $spell_host"); } else $have_spell_flag = 1; } elseif (($ispellmode == 'text') && ($sp)) { reset($affix_file); while (list ($t_lang, $file) = each($affix_file)) { $param = array(); if (preg_match("/(.+)\;(.+)/", $file, $param)) { $t_charset = trim($param[1]); $t_file = trim($param[2]); if (!udm_load_ispell_data($udm_agent, UDM_ISPELL_TYPE_AFFIX, $t_lang, $t_charset, $t_file, 0)) { print_error_local("Error loading ispell data from file"); } else $have_spell_flag = 1; } $temp = $spell_file[$t_lang]; for ($i = 0; $i < count($temp); $i += 1) { if (preg_match("/(.+)\;(.+)/", $temp[$i], $param)) { $t_charset = trim($param[1]); $t_file = trim($param[2]); if (!udm_load_ispell_data($udm_agent, UDM_ISPELL_TYPE_SPELL, $t_lang, $t_charset, $t_file, 1)) { print_error_local("Error loading ispell data from file"); } else $have_spell_flag = 1; } } } } udm_parse_query_string($udm_agent, $q_string);}/** * Some variation of the init function? * */function init_cc() { global $q, $q_string, $query_orig, $have_query_flag, $have_spell_flag, $auto_wild; global $tag, $tag_arr, $cat, $cat_arr, $np, $ps, $lang, $lang_arr, $wm, $wf, $ul, $m; global $dt, $dp, $dx, $dm, $dd, $dy, $db, $de, $s, $resultslimit; global $trackquery, $localcharset, $browsercharset, $stopwordtable_arr, $stopwordfile_arr; global $minwordlength, $maxwordlength, $phrase, $cache; global $ispelluseprefixes, $crosswords, $ispellmode, $spell_host; global $affix_file, $spell_file, $vardir, $datadir, $sp, $sy; global $dbaddr, $dbmode, $udm_agent, $hlbeg, $hlend, $detectclones; global $phpver, $synonym_arr, $searchd_arr, $ul_arr; global $REMOTE_ADDR, $storedaddr, $type_arr, $type, $groupbysite, $site; global $excerptsize, $excerptpadding, $dateformat, $suggest; //parse the $QUERY_STRING global variable and puts pieces into corresponding arrays ParseQString(); //read the template file read_template(); $udm_agent = udm_alloc_agent_array($dbaddr); if ($localcharset != '') { udm_set_agent_param($udm_agent, UDM_PARAM_CHARSET, $localcharset); if (!udm_check_charset($udm_agent, $localcharset)) { print_template('top'); flush(); print_error_local("Incorrect localcharset $localcharset"); } } if ($localcharset == '') udm_set_agent_param($udm_agent, UDM_PARAM_CHARSET, 'utf-8'); if ($browsercharset != '') { if (!udm_check_charset($udm_agent, $browsercharset)) { print_template('top'); flush(); print_error_local("Incorrect browsercharset $browsercharset"); } udm_set_agent_param($udm_agent, UDM_PARAM_BROWSER_CHARSET, $browsercharset); header("Content-Type: text/html; charset=$browsercharset"); } else { udm_set_agent_param($udm_agent, UDM_PARAM_BROWSER_CHARSET, 'utf-8'); header("Content-Type: text/html; charset=utf-8"); } if ($hlbeg == '') $hlbeg = '<font color="000088"><b>'; udm_set_agent_param($udm_agent, UDM_PARAM_HLBEG, $hlbeg); if ($hlend == '') $hlend = '</b></font>'; udm_set_agent_param($udm_agent, UDM_PARAM_HLEND, $hlend); udm_set_agent_param($udm_agent, UDM_PARAM_QSTRING, $q_string); udm_set_agent_param($udm_agent, UDM_PARAM_REMOTE_ADDR, $REMOTE_ADDR); if ($have_query_flag) udm_set_agent_param($udm_agent, UDM_PARAM_QUERY, $query_orig); if (function_exists('udm_set_agent_param_ex')) { if ($dateformat != '') udm_set_agent_param_ex($udm_agent, 'DateFormat', $dateformat); } udm_parse_query_string($udm_agent, $q_string);}?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -