init.inc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. <?php
  2. /**
  3. * Initialisation code + library of functions to process to the initialisation in
  4. * a varied set of ways.
  5. * This script is a modified version that can only be used with the php extension >= 3.2.32
  6. * and PHP version 4.2 or higher
  7. */
  8. /**
  9. * Faking the register_globals code - very bad thing - should escape all vars
  10. */
  11. if (isset ($HTTP_GET_VARS)) {
  12. while (list ($var, $val) = each($HTTP_GET_VARS)) {
  13. $$var = $val;
  14. }
  15. }
  16. if (isset ($HTTP_POST_VARS)) {
  17. while (list ($var, $val) = each($HTTP_POST_VARS)) {
  18. $$var = $val;
  19. }
  20. }
  21. if (isset ($HTTP_COOKIE_VARS)) {
  22. while (list ($var, $val) = each($HTTP_COOKIE_VARS)) {
  23. $$var = $val;
  24. }
  25. }
  26. if (isset ($HTTP_SERVER_VARS)) {
  27. while (list ($var, $val) = each($HTTP_SERVER_VARS)) {
  28. $$var = $val;
  29. }
  30. }
  31. $self = $PHP_SELF;
  32. /**
  33. * Setting default values for variables that will be used globally
  34. */
  35. if ($ps == "")
  36. $ps = 20;
  37. if ($np == "")
  38. $np = 0;
  39. if ($o == "")
  40. $o = 0;
  41. if ($resultslimit <= 0)
  42. $resultslimit = 0;
  43. if ($excerptsize == "")
  44. $excerptsize = 256;
  45. if ($excerptpadding == "")
  46. $excerptsize = 40;
  47. if (($dt != 'back') && ($dt != 'er') && ($dt != 'range'))
  48. $dt = '';
  49. if ($dp == "")
  50. $dp = 0;
  51. if (($dx != 0) && ($dx != -1) && ($dx != 1))
  52. $dx = 0;
  53. if ($dy < 1970)
  54. $dy = 1970;
  55. if (($dm < 0) || ($dm > 11))
  56. $dm = 0;
  57. if (($dd <= 0) || ($dd > 31))
  58. $dd = "01";
  59. $db = urldecode($db);
  60. $de = urldecode($de);
  61. $type = urldecode($type);
  62. $url = urldecode($url);
  63. if ($db == "")
  64. $db = '01/01/1970';
  65. if ($de == "")
  66. $de = '31/12/2020';
  67. if ($hlbeg == "")
  68. $hlbeg = '<b>';
  69. if ($hlend == "")
  70. $hlend = '</b>';
  71. if ($storedocurl == "")
  72. $storedocurl = '/cgi-bin/storedoc.cgi';
  73. if (isset ($q)) {
  74. $q = urldecode($q);
  75. $have_query_flag = 1;
  76. } else {
  77. $have_query_flag = 0;
  78. }
  79. $query_orig = $q;
  80. if (isset ($CHARSET_SAVED_QUERY_STRING)) {
  81. $q_local = urldecode($CHARSET_SAVED_QUERY_STRING);
  82. if (preg_match('/q=([^&]*)\&/', $q_local, $param)) {
  83. $q_local = urlencode($param[1]);
  84. }
  85. elseif (preg_match('/q=(.*)$/', $q_local, $param)) {
  86. $q_local = urlencode($param[1]);
  87. } else {
  88. $q_local = urlencode($q);
  89. }
  90. $q_string = $CHARSET_SAVED_QUERY_STRING;
  91. } else {
  92. $q_local = urlencode(stripslashes($q));
  93. $q_string = $QUERY_STRING;
  94. }
  95. $db_local = urlencode($db);
  96. $de_local = urlencode($de);
  97. $type_local = urlencode($type);
  98. $url_local = urlencode($url);
  99. if (($MAX_NP > 0) && ($np > $MAX_NP))
  100. $np = $MAX_NP;
  101. if (($MAX_PS > 0) && ($ps > $MAX_PS))
  102. $ps = $MAX_PS;
  103. /**
  104. * Initialisation function. Gets the global variables defined all over and prepares
  105. * the udm agent accordingly.
  106. *
  107. */
  108. function init() {
  109. global $q, $q_string, $query_orig, $have_query_flag, $have_spell_flag, $auto_wild;
  110. global $tag, $tag_arr, $cat, $cat_arr, $np, $ps, $lang, $lang_arr, $wm, $wf, $ul, $m;
  111. global $dt, $dp, $dx, $dm, $dd, $dy, $db, $de, $s, $resultslimit;
  112. global $trackquery, $localcharset, $browsercharset, $stopwordtable_arr, $stopwordfile_arr;
  113. global $minwordlength, $maxwordlength, $phrase, $cache;
  114. global $ispelluseprefixes, $crosswords, $ispellmode, $spell_host;
  115. global $affix_file, $spell_file, $vardir, $datadir, $sp, $sy;
  116. global $dbaddr, $dbmode, $udm_agent, $hlbeg, $hlend, $detectclones;
  117. global $phpver, $synonym_arr, $searchd_arr, $ul_arr;
  118. global $REMOTE_ADDR, $storedaddr, $type_arr, $type, $groupbysite, $site;
  119. global $excerptsize, $excerptpadding, $dateformat, $suggest;
  120. global $XMLOutput;
  121. ParseQString();
  122. /*
  123. if (preg_match("/^(\d+)\.(\d+)\.(\d+)/",phpversion(),$param)) {
  124. $phpver=$param[1];
  125. if ($param[2] < 9) {
  126. $phpver .= "0$param[2]";
  127. } else {
  128. $phpver .= "$param[2]";
  129. }
  130. if ($param[3] < 9) {
  131. $phpver .= "0$param[3]";
  132. } else {
  133. $phpver .= "$param[3]";
  134. }
  135. } else {
  136. print "Cannot determine php version: <b>".phpversion()."</b>\n";
  137. exit;
  138. }
  139. */
  140. $have_spell_flag = 0;
  141. $stopwordtable_arr = array ();
  142. $stopwordfile_arr = array ();
  143. $synonym_arr = array ();
  144. $searchd_arr = array ();
  145. read_template();
  146. if ($sp == '')
  147. $sp = 0;
  148. if ($sy == '')
  149. $sy = 0;
  150. $udm_agent = udm_alloc_agent_array($dbaddr);
  151. udm_set_agent_param($udm_agent, UDM_PARAM_PAGE_SIZE, $ps);
  152. udm_set_agent_param($udm_agent, UDM_PARAM_PAGE_NUM, $np);
  153. $trackquery = strtolower($trackquery);
  154. if ($trackquery == 'yes') {
  155. udm_set_agent_param($udm_agent, UDM_PARAM_TRACK_MODE, UDM_ENABLED);
  156. } else {
  157. udm_set_agent_param($udm_agent, UDM_PARAM_TRACK_MODE, UDM_DISABLED);
  158. }
  159. $cache = strtolower($cache);
  160. if ($cache == 'yes') {
  161. udm_set_agent_param($udm_agent, UDM_PARAM_CACHE_MODE, UDM_ENABLED);
  162. } else {
  163. udm_set_agent_param($udm_agent, UDM_PARAM_CACHE_MODE, UDM_DISABLED);
  164. }
  165. $ispelluseprefixes = strtolower($ispelluseprefixes);
  166. if ($ispelluseprefixes == 'yes') {
  167. udm_set_agent_param($udm_agent, UDM_PARAM_ISPELL_PREFIXES, UDM_ENABLED);
  168. } else {
  169. udm_set_agent_param($udm_agent, UDM_PARAM_ISPELL_PREFIXES, UDM_DISABLED);
  170. }
  171. $crosswords = strtolower($crosswords);
  172. if ($crosswords == 'yes') {
  173. udm_set_agent_param($udm_agent, UDM_PARAM_CROSS_WORDS, UDM_ENABLED);
  174. } else {
  175. udm_set_agent_param($udm_agent, UDM_PARAM_CROSS_WORDS, UDM_DISABLED);
  176. }
  177. if ($localcharset != '') {
  178. udm_set_agent_param($udm_agent, UDM_PARAM_CHARSET, $localcharset);
  179. if (!udm_check_charset($udm_agent, $localcharset)) {
  180. print_template('top');
  181. flush();
  182. print_error_local("Incorrect localcharset $localcharset");
  183. }
  184. }
  185. if ($localcharset == '')
  186. udm_set_agent_param($udm_agent, UDM_PARAM_CHARSET, 'utf-8');
  187. if ($browsercharset != '') {
  188. if (!udm_check_charset($udm_agent, $browsercharset)) {
  189. print_template('top');
  190. flush();
  191. print_error_local("Incorrect browsercharset $browsercharset");
  192. }
  193. udm_set_agent_param($udm_agent, UDM_PARAM_BROWSER_CHARSET, $browsercharset);
  194. if($XMLOutput != 1){
  195. header("Content-Type: text/html; charset=$browsercharset");
  196. }else{
  197. header("Content-Type: text/xml");
  198. echo "<?xml version='1.0' encoding=\"$browsercharset\" ?>\n";
  199. }
  200. } else {
  201. udm_set_agent_param($udm_agent, UDM_PARAM_BROWSER_CHARSET, 'utf-8');
  202. if($XMLOutput != 1){
  203. header("Content-Type: text/html; charset=utf-8");
  204. }else{
  205. header("Content-Type: text/xml");
  206. echo "<?xml version='1.0' encoding=\"utf-8\" ?>\n";
  207. }
  208. }
  209. if ($hlbeg == '')
  210. $hlbeg = '<font color="000088"><b>';
  211. udm_set_agent_param($udm_agent, UDM_PARAM_HLBEG, $hlbeg);
  212. if ($hlend == '')
  213. $hlend = '</b></font>';
  214. udm_set_agent_param($udm_agent, UDM_PARAM_HLEND, $hlend);
  215. for ($i = 0; $i < count($stopwordfile_arr); $i += 1) {
  216. if ($stopwordfile_arr[$i] != '') {
  217. udm_set_agent_param($udm_agent, UDM_PARAM_STOPFILE, $stopwordfile_arr[$i]);
  218. }
  219. }
  220. if ($sy) {
  221. for ($i = 0; $i < count($synonym_arr); $i += 1) {
  222. if ($synonym_arr[$i] != '') {
  223. udm_set_agent_param($udm_agent, UDM_PARAM_SYNONYM, $synonym_arr[$i]);
  224. }
  225. }
  226. }
  227. udm_set_agent_param($udm_agent, UDM_PARAM_QSTRING, $q_string);
  228. udm_set_agent_param($udm_agent, UDM_PARAM_REMOTE_ADDR, $REMOTE_ADDR);
  229. if ($have_query_flag)
  230. udm_set_agent_param($udm_agent, UDM_PARAM_QUERY, $query_orig);
  231. if ($storedaddr != '')
  232. udm_set_agent_param($udm_agent, UDM_PARAM_STORED, $storedaddr);
  233. $groupbysite = strtolower($groupbysite);
  234. if ($groupbysite == 'yes') {
  235. udm_set_agent_param($udm_agent, UDM_PARAM_GROUPBYSITE, UDM_ENABLED);
  236. } else {
  237. udm_set_agent_param($udm_agent, UDM_PARAM_GROUPBYSITE, UDM_DISABLED);
  238. }
  239. if ($site)
  240. udm_set_agent_param($udm_agent, UDM_PARAM_SITEID, $site);
  241. $detectclones = strtolower($detectclones);
  242. if ($detectclones == 'yes') {
  243. udm_set_agent_param($udm_agent, UDM_PARAM_DETECT_CLONES, UDM_ENABLED);
  244. } else {
  245. udm_set_agent_param($udm_agent, UDM_PARAM_DETECT_CLONES, UDM_DISABLED);
  246. }
  247. if ($m == 'any') {
  248. udm_set_agent_param($udm_agent, UDM_PARAM_SEARCH_MODE, UDM_MODE_ANY);
  249. }
  250. elseif ($m == 'all') {
  251. udm_set_agent_param($udm_agent, UDM_PARAM_SEARCH_MODE, UDM_MODE_ALL);
  252. }
  253. elseif ($m == 'bool') {
  254. udm_set_agent_param($udm_agent, UDM_PARAM_SEARCH_MODE, UDM_MODE_BOOL);
  255. }
  256. elseif ($m == 'phrase') {
  257. udm_set_agent_param($udm_agent, UDM_PARAM_SEARCH_MODE, UDM_MODE_PHRASE);
  258. } else {
  259. udm_set_agent_param($udm_agent, UDM_PARAM_SEARCH_MODE, UDM_MODE_ALL);
  260. }
  261. if ($wm == 'wrd') {
  262. udm_set_agent_param($udm_agent, UDM_PARAM_WORD_MATCH, UDM_MATCH_WORD);
  263. }
  264. elseif ($wm == 'beg') {
  265. udm_set_agent_param($udm_agent, UDM_PARAM_WORD_MATCH, UDM_MATCH_BEGIN);
  266. }
  267. elseif ($wm == 'end') {
  268. udm_set_agent_param($udm_agent, UDM_PARAM_WORD_MATCH, UDM_MATCH_END);
  269. }
  270. elseif ($wm == 'sub') {
  271. udm_set_agent_param($udm_agent, UDM_PARAM_WORD_MATCH, UDM_MATCH_SUBSTR);
  272. } else {
  273. udm_set_agent_param($udm_agent, UDM_PARAM_WORD_MATCH, UDM_MATCH_WORD);
  274. }
  275. if ($minwordlength > 0) {
  276. udm_set_agent_param($udm_agent, UDM_PARAM_MIN_WORD_LEN, $minwordlength);
  277. } else {
  278. udm_set_agent_param($udm_agent, UDM_PARAM_MIN_WORD_LEN, 1);
  279. }
  280. if ($maxwordlength > 0) {
  281. udm_set_agent_param($udm_agent, UDM_PARAM_MAX_WORD_LEN, $maxwordlength);
  282. } else {
  283. udm_set_agent_param($udm_agent, UDM_PARAM_MAX_WORD_LEN, 32);
  284. }
  285. if ($vardir != '')
  286. udm_set_agent_param($udm_agent, UDM_PARAM_VARDIR, $vardir);
  287. if ($datadir != '')
  288. udm_set_agent_param($udm_agent, UDM_PARAM_VARDIR, $datadir);
  289. if ($wf != '') {
  290. udm_set_agent_param($udm_agent, UDM_PARAM_WEIGHT_FACTOR, $wf);
  291. }
  292. for ($i = 0; $i < count($ul_arr); $i += 1) {
  293. $temp_ul = $ul_arr[$i];
  294. if ($temp_ul != '') {
  295. $auto_wild = strtolower($auto_wild);
  296. if (($auto_wild == 'yes') || ($auto_wild == '')) {
  297. 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://')) {
  298. udm_add_search_limit($udm_agent, UDM_LIMIT_URL, "$temp_ul%");
  299. } else {
  300. udm_add_search_limit($udm_agent, UDM_LIMIT_URL, "%$temp_ul%");
  301. }
  302. } else {
  303. udm_add_search_limit($udm_agent, UDM_LIMIT_URL, $temp_ul);
  304. }
  305. }
  306. }
  307. for ($i = 0; $i < count($tag_arr); $i += 1) {
  308. $temp_tag = $tag_arr[$i];
  309. if ($temp_tag != '')
  310. udm_add_search_limit($udm_agent, UDM_LIMIT_TAG, $temp_tag);
  311. }
  312. for ($i = 0; $i < count($type_arr); $i += 1) {
  313. $temp_type = $type_arr[$i];
  314. if ($temp_type != '')
  315. udm_add_search_limit($udm_agent, UDM_LIMIT_TYPE, $temp_type);
  316. }
  317. for ($i = 0; $i < count($cat_arr); $i += 1) {
  318. $temp_cat = $cat_arr[$i];
  319. if ($temp_cat != '')
  320. udm_add_search_limit($udm_agent, UDM_LIMIT_CAT, $temp_cat);
  321. }
  322. for ($i = 0; $i < count($lang_arr); $i += 1) {
  323. $temp_lang = $lang_arr[$i];
  324. if ($temp_lang != '')
  325. udm_add_search_limit($udm_agent, UDM_LIMIT_LANG, $temp_lang);
  326. }
  327. if (function_exists('udm_set_agent_param_ex')) {
  328. if ($excerptsize > 0)
  329. udm_set_agent_param_ex($udm_agent, 'ExcerptSize', $excerptsize);
  330. if ($excerptpadding > 0)
  331. udm_set_agent_param_ex($udm_agent, 'ExcerptPadding', $excerptpadding);
  332. if ($dateformat != '')
  333. udm_set_agent_param_ex($udm_agent, 'DateFormat', $dateformat);
  334. if ($s != '')
  335. udm_set_agent_param_ex($udm_agent, 's', $s);
  336. if ($resultslimit > 0)
  337. udm_set_agent_param_ex($udm_agent, 'resultslimit', $resultslimit);
  338. if (($dt == 'back') || ($dt == 'er') || ($dt == 'range')) {
  339. udm_set_agent_param_ex($udm_agent, 'dt', $dt);
  340. udm_set_agent_param_ex($udm_agent, 'dx', $dx);
  341. udm_set_agent_param_ex($udm_agent, 'dm', $dm);
  342. udm_set_agent_param_ex($udm_agent, 'dy', $dy);
  343. udm_set_agent_param_ex($udm_agent, 'dd', $dd);
  344. udm_set_agent_param_ex($udm_agent, 'dp', $dp);
  345. udm_set_agent_param_ex($udm_agent, 'db', $db);
  346. udm_set_agent_param_ex($udm_agent, 'de', $de);
  347. }
  348. $suggest = strtolower($suggest);
  349. if ($suggest == 'yes')
  350. udm_set_agent_param_ex($udm_agent, 'suggest', 'yes');
  351. }
  352. if (($dt == 'back') && ($dp != '0')) {
  353. $recent_time = format_dp($dp);
  354. if ($recent_time != 0) {
  355. $dl = time() - $recent_time;
  356. udm_add_search_limit($udm_agent, UDM_LIMIT_DATE, ">$dl");
  357. }
  358. }
  359. elseif ($dt == 'er') {
  360. $recent_time = mktime(0, 0, 0, ($dm +1), $dd, $dy);
  361. if ($dx == -1) {
  362. udm_add_search_limit($udm_agent, UDM_LIMIT_DATE, "<$recent_time");
  363. }
  364. elseif ($dx == 1) {
  365. udm_add_search_limit($udm_agent, UDM_LIMIT_DATE, ">$recent_time");
  366. }
  367. }
  368. elseif ($dt == 'range') {
  369. $begin_time = format_userdate($db);
  370. if ($begin_time)
  371. udm_add_search_limit($udm_agent, UDM_LIMIT_DATE, ">$begin_time");
  372. $end_time = format_userdate($de);
  373. if ($end_time)
  374. udm_add_search_limit($udm_agent, UDM_LIMIT_DATE, "<$end_time");
  375. }
  376. print_template('top');
  377. flush();
  378. $ispellmode = strtolower($ispellmode);
  379. if ($ispellmode == 'db') {
  380. if (!udm_load_ispell_data($udm_agent, UDM_ISPELL_TYPE_DB, '', '', 1)) {
  381. print_error_local(udm_error($udm_agent));
  382. } else
  383. $have_spell_flag = 1;
  384. }
  385. elseif ($ispellmode == 'server') {
  386. if (!udm_load_ispell_data($udm_agent, UDM_ISPELL_TYPE_SERVER, $spell_host, '', 1)) {
  387. print_error_local("Error loading ispell data from server $spell_host");
  388. } else
  389. $have_spell_flag = 1;
  390. }
  391. elseif (($ispellmode == 'text') && ($sp)) {
  392. reset($affix_file);
  393. while (list ($t_lang, $file) = each($affix_file)) {
  394. $param = array();
  395. if (preg_match("/(.+)\;(.+)/", $file, $param)) {
  396. $t_charset = trim($param[1]);
  397. $t_file = trim($param[2]);
  398. if (!udm_load_ispell_data($udm_agent, UDM_ISPELL_TYPE_AFFIX, $t_lang, $t_charset, $t_file, 0)) {
  399. print_error_local("Error loading ispell data from file");
  400. } else
  401. $have_spell_flag = 1;
  402. }
  403. $temp = $spell_file[$t_lang];
  404. for ($i = 0; $i < count($temp); $i += 1) {
  405. if (preg_match("/(.+)\;(.+)/", $temp[$i], $param)) {
  406. $t_charset = trim($param[1]);
  407. $t_file = trim($param[2]);
  408. if (!udm_load_ispell_data($udm_agent, UDM_ISPELL_TYPE_SPELL, $t_lang, $t_charset, $t_file, 1)) {
  409. print_error_local("Error loading ispell data from file");
  410. } else
  411. $have_spell_flag = 1;
  412. }
  413. }
  414. }
  415. }
  416. udm_parse_query_string($udm_agent, $q_string);
  417. }
  418. /**
  419. * Some variation of the init function?
  420. *
  421. */
  422. function init_cc() {
  423. global $q, $q_string, $query_orig, $have_query_flag, $have_spell_flag, $auto_wild;
  424. global $tag, $tag_arr, $cat, $cat_arr, $np, $ps, $lang, $lang_arr, $wm, $wf, $ul, $m;
  425. global $dt, $dp, $dx, $dm, $dd, $dy, $db, $de, $s, $resultslimit;
  426. global $trackquery, $localcharset, $browsercharset, $stopwordtable_arr, $stopwordfile_arr;
  427. global $minwordlength, $maxwordlength, $phrase, $cache;
  428. global $ispelluseprefixes, $crosswords, $ispellmode, $spell_host;
  429. global $affix_file, $spell_file, $vardir, $datadir, $sp, $sy;
  430. global $dbaddr, $dbmode, $udm_agent, $hlbeg, $hlend, $detectclones;
  431. global $phpver, $synonym_arr, $searchd_arr, $ul_arr;
  432. global $REMOTE_ADDR, $storedaddr, $type_arr, $type, $groupbysite, $site;
  433. global $excerptsize, $excerptpadding, $dateformat, $suggest;
  434. //parse the $QUERY_STRING global variable and puts pieces into corresponding arrays
  435. ParseQString();
  436. //read the template file
  437. read_template();
  438. $udm_agent = udm_alloc_agent_array($dbaddr);
  439. if ($localcharset != '') {
  440. udm_set_agent_param($udm_agent, UDM_PARAM_CHARSET, $localcharset);
  441. if (!udm_check_charset($udm_agent, $localcharset)) {
  442. print_template('top');
  443. flush();
  444. print_error_local("Incorrect localcharset $localcharset");
  445. }
  446. }
  447. if ($localcharset == '')
  448. udm_set_agent_param($udm_agent, UDM_PARAM_CHARSET, 'utf-8');
  449. if ($browsercharset != '') {
  450. if (!udm_check_charset($udm_agent, $browsercharset)) {
  451. print_template('top');
  452. flush();
  453. print_error_local("Incorrect browsercharset $browsercharset");
  454. }
  455. udm_set_agent_param($udm_agent, UDM_PARAM_BROWSER_CHARSET, $browsercharset);
  456. header("Content-Type: text/html; charset=$browsercharset");
  457. } else {
  458. udm_set_agent_param($udm_agent, UDM_PARAM_BROWSER_CHARSET, 'utf-8');
  459. header("Content-Type: text/html; charset=utf-8");
  460. }
  461. if ($hlbeg == '')
  462. $hlbeg = '<font color="000088"><b>';
  463. udm_set_agent_param($udm_agent, UDM_PARAM_HLBEG, $hlbeg);
  464. if ($hlend == '')
  465. $hlend = '</b></font>';
  466. udm_set_agent_param($udm_agent, UDM_PARAM_HLEND, $hlend);
  467. udm_set_agent_param($udm_agent, UDM_PARAM_QSTRING, $q_string);
  468. udm_set_agent_param($udm_agent, UDM_PARAM_REMOTE_ADDR, $REMOTE_ADDR);
  469. if ($have_query_flag)
  470. udm_set_agent_param($udm_agent, UDM_PARAM_QUERY, $query_orig);
  471. if (function_exists('udm_set_agent_param_ex')) {
  472. if ($dateformat != '')
  473. udm_set_agent_param_ex($udm_agent, 'DateFormat', $dateformat);
  474. }
  475. udm_parse_query_string($udm_agent, $q_string);
  476. }
  477. ?>