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
This commit is contained in:
Nils Adermann 2006-01-11 21:52:41 +00:00
parent 0e0b1120fb
commit 09edf1e1a5
2 changed files with 3 additions and 3 deletions

View file

@ -564,7 +564,7 @@ CREATE TABLE phpbb_reports (
); );
# Table: 'phpbb_search_results' # Table: 'phpbb_search_results'
CREATE TABLE new_search_results ( CREATE TABLE phpbb_search_results (
search_key varchar(32) DEFAULT '' NOT NULL, search_key varchar(32) DEFAULT '' NOT NULL,
search_time int(11) DEFAULT '0' NOT NULL, search_time int(11) DEFAULT '0' NOT NULL,
search_keywords mediumtext NOT NULL, search_keywords mediumtext NOT NULL,

View file

@ -84,12 +84,12 @@ if ($keywords || $author || $search_id)
// Which forums should not be searched? // Which forums should not be searched?
$ex_fid_ary = array_keys($auth->acl_getf('!f_read', true)); $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 $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 FROM ' . FORUMS_TABLE . ' f
LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id
AND fa.session_id = '" . $db->sql_escape($user->data['session_id']) . "') AND fa.session_id = '" . $db->sql_escape($user->data['session_id']) . "')
WHERE f.forum_id NOT IN (" . implode(', ', $ex_fid_ary) . ") WHERE $not_in_fid(f.forum_password <> '' AND fa.user_id <> " . (int) $user->data['user_id'] . ')
OR (f.forum_password <> '' AND fa.user_id <> " . (int) $user->data['user_id'] . ')
ORDER BY f.left_id'; ORDER BY f.left_id';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);