- $oDB->query('insert into query_log values ('.getDBQuoted($hLog[0]).','.getDBQuoted($hLog[3]).','.getDBQuoted($hLog[1]).')');
+ if (isset($_GET['email']))
+ $sUserAgent = $_GET['email'];
+ elseif (isset($_SERVER['HTTP_REFERER']))
+ $sUserAgent = $_SERVER['HTTP_REFERER'];
+ elseif (isset($_SERVER['HTTP_USER_AGENT']))
+ $sUserAgent = $_SERVER['HTTP_USER_AGENT'];
+ else
+ $sUserAgent = '';
+ $sSQL = 'insert into new_query_log (type,starttime,query,ipaddress,useragent,language,format,searchterm)';
+ $sSQL .= ' values ('.getDBQuoted($sType).','.getDBQuoted($hLog[0]).','.getDBQuoted($hLog[2]);
+ $sSQL .= ','.getDBQuoted($hLog[1]).','.getDBQuoted($sUserAgent).','.getDBQuoted(join(',',$aLanguageList)).','.getDBQuoted($sOutputFormat).','.getDBQuoted($hLog[3]).')';
+ $oDB->query($sSQL);