aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2006-01-11 21:52:41 +0000
committerNils Adermann <naderman@naderman.de>2006-01-11 21:52:41 +0000
commit09edf1e1a59f245164a157f60231e8e656961e7e (patch)
treed049ea93189e43fe0dd9c9ec003d38b122ca2d97
parent0e0b1120fba8ed4f2ebc5d62eb29b1a34c1b1007 (diff)
downloadforums-09edf1e1a59f245164a157f60231e8e656961e7e.tar
forums-09edf1e1a59f245164a157f60231e8e656961e7e.tar.gz
forums-09edf1e1a59f245164a157f60231e8e656961e7e.tar.bz2
forums-09edf1e1a59f245164a157f60231e8e656961e7e.tar.xz
forums-09edf1e1a59f245164a157f60231e8e656961e7e.zip
somehow I knew this had to happen :(
(just two very tiny changes to the previous commit) git-svn-id: file:///svn/phpbb/trunk@5443 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/install/schemas/mysql_schema.sql2
-rw-r--r--phpBB/search.php4
2 files changed, 3 insertions, 3 deletions
diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql
index eb60923afc..169fc71ad4 100644
--- a/phpBB/install/schemas/mysql_schema.sql
+++ b/phpBB/install/schemas/mysql_schema.sql
@@ -564,7 +564,7 @@ CREATE TABLE phpbb_reports (
);
# Table: 'phpbb_search_results'
-CREATE TABLE new_search_results (
+CREATE TABLE phpbb_search_results (
search_key varchar(32) DEFAULT '' NOT NULL,
search_time int(11) DEFAULT '0' NOT NULL,
search_keywords mediumtext NOT NULL,
diff --git a/phpBB/search.php b/phpBB/search.php
index fceab40459..2b2151ba10 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -84,12 +84,12 @@ if ($keywords || $author || $search_id)
// Which forums should not be searched?
$ex_fid_ary = array_keys($auth->acl_getf('!f_read', true));
+ $not_in_fid = (sizeof($ex_fid_ary)) ? 'f.forum_id NOT IN (' . implode(', ', $ex_fid_ary) . ') OR ' : '';
$sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, fa.user_id
FROM ' . FORUMS_TABLE . ' f
LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id
AND fa.session_id = '" . $db->sql_escape($user->data['session_id']) . "')
- WHERE f.forum_id NOT IN (" . implode(', ', $ex_fid_ary) . ")
- OR (f.forum_password <> '' AND fa.user_id <> " . (int) $user->data['user_id'] . ')
+ WHERE $not_in_fid(f.forum_password <> '' AND fa.user_id <> " . (int) $user->data['user_id'] . ')
ORDER BY f.left_id';
$result = $db->sql_query($sql);