First of all, fix your domain scope timeout by setting the domain scope to
timeout at 0. That will keep it alive.

Next, Create a domain scope array with three columns: Forum#,visitor name,
and a timestamp. 

Whenever a person hits a forum, add a row at the top of the array
(position=0) with the specific forum # they are visiting, their name, and
the timestamp.

You then filter the array for for entries that are less than x minutes old
(your definition of "now", I use 10 minutes), and take out the duplicates.

You now have an array of "who is here now" to diplay as you like.

Example:

In this case, multiple forums are on one site, and the forums are numbered
and specified in an argument. I do the thing in application scope. Domain
works the same:


<@IFEMPTY VALUE=@@request$forum><@ELSE>

<@ADDROWS position=0 array=whoishere scope=application value="<@ARRAY COLS=3
value='@@request$forum,@@user$forum_firstname
@@user$forum_lastname,<@TIMETOSECS TIME=<@CURRENTTIME>>'>">
</@IF>
<@comment> The next filter is taking out any items that are more than 600
seconds old and any that might be left over from the day before </@comment>
<@ASSIGN application$whoishere value='<@FILTER array=whoishere
scope=application EXPR="((<@TIMETOSECS TIME=<@CURRENTTIME>> - #3) < 600) AND
((<@TIMETOSECS TIME=<@CURRENTTIME>> - #3) > -1)">'>

<@ASSIGN application$whoishere value='<@DISTINCT array=whoishere
scope=application cols="1,2">'>

<@ASSIGN request$whoishere value='<@FILTER array=whoishere scope=application
EXPR="#1 = @@request$forum">'>
<@comment> <!-- put this where you want to show who is currently browsing ->
Members browsing this forum: <@ROWS array=whoishere scope=request><@IF
EXPR="<@CURROW> > 1">, </@IF><@COL NUM=2></@ROWS>
</@comment>


You will see it at http://www.patricknagel.com/forum_new/

(register and you'll see your name as well as other visitors on the forums
you are on)

On 1/3/05 5:49 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:

> Witango 2000
> IIS 5
> Win2k Server
> 
> Okay, I got one that I am having a hard time figuring out where to start.
> 
> I have many sites but on several of these sites I have either a forum
> or chat room built in Witango. I would like to be able to show a list
> of users currenlty online for all who have logged in for any of the
> particular sites. In other words, in one of the forums, have a spot
> where all usernames are listed of people who happen to be on-line for
> that particular forum. I see this on other forums and would like to
> emulate something similar. Any ideas on how to go about this? I
> assume I have to travel into the world of domain scoped variables.
> 
> Thanks
> 
> 
> ________________________________________________________________________
> TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
> 


-----------------------------------------
Roland Dumas
Roberts Information Services
310 W. Bellevue Avenue
San Mateo CA 94402
650-347-1373
415-412-9300 (cell)
[EMAIL PROTECTED]
SMS: http://new.servqual.com/html/sms.tml


________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to