Index: openacs-4/packages/photo-album/www/base-photo.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/base-photo.tcl,v diff -u -r1.4 -r1.4.6.1 --- openacs-4/packages/photo-album/www/base-photo.tcl 18 Nov 2003 22:59:03 -0000 1.4 +++ openacs-4/packages/photo-album/www/base-photo.tcl 2 Dec 2005 09:34:15 -0000 1.4.6.1 @@ -38,35 +38,15 @@ set context [pa_context_bar_list -final "[_ photo-album._Full]" $photo_id] # query all the photo and permission info with a single trip to database -db_1row get_photo_info {select - pp.caption, - pp.story, - cr.title, - cr.description, - i.height as height, - i.width as width, - i.image_id as image_id, - ci.parent_id as album_id -from cr_items ci, - cr_revisions cr, - pa_photos pp, - cr_items ci2, - cr_child_rels ccr2, - images i -where cr.revision_id = pp.pa_photo_id - and ci.live_revision = cr.revision_id - and ci.item_id = ccr2.parent_id - and ccr2.child_id = ci2.item_id - and ccr2.relation_tag = 'base' - and ci2.live_revision = i.image_id - and ci.item_id = :photo_id -} -set path $image_id +if {![db_0or1row get_photo_info {}]} { + ad_return_error "[_ photo-album.No_Photo]" "[_ photo-album.lt_No_Photo_was_found_fo]" +} else { + set path $image_id -# determine what album page the photo is on so page can present link back to thumbnail page -set page_num [pa_page_of_photo_in_album $photo_id $album_id] + # determine what album page the photo is on so page can present link back to thumbnail page + set page_num [pa_page_of_photo_in_album $photo_id $album_id] + + set photo_nav_html [pa_pagination_bar $photo_id [pa_all_photos_in_album $album_id] "base-photo?photo_id="] -set photo_nav_html [pa_pagination_bar $photo_id [pa_all_photos_in_album $album_id] "base-photo?photo_id="] - -ad_return_template - + ad_return_template +} Index: openacs-4/packages/photo-album/www/photo.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo.tcl,v diff -u -r1.8 -r1.8.2.1 --- openacs-4/packages/photo-album/www/photo.tcl 3 May 2004 13:13:56 -0000 1.8 +++ openacs-4/packages/photo-album/www/photo.tcl 2 Dec 2005 09:34:15 -0000 1.8.2.1 @@ -94,14 +94,15 @@ # if we did get a photo, and we need html source, get some info about the thumbnail db_0or1row get_thumbnail_info { *SQL* } } + set path $image_id } -set path $image_id + # to move a photo need write on photo and write on parent album set move_p [expr $write_p && $album_write_p] # build form to move the photo if move_p is 1