Index: openacs-4/packages/random-photo-portlet/www/random-photo-portlet-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/random-photo-portlet/www/random-photo-portlet-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/random-photo-portlet/www/random-photo-portlet-postgresql.xql 25 May 2005 16:41:18 -0000 1.1 @@ -0,0 +1,35 @@ + + + + postgresql7.3 + + + + select dotlrn_communities_all.community_id + from dotlrn_communities_all, + dotlrn_member_rels_approved + where dotlrn_communities_all.community_id = dotlrn_member_rels_approved.community_id + and dotlrn_member_rels_approved.user_id = :user_id + order by random () + limit 1 + + + + + + + select dotlrn_member_rels_approved.user_id + from registered_users, acs_rels a, + dotlrn_member_rels_approved + where dotlrn_member_rels_approved.community_id = :random_comm_id + and a.rel_type = 'user_portrait_rel' + and a.object_id_one = registered_users.user_id + and dotlrn_member_rels_approved.user_id = registered_users.user_id + order by random () + limit 1 + + + + + + Index: openacs-4/packages/random-photo-portlet/www/random-photo-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/random-photo-portlet/www/random-photo-portlet.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/random-photo-portlet/www/random-photo-portlet.tcl 10 Jun 2004 18:03:13 -0000 1.1 +++ openacs-4/packages/random-photo-portlet/www/random-photo-portlet.tcl 25 May 2005 16:41:18 -0000 1.2 @@ -16,16 +16,10 @@ if [empty_string_p $random_comm_id] { # If the user is in "My Space" - - set comm_list [db_list select_all_communities "*SQL*"] - set random_comm_pos [expr { int(rand()*[llength $comm_list])}] - set random_comm_id [lindex $comm_list $random_comm_pos] - + set random_comm_id [db_list communities "*SQL*"] } -set users_list [db_list "members" "*SQL*"] -set random_user_pos [expr { int(rand()*[llength $users_list])}] -set random_user_id [lindex $users_list $random_user_pos] +set random_user_id [db_list "members" "*SQL*"] if ![db_0or1row "get_member_info" "*SQL*"] { set user_p 0 Index: openacs-4/packages/random-photo-portlet/www/random-photo-portlet.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/random-photo-portlet/www/random-photo-portlet.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/random-photo-portlet/www/random-photo-portlet.xql 10 Jun 2004 18:03:13 -0000 1.1 +++ openacs-4/packages/random-photo-portlet/www/random-photo-portlet.xql 25 May 2005 16:41:18 -0000 1.2 @@ -1,31 +1,6 @@ - - - - select dotlrn_communities_all.community_id - from dotlrn_communities_all, - dotlrn_member_rels_approved - where dotlrn_communities_all.community_id = dotlrn_member_rels_approved.community_id - and dotlrn_member_rels_approved.user_id = :user_id - - - - - - - select dotlrn_member_rels_approved.user_id - from registered_users, acs_rels a, - dotlrn_member_rels_approved - where dotlrn_member_rels_approved.community_id = :random_comm_id - and a.rel_type = 'user_portrait_rel' - and a.object_id_one = registered_users.user_id - and dotlrn_member_rels_approved.user_id = registered_users.user_id - - - - select dotlrn_member_rels_approved.rel_id,