Lack of interest [Code suggestion] log model getModeratorLogEntries & getAdminLogEntries

  • Thread starter Thread starter ragtek
  • Start date Start date
This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.
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:p

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');
as you see, only the where part is different..
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
Top Bottom