Author |
Topic |
tomasalsbro
Average Member
Sweden
818 Posts |
Posted - 21 April 2001 : 06:25:53
|
Hi, How do I do to have "Active Users + Visits Today" shown the way it does in this forum (under the Snitz Forums 2000 image at the top left) Cheers / Tomas?
!-Keep distance in trafik-! www.whiplash.pp.se |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 21 April 2001 : 06:49:56
|
fisrstly , you need a global.asa file which contains the following code
<script language="vbscript" runat="server"> sub Session_OnStart set Session("HistLog") = Server.CreateObject("Scripting.Dictionary") Session("HistCount") = 0 end sub
sub Session_OnEnd Session("HistCount") = nothing set Session("HistLog") = nothing end sub </script>
Then place this code where you want it displayed.
<B><%= Application("ActiveUsers") %></B> Active Users <B><%= Application("VisitorsToday") %></B> Visitors Today
|
|
|
tomasalsbro
Average Member
Sweden
818 Posts |
Posted - 21 April 2001 : 06:54:39
|
OK Huw, any suggestions of were in the global.asa I should put the code? Cheers / Tomas
!-Keep distance in trafik-! www.whiplash.pp.se |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 21 April 2001 : 07:32:58
|
If you already have a global asa, then you will need to check whether you already have a session_onstart and session_onend defined, if not simply insert the code at the end of your global.asa
If you already have the functions defined, then just copy the code from each of the functions, and insert it at the end of your existing functions
|
|
|
tomasalsbro
Average Member
Sweden
818 Posts |
Posted - 21 April 2001 : 08:07:28
|
OK Huw, I have done what you suggested but there are no figures showing any visitors or active user. Take a look here http://www.whiplash.pp.se/forum/default.asp Tomas
!-Keep distance in trafik-! www.whiplash.pp.se |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 21 April 2001 : 08:46:30
|
the global.asa should be in the root of your website, is that where you placed it.
The only problem with this mod, is it doesn't show you active and total users for the forum, but for the whole site.
|
|
|
tomasalsbro
Average Member
Sweden
818 Posts |
Posted - 21 April 2001 : 09:25:27
|
quote:
the global.asa should be in the root of your website, is that where you placed it.
The only problem with this mod, is it doesn't show you active and total users for the forum, but for the whole site.
OK Huw, then it's nothing for me I guess. Cheers / Tomas
!-Keep distance in trafik-! www.whiplash.pp.se |
|
|
ki5ck
New Member
69 Posts |
Posted - 05 May 2001 : 12:33:09
|
I have this added to my site, and I have the Global.asa (as listed above) in my web site root. I'm not getting any numbers, though. What should I check?
Paul Wood SLT Webmaster |
|
|
ki5ck
New Member
69 Posts |
Posted - 05 May 2001 : 17:07:59
|
Ah. Fixed it. I used a method I found on coveryourasp.com. Still not sure why I couldn't get the other method to work.
Paul Wood SLT Webmaster |
|
|
MAD_PsyClown
Starting Member
Denmark
6 Posts |
Posted - 15 May 2001 : 14:35:14
|
Mine dosn't show any numbers either, can someone plz help me?
|
|
|
whiterose
Starting Member
18 Posts |
Posted - 18 May 2001 : 19:07:47
|
what exactly is a global asa?
|
|
|
mafifi
Junior Member
USA
308 Posts |
|
mafifi
Junior Member
USA
308 Posts |
Posted - 21 May 2001 : 21:35:10
|
Copy this code into a file and call it global.asa and place it into you Root directory.
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart Application("ActiveUsers") = 0 Application("TodaysDate") = Date
End Sub
Sub Session_OnStart If Application("VisitorsToday") = "" then Application("VisitorsToday") = 0 end if Session.Timeout = 10 ' minutes Session("Start") = Now Application.Lock Application("ActiveUsers") = Application("ActiveUsers") + 1 if Application("TodaysDate") = Date then Application("VisitorsToday") = Application("VisitorsToday") + 1 else Application("TodaysDate") = Date Application("VisitorsToday") = 1 end if Application.UnLock 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
</SCRIPT>
Copy this code and put it where you want the information to show.
<%Response.Write "Active Users: " & Application("ActiveUsers") &" Visits Today: " & Application("VisitorsToday") %>
I placed mine in the inc_top.asp at the end of line No. 137 <BR><BR><FONT FACE="Arial" SIZE="1"><%Response.Write "Active Users: " & Application("ActiveUsers") &" Visits Today: " & Application("VisitorsToday") %></FONT>
Thanks,
Mo |
|
|
NucleusWDS
Starting Member
United Kingdom
38 Posts |
Posted - 23 May 2001 : 09:57:51
|
Can some HELP Please ... I can't get VISITS TODAY to display numbers ...
Followed the instructions as above ... Here check it out http://www.amd3d.com/forum
Edited by - NucleusWDS on 23 May 2001 09:58:34 |
|
|
mafifi
Junior Member
USA
308 Posts |
Posted - 24 May 2001 : 20:09:13
|
Correction. Place the following code at the end of line No. 114 NOT line 137, Sorry.
<BR><BR><FONT FACE="Arial" SIZE="1"><%Response.Write "Active Users: " & Application("ActiveUsers") &" Visits Today: " & Application("VisitorsToday") %></FONT>
Check mine. http://www.media-2000.com/forum/
If you still having problems I can e-mail you the whole inc_top.asp file.
Thanks,
Mo |
|
|
nalley
Starting Member
34 Posts |
Posted - 24 May 2001 : 20:09:23
|
Hi NucleusWDS:
I went to your side and I noticed the active user in your fourm is seperated into members and guests two sections. I am wondering how can you do that? where you do get that code?
As to the VISITS TODAY, I don't recommend you to do show that number. I follow the step as above, and it did show the numbers, but as long as your server was down, even though just one second, the vists counts will be back to zero. That's why I have experienced.
|
|
|
Topic |
|