Index: openacs-4/packages/acs-subsite/www/shared/portrait.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/shared/portrait.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/acs-subsite/www/shared/portrait.tcl 27 Jun 2015 16:47:27 -0000 1.10 +++ openacs-4/packages/acs-subsite/www/shared/portrait.tcl 7 Aug 2017 23:47:59 -0000 1.11 @@ -18,18 +18,24 @@ set subsite_url [subsite::get_element -element url] -if {![db_0or1row user_info "select first_names, last_name from persons where person_id=:user_id"]} { +if {![db_0or1row user_info { + select first_names, last_name + from persons + where person_id = :user_id +}]} { ad_return_warning "Account Unavailable" "We can't find user #$user_id in the users table." return } -if {![db_0or1row get_item_id "select i.width, i.height, cr.title, cr.description, cr.publish_date - from acs_rels a, cr_items c, cr_revisions cr, images i - where a.object_id_two = c.item_id - and c.live_revision = cr.revision_id - and cr.revision_id = i.image_id - and a.object_id_one = :user_id - and a.rel_type = 'user_portrait_rel'"]} { +if {![db_0or1row get_item_id { + select i.width, i.height, cr.title, cr.description, cr.publish_date + from acs_rels a, cr_items c, cr_revisions cr, images i + where a.object_id_two = c.item_id + and c.live_revision = cr.revision_id + and cr.revision_id = i.image_id + and a.object_id_one = :user_id + and a.rel_type = 'user_portrait_rel' +}]} { ad_return_complaint 1 "
  • You shouldn't have gotten here; we don't have a portrait on file for this person." return } @@ -42,7 +48,13 @@ set doc(title) [_ acs-subsite.lt_Portrait_of_first_last] set context [list [list [acs_community_member_url -user_id $user_id] "$first_names $last_name"] [_ acs-subsite.Portrait]] -set export_vars [export_vars {user_id}] +set portrait_image_url [export_vars -base ${subsite_url}shared/portrait-bits.tcl {user_id}] set pretty_date [lc_time_fmt $publish_date "%q"] ad_return_template + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: