1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Closed Suggestions' started by ragtek, Oct 6, 2011.

  1. ragtek

    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

    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');
    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']
    as you see, only the where part is different..

Share This Page