Announcements fix #1
This commit is contained in:
@@ -46,49 +46,53 @@ function phpbb_fetch_posts($forum_sql, $number_of_posts, $text_length, $time, $t
|
|||||||
|
|
||||||
|
|
||||||
$sql = 'SELECT
|
$sql = '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,
|
||||||
t.topic_time,
|
t.topic_time,
|
||||||
t.topic_title,
|
t.topic_title,
|
||||||
t.topic_attachment,
|
t.topic_attachment,
|
||||||
t.topic_views,
|
t.topic_views,
|
||||||
t.poll_title,
|
t.poll_title,
|
||||||
t.topic_replies,
|
t.topic_replies,
|
||||||
t.forum_id,
|
t.topic_poster,
|
||||||
t.topic_poster,
|
u.username,
|
||||||
u.username,
|
u.user_id,
|
||||||
u.user_id,
|
u.user_type,
|
||||||
u.user_type,
|
u.user_colour,
|
||||||
u.user_colour,
|
p.post_id,
|
||||||
p.post_id,
|
p.post_time,
|
||||||
p.post_time,
|
p.post_text,
|
||||||
p.post_text,
|
p.post_attachment,
|
||||||
p.post_attachment,
|
p.enable_smilies,
|
||||||
p.enable_smilies,
|
p.enable_bbcode,
|
||||||
p.enable_bbcode,
|
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
|
||||||
FROM
|
' . TOPICS_TABLE . ' AS t
|
||||||
' . TOPICS_TABLE . ' AS t,
|
LEFT JOIN
|
||||||
' . USERS_TABLE . ' AS u,
|
' . USERS_TABLE . ' as u
|
||||||
' . POSTS_TABLE . ' AS p,
|
ON
|
||||||
' . FORUMS_TABLE . ' AS f
|
t.topic_poster = u.user_id
|
||||||
WHERE
|
LEFT JOIN
|
||||||
' . $topic_type . '
|
' . FORUMS_TABLE . ' as f
|
||||||
' . $from_forum . '
|
ON
|
||||||
' . $post_time . '
|
t.forum_id=f.forum_id
|
||||||
t.topic_poster = u.user_id AND
|
LEFT JOIN
|
||||||
t.topic_first_post_id = p.post_id AND
|
' . POSTS_TABLE . ' as p
|
||||||
t.topic_status <> 2 AND
|
ON
|
||||||
t.topic_approved = 1 AND
|
t.topic_first_post_id = p.post_id
|
||||||
t.forum_id = f.forum_id
|
WHERE
|
||||||
|
' . $topic_type . '
|
||||||
ORDER BY
|
' . $from_forum . '
|
||||||
t.topic_time DESC';
|
' . $post_time . '
|
||||||
|
t.topic_status <> 2 AND
|
||||||
|
t.topic_approved = 1
|
||||||
|
ORDER BY
|
||||||
|
t.topic_time DESC';
|
||||||
|
|
||||||
|
|
||||||
// query the database
|
// query the database
|
||||||
@@ -219,7 +223,7 @@ function phpbb_fetch_posts($forum_sql, $number_of_posts, $text_length, $time, $t
|
|||||||
t.topic_last_post_id = p.post_id AND
|
t.topic_last_post_id = p.post_id AND
|
||||||
t.topic_status <> 2 AND
|
t.topic_status <> 2 AND
|
||||||
t.topic_approved = 1 AND
|
t.topic_approved = 1 AND
|
||||||
t.forum_id = f.forum_id
|
f.forum_id = t.forum_id
|
||||||
|
|
||||||
ORDER BY
|
ORDER BY
|
||||||
t.topic_last_post_time DESC';
|
t.topic_last_post_time DESC';
|
||||||
|
|||||||
Reference in New Issue
Block a user