Index: openacs-4/contrib/packages/general-comments/www/view-comment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/general-comments/www/Attic/view-comment.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/general-comments/www/view-comment.tcl 2 May 2003 15:50:44 -0000 1.1 +++ openacs-4/contrib/packages/general-comments/www/view-comment.tcl 14 Jul 2003 01:39:34 -0000 1.2 @@ -50,89 +50,30 @@ }] } # get revision data from the database - if { ![db_0or1row get_revision_comment { - select g.object_id, - g.comment_id, - content_item.get_live_revision(g.comment_id) as live_revision, - r.revision_id, - r.title, - r.content, - r.mime_type, - o.creation_user, - o.creation_date, - acs_object.name(o.creation_user) as author - from general_comments g, - cr_revisions r, - acs_objects o - where g.comment_id = o.object_id and - g.comment_id = r.item_id and - r.revision_id = :revision_id - }] } { + if { ![db_0or1row get_revision_comment {}] } { ad_return_complaint 1 "[_ general-comments.lt_The_comment_id_does_n]" } } else { # get live revision data from the database - if { ![db_0or1row get_comment { - select g.object_id, - g.comment_id, - r.revision_id as live_revision, - r.revision_id, - r.title, - r.content, - r.mime_type, - o.creation_user, - o.creation_date, - acs_object.name(o.creation_user) as author - from general_comments g, - acs_objects o, - cr_revisions r - where g.comment_id = :comment_id and - g.comment_id = o.object_id and - g.comment_id = r.item_id and - r.revision_id = content_item.get_live_revision(:comment_id) - }] } { + if { ![db_0or1row get_comment {}] } { ad_return_complaint 1 "[_ general-comments.lt_The_comment_id_does_n]" } } -db_multirow attachments get_attachments { - select r.title, - r.mime_type, - i.name, - i.item_id - from cr_items i, - cr_revisions r - where i.parent_id = :comment_id and - r.revision_id = i.live_revision -} +db_multirow attachments get_attachments {} -db_multirow links get_links { - select i.item_id, - e.label, - e.url - from cr_items i, cr_extlinks e - where i.parent_id = :comment_id and - e.extlink_id = i.item_id -} +db_multirow links get_links {} -db_multirow revisions get_revisions { - select r.revision_id, - to_char(o.creation_date, 'MM-DD-YY HH24:MI:SS') as revision_date - from cr_revisions r, - acs_objects o - where r.item_id = :comment_id and - o.object_id = r.revision_id - order by o.creation_date desc -} +db_multirow revisions get_revisions {} set allow_file_p [ad_parameter AllowFileAttachmentsP {general-comments} {t}] set allow_link_p [ad_parameter AllowLinkAttachmentsP {general-comments} {t}] set allow_attach_p "t" if { $allow_file_p == "f" && $allow_link_p == "f" } { set allow_attach_p "f" } -set comment_on_id [db_string get_object_id "select object_id from general_comments where comment_id = :comment_id"] +set comment_on_id [db_string get_object_id ""] set page_title "[_ general-comments.View_comment_on]: [acs_object_name $comment_on_id]" set context "\"[_ general-comments.View_comment]\"" set return_url_view "[ad_urlencode view-comment?[export_ns_set_vars url]]"