| Author |
Topic Search Topic Options
|
jackals
Groupie
Joined: 27 June 2005
Location: United Kingdom
Status: Offline
Points: 66
|
Post Options
Thanks(0)
Quote Reply
Topic: Max number of users Posted: 23 November 2006 at 12:05am |
I'm after a mod that shows the Max number of users online at any one time...
but when it goes above the max number of users it will update its self... to show the highest number of users... If you know wot i mean...
Has there ever been a mod created for this? I can't see one... 
Jack
|
 |
javi712
Senior Member
Joined: 22 May 2003
Location: United States
Status: Offline
Points: 488
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 November 2006 at 12:18am |
|
Jackals, unfortunately one has not been created as of yet. But I do hope the asp gurus on here do take this as motivation to create one if they see several users requesting a mod. I personally would like to see a mod like this become available for our forums.
|
 |
slapmonkay
Newbie
Joined: 13 July 2006
Status: Offline
Points: 21
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 November 2006 at 2:07am |
Add 3 tables to Configuration Table
- Most_users_online (int, Dont allow nulls, default 0)
- Most_guests_online (int, Dont allow nulls, default 0)
- Last_post_date (datetime, allow nulls)
Add the following code to default.asp
<%
strSQL = "SELECT " & strDbTable & "Configuration.Most_users_online, " & strDbTable & "Configuration.Most_guests_online, " & strDbTable & "Configuration.Last_post_date " & _ "FROM " & strDbTable & "Configuration" & strRowLock & " " & _ "WHERE " & strDbTable & "Configuration.ID = 1 ;" On Error Resume Next rsCommon.CursorType = 2 rsCommon.LockType = 3 rsCommon.Open strSQL, adoCon If Err.Number <> 0 Then Call errorMsg("An error has occured while executing SQL query on database.", "member_count", "default.asp") On Error goto 0 if not rsCommon.EOF then 'read data.. if isNumeric(rsCommon("Most_users_online")) then intMUOUsers = rsCommon("Most_users_online") else intMUOUsers = 0 if isNumeric(rsCommon("Most_guests_online")) then intMUOGuest = rsCommon("Most_guests_online") else intMUOGuest = 0 if IsDate(rsCommon("Last_post_date")) then dateMUODate = CDate(rsCommon("Last_post_date")) else dateMUODate = internationalDateTime(Now()) 'update?? if (intMUOUsers + intMUOGuest) < intActiveUsers then intMUOUsers = intActiveMembers intMUOGuest = intActiveGuests rsCommon.Fields("Most_users_online") = intMUOUsers rsCommon.Fields("Most_guests_online") = intMUOGuest rsCommon.Fields("Last_post_date") = internationalDateTime(Now()) 'Update the database with the new poll question rsCommon.Update End if End if rsCommon.close
%>
|
You will then need to add the following code wherever you want to display the total number of members ever online
<% = intMUOUsers + intMUOGuest %>
|
Original code from venkys mod
|
 |
coolguy
Newbie
Joined: 14 November 2006
Location: United States
Status: Offline
Points: 37
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 November 2006 at 3:20am |
Where in the default file do you add this code?
|
 |
jackals
Groupie
Joined: 27 June 2005
Location: United Kingdom
Status: Offline
Points: 66
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 November 2006 at 6:50pm |
Cool....  .. I'll try that inabit slapmonkey.
|
 |
javi712
Senior Member
Joined: 22 May 2003
Location: United States
Status: Offline
Points: 488
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 November 2006 at 7:34pm |
|
wow... thanks slapmonkey!
is there a way to implement your code or alter it in any way so that we don't have to make any database changes?
thanks in advance!
|
 |
dj air
Senior Member
Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 November 2006 at 7:40pm |
|
you could store it in a .txt file but not good for performance
or can store the values within a applicastion veribles but will dis apear when the server/pool is reset
db is best bet
|
 |
jackals
Groupie
Joined: 27 June 2005
Location: United Kingdom
Status: Offline
Points: 66
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 November 2006 at 11:46pm |
 where would i put the
<% = intMUOUsers + intMUOGuest %> |
Edited by jackals - 23 November 2006 at 11:47pm
|
 |