R
ragtek
Guest
pls include here fetchconditions too, instead of the hardcoded (IMO LIMITED where user_id=? ) condition...
The log is a great tool and could be used for more things (e.g. => output for mods in the frontend, but it's limited with the query and it's ugly to have c&p code only because of the condition
original:
as you see, only the where part is different..
The log is a great tool and could be used for more things (e.g. => output for mods in the frontend, but it's limited with the query and it's ugly to have c&p code only because of the condition

Code:
return $this->fetchAllKeyed($this->limitQueryResults(
'
SELECT moderator_log.*, user.username
FROM xf_moderator_log AS moderator_log
INNER JOIN xf_user AS user ON (user.user_id = moderator_log.user_id)
WHERE moderator_log.discussion_content_type = "thread"
AND moderator_log.discussion_content_id = ' . $db->quote($threadId) .'
ORDER BY moderator_log.log_date DESC
', $limitOptions['limit'], $limitOptions['offset']
), 'moderator_log_id');
original:
PHP:
return $this->fetchAllKeyed($this->limitQueryResults(
'
SELECT moderator_log.*, user.username
FROM xf_moderator_log AS moderator_log
INNER JOIN xf_user AS user ON (user.user_id = moderator_log.user_id)
WHERE ' . ($userId ? 'moderator_log.user_id = ' . $db->quote($userId) : '1=1') . '
ORDER BY moderator_log.log_date DESC
', $limitOptions['limit'], $limitOptions['offset']
), 'moderator_log_id');
Upvote
0