Author |
Topic |
|
wii
Free ASP Hosts Moderator
Denmark
2632 Posts |
Posted - 27 December 2004 : 07:05:32
|
Would it be hard to change the code in active users to only count members (not guests) ? If no, then where and how.
Thanks a lot. |
|
masterao
Senior Member
Sweden
1678 Posts |
Posted - 27 December 2004 : 09:57:21
|
I don't think so. You have to change the code in active_users.asp, inc_activeusers.asp and in inc_func_common.asp (the ActiveUserTracker() sub and the chkAURecord function).
Look for the code which calls for guests (it is commented where). |
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
|
|
wii
Free ASP Hosts Moderator
Denmark
2632 Posts |
Posted - 28 December 2004 : 05:31:42
|
Thanks |
|
|
masterao
Senior Member
Sweden
1678 Posts |
|
wii
Free ASP Hosts Moderator
Denmark
2632 Posts |
Posted - 09 February 2005 : 11:43:02
|
Ok, how do I change the active users record to only count the record of members, not guests? Often a spider comes by and I would have 139 online users, where the highest member count I´ve ever seen is around 15.
I see this in: inc_func_common.asp:
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 |
|
|
masterao
Senior Member
Sweden
1678 Posts |
Posted - 09 February 2005 : 19:42:24
|
I thik the easiest would be to change how the function is called. Look for the following in inc_activeusers.asp:
'## 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 intTotalActiveUsers = intTotalActiveUsers + intActiveGuests
Add the red line (see below) before the last line in that code section:
set rs = nothing intTotalActiveMembers = intTotalActiveUsers intTotalActiveUsers = intTotalActiveUsers + intActiveGuests
Then, look for the following:
'## Ls3k - Ok, now it is time to check the record, cause it would be cool if we broke it! chkAURecord(intTotalActiveUsers)[size=1]
Change chkAURecord(intTotalActiveUsers) to chkAURecord(intTotalActiveMembers)
That should make it so that it only counts members and not guests. |
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
|
|
wii
Free ASP Hosts Moderator
Denmark
2632 Posts |
Posted - 10 February 2005 : 02:53:57
|
Wow, that was simple.
Thanks |
|
|
masterao
Senior Member
Sweden
1678 Posts |
|
masterao
Senior Member
Sweden
1678 Posts |
|
|
Topic |
|