From 73d61b7839c407cee996a6d79f7d4bce63e81d87 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 12 Oct 2001 18:35:21 +0000 Subject: - fixed 4 SQL queries to use ANSI SQL instead: '||' --> 'OR' --- includes/theme.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'includes/theme.inc') diff --git a/includes/theme.inc b/includes/theme.inc index a4d0eb2a6..95be767b9 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -97,8 +97,8 @@ function theme_blocks($region, $theme) { break; case "/index.php": - if ($user->uid) $result = db_query("SELECT * FROM blocks b LEFT JOIN layout l ON b.name = l.block WHERE (b.status = 2 OR (b.status = 1 AND l.userid = '$user->uid'))". (($region == "left" || $region == "right") ? ($region == "left" ? " AND b.region = 0" : " AND b.region = 1") : "") ." ORDER BY weight"); - else $result = db_query("SELECT * FROM blocks WHERE status = 2". (($region == "left" || $region == "right") ? ($region == "left" ? " AND region = 0" : " AND region = 1") : "") ." ORDER BY weight"); + if ($user->uid) $result = db_query("SELECT * FROM blocks b LEFT JOIN layout l ON b.name = l.block WHERE (b.status = 2 OR (b.status = 1 AND l.userid = '$user->uid'))". (($region == "left" OR $region == "right") ? ($region == "left" ? " AND b.region = 0" : " AND b.region = 1") : "") ." ORDER BY weight"); + else $result = db_query("SELECT * FROM blocks WHERE status = 2". (($region == "left" OR $region == "right") ? ($region == "left" ? " AND region = 0" : " AND region = 1") : "") ." ORDER BY weight"); while ($result && ($block = db_fetch_object($result))) { $blocks = module_invoke($block->module, "block"); if ($blocks[$block->offset]["content"]) -- cgit v1.2.3