Index: openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl,v diff -u -r1.52 -r1.53 --- openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 20 Aug 2007 20:10:13 -0000 1.52 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs.tcl 20 Aug 2007 21:47:38 -0000 1.53 @@ -740,3 +740,23 @@ where pamm.party_id = :party_id $where_clause"] } + +ad_proc -public acs_user::get_portrait_id { + {-user_id:required} +} { + Return the image_id of the portrait of a user, if it does not exist, return 0 + + @param user_id user_id of the user for whom we need the portrait +} { + return [util_memoize [list acs_user::get_portrait_id_not_cached -user_id $user_id] 600] +} + +ad_proc -public acs_user::get_portrait_id_not_cached { + {-user_id:required} +} { + Return the image_id of the portrait of a user, if it does not exist, return 0 + + @param user_id user_id of the user for whom we need the portrait +} { + return [db_string get_item_id "" -default 0] +} Index: openacs-4/packages/acs-tcl/tcl/community-core-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/community-core-procs.xql,v diff -u -r1.20 -r1.21 --- openacs-4/packages/acs-tcl/tcl/community-core-procs.xql 20 Aug 2007 20:12:44 -0000 1.20 +++ openacs-4/packages/acs-tcl/tcl/community-core-procs.xql 20 Aug 2007 21:47:38 -0000 1.21 @@ -219,4 +219,16 @@ + + + + select c.item_id + from acs_rels a, cr_items c + where a.object_id_two = c.item_id + and a.object_id_one = :user_id + and a.rel_type = 'user_portrait_rel' + + + +