Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Upload/inc/plugins/asb/modules/recent_posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,12 @@ function asb_recent_posts_get_content($settings, $script, $dateline)

if ($dateline &&
$dateline !== TIME_NOW) {
$newQuery = $db->simple_select('posts p', 'pid', "p.visible='1'{$query_where} AND p.dateline > {$dateline}", array('limit' => 1));
$newQuery = $db->simple_select(
"posts p LEFT JOIN {$db->table_prefix}threads ON (p.tid=t.tid)",
'pid',
"p.visible='1' AND t.visible='1'{$query_where} AND p.dateline > {$dateline}",
array('limit' => 1)
);

if ($db->num_rows($newQuery) < 1) {
// no new content
Expand All @@ -181,7 +186,7 @@ function asb_recent_posts_get_content($settings, $script, $dateline)
LEFT JOIN {$db->table_prefix}users u ON (u.uid=p.uid)
LEFT JOIN {$db->table_prefix}threads t ON (t.tid=p.tid)
WHERE
p.visible='1'{$query_where}
p.visible='1' AND t.visible='1'{$query_where}
ORDER BY
p.dateline DESC
LIMIT
Expand Down