Fixes for more messups on my part

git-svn-id: file:///svn/phpbb/trunk@512 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2001-06-18 23:18:40 +00:00
parent 499570030a
commit baedfce292
3 changed files with 8 additions and 10 deletions

View file

@ -164,7 +164,7 @@ function auth($type, $forum_id, $userdata, $f_access = -1)
if($userdata['session_logged_in']) if($userdata['session_logged_in'])
{ {
$forum_match_sql = ($forum_id != AUTH_LIST_ALL) ? "AND ( au.forum_id = $forum_id OR au.forum_id = 0 )" : ""; $forum_match_sql = ($forum_id != AUTH_LIST_ALL) ? "AND au.forum_id = $forum_id" : "";
$sql = "SELECT au.forum_id, $a_sql, au.auth_mod, g.group_single_user $sql = "SELECT au.forum_id, $a_sql, au.auth_mod, g.group_single_user
FROM ".AUTH_ACCESS_TABLE." au, " . USER_GROUP_TABLE. " ug, " . GROUPS_TABLE. " g FROM ".AUTH_ACCESS_TABLE." au, " . USER_GROUP_TABLE. " ug, " . GROUPS_TABLE. " g
WHERE ug.user_id = ".$userdata['user_id']. " WHERE ug.user_id = ".$userdata['user_id']. "

View file

@ -139,18 +139,17 @@ if($total_categories)
case 'postgresql': case 'postgresql':
$limit_forums = ($viewcat != -1) ? "AND f.cat_id = $viewcat " : ""; $limit_forums = ($viewcat != -1) ? "AND f.cat_id = $viewcat " : "";
$sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time, p.post_username $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time, p.post_username
FROM ".FORUMS_TABLE." f, ".TOPICS_TABLE." t, ".POSTS_TABLE." p, ".USERS_TABLE." u, ".AUTH_FORUMS_TABLE." af FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
WHERE f.forum_last_post_id = p.post_id WHERE f.forum_last_post_id = p.post_id
AND p.post_id = t.topic_last_post_id AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id AND p.poster_id = u.user_id
AND af.forum_id = f.forum_id
$limit_forums $limit_forums
UNION ( UNION (
SELECT f.*, NULL, NULL, NULL, NULL, NULL, NULL, NULL SELECT f.*, NULL, NULL, NULL, NULL, NULL, NULL, NULL
FROM ".FORUMS_TABLE." f FROM " . FORUMS_TABLE . " f
WHERE NOT EXISTS ( WHERE NOT EXISTS (
SELECT p.post_time SELECT p.post_time
FROM ".POSTS_TABLE." p FROM " . POSTS_TABLE . " p
WHERE f.forum_last_post_id = p.post_id WHERE f.forum_last_post_id = p.post_id
) )
$limit_forums $limit_forums
@ -161,11 +160,10 @@ if($total_categories)
case 'oracle': case 'oracle':
$limit_forums = ($viewcat != -1) ? "AND f.cat_id = $viewcat " : ""; $limit_forums = ($viewcat != -1) ? "AND f.cat_id = $viewcat " : "";
$sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time, p.post_username $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time, p.post_username
FROM ".FORUMS_TABLE." f, ".POSTS_TABLE." p, ".TOPICS_TABLE." t, ".USERS_TABLE." u, ".AUTH_FORUMS_TABLE." af FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u
WHERE f.forum_last_post_id = p.post_id(+) WHERE f.forum_last_post_id = p.post_id(+)
AND p.post_id = t.topic_last_post_id(+) AND p.post_id = t.topic_last_post_id(+)
AND p.poster_id = u.user_id(+) AND p.poster_id = u.user_id(+)
AND af.forum_id = f.forum_id(+)
$limit_forums $limit_forums
ORDER BY f.cat_id, f.forum_order"; ORDER BY f.cat_id, f.forum_order";
break; break;
@ -205,8 +203,8 @@ if($total_categories)
// //
$sql = "SELECT f.forum_id, u.username, u.user_id $sql = "SELECT f.forum_id, u.username, u.user_id
FROM ".FORUMS_TABLE." f, ".USERS_TABLE." u, ".USER_GROUP_TABLE." ug, ".AUTH_ACCESS_TABLE." aa FROM ".FORUMS_TABLE." f, ".USERS_TABLE." u, ".USER_GROUP_TABLE." ug, ".AUTH_ACCESS_TABLE." aa
WHERE ( aa.forum_id = f.forum_id OR aa.forum_id = 0 ) WHERE aa.forum_id = f.forum_id
AND aa.auth_mod = 1 AND aa.auth_mod = " . TRUE . "
AND ug.group_id = aa.group_id AND ug.group_id = aa.group_id
AND u.user_id = ug.user_id AND u.user_id = ug.user_id
ORDER BY f.forum_id, u.user_id"; ORDER BY f.forum_id, u.user_id";

View file

@ -60,7 +60,7 @@ if(isset($forum_id))
FROM ".FORUMS_TABLE." f, ".USERS_TABLE." u, ".USER_GROUP_TABLE." ug, ".AUTH_ACCESS_TABLE." aa FROM ".FORUMS_TABLE." f, ".USERS_TABLE." u, ".USER_GROUP_TABLE." ug, ".AUTH_ACCESS_TABLE." aa
WHERE f.forum_id = $forum_id WHERE f.forum_id = $forum_id
AND aa.auth_mod = 1 AND aa.auth_mod = 1
AND ( aa.forum_id = f.forum_id OR aa.forum_id = 0 ) AND aa.forum_id = f.forum_id
AND ug.group_id = aa.group_id AND ug.group_id = aa.group_id
AND u.user_id = ug.user_id"; AND u.user_id = ug.user_id";
} }