mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-19 17:58:51 +00:00
Merge branch 'ticket/rxu/8779' into develop-olympus
* ticket/rxu/8779: [ticket/8779] Slow search for 'View unread posts'
This commit is contained in:
commit
4229490725
1 changed files with 3 additions and 2 deletions
|
@ -1698,7 +1698,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
|
|||
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
||||
{
|
||||
// Get list of the unread topics
|
||||
$last_mark = $user->data['user_lastmark'];
|
||||
$last_mark = (int) $user->data['user_lastmark'];
|
||||
|
||||
$sql_array = array(
|
||||
'SELECT' => 't.topic_id, t.topic_last_post_time, tt.mark_time as topic_mark_time, ft.mark_time as forum_mark_time',
|
||||
|
@ -1717,10 +1717,11 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
|
|||
),
|
||||
|
||||
'WHERE' => "
|
||||
t.topic_last_post_time > $last_mark AND
|
||||
(
|
||||
(tt.mark_time IS NOT NULL AND t.topic_last_post_time > tt.mark_time) OR
|
||||
(tt.mark_time IS NULL AND ft.mark_time IS NOT NULL AND t.topic_last_post_time > ft.mark_time) OR
|
||||
(tt.mark_time IS NULL AND ft.mark_time IS NULL AND t.topic_last_post_time > $last_mark)
|
||||
(tt.mark_time IS NULL AND ft.mark_time IS NULL)
|
||||
)
|
||||
$sql_extra
|
||||
$sql_sort",
|
||||
|
|
Loading…
Add table
Reference in a new issue