R
ragtek
Guest
Class: XenForo_Model_Thread
Method: rebuildThreadUserPostCounters
Line: 1295
There is no $db in the scope.
Is missing^^
Also
doesn't make sense.
IMHO you don't need the and 1=1.
Method: rebuildThreadUserPostCounters
Line: 1295
PHP:
public function rebuildThreadUserPostCounters($threadId, $userId = null)
{
if ($userId === 0)
{
return;
}
$records = $this->_getDb()->fetchPairs('
SELECT user_id, COUNT(*)
FROM xf_post
WHERE thread_id = ?
AND message_state = \'visible\'
' . ($userId !== null ? ' AND user_id = ' . $db->quote($userId) : ' AND 1=1') . '
GROUP BY user_id
');
PHP:
$db = $this->_getDb();
Also
PHP:
AND message_state = \'visible\'
' . ($userId !== null ? ' AND user_id = ' . $db->quote($userId) : ' AND 1=1') .
IMHO you don't need the and 1=1.