Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Max number of users
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Max number of users

 Post Reply Post Reply Page  12>
Author
jackals View Drop Down
Groupie
Groupie
Avatar

Joined: 27 June 2005
Location: United Kingdom
Status: Offline
Points: 66
Post Options Post Options   Thanks (0) Thanks(0)   Quote jackals Quote  Post ReplyReply Direct Link To This Post 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...Embarrassed
 
Jack
Back to Top
javi712 View Drop Down
Senior Member
Senior Member


Joined: 22 May 2003
Location: United States
Status: Offline
Points: 488
Post Options Post Options   Thanks (0) Thanks(0)   Quote javi712 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
slapmonkay View Drop Down
Newbie
Newbie


Joined: 13 July 2006
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote slapmonkay Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
coolguy View Drop Down
Newbie
Newbie
Avatar

Joined: 14 November 2006
Location: United States
Status: Offline
Points: 37
Post Options Post Options   Thanks (0) Thanks(0)   Quote coolguy Quote  Post ReplyReply Direct Link To This Post Posted: 23 November 2006 at 3:20am
Where in the default file do you add this code?
Back to Top
jackals View Drop Down
Groupie
Groupie
Avatar

Joined: 27 June 2005
Location: United Kingdom
Status: Offline
Points: 66
Post Options Post Options   Thanks (0) Thanks(0)   Quote jackals Quote  Post ReplyReply Direct Link To This Post Posted: 23 November 2006 at 6:50pm
Cool....Big%20smile.. I'll try that inabit slapmonkey.Thumbs%20Up
Back to Top
javi712 View Drop Down
Senior Member
Senior Member


Joined: 22 May 2003
Location: United States
Status: Offline
Points: 488
Post Options Post Options   Thanks (0) Thanks(0)   Quote javi712 Quote  Post ReplyReply Direct Link To This Post 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!
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
jackals View Drop Down
Groupie
Groupie
Avatar

Joined: 27 June 2005
Location: United Kingdom
Status: Offline
Points: 66
Post Options Post Options   Thanks (0) Thanks(0)   Quote jackals Quote  Post ReplyReply Direct Link To This Post Posted: 23 November 2006 at 11:46pm
Embarrassedwhere would i put the
 
<% = intMUOUsers + intMUOGuest %>
 
 


Edited by jackals - 23 November 2006 at 11:47pm
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.