@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | */ |
359 | 359 | private function _getUnreadReplies($start, $limit, $include_avatars = false) |
360 | 360 | { |
361 | - $request = $this->_db->query('unread_replies', ' |
|
361 | + $request = $this->_db->query('unread_replies', ' |
|
362 | 362 | SELECT DISTINCT t.id_topic |
363 | 363 | FROM {db_prefix}topics AS t |
364 | 364 | INNER JOIN {db_prefix}messages AS m ON (m.id_topic = t.id_topic AND m.id_member = {int:current_member})' . (strpos($this->_sort_query, 'ms.') === false ? '' : ' |
@@ -369,19 +369,19 @@ discard block |
||
369 | 369 | WHERE t.id_board IN ({array_int:boards}) |
370 | 370 | AND t.id_last_msg >= {int:min_message} |
371 | 371 | AND COALESCE(lt.id_msg, lmr.id_msg, 0) < t.id_last_msg' . |
372 | - ($this->_post_mod ? ' AND t.approved = {int:is_approved}' : '') . |
|
373 | - ($this->_unwatch ? ' AND COALESCE(lt.unwatched, 0) != 1' : '') . ' |
|
372 | + ($this->_post_mod ? ' AND t.approved = {int:is_approved}' : '') . |
|
373 | + ($this->_unwatch ? ' AND COALESCE(lt.unwatched, 0) != 1' : '') . ' |
|
374 | 374 | ORDER BY {raw:order} |
375 | 375 | LIMIT {int:offset}, {int:limit}', |
376 | - array_merge($this->_query_parameters, array( |
|
377 | - 'current_member' => $this->_user_id, |
|
378 | - 'min_message' => $this->_min_message, |
|
379 | - 'is_approved' => 1, |
|
380 | - 'order' => $this->_sort_query . ($this->_ascending ? '' : ' DESC'), |
|
381 | - 'offset' => $start, |
|
382 | - 'limit' => $limit, |
|
383 | - )) |
|
384 | - ); |
|
376 | + array_merge($this->_query_parameters, array( |
|
377 | + 'current_member' => $this->_user_id, |
|
378 | + 'min_message' => $this->_min_message, |
|
379 | + 'is_approved' => 1, |
|
380 | + 'order' => $this->_sort_query . ($this->_ascending ? '' : ' DESC'), |
|
381 | + 'offset' => $start, |
|
382 | + 'limit' => $limit, |
|
383 | + )) |
|
384 | + ); |
|
385 | 385 | |
386 | 386 | $topics = array(); |
387 | 387 | while ($row = $this->_db->fetch_assoc($request)) |
@@ -1591,7 +1591,7 @@ discard block |
||
1591 | 1591 | $db = database(); |
1592 | 1592 | |
1593 | 1593 | // Get the messages and stick them into an array. |
1594 | - $request = $db->query('', ' |
|
1594 | + $request = $db->query('', ' |
|
1595 | 1595 | SELECT |
1596 | 1596 | m.subject, COALESCE(mem.real_name, m.poster_name) AS real_name, m.poster_time, m.body, |
1597 | 1597 | m.id_msg, m.smileys_enabled, m.id_member |
@@ -1610,17 +1610,17 @@ discard block |
||
1610 | 1610 | JOIN {db_prefix}messages as m ON o.id_msg=m.id_msg |
1611 | 1611 | LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member) |
1612 | 1612 | ORDER BY m.id_msg DESC', |
1613 | - array( |
|
1614 | - 'current_topic' => $topic, |
|
1615 | - 'no_split_msgs' => !empty($messages['excluded']) ? $messages['excluded'] : array(), |
|
1616 | - 'split_msgs' => !empty($messages['included']) ? $messages['included'] : array(), |
|
1617 | - 'is_approved' => 1, |
|
1618 | - 'start' => $start, |
|
1619 | - 'messages_per_page' => $items_per_page, |
|
1620 | - 'msg_before' => !empty($messages['before']) ? (int) $messages['before'] : 0, |
|
1621 | - 'msg_after' => !empty($messages['after']) ? (int) $messages['after'] : 0, |
|
1622 | - ) |
|
1623 | - ); |
|
1613 | + array( |
|
1614 | + 'current_topic' => $topic, |
|
1615 | + 'no_split_msgs' => !empty($messages['excluded']) ? $messages['excluded'] : array(), |
|
1616 | + 'split_msgs' => !empty($messages['included']) ? $messages['included'] : array(), |
|
1617 | + 'is_approved' => 1, |
|
1618 | + 'start' => $start, |
|
1619 | + 'messages_per_page' => $items_per_page, |
|
1620 | + 'msg_before' => !empty($messages['before']) ? (int) $messages['before'] : 0, |
|
1621 | + 'msg_after' => !empty($messages['after']) ? (int) $messages['after'] : 0, |
|
1622 | + ) |
|
1623 | + ); |
|
1624 | 1624 | |
1625 | 1625 | $messages = array(); |
1626 | 1626 | $parser = \BBC\ParserWrapper::instance(); |
@@ -2176,9 +2176,9 @@ discard block |
||
2176 | 2176 | ); |
2177 | 2177 | |
2178 | 2178 | // When evaluating potentially huge offsets, grab the ids only, first. |
2179 | - // The performance impact is still significant going from three columns to one. |
|
2179 | + // The performance impact is still significant going from three columns to one. |
|
2180 | 2180 | $postMod = $modSettings['postmod_active'] && allowedTo('approve_posts'); |
2181 | - $request = $db->query('display_get_post_poster', ' |
|
2181 | + $request = $db->query('display_get_post_poster', ' |
|
2182 | 2182 | SELECT |
2183 | 2183 | m.id_msg, m.id_member |
2184 | 2184 | FROM ( |
@@ -2191,13 +2191,13 @@ discard block |
||
2191 | 2191 | LIMIT ' . $limit['start'] . ', ' . $limit['offset']) . ') AS o |
2192 | 2192 | JOIN {db_prefix}messages as m ON o.id_msg=m.id_msg |
2193 | 2193 | ORDER BY m.id_msg ' . ($sort ? '' : 'DESC'), |
2194 | - array( |
|
2195 | - 'current_member' => $user_info['id'], |
|
2196 | - 'current_topic' => $topic, |
|
2197 | - 'is_approved' => 1, |
|
2198 | - 'blank_id_member' => 0, |
|
2199 | - ) |
|
2200 | - ); |
|
2194 | + array( |
|
2195 | + 'current_member' => $user_info['id'], |
|
2196 | + 'current_topic' => $topic, |
|
2197 | + 'is_approved' => 1, |
|
2198 | + 'blank_id_member' => 0, |
|
2199 | + ) |
|
2200 | + ); |
|
2201 | 2201 | while ($row = $db->fetch_assoc($request)) |
2202 | 2202 | { |
2203 | 2203 | if (!empty($row['id_member'])) |