Index: openacs-4/packages/news/www/item.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/item.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/news/www/item.tcl 15 May 2007 20:14:50 -0000 1.15 +++ openacs-4/packages/news/www/item.tcl 9 Nov 2008 23:29:28 -0000 1.16 @@ -35,17 +35,8 @@ # live view of a news item in its active revision -set item_exist_p [db_0or1row one_item " -select item_id, - live_revision, - publish_title, - html_p, - publish_date, - '' || item_creator || '' as creator_link -from news_items_live_or_submitted -where item_id = :item_id"] +set item_exist_p [db_0or1row one_item {}] - if { $item_exist_p } { # workaround to get blobs with >4000 chars into a var, content.blob_to_string fails! @@ -54,70 +45,53 @@ # RAL: publish_body is already snagged in the 1st query above for postgres. # set get_content [db_map get_content] - if {![string match "" $get_content]} { - set publish_body [db_string get_content "select content - from cr_revisions - where revision_id = :live_revision"] + if { $get_content ne "" } { + set publish_body [db_string get_content {}] } # text-only body - if {[info exists html_p] && [string equal $html_p "f"]} { - set publish_body [ad_text_to_html -- $publish_body] + if { !$html_p } { + set publish_body "
[ad_text_to_html -- $publish_body]
" } + # Footer actions + set footer_links [list] + if { [ad_parameter SolicitCommentsP "news" 0] && [ad_permission_p $item_id general_comments_create] } { - set comment_link [general_comments_create_link $item_id "[ad_conn package_url]item?item_id=$item_id"] - set comments [general_comments_get_comments -print_content_p 1 -print_attachments_p 1 \ - $item_id "[ad_conn package_url]item?item_id=$item_id"] + + lappend footer_links [general_comments_create_link \ + -link_attributes { class="button" } \ + $item_id \ + "[ad_conn package_url]item?item_id=$item_id"] + + set comments [general_comments_get_comments \ + -print_content_p 1 \ + -print_attachments_p 1 \ + $item_id "[ad_conn package_url]item?item_id=$item_id"] } else { - set comment_link "" set comments "" } if {[permission::permission_p -object_id $item_id -privilege write] } { - set edit_link "[_ news.Revise]" - } else { - set edit_link "" + lappend footer_links "[_ news.Revise]" } + set footer_links [join $footer_links "\n