Okay, I've got so far but I've hit a wall.
I've created a new function in inc_func_common called chkAUMeRecord:
Code:
function chkAUMeRecord(intTotalActiveMembers)
if cInt(intTotalActiveMembers) > cInt(intAUMeRecord) 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 = 'intAUMeRecord'"
set rs = my_conn.execute (strSql)
intOldMeRecord = cint(rs("C_VALUE"))
rs.close
set rs = nothing
if cInt(intOldMeRecord) > cInt(intTotalActiveMembers) then
'Oopsi, this was a false alarm
strSql = "SELECT C_VALUE FROM " & strTablePrefix & "CONFIG_NEW WHERE C_VARIABLE = 'strAUMeRecordDate'"
set rs = my_conn.execute (strSql)
strOldMeDate = rs("C_VALUE")
rs.close
set rs = nothing
Application(strCookieURL & "INTAUMERECORD") = intOldMeRecord
Application(strCookieURL & "STRAUMERECORDDATE") = strOldMeDate
intAUMeRecord = intOldMeRecord
strAUMeRecordDate = strOldMeDate
else
my_conn.execute ("UPDATE " & strTablePrefix & "CONFIG_NEW SET C_VALUE = '" & cstr(intTotalActiveMembers) & "' WHERE C_VARIABLE = 'intAUMeRecord'")
my_conn.execute ("UPDATE " & strTablePrefix & "CONFIG_NEW SET C_VALUE = '" &DateToStr(strForumTimeAdjust) & "' WHERE C_VARIABLE = 'strAUMeRecordDate'")
intAUMeRecord = intTotalActiveMembers
strAUMeRecordDate = DateToStr(strForumTimeAdjust)
Application(strCookieURL & "INTAUMERECORD") = intTotalActiveMembers
Application(strCookieURL & "STRAUMERECORDDATE") = DateToStr(strForumTimeAdjust)
end if
end if
end function
In inc_activeusers I've created a new variable called intTotalActiveMembers which is basically intTotalActiveUsers without adding the guests. Therefore, I've changed the code thus:
Code:
'## Ls3k - Now lets count those peskey guests.
strSql = "SELECT COUNT(AU_IP) AS CNT FROM " & strTablePrefix & "ACTIVE_USERS WHERE MEMBER_ID = -1"
set rs = my_conn.execute (strSql)
intActiveGuests = rs("CNT")
rs.close
set rs = nothing
intTotalActiveMembers = intTotalActiveUsers
intTotalActiveUsers = intTotalActiveUsers + intActiveGuests
I've added the call to the function to check the record:
Code:
'## Ls3k - Ok, now it is time to check the record, cause it would be cool if we broke it!
chkAUMeRecord(intTotalActiveMembers)
chkAURecord(intTotalActiveUsers)
I've added a new line of code to the stats which displays the new active members record like this:
Code:
if (strAUAdminColor <> "" or strAUModColor <> "") AND intActiveMembers > 0 then
response.write " [ <font color=""" & strAUAdminColor & """>" & fLang(strLangMOD_Ls3kAU_00050) & "</font> | <font color=""" & strAUModColor & """>" & fLang(strLangMOD_Ls3kAU_00060) & "</font> ]" & VBNewLine
end if
response.write " <br>" & VBNewLine & _
" " & fLang(strLangMOD_Ls3kAU_00120) & ": " & intAUMeRecord & " | " & fLang(strLangMOD_Ls3kAU_00080) & ": " & ChkDate(strAUMeRecordDate," " & fLang(strLangMOD_Ls3kAU_00090) & " ",true) & VBNewLine & _
" <br>" & VBNewLine & _
" " & fLang(strLangMOD_Ls3kAU_00070) & ": " & intAURecord & " | " & fLang(strLangMOD_Ls3kAU_00080) & ": " & ChkDate(strAURecordDate," " & fLang(strLangMOD_Ls3kAU_00090) & " ",true) & VBNewLine & _
" </td>" & VBNewLine & _
" </tr>" & VBNewLine & _
" <tr>" & VBNewLine & _
" <td class=""forumheader"" colspan=""" & sGetColspan(6,5) & """>" & VBNewLine & _
" " & fLang(strLangMOD_Ls3kAU_00100) & ": "
(strLangMOD_Ls3kAU_00120 = "Active Members Record: ")
I've added the new variables to the CONFIG_NEW table in the database using the alternative mod setup as you suggested, and checking the database, they are being populated with the members record and time of record.
BUT, the results are not showing up on default.asp. All I'm getting is "Active Members Record: | Record Set On: "
I think I'm close but can you see where I've gone wrong?<