aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/index.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-05-13 16:02:30 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-05-13 16:02:30 +0000
commite3bd9660427c1cdfb5f906dbc34890ed6e2a5834 (patch)
treef435d6ade1f8742fb31d7cecac386dd7324d3a69 /phpBB/index.php
parentbdaedc9afc2dc1c40aecaf5fb7caa2212449dc9f (diff)
downloadforums-e3bd9660427c1cdfb5f906dbc34890ed6e2a5834.tar
forums-e3bd9660427c1cdfb5f906dbc34890ed6e2a5834.tar.gz
forums-e3bd9660427c1cdfb5f906dbc34890ed6e2a5834.tar.bz2
forums-e3bd9660427c1cdfb5f906dbc34890ed6e2a5834.tar.xz
forums-e3bd9660427c1cdfb5f906dbc34890ed6e2a5834.zip
Initial SQL updates complete
git-svn-id: file:///svn/phpbb/trunk@281 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/index.php')
-rw-r--r--phpBB/index.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/phpBB/index.php b/phpBB/index.php
index 9d7c118290..356ac0fb69 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -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))
{