Print Page | Close Window

Max number of users

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=22006
Printed Date: 29 March 2026 at 7:47pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Max number of users
Posted By: jackals
Subject: Max number of users
Date 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



Replies:
Posted By: javi712
Date 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.


Posted By: slapmonkay
Date 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


Posted By: coolguy
Date Posted: 23 November 2006 at 3:20am
Where in the default file do you add this code?


Posted By: jackals
Date Posted: 23 November 2006 at 6:50pm
Cool....Big%20smile.. I'll try that inabit slapmonkey.Thumbs%20Up


Posted By: javi712
Date 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!


Posted By: dj air
Date 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


Posted By: jackals
Date Posted: 23 November 2006 at 11:46pm
Embarrassedwhere would i put the
 
<% = intMUOUsers + intMUOGuest %>
 
 


Posted By: dj air
Date Posted: 24 November 2006 at 10:35am
place that where you want to display the numbers, maybe a section in the statistics area


Posted By: jackals
Date Posted: 24 November 2006 at 10:45am
Thumbs%20Up ok.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net