Hidden forums work for postgres now.

Note: If the forum dosan't have an entry in the auth_forums it won't show in the index!


git-svn-id: file:///svn/phpbb/trunk@405 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
James Atkinson 2001-06-01 17:08:55 +00:00
parent 4578116303
commit b5e73bc550

View file

@ -94,14 +94,15 @@ 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, p.post_time, u.username, u.user_id $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time, af.auth_view, af.auth_read, af.auth_post, af.auth_reply, af.auth_edit, af.auth_delete, af.auth_votecreate, af.auth_vote
FROM ".FORUMS_TABLE." f, ".TOPICS_TABLE." t, ".POSTS_TABLE." p, ".USERS_TABLE." u FROM ".FORUMS_TABLE." f, ".TOPICS_TABLE." t, ".POSTS_TABLE." p, ".USERS_TABLE." u, ".AUTH_FORUMS_TABLE." af
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 SELECT f.*, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 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
@ -115,11 +116,12 @@ 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 $sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time, af.auth_view, af.auth_read, af.auth_post, af.auth_reply, af.auth_edit, af.auth_delete, af.auth_votecreate, af.auth_vote
FROM ".FORUMS_TABLE." f, ".POSTS_TABLE." p, ".TOPICS_TABLE." t, ".USERS_TABLE." u FROM ".FORUMS_TABLE." f, ".POSTS_TABLE." p, ".TOPICS_TABLE." t, ".USERS_TABLE." u, ".AUTH_FORUMS_TABLE." af
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;
@ -138,9 +140,17 @@ if($total_categories)
break; break;
} }
if(!$q_forums = $db->sql_query($sql)) if(!$q_forums = $db->sql_query($sql))
{
if(DEBUG)
{
$error = $db->sql_error();
error_die(SQL_QUERY, "Could not query forums information.<br>Reason: ".$error['message']."<br>Query: $sql", __LINE__, __FILE__);
}
else
{ {
error_die(SQL_QUERY, "Could not query forums information.", __LINE__, __FILE__); error_die(SQL_QUERY, "Could not query forums information.", __LINE__, __FILE__);
} }
}
$total_forums = $db->sql_numrows($q_forums); $total_forums = $db->sql_numrows($q_forums);
$forum_rows = $db->sql_fetchrowset($q_forums); $forum_rows = $db->sql_fetchrowset($q_forums);