From a392bb19d31cafe19c6591fffd116d8878055342 Mon Sep 17 00:00:00 2001 From: alex_t_king Date: Thu, 1 Jan 2004 21:12:22 +0000 Subject: [PATCH] suppressing Notice messages and moving the use_cache setting higher in blog-header so that it actually gets used when getting settings git-svn-id: http://svn.automattic.com/wordpress/trunk@677 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-blog-header.php | 3 ++- wp-includes/functions.php | 4 +++- wp-includes/template-functions.php | 11 +++++++---- wp-includes/wp-db.php | 2 ++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/wp-blog-header.php b/wp-blog-header.php index ec842d716..949168382 100644 --- a/wp-blog-header.php +++ b/wp-blog-header.php @@ -1,5 +1,7 @@ $setting)) { error_log("get_settings: Didn't find setting $setting"); } - return $settings->$setting; + else { + return $settings->$setting; + } } function get_alloptions() { diff --git a/wp-includes/template-functions.php b/wp-includes/template-functions.php index 01958be04..8ece23dd4 100644 --- a/wp-includes/template-functions.php +++ b/wp-includes/template-functions.php @@ -129,9 +129,9 @@ function wp_title($sep = '»', $display = true) { } // Send it out - if ($display && $title) { + if ($display && isset($title)) { echo " $sep $title"; - } elseif (!$display && $title) { + } elseif (!$display && isset($title)) { return " $sep $title"; } } @@ -304,7 +304,9 @@ function get_calendar($daylength = 1) { return; } - $w = ''.intval($HTTP_GET_VARS['w']); + if (isset($HTTP_GET_VARS['w'])) { + $w = ''.intval($HTTP_GET_VARS['w']); + } $time_difference = get_settings('time_difference'); // Let's figure out when we are @@ -419,6 +421,7 @@ function get_calendar($daylength = 1) { ); if ($ak_post_titles) { foreach ($ak_post_titles as $ak_post_title) { + $ak_titles_for_day["$ak_post_title->dom"] = ''; if (empty($ak_titles_for_day["$ak_post_title->dom"])) { // first one $ak_titles_for_day["$ak_post_title->dom"] .= htmlspecialchars(stripslashes($ak_post_title->post_title)); } else { @@ -434,7 +437,7 @@ function get_calendar($daylength = 1) { $daysinmonth = intval(date('t', $unixmonth)); for ($day = 1; $day <= $daysinmonth; ++$day) { - if ($newrow) + if (isset($newrow) && $newrow) echo "\n\t\n\t\n\t\t"; $newrow = false; diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 9fb35b39a..9683308ee 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -20,6 +20,7 @@ var $debug_called; var $vardump_called; var $show_errors = true; + var $querycount; // ================================================================== // DB Constructor - connects to the server and selects a database @@ -44,6 +45,7 @@ $this->select($dbname); + $this->querycount = 0; }