Index: openacs-4/packages/news-portlet/www/news-portlet-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/www/Attic/news-portlet-oracle.xql,v diff -u -r1.8 -r1.9 --- openacs-4/packages/news-portlet/www/news-portlet-oracle.xql 8 Aug 2006 21:27:05 -0000 1.8 +++ openacs-4/packages/news-portlet/www/news-portlet-oracle.xql 19 Jun 2018 09:28:45 -0000 1.9 @@ -3,31 +3,6 @@ oracle8.1.6 - - - select news_items_approved.package_id, - acs_object.name(apm_package.parent_id(news_items_approved.package_id)) as parent_name, - (select site_node.url(site_nodes.node_id) - from site_nodes - where site_nodes.object_id = news_items_approved.package_id) as url, - news_items_approved.item_id, - news_items_approved.publish_title, - to_char(news_items_approved.publish_date, 'YYYY-MM-DD HH24:MI:SS') as publish_date_ansi, - item_creator, - creation_user - $content_column - from news_items_approved - where news_items_approved.publish_date < sysdate - and (news_items_approved.archive_date >= sysdate or news_items_approved.archive_date is null) - and news_items_approved.package_id in ([join $list_of_package_ids ", "]) - order by package_id, - parent_name, - news_items_approved.publish_date desc, - news_items_approved.publish_title - - - - select package_id Index: openacs-4/packages/news-portlet/www/news-portlet-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/www/Attic/news-portlet-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/news-portlet/www/news-portlet-postgresql.xql 7 Aug 2017 23:48:12 -0000 1.5 +++ openacs-4/packages/news-portlet/www/news-portlet-postgresql.xql 19 Jun 2018 09:28:45 -0000 1.6 @@ -3,30 +3,6 @@ postgresql7.1 - - - select news_items_approved.package_id, - acs_object__name(apm_package__parent_id(news_items_approved.package_id)) as parent_name, - (select site_node__url(site_nodes.node_id) - from site_nodes - where site_nodes.object_id = news_items_approved.package_id) as url, - item_id, - publish_title, - to_char(news_items_approved.publish_date, 'YYYY-MM-DD HH24:MI:SS') as publish_date_ansi, - item_creator, - creation_user - $content_column - from news_items_approved - where publish_date < current_timestamp - and (archive_date >= current_timestamp or archive_date is null) - and package_id in ([join $list_of_package_ids ", "]) - order by package_id, - parent_name, - publish_date desc, - publish_title - - - select package_id Index: openacs-4/packages/news-portlet/www/news-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/www/news-portlet.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/news-portlet/www/news-portlet.tcl 7 Aug 2017 23:48:12 -0000 1.23 +++ openacs-4/packages/news-portlet/www/news-portlet.tcl 19 Jun 2018 09:28:45 -0000 1.24 @@ -70,9 +70,10 @@ set news_url [news_util_get_url $package_id] if { $display_subgroup_items_p } { - db_foreach select_subgroup_package_ids {} { + set subgroup_package_ids [db_list select_subgroup_package_ids {}] + if {[llength $subgroup_package_ids] > 0} { set one_instance_p 0 - lappend list_of_package_ids $package_id + lappend list_of_package_ids {*}$subgroup_package_ids } } } @@ -90,20 +91,42 @@ set content_column ,[join $content_column ,] } -db_multirow -extend { publish_date view_url creator_url} news_items select_news_items {} { +db_multirow -extend { publish_date view_url creator_url } news_items select_news_items [subst { + select news_items_approved.package_id, + (select instance_name + from apm_packages pp, + site_nodes pn + where pp.package_id = pn.object_id + and pn.node_id = n.parent_id) as parent_name, + n.node_id, + item_id, + publish_title, + to_char(news_items_approved.publish_date, 'YYYY-MM-DD HH24:MI:SS') as publish_date_ansi, + item_creator, + creation_user + $content_column + from news_items_approved + left join site_nodes n on n.object_id = news_items_approved.package_id + where publish_date < current_timestamp + and (archive_date >= current_timestamp or archive_date is null) + and package_id in ([join $list_of_package_ids ", "]) + order by package_id, + parent_name, + publish_date desc, + publish_title +}] { set publish_date [lc_time_fmt $publish_date_ansi "%q"] - if { [info exists ipackages($package_id)] } {set url $ipackages($package_id)} + set url [expr {[info exists ipackages($package_id)] ? + $ipackages($package_id) : [site_node::get_url -node_id $node_id]}] set view_url [export_vars -base "${url}item" { item_id }] - set creator_url "" # text-only body if {$display_item_content_p } { set publish_body \ [ad_html_text_convert -from $publish_format -to text/html -- $publish_body] } - if { $display_item_attribution_p } { - set creator_url [acs_community_member_url -user_id $creation_user] - } + set creator_url [expr {$display_item_attribution_p ? + [acs_community_member_url -user_id $creation_user] : ""}] } # Local variables: