Fixed forum read checking logic!

This commit is contained in:
flash 2018-10-19 10:14:06 +02:00
parent 360164f334
commit 4d5ce2dc19

View file

@ -189,19 +189,16 @@ function forum_read_status_sql(
AND AND
%3$s >= NOW() - INTERVAL 1 MONTH %3$s >= NOW() - INTERVAL 1 MONTH
AND ( AND (
SELECT COUNT(ti.`topic_id`) < ( SELECT COUNT(tt.`topic_id`)
SELECT COUNT(`topic_id`)
FROM `msz_forum_topics`
WHERE `forum_id` = %4$s
AND `topic_bumped` >= NOW() - INTERVAL 1 MONTH
AND `topic_deleted` IS NULL
)
FROM `msz_forum_topics_track` as tt FROM `msz_forum_topics_track` as tt
RIGHT JOIN `msz_forum_topics` as ti RIGHT JOIN `msz_forum_topics` as ti
ON ti.`topic_id` = tt.`topic_id` ON ti.`topic_id` = tt.`topic_id`
WHERE ti.`forum_id` = %4$s WHERE ti.`forum_id` = %4$s
AND tt.`user_id` = %1$s AND tt.`user_id` = %1$s
AND `track_last_read` >= `topic_bumped` AND (
tt.`track_last_read` IS NULL
OR tt.`track_last_read` < ti.`topic_bumped`
)
) )
', ',
$user_param, $user_param,