Index: openacs-4/packages/static-pages/tcl/static-pages-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-pages/tcl/static-pages-procs-postgresql.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/static-pages/tcl/static-pages-procs-postgresql.xql 24 Jul 2001 19:51:56 -0000 1.3
+++ openacs-4/packages/static-pages/tcl/static-pages-procs-postgresql.xql 31 Jul 2001 14:29:50 -0000 1.4
@@ -36,11 +36,10 @@
- FIX ME LOB
- update cr_revisions set content = empty_blob()
- where revision_id = content_item.get_live_revision(:static_page_id)
- returning content into :1
-
+
+ update cr_revisions set content = :file
+ where revision_id = content_item__get_live_revisions(:static_page_id)
+
@@ -59,11 +58,11 @@
- FIX ME LOB
- update cr_revisions set content = empty_blob()
- where revision_id = content_item.get_live_revision(:static_page_id)
- returning content into :1
+ update cr_revisions set content = :file
+ where revision_id = content_item__get_live_revisions(:static_page_id)
+
+
@@ -119,5 +118,17 @@
+
+
+select '{'||content_item__get_title(:page_id)||'} '||CASE WHEN show_comments_p='t' then '1' else '0' END from static_pages where static_page_id = :page_id
+
+
+
+
+select '{'||content_item__get_title(:page_id)||'} '||CASE WHEN show_comments_p='t' then '1' else '0' END from static_pages where static_page_id = :page_id
+
+
+
+
Index: openacs-4/packages/static-pages/tcl/static-pages-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-pages/tcl/static-pages-procs.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/static-pages/tcl/static-pages-procs.tcl 2 Jul 2001 19:40:58 -0000 1.2
+++ openacs-4/packages/static-pages/tcl/static-pages-procs.tcl 31 Jul 2001 14:29:50 -0000 1.3
@@ -311,17 +311,29 @@
@author Brandoch Calef (bcalef@arsdigita.com)
@creation-date 2001-02-23
} {
- return "select '{'||content_item.get_title($page_id)||'} '||decode(show_comments_p,'t',1,0) from static_pages where static_page_id = $page_id"
+ return [db_list get_page_info "select '{'||content_item.get_title($page_id)||'} '||decode(show_comments_p,'t',1,0) from static_pages where static_page_id = $page_id"]
}
+
+ad_proc -private sp_get_page_id { filename } {
+ Gets page_id
+ @author Dave Bauer (dave@thedesignexperience.org)
+ @creation-date 2001-07-30
+} {
+ return [list [db_string search_page "
+ select static_page_id from static_pages sp, sp_folders spf
+ where filename='$filename' and sp.folder_id=spf.folder_id
+ and package_id=[apm_package_id_from_key "static-pages"]" -default -1]]
+}
+
ad_proc -public sp_flush_page { page_id } {
Flushes the cache entry for a static page. This should be done whenever the
page title or show_comment_p setting change.
@author Brandoch Calef (bcalef@arsdigita.com)
@creation-date 2001-02-23
} {
- util_memoize_flush [list db_string get_page_info [sp_get_page_info_query $page_id]]
+ util_memoize_flush [list [sp_get_page_info_query $page_id]]
}
ad_proc -public sp_serve_html_page { } {
@@ -331,25 +343,24 @@
@creation-date 2001-01-23
} {
set filename [ad_conn file]
- set query "select static_page_id from static_pages sp, sp_folders spf
- where filename='$filename' and sp.folder_id=spf.folder_id
- and package_id=[apm_package_id_from_key "static-pages"]"
- set page_id [util_memoize [list db_string search_page $query -default -1]]
+ set page_id [util_memoize [list sp_get_page_id $filename]]
+
# If the page is in the db, serve it carefully; otherwise just dump it out.
if { $page_id >= 0 } {
- set page_info [util_memoize [list db_string get_page_info [sp_get_page_info_query $page_id]]]
+ set page_info [util_memoize [list sp_get_page_info_query $page_id]]
+
+
# We only show the link here if the_public has
# general_comments_create privilege on the page. Why the_public
# rather than the current user? Because we don't want admins to
# be seeing "Add a comment" links on non-commentable pages.
#
set comment_link ""
if { [ad_permission_p -user_id [acs_magic_object the_public] $page_id general_comments_create] } {
- append comment_link "
- [general_comments_create_link -object_name [lindex $page_info 0] $page_id [ad_conn url]]
- "
+
+ append comment_link "[general_comments_create_link -object_name [lindex $page_info 0] $page_id [ad_conn url]]"
}
append comment_link "[general_comments_get_comments -print_content_p [lindex $page_info 1] $page_id [ad_conn url]]"
Index: openacs-4/packages/static-pages/tcl/static-pages-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/static-pages/tcl/static-pages-procs.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/static-pages/tcl/static-pages-procs.xql 6 May 2001 19:54:35 -0000 1.2
+++ openacs-4/packages/static-pages/tcl/static-pages-procs.xql 31 Jul 2001 14:29:50 -0000 1.3
@@ -73,16 +73,23 @@
+
+
+select '{'||content_item__get_title(:page_id)||'} '|| (CASE WHEN show_comments_p='t' then '1' else '0' END) from static_pages where static_page_id = :page_id
+
+
+
- sp_get_page_info_query $page_id
+select '{'||content_item__get_title(:page_id)||'} '|| (CASE WHEN show_comments_p='t' then '1' else '0' END) from static_pages where static_page_id = :page_id
- sp_get_page_info_query $page_id
+select '{'||content_item__get_title(:page_id)||'} '|| (CASE WHEN show_comments_p='t' then '1' else '0' END) from static_pages where static_page_id = :page_id
+