Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Active Users Lite
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

NiteOwl
Junior Member

Canada
403 Posts

Posted - 21 October 2003 :  20:29:53  Show Profile  Visit NiteOwl's Homepage
Simple Active Users Lite Code for your Forum:
works in Snitz 3.4.03


The original came from RichardK when queried as to how he makes the Active Users display on the opening page of the Snitz website. Some modification was done and documentation to make it fit my requirements and I thought I would share, in-case someone else was interested.



The Files:
Link to ActiveUsersLite



Output:




If you like it please enjoy, if you can make it better, great!


-=NiteOwl=-

Edited by - NiteOwl on 21 October 2003 20:30:35

laser
Advanced Member

Australia
3859 Posts

Posted - 21 October 2003 :  20:37:15  Show Profile
23 pending members ... shame on you

But a good MOD, I can see where it will come it handy
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 21 October 2003 :  20:47:35  Show Profile  Visit NiteOwl's Homepage
The site has been active for 5 weeks, it has over 1000 members and grows by 25 to 50 a day grin


-=NiteOwl=-
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 21 October 2003 :  21:06:20  Show Profile
Of course I just looked at the site. Thanks for releasing the MOD, and I'm glad we got the counters working properly
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 21 December 2003 :  05:24:17  Show Profile  Visit Webbo's Homepage
Is it possible to modify the global.asa so that it's possible to show the Highest Active Users over a period of time longer than that day?

The code in the global.asa file in the MOD reads:

quote:
<script language="VBScript" runat="Server">

'################## START Snitz Active Users Lite ##############################

'###############################################################################
'## Edited by NiteOwl
'## File name is Global.asa to be located in the ROOT of your web
'## to be used with the Active-Users-Lite application
'###############################################################################
'## Default of this program is running on a server located 3 hours ahead of me.
'## This is changed with the file named last-update txt the text file needs to
'## have one default entry of (in my case)
'## 10/13/2003 02:58:00 AM
'## The script checks this date, compares it to see if its >24hrs and if so
'## overwrites the current entry in the txt file with the current date and time and
'## also runs whatever process I have specified. If the date and time is not yet due
'## the process continues to check.
'################################################################################

Sub Application_OnStart()
Application("ActiveUsers") = 0
Application("HighestToDate") = 0
Application("VisitorsToday") = 0
End Sub

Sub Session_OnStart()
Session.Timeout = 20 '## minutes
Session("Start") = Now

Application.Lock
Application("ActiveUsers") = Application("ActiveUsers") + 1
if Application("ActiveUsers") > Application("HighestToDate") then
Application("HighestToDate") = Application("HighestToDate") + 1
end if
Application("VisitorsToday") = Application("VisitorsToday") + 1
Application.UnLock

Set ObjMyFile = CreateObject("Scripting.FileSystemObject")
Set OpenMyFile = ObjMyFile.OpenTextFile(Server.MapPath("global/last-update.txt"))
MyFileValue = OpenMyFile.ReadLine
OpenMyFile.Close
if DateDiff("h",MyFileValue,NOW) > 24 Then

Application.lock
'#### Insert Apps you want to Run
Application("VisitorsToday") = 1
'#### Insert Apps you want to Run
Application.Unlock

Set WriteMyFile = ObjMyFile.CreateTextFile(Server.MapPath("global/last-update.txt"))
WriteMyFile.WriteLine(NOW)
WriteMyFile.Close
end if
End Sub

Sub Session_OnEnd()
' Decrease the active visitors count when the session ends.
Application.Lock
Application("ActiveUsers") = Application("ActiveUsers") - 1
Application.UnLock
End Sub
'################## End Snitz Active users ######################################
</SCRIPT>



Thanks
Go to Top of Page

Blue Starfish
Starting Member

28 Posts

Posted - 21 December 2003 :  09:41:23  Show Profile
Pardon me for asking this, but is it possible to modify it to show you who's online, and links to their profiles??? Sorry if this has already been asked!!

Cool code,

Jen for Blue Starfish
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 21 December 2003 :  11:10:16  Show Profile  Visit Webbo's Homepage
For that Blue Starfish you'd be better off using the Active Users MOD which can be found here: http://forum.snitz.com/forum/topic.asp?TOPIC_ID=48526
Go to Top of Page

NiteOwl
Junior Member

Canada
403 Posts

Posted - 21 December 2003 :  11:19:56  Show Profile  Visit NiteOwl's Homepage
quote:
Is it possible to modify the global.asa so that it's possible to show the Highest Active Users over a period of time longer than that day?

Hi webbo - I would say yes, BUT remember the information is not written anywhere with this app, if the server boots or the global is overwritten the data would start from zero again. (So its not that reliable when your stretching over 24 hours)


quote:
Pardon me for asking this, but is it possible to modify it to show you who's on-line, and links to their profiles??? Sorry if this has already been asked!!

Hi Blue Starfish - Have a look at the full blown Active Users MOD as that (I think) is really something that should be handled with code rather than the global.asa file.

-=NiteOwl=-
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.19 seconds. Powered By: Snitz Forums 2000 Version 3.4.07