Index: openacs-4/packages/acs-subsite/www/pvt/home.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/pvt/home.adp,v diff -u -r1.15 -r1.16 --- openacs-4/packages/acs-subsite/www/pvt/home.adp 30 Sep 2003 10:22:36 -0000 1.15 +++ openacs-4/packages/acs-subsite/www/pvt/home.adp 1 Oct 2003 15:48:37 -0000 1.16 @@ -44,3 +44,5 @@

+

Who's online?

+» View a list of online users \ No newline at end of file Fisheye: Tag 1.3 refers to a dead (removed) revision in file `openacs-4/packages/acs-subsite/www/shared/whos-online-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-subsite/www/shared/whos-online.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/whos-online.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/www/shared/whos-online.adp 15 Aug 2003 21:18:13 -0000 1.6 +++ openacs-4/packages/acs-subsite/www/shared/whos-online.adp 1 Oct 2003 15:48:37 -0000 1.7 @@ -2,34 +2,11 @@ @title;noquote@ @context;noquote@ - - This page is mostly useful in conjunction with - @chat_system_name@. - - - - These are the registered users who have requested a page from this server within the last -@last_visit_interval@ seconds. +@whos_online_interval@ seconds. Note that not logged +in users are not included in this list.

- -On a public Internet service, the number of casual surfers -(unregistered) will outnumber the registered users by at least 10 to -1. Thus there could be many more people using this service than it -would appear. - + +

Index: openacs-4/packages/acs-subsite/www/shared/whos-online.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/whos-online.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/www/shared/whos-online.tcl 15 Aug 2003 21:18:13 -0000 1.5 +++ openacs-4/packages/acs-subsite/www/shared/whos-online.tcl 1 Oct 2003 15:48:37 -0000 1.6 @@ -1,36 +1,43 @@ ad_page_contract { Displays who's currently online + @author Peter Marklund + @cvs-id $Id$ } -properties { title:onevalue context:onevalue - last_visit_interval:onevalue - chat_system_name:onevalue - connected_user_id:onevalue - users:multirow - subsite_url:onevalue } -set subsite_url [subsite::get_element -element url] -set connected_user_id [ad_verify_and_get_user_id] +set title "Who's Online?" +set context [list "Who's Online"] -db_multirow users grab_users "select user_id, first_names, last_name, email -from cc_users -where last_visit > sysdate - [ad_parameter LastVisitUpdateInterval "" 600]/86400 -order by upper(last_name), upper(first_names), email" +set whos_online_interval [util::whos_online::interval] -db_release_unused_handles +template::list::create \ + -name online_users \ + -multirow online_users \ + -elements { + user_link { + label "User name" + display_template { + @online_users.user_link;noquote@ + } + } + last_request_seconds { + label "Seconds since last request" + } + } -set title "Who's Online?" -set context [list "Who's Online"] +multirow create online_users user_link last_request_seconds +foreach user_id [util::whos_online::user_ids] { + acs_user::get -user_id $user_id -array user + set user_name "$user(first_names) $user(last_name)" + set user_link [acs_community_member_link -user_id $user_id -label $user_name] -set last_visit_interval [ad_parameter LastVisitUpdateInterval ""] + set last_request_seconds [util::whos_online::time_since_last_request $user_id] -#if ![ad_parameter EnabledP chat 0] { - set chat_system_name "" -#} else { -# set chat_system_name [chat_system_name] -#} + multirow append online_users $user_link $last_request_seconds +} ad_return_template