Index: openacs-4/packages/general-comments/tcl/general-comments-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/tcl/general-comments-procs.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/general-comments/tcl/general-comments-procs.tcl 9 Mar 2005 17:07:09 -0000 1.18 +++ openacs-4/packages/general-comments/tcl/general-comments-procs.tcl 8 Aug 2006 21:26:56 -0000 1.19 @@ -65,6 +65,7 @@ ad_proc -public general_comments_get_comments { { -print_content_p 0 } { -print_attachments_p 0 } + { -print_user_info_p 1} { -context_id "" } { -my_comments_only_p 0 } object_id @@ -137,7 +138,7 @@ # call on helper proc to print out comment append html [general_comments_print_comment $comment_id $title $mime_type \ $creation_user $author $pretty_date $pretty_date2 $content \ - $print_content_p $print_attachments_p $package_url $return_url] + $print_content_p $print_attachments_p $package_url $return_url $print_user_info_p] } return $html } @@ -155,6 +156,7 @@ print_attachments_p package_url return_url + print_user_info_p } { Helper proc to format and print out a single comment. @param comment_id The id of the comment. @@ -169,6 +171,7 @@ @param print_attachments_p Pass in 1 to print out attachments of comments. @param package_url The url to the mounted general-comments package instance. @param return_url A url for the user to return to after viewing a comment. + @param print_user_info_p Pass 1 in to print out user name and time of entry. } { # -- create query statements to retrieve attachments @@ -194,25 +197,30 @@ append attachments_html "
  • $title " if { $mime_type == "image_gif" || $mime_type == "image/jpeg" } { - append attachments_html "($name)\n" + append attachments_html "($name)\n" } else { - append attachments_html "($name)\n" + append attachments_html "($name)\n" } } db_foreach 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" { - append attachments_html "
  • $label\n" + append attachments_html "
  • $label\n" } if { ![empty_string_p $attachments_html] } { append html "
    [_ general-comments.Attachments]
    \n\n" } } - append html "

    -- $author [_ general-comments.on] $pretty_date2 ([_ general-comments.view_details])

    \n" + append html "

    -- $author [_ general-comments.on] $pretty_date2 ([_ general-comments.view_details])

    \n" } else { - append html "
  • $title [_ general-comments.by] $author [_ general-comments.on] $pretty_date
    \n" + append html "
  • $title" + if {$print_user_info_p} { + append html " [_ general-comments.by] $author [_ general-comments.on] $pretty_date
    \n" + } else { + append html "
    \n" + } } return $html @@ -221,7 +229,7 @@ ad_proc -public general_comments_create_link { -object_name - { -link_text {Add a comment} } + { -link_text #general-comments.Add_comment# } -context_id { -category {} } { -link_attributes "" } @@ -250,7 +258,7 @@ if { ![info exists object_name] } { set object_name [acs_object_name $object_id] } if { ![info exists context_id] } { set context_id $object_id } - set html "$link_text" + set html "$link_text" return $html } @@ -297,7 +305,7 @@ o.object_id = g.comment_id and p.person_id = o.creation_user order by creation_date" { - append html "
  • $title by $author, $creation_date
    \n" + append html "
  • $title by $author, $creation_date
    \n" } return "$html" } @@ -315,7 +323,7 @@ # get the package url set package_url [general_comments_package_url] - set html "$link_text" + set html "$link_text" return $html }