See the number of Users active in the past 30 days

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/69823?pagenum=1
05 November 2025, 09:06

Topic


kyodai
See the number of Users active in the past 30 days
06 February 2011, 00:14


If you're curious about how many users have been active in the past 30 days then this is for you...
Might as well put it in your default.asp if you want everyone to see it, but i made it so only mods and admins can check the page...
Not too useful, only interesting for statistics fans. It simply counts the rows where "M_LASTLOGINDATE" is larger than Current date minus 30 days.

Enjoy!

bigsmile

http://www.tankraider.com/userup/1296989102.zip

 

Replies ...


Carefree
06 February 2011, 06:36


I incorporated your idea (and added a month-to-date statistic) into active users program, seems a good place for it.
Code:

In "LangMODS_Ls3kAU4_1033.asp",

Look for the following lines (appx 56-58):

strLangMOD_Ls3kAU_00090 = "at"
strLangMOD_Ls3kAU_00100 = "Members Online"
strLangMOD_Ls3kAU_00110 = "None"

Below them, insert these:

strLangMOD_Ls3kAU_00120 = "last 30 days"
strLangMOD_Ls3kAU_00130 = "so far this month"

In "config.asp",

Look for the following lines (appx 164-178):

intAURecord = cint(Application(strCookieURL & "INTAURECORD"))
strAURecordDate = Application(strCookieURL & "STRAURECORDDATE")
strAUAnon = Application(strCookieURL & "STRAUANON")
strAUAnonOverride = Application(strCookieURL & "STRAUANONOVERRIDE")
strAUPAllow = Application(strCookieURL & "STRAUPALLOW")
strAUPCollapse = Application(strCookieURL & "STRAUPCOLLAPSE")
strAUAllow = Application(strCookieURL & "STRAUALLOW")
strAURefresh = Application(strCookieURL & "STRAUREFRESH")
strAUIP = Application(strCookieURL & "STRAUIP")
strAUUA = Application(strCookieURL & "STRAUUA")
strAULocal = Application(strCookieURL & "STRAULOCAL")
strAUTimeout = Application(strCookieURL & "STRAUTIMEOUT")
strAUPIsland = Application(strCookieURL & "STRAUPISLAND")
strAUAdminColor = Application(strCookieURL & "STRAUADMINCOLOR")
strAUModColor = Application(strCookieURL & "STRAUMODCOLOR"

After them, insert the following:

intActMon = Application(strCookieURL & "INTACTMON")
intThisMon = Application(strCookieURL & "INTTHISMON")


Look for the following lines (appx 125-126):

'############## Active Users Mod ################
Dim strAURecord, strAURecordDate, strAUAnon, strAUAnonOverride, strAUPAllow, strAUPCollapse, intActMon, intThisMon
Dim strAUAllow, strAURefresh, strAUIP, strAUUA, strAULocal, strAUTimeout, strAUPIsland, strAUAdminColor, strAUModColor
'############## Active Users Mod End ############


Replace them with these:

'############## Active Users Mod ################
Dim strAURecord, strAURecordDate, strAUAnon, strAUAnonOverride, strAUPAllow, strAUPCollapse, intActMon, intThisMon
Dim strAUAllow, strAURefresh, strAUIP, strAUUA, strAULocal, strAUTimeout, strAUPIsland, strAUAdminColor, strAUModColor
'############## Active Users Mod End ############


In "inc_activeusers.asp",

Look for the following lines (appx 171-172):

response.write " <br>" & VBNewLine & _
" " & fLang(strLangMOD_Ls3kAU_00070) & ": " & intAURecord & " | " & fLang(strLangMOD_Ls3kAU_00080) & ": " & ChkDate(strAURecordDate," " & fLang(strLangMOD_Ls3kAU_00090) & " ",true) & VBNewLine & _

After them, insert the following:

" <br>" & VBNewLine & _
" " & fLang(strLangMOD_Ls3kAU_00040) & " " & fLang(strLangMOD_Ls3kAU_00120) & ": " & intActMon & ", " & fLang(strLangMOD_Ls3kAU_00130) & ": " & intThisMon & vbNewLine & _

Finally, look for the following lines (appx 99-101):

intTotalActiveUsers = intTotalActiveUsers + intActiveGuests

'## Ls3k - Ok, now it is time to check the record, cause it would be cool if we broke it!
After those, insert the following:

strSql = "SELECT COUNT(MEMBER_ID) AS ACTMON FROM " & strMemberTablePrefix & "MEMBERS WHERE M_LASTHEREDATE > " & DateAdd("d", -30, strCurrentTime)
Set rsMonth = my_Conn.Execute(strSql)
If NOT rsMonth.EOF Then
intActMon = rsMonth("Actmon")
rsMonth.Close
End If
Set rsMonth = Nothing
strSql = "SELECT COUNT(MEMBER_ID) AS ACTMON FROM " & strMemberTablePrefix & "MEMBERS WHERE MID(M_LASTHEREDATE,5,2) = '" & MID(DatetoStr(strForumTimeAdjust),5,2) & "'"
Set rsMonth = my_Conn.Execute(strSql)
If NOT rsMonth.EOF Then
intThisMon = rsMonth("Actmon")
rsMonth.Close
End If
Set rsMonth = Nothing
© 2000-2021 Snitz™ Communications