From 427604dfb645808958ffe71f0f7ccf8ca21ff9bb Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 23 Aug 2006 18:32:39 +0000 Subject: - Patch #80201: don't show blocks when serving a 404. Saves CPU and bandwidth. --- themes/engines/phptemplate/phptemplate.engine | 36 +++++++++++++++------------ 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'themes/engines/phptemplate/phptemplate.engine') diff --git a/themes/engines/phptemplate/phptemplate.engine b/themes/engines/phptemplate/phptemplate.engine index 744563ad9..831e35059 100644 --- a/themes/engines/phptemplate/phptemplate.engine +++ b/themes/engines/phptemplate/phptemplate.engine @@ -147,7 +147,7 @@ function phptemplate_features() { * generate a series of page template files suggestions based on the * current path. If none are found, the default page.tpl.php is used. */ -function phptemplate_page($content) { +function phptemplate_page($content, $show_blocks = TRUE) { /* Set title and breadcrumb to declared values */ if (drupal_is_front_page()) { @@ -162,23 +162,27 @@ function phptemplate_page($content) { /** * Populate sidebars. */ - $layout = 'none'; - global $sidebar_indicator; - /** - * Sidebar_indicator tells the block counting code to count sidebars separately. - */ - $sidebar_indicator = 'left'; - $sidebar_left = theme('blocks', 'left'); - if ($sidebar_left != '') { - $layout = 'left'; - } + if ($show_blocks) { + global $sidebar_indicator; + /** + * Sidebar_indicator tells the block counting code to count sidebars separately. + */ + $sidebar_indicator = 'left'; + $sidebar_left = theme('blocks', 'left'); + if ($sidebar_left != '') { + $layout = 'left'; + } - $sidebar_indicator = 'right'; - $sidebar_right = theme('blocks', 'right'); - if ($sidebar_right != '') { - $layout = ($layout == 'left') ? 'both' : 'right'; + $sidebar_indicator = 'right'; + $sidebar_right = theme('blocks', 'right'); + if ($sidebar_right != '') { + $layout = ($layout == 'left') ? 'both' : 'right'; + } + $sidebar_indicator = NULL; + } + else { + $layout = 'none'; } - $sidebar_indicator = NULL; // Construct page title if (drupal_get_title()) { -- cgit v1.2.3