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.14 -r1.15 --- openacs-4/packages/static-pages/tcl/static-pages-procs.tcl 1 Nov 2003 08:45:39 -0000 1.14 +++ openacs-4/packages/static-pages/tcl/static-pages-procs.tcl 29 Apr 2004 14:25:45 -0000 1.15 @@ -750,14 +750,20 @@ # TemplatingEnabledP, need to know the package_id of the # static-pages instance where this page is located, which is # likely NOT the package_id returned by [ad_conn package_id]: - foreach [list page_id package_id] \ [util_memoize [list sp_get_page_id $sp_filename]] { break } + set templating_enabled_p [parameter::get -package_id $package_id -parameter TemplatingEnabledP -default 0] + set comment_p [parameter::get -package_id $package_id -parameter CommentsDisplayedP -default 1] + set file [ad_conn file] ad_conn -set subsite_id [site_node_closest_ancestor_package "acs-subsite"] # If the page is in the db, serve it carefully; otherwise just dump it out. + # We are careful to use ns_returnfile if possible since it is much more + # efficient than reading the whole file into a tcl string and doing ns_return, + # plus it will give 304's if the file is unchanged. + if { $page_id >= 0 } { set page_info [util_memoize [list sp_get_page_info_query $page_id]] @@ -769,58 +775,73 @@ # 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 "