Author |
Topic |
|
NiteOwl
Junior Member
Canada
403 Posts |
Posted - 21 October 2003 : 20:29:53
|
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
|
23 pending members ... shame on you
But a good MOD, I can see where it will come it handy |
|
|
NiteOwl
Junior Member
Canada
403 Posts |
Posted - 21 October 2003 : 20:47:35
|
The site has been active for 5 weeks, it has over 1000 members and grows by 25 to 50 a day grin
|
-=NiteOwl=-
|
|
|
laser
Advanced Member
Australia
3859 Posts |
Posted - 21 October 2003 : 21:06:20
|
Of course I just looked at the site. Thanks for releasing the MOD, and I'm glad we got the counters working properly |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 21 December 2003 : 05:24:17
|
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 |
|
|
Blue Starfish
Starting Member
28 Posts |
Posted - 21 December 2003 : 09:41:23
|
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 |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
|
NiteOwl
Junior Member
Canada
403 Posts |
Posted - 21 December 2003 : 11:19:56
|
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=-
|
|
|
|
Topic |
|