Index: openacs-4/packages/news/www/index-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/Attic/index-oracle.xql,v
diff -u -N
--- openacs-4/packages/news/www/index-oracle.xql 15 Oct 2001 13:41:03 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,48 +0,0 @@
-
-
-
- oracle8.1.6
-
-
-
-
- select case when count(*) = 0 then 0 else 1 end
- from news_items_approved
- where publish_date < sysdate
- and archive_date < sysdate
- and package_id = :package_id
-
-
-
-
-
-
-
- select case when count(*) = 0 then 0 else 1 end
- from news_items_approved
- where publish_date < sysdate
- and (archive_date is null
- or archive_date > sysdate)
- and package_id = :package_id
-
-
-
-
-
-
-
- publish_date < sysdate
- and (archive_date is null or archive_date > sysdate)
-
-
-
-
-
-
-
- publish_date < sysdate
- and archive_date < sysdate
-
-
-
-
Index: openacs-4/packages/news/www/index-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/Attic/index-postgresql.xql,v
diff -u -N
--- openacs-4/packages/news/www/index-postgresql.xql 15 Oct 2001 13:41:03 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,48 +0,0 @@
-
-
-
- postgresql7.1
-
-
-
-
- select case when count(*) = 0 then 0 else 1 end
- from news_items_approved
- where publish_date < current_timestamp
- and archive_date < current_timestamp
- and package_id = :package_id
-
-
-
-
-
-
-
- select case when count(*) = 0 then 0 else 1 end
- from news_items_approved
- where publish_date < current_timestamp
- and (archive_date is null
- or archive_date > current_timestamp)
- and package_id = :package_id
-
-
-
-
-
-
-
- publish_date < current_timestamp
- and (archive_date is null or archive_date > current_timestamp)
-
-
-
-
-
-
-
- publish_date < current_timestamp
- and archive_date < current_timestamp
-
-
-
-
Index: openacs-4/packages/news/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/index.tcl,v
diff -u -N -r1.21 -r1.22
--- openacs-4/packages/news/www/index.tcl 7 Aug 2017 23:48:12 -0000 1.21
+++ openacs-4/packages/news/www/index.tcl 15 Nov 2017 13:42:33 -0000 1.22
@@ -38,7 +38,7 @@
set title [apm_instance_name_from_id $package_id]
set view_clause [db_map view_clause_live]
- if { [db_string archived_p {}]} {
+ if { [db_0or1row archived_p {}]} {
lappend actions_list [_ news.Show_archived_news] \
[export_vars -base [ad_conn url] {{view archive}}] \
[_ news.Show_archived_news]
@@ -49,7 +49,7 @@
set title [apm_instance_name_from_id $package_id]
set view_clause [db_map view_clause_archived]
- if { [db_string live_p {}] } {
+ if { [db_0or1row live_p {}] } {
lappend actions_list [_ news.Show_live_news] \
[export_vars -base [ad_conn url] {{view live}}] \
[_ news.Show_live_news]
Index: openacs-4/packages/news/www/index.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/index.xql,v
diff -u -N -r1.3 -r1.4
--- openacs-4/packages/news/www/index.xql 24 Feb 2005 18:03:05 -0000 1.3
+++ openacs-4/packages/news/www/index.xql 15 Nov 2017 13:42:33 -0000 1.4
@@ -2,6 +2,47 @@
+
+
+ select 1 where exists (
+ select 1 from news_items_approved
+ where publish_date < current_timestamp
+ and archive_date < current_timestamp
+ and package_id = :package_id
+ )
+
+
+
+
+
+ select 1 where exists (
+ select 1
+ from news_items_approved
+ where publish_date < current_timestamp
+ and (archive_date is null
+ or archive_date > current_timestamp)
+ and package_id = :package_id
+ )
+
+
+
+
+
+
+ publish_date < current_timestamp
+ and (archive_date is null or archive_date > current_timestamp)
+
+
+
+
+
+
+
+ publish_date < current_timestamp
+ and archive_date < current_timestamp
+
+
+
@@ -17,5 +58,4 @@
-