Index: openacs-4/packages/general-comments/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/index.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/general-comments/www/index.tcl 7 Nov 2002 08:32:49 -0000 1.4
+++ openacs-4/packages/general-comments/www/index.tcl 24 Jan 2005 00:29:38 -0000 1.5
@@ -45,44 +45,23 @@
# ad_table definition
set table_def [list \
- [list num "[_ general-comments.Num]" {} {
$Tcount | }] \
- [list comment_id "[_ general-comments.ID]" {} \
- {$comment_id | }] \
- [list title "[_ general-comments.Title_1]" {} {}] \
- [list approved_p "[_ general-comments.Approved]" {} 01] \
- [list live_version_p "[_ general-comments.Has_live_version]" {} 01] \
- [list pretty_date "[_ general-comments.Last_Modified]" {creation_date $order} {}] \
+ [list num "[_ general-comments.Num]" {} {$Tcount | }] \
+ [list comment_id "[_ general-comments.ID]" {} \
+ {$comment_id | }] \
+ [list title "[_ general-comments.Title_1]" {} {}] \
+ [list approved_p "[_ general-comments.Approved]" {} 01] \
+ [list live_version_p "[_ general-comments.Has_live_version]" {} 01] \
+ [list pretty_date "[_ general-comments.Last_Modified]" {creation_date $order} {[lc_time_fmt $creation_date "%x %X" en_GB] | }] \
]
-
-# sql to retrieve comments
-set sql "
- select g.comment_id,
- r.title,
- acs_object.name(o.creation_user) as author,
- o.creation_user,
- decode(i.live_revision,null,0,1) as live_version_p,
- decode(i.live_revision,r.revision_id,1,0) as approved_p,
- to_char(o.creation_date, 'MM-DD-YYYY HH12:MI:AM') as pretty_date
- from general_comments g,
- cr_items i,
- cr_revisions r,
- acs_objects o
- where g.comment_id = i.item_id and
- r.revision_id = o.object_id and
- r.revision_id = content_item.get_latest_revision(g.comment_id) and
- o.creation_user = :user_id
- [ad_dimensional_sql $dimensional]
- [ad_order_by_from_sort_spec $orderby $table_def]
-"
# create the table to display the comments
set bind_ns_set [ad_tcl_vars_to_ns_set user_id]
set extra_var_list [list return_url $return_url]
set comments_table [ad_table -Torderby $orderby \
- -Tmissing_text "[_ general-comments.lt_No_comments_available]" \
- -Textra_vars $extra_var_list \
- -bind $bind_ns_set \
- comments_select $sql $table_def]
+ -Tmissing_text "[_ general-comments.lt_No_comments_available]" \
+ -Textra_vars $extra_var_list \
+ -bind $bind_ns_set \
+ comments_select {} $table_def]
set page_title "[_ general-comments.General_Comments]"
set context {}