1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-12 03:34:04 +02:00

Initial SQL updates complete

git-svn-id: file:///svn/phpbb/trunk@281 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen
2001-05-13 16:02:30 +00:00
parent bdaedc9afc
commit e3bd966042
13 changed files with 192 additions and 171 deletions

View File

@@ -35,7 +35,6 @@ init_userprefs($userdata);
//
// End session management
//
//nl2br(var_dump($userdata));
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
@@ -51,7 +50,7 @@ if(empty($viewcat))
include('includes/page_header.'.$phpEx);
$sql = "SELECT c.*
$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
FROM ".CATEGORIES_TABLE." c, ".FORUMS_TABLE." f
WHERE f.cat_id=c.cat_id
GROUP BY c.cat_id, c.cat_title, c.cat_order
@@ -70,14 +69,14 @@ if($total_categories)
$limit_forums = "";
if($viewcat != -1)
{
$limit_forums = " WHERE f.cat_id = $viewcat ";
$limit_forums = "AND f.cat_id = $viewcat ";
}
$sql = "SELECT f.*, t.topic_id, u.username, u.user_id, p.post_time
FROM ".FORUMS_TABLE." f
LEFT JOIN ".POSTS_TABLE." p ON p.post_id = f.forum_last_post_id
LEFT JOIN ".USERS_TABLE." u ON u.user_id = p.poster_id
LEFT JOIN ".TOPICS_TABLE." t ON t.topic_last_post_id = p.post_id
$limit_forums
FROM ".FORUMS_TABLE." f, ".POSTS_TABLE." p, ".USERS_TABLE." u, ".TOPICS_TABLE." t
WHERE p.post_id = f.forum_last_post_id
AND u.user_id = p.poster_id
AND t.topic_last_post_id = p.post_id
$limit_forums
ORDER BY f.cat_id, f.forum_order";
if(!$q_forums = $db->sql_query($sql))
{