@@ -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)) |
@@ -1598,7 +1598,7 @@ discard block |
||
1598 | 1598 | $db = database(); |
1599 | 1599 | |
1600 | 1600 | // Get the messages and stick them into an array. |
1601 | - $request = $db->query('', ' |
|
1601 | + $request = $db->query('', ' |
|
1602 | 1602 | SELECT m.subject, COALESCE(mem.real_name, m.poster_name) AS real_name, m.poster_time, m.body, m.id_msg, m.smileys_enabled, m.id_member FROM |
1603 | 1603 | (SELECT m.id_msg FROM {db_prefix}messages AS m |
1604 | 1604 | WHERE m.id_topic = {int:current_topic}' . (empty($messages['before']) ? '' : ' |
@@ -1611,17 +1611,17 @@ discard block |
||
1611 | 1611 | LIMIT {int:start}, {int:messages_per_page}) AS o JOIN {db_prefix}messages as m ON o.id_msg=m.id_msg LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member) |
1612 | 1612 | ORDER BY m.id_msg DESC |
1613 | 1613 | ', |
1614 | - array( |
|
1615 | - 'current_topic' => $topic, |
|
1616 | - 'no_split_msgs' => !empty($messages['excluded']) ? $messages['excluded'] : array(), |
|
1617 | - 'split_msgs' => !empty($messages['included']) ? $messages['included'] : array(), |
|
1618 | - 'is_approved' => 1, |
|
1619 | - 'start' => $start, |
|
1620 | - 'messages_per_page' => $items_per_page, |
|
1621 | - 'msg_before' => !empty($messages['before']) ? (int) $messages['before'] : 0, |
|
1622 | - 'msg_after' => !empty($messages['after']) ? (int) $messages['after'] : 0, |
|
1623 | - ) |
|
1624 | - ); |
|
1614 | + array( |
|
1615 | + 'current_topic' => $topic, |
|
1616 | + 'no_split_msgs' => !empty($messages['excluded']) ? $messages['excluded'] : array(), |
|
1617 | + 'split_msgs' => !empty($messages['included']) ? $messages['included'] : array(), |
|
1618 | + 'is_approved' => 1, |
|
1619 | + 'start' => $start, |
|
1620 | + 'messages_per_page' => $items_per_page, |
|
1621 | + 'msg_before' => !empty($messages['before']) ? (int) $messages['before'] : 0, |
|
1622 | + 'msg_after' => !empty($messages['after']) ? (int) $messages['after'] : 0, |
|
1623 | + ) |
|
1624 | + ); |
|
1625 | 1625 | |
1626 | 1626 | $messages = array(); |
1627 | 1627 | $parser = \BBC\ParserWrapper::instance(); |
@@ -2177,8 +2177,8 @@ discard block |
||
2177 | 2177 | ); |
2178 | 2178 | |
2179 | 2179 | // When evaluating potentially huge offsets, grab the ids only, first. |
2180 | - // The performance impact is still significant going from three columns to one. |
|
2181 | - $request = $db->query('display_get_post_poster', ' |
|
2180 | + // The performance impact is still significant going from three columns to one. |
|
2181 | + $request = $db->query('display_get_post_poster', ' |
|
2182 | 2182 | SELECT m.id_msg, m.id_member, m.approved |
2183 | 2183 | FROM (SELECT id_msg FROM {db_prefix}messages |
2184 | 2184 | WHERE id_topic = {int:current_topic}' . (!$modSettings['postmod_active'] || allowedTo('approve_posts') ? '' : ' |
@@ -2187,13 +2187,13 @@ discard block |
||
2187 | 2187 | ORDER BY id_msg ' . ($sort ? '' : 'DESC') . ($limit['messages_per_page'] == -1 ? '' : ' |
2188 | 2188 | LIMIT ' . $limit['start'] . ', ' . $limit['offset']) . ') AS o JOIN {db_prefix}messages as m ON o.id_msg=m.id_msg |
2189 | 2189 | ORDER BY m.id_msg ' . ($sort ? '' : 'DESC'), |
2190 | - array( |
|
2191 | - 'current_member' => $user_info['id'], |
|
2192 | - 'current_topic' => $topic, |
|
2193 | - 'is_approved' => 1, |
|
2194 | - 'blank_id_member' => 0, |
|
2195 | - ) |
|
2196 | - ); |
|
2190 | + array( |
|
2191 | + 'current_member' => $user_info['id'], |
|
2192 | + 'current_topic' => $topic, |
|
2193 | + 'is_approved' => 1, |
|
2194 | + 'blank_id_member' => 0, |
|
2195 | + ) |
|
2196 | + ); |
|
2197 | 2197 | |
2198 | 2198 | while ($row = $db->fetch_assoc($request)) |
2199 | 2199 | { |