Jackswins
Starting Member
1 Posts |
Posted - 22 August 2003 : 01:38:50
|
Hi..
I'm very new at this.
I loaded the ACTIVE_USERS_MOD.
But after that i can't login the forum.
It says " You successfully logged in."
But it gives an error like this.
Microsoft JET Database Engine (0x80040E14) 'MEMBER_ID =' sorgu ifadesi içindeki Sözdizimi hatası (eksik işleç)
means
'MEMBER_ID=' syntax error in query (missing operator)
/forum/inc_func_common.asp, line 62
The part i copied to inc_func_common for active users is below.
'############################################## '## Active Users ## '##############################################
Sub ActiveUserTracker() 'Ls3k- Declaire and assign variables. Dim strUserIP, strScriptName, strQueryString, strUserAgent, strCurrentTime, strTimedOut
strUserIP = Request.ServerVariables("REMOTE_ADDR") strScriptName = Mid(Request.ServerVariables("SCRIPT_NAME"), InstrRev(Request.ServerVariables("SCRIPT_NAME"), "/")+1) strQueryString = Request.ServerVariables("QUERY_STRING") strUserAgent = Request.ServerVariables("HTTP_USER_AGENT") strCurrentTime = DateToStr(strForumTimeAdjust)
'Ls3k- First Order of business, is this person new? if MemberID="-1" then 'If this is a Guest, check by IP strSql = "SELECT AU_LASTACTIVETIME FROM " & strTablePrefix & "ACTIVE_USERS WHERE AU_IP = " & Chkstring(strUserIP, "SQLString") & "' AND MEMBER_ID = -1" else 'If this is a Member, check by Member_ID strSql = "SELECT AU_LASTACTIVETIME FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID = " & MemberID end if set rs = my_conn.execute (strSql) if rs.EOF or rs.BOF then strNewUser = 1 else strNewUser = 0 strAUTimedOut = DateToStr(DateAdd("n",-strAUTimeout,strForumTimeAdjust)) if rs("AU_LASTACTIVETIME") < strAUTimedOut then 'Check to see if user has timed out since last active. strSql = "DELETE FROM " & strTablePrefix & "ACTIVE_USERS WHERE (MEMBER_ID = " & MemberID & " AND MEMBER_ID <> -1) OR (AU_IP = '" & Chkstring(strUserIP, "SQLString") & "' AND MEMBER_ID = -1)" my_conn.execute (strSql) strNewUser = 1 end if end if rs.close set rs = Nothing
'Ls3k- Second order of business, lets update those already-active users if strNewUser = 0 then 'If already-active strSql = "UPDATE " & strTablePrefix & "ACTIVE_USERS SET " & _ "AU_LASTACTIVETIME='" & Chkstring(strCurrentTime, "SQLString") & "'" & _ ", AU_LASTPAGE='" & Chkstring(strScriptName, "SQLString") & "'" & _ ", AU_QUERYSTRING='" & Chkstring(strQueryString, "SQLString") & "' " if MemberID=-1 then 'If guest, update based on IP strSql = strSql & "WHERE AU_IP = '" & Chkstring(strUserIP, "SQLString") & "' " & _ "AND MEMBER_ID = " & MemberID else 'Update members based on MemberID strSql = strSql & "WHERE MEMBER_ID = " & MemberID end if my_conn.execute (strSql) else 'Is a new user, make new record strSql = "INSERT INTO " & strTablePrefix & "ACTIVE_USERS (" & _ "MEMBER_ID, AU_IP, AU_LOGINTIME, AU_LASTACTIVETIME, " & _ "AU_LASTPAGE, AU_QUERYSTRING, AU_USER_AGENT) VALUES(" & _ MemberID & ", " & _ "'" & Chkstring(strUserIP, "SQLString") & "', " & _ "'" & Chkstring(strCurrentTime, "SQLString") & "', " & _ "'" & Chkstring(strCurrentTime, "SQLString") & "', " & _ "'" & Chkstring(strScriptName, "SQLString") & "', " & _ "'" & Chkstring(strQueryString, "SQLString") & "', " & _ "'" & Chkstring(strUserAgent, "SQLString") & "')" my_conn.execute (strSql) end if end sub
function chkAUPermissions(fCheck) chkAUPermissions=0 select case fCheck case "1" if mLev=4 then chkAUPermissions=1 end if case "2" if mLev=4 or mLev=3 then chkAUPermissions=1 end if case "3" if mLev=4 or mLev = 3 or mLev=2 then chkAUPermissions=1 end if case "4" chkAUPermissions=1 end select end function
function chkAURecord(intTotalActiveUsers) if cInt(intTotalActiveUsers) > cInt(intAURecord) then 'We have a new record!!! :) 'Check to see if it *Really* is a record, or if Application varaibles just got reset strSql = "SELECT C_VALUE FROM " & strTablePrefix & "CONFIG_NEW WHERE C_VARIABLE = 'intAURecord'" set rs = my_conn.execute (strSql) intOldRecord = cint(rs("C_VALUE")) rs.close set rs = nothing if cInt(intOldRecrod) > cInt(intTotalActiveUsers) then 'Oopsi, this was a false alarm strSql = "SELECT C_VALUE FROM " & strTablePrefix & "CONFIG_NEW WHERE C_VARIABLE = 'strAURecordDate'" set rs = my_conn.execute (strSql) strOldDate = rs("C_VALUE") rs.close set rs = nothing Application(strCookieURL & "INTAURECORD") = intOldRecord Application(strCookieURL & "STRAURECORDDATE") = strOldDate intAURecord = intOldRecord strAURecordDate = strOldDate else my_conn.execute ("UPDATE " & strTablePrefix & "CONFIG_NEW SET C_VALUE = '" & cstr(intTotalActiveUsers) & "' WHERE C_VARIABLE = 'intAURecord'") my_conn.execute ("UPDATE " & strTablePrefix & "CONFIG_NEW SET C_VALUE = '" &DateToStr(strForumTimeAdjust) & "' WHERE C_VARIABLE = 'strAURecordDate'") intAURecord = intTotalActiveUsers strAURecordDate = DateToStr(strForumTimeAdjust) Application(strCookieURL & "INTAURECORD") = intTotalActiveUsers Application(strCookieURL & "STRAURECORDDATE") = DateToStr(strForumTimeAdjust) end if end if end function
sub deleteInactiveUsers() strAUTimedOut = DateToStr(DateAdd("n",-strAUTimeout,strForumTimeAdjust)) strSql = "DELETE FROM " & strTablePrefix & "ACTIVE_USERS WHERE AU_LASTACTIVETIME < '" & strAUTimedOut & "'" my_conn.execute (strSql) end sub
sub AUHandleLoging() strSql = "DELETE FROM " & strTablePrefix & "ACTIVE_USERS WHERE AU_IP = '" & Chkstring(request.ServerVariables("REMOTE_ADDR"), "SQLString") & "'" my_conn.execute (strSql) end sub
function checkSelect(actualValue, thisValue) if actualValue = thisValue then checkSelect = " selected" else checkSelect = "" end if end function
function checkRadio(actualValue, thisValue, boltf) if actualValue = thisValue EQV boltf then checkRadio = " checked" else checkRadio = "" end if end function
Can anybody help me?
Jacks
|
Edited by - Jackswins on 22 August 2003 01:40:17 |
|