sql_build_query update

This commit is contained in:
Ice
2008-08-09 14:11:01 +00:00
parent 27d9a538bd
commit 618d0cca19

View File

@@ -174,9 +174,8 @@ function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_le
} }
$sql_array = array(
$sql = 'SELECT 'SELECT' => 't.forum_id,
t.forum_id,
t.topic_id, t.topic_id,
t.topic_last_post_id, t.topic_last_post_id,
t.topic_last_post_time, t.topic_last_post_time,
@@ -200,30 +199,38 @@ function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_le
p.enable_magic_url, p.enable_magic_url,
p.bbcode_bitfield, p.bbcode_bitfield,
p.bbcode_uid, p.bbcode_uid,
f.forum_name f.forum_name',
FROM
' . TOPICS_TABLE . ' AS t 'FROM' => array(
LEFT JOIN TOPICS_TABLE => 't',
' . USERS_TABLE . ' as u ),
ON
' . $user_link . ' 'LEFT_JOIN' => array(
LEFT JOIN array(
' . FORUMS_TABLE . ' as f 'FROM' => array(USERS_TABLE => 'u'),
ON 'ON' => $user_link,
t.forum_id=f.forum_id ),
LEFT JOIN array(
' . POSTS_TABLE . ' as p 'FROM' => array(FORUMS_TABLE => 'f'),
ON 'ON' => 't.forum_id=f.forum_id',
' . $post_link . ' ),
WHERE array(
' . $topic_type . ' 'FROM' => array(POSTS_TABLE => 'p'),
'ON' => $post_link,
),
),
'WHERE' => $topic_type . '
' . $post_time . ' ' . $post_time . '
AND t.topic_status <> 2 AND t.topic_status <> 2
AND t.topic_approved = 1 AND t.topic_approved = 1
AND t.topic_moved_id = 0 AND t.topic_moved_id = 0
' . $str_where .' ' . $str_where,
ORDER BY
' . $topic_order; 'ORDER_BY' => $topic_order,
);
$sql = $db->sql_build_query('SELECT', $sql_array);
if ($number_of_posts <> 0) if ($number_of_posts <> 0)
{ {