aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewforum.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-03-02 18:19:18 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-03-02 18:19:18 +0000
commit1f13c1bb65611a0874ba9a9c3eac8a1c1eecc4c2 (patch)
tree7dc1e9e46d1e92d9472f1662c7ed9bb298075c75 /phpBB/viewforum.php
parentd2ec2d387481f272479750080c98fde0557edaac (diff)
downloadforums-1f13c1bb65611a0874ba9a9c3eac8a1c1eecc4c2.tar
forums-1f13c1bb65611a0874ba9a9c3eac8a1c1eecc4c2.tar.gz
forums-1f13c1bb65611a0874ba9a9c3eac8a1c1eecc4c2.tar.bz2
forums-1f13c1bb65611a0874ba9a9c3eac8a1c1eecc4c2.tar.xz
forums-1f13c1bb65611a0874ba9a9c3eac8a1c1eecc4c2.zip
Perhaps temporary, perhaps permanent INNER JOIN fix
git-svn-id: file:///svn/phpbb/trunk@76 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewforum.php')
-rw-r--r--phpBB/viewforum.php28
1 files changed, 19 insertions, 9 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 8e425dfb78..efdee4569e 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -29,7 +29,9 @@ if(isset($forum_id))
{
$sql = "SELECT f.forum_type, f.forum_name, u.username, u.user_id
FROM ".FORUMS_TABLE." f, ".FORUM_MODS_TABLE." fm, ".USERS_TABLE." u
- WHERE f.forum_id = '$forum_id' AND fm.forum_id = '$forum_id' AND u.user_id = fm.user_id";
+ WHERE f.forum_id = '$forum_id'
+ AND fm.forum_id = '$forum_id'
+ AND u.user_id = fm.user_id";
}
else
{
@@ -41,6 +43,15 @@ if(!$result = $db->sql_query($sql))
error_die($db, QUERY_ERROR);
}
+$pagetype = "viewforum";
+$page_title = "View Forum - $forum_name";
+include('page_header.'.$phpEx);
+
+//
+// Add checking for private forums here!!
+//
+
+
// If the query dosan't return any rows this isn't a valid forum. Inform the user.
if(!$total_rows = $db->sql_numrows($result))
{
@@ -61,13 +72,6 @@ for($x = 0; $x < $db->sql_numrows($result); $x++)
$forum_moderators .= "<a href=\"profile.$phpEx?mode=viewprofile&user_id=".$forum_row[$x]["user_id"]."\">".$forum_row[$x]["username"]."</a>";
}
-$pagetype = "viewforum";
-$page_title = "View Forum - $forum_name";
-include('page_header.'.$phpEx);
-
-
-// Add checking for private forums here!!
-
$template->set_block("body", "topicrow", "topics");
if(!isset($start))
@@ -75,7 +79,13 @@ if(!isset($start))
$start = 0;
}
-$sql = "SELECT t.*, u.username, p.post_time FROM " . TOPICS_TABLE ." t INNER JOIN ". USERS_TABLE. " u ON t.topic_poster = u.user_id LEFT JOIN ".POSTS_TABLE." p ON p.post_id = t.topic_last_post_id WHERE t.forum_id = '$forum_id' ORDER BY topic_time DESC LIMIT $start, $topics_per_page";
+$sql = "SELECT t.*, u.username, p.post_time
+ FROM " . TOPICS_TABLE ." t
+ LEFT JOIN ". USERS_TABLE. " u ON t.topic_poster = u.user_id
+ LEFT JOIN ".POSTS_TABLE." p ON p.post_id = t.topic_last_post_id
+ WHERE t.forum_id = '$forum_id'
+ ORDER BY topic_time DESC
+ LIMIT $start, $topics_per_page";
if(!$t_result = $db->sql_query($sql))
{
error_die($db, QUERY_ERROR);