Mr.Smith Member Nov 17, 2011 #1 Can anyone help me with a simple mySQL command to grab 10 mod logs from the last 24 hrs from the xenforo DB? I just need to do a basic script so that the mods can see the logs themselves (only number of actions they have performed). thanks!
Can anyone help me with a simple mySQL command to grab 10 mod logs from the last 24 hrs from the xenforo DB? I just need to do a basic script so that the mods can see the logs themselves (only number of actions they have performed). thanks!
Jake Bunce Well-known member Nov 19, 2011 #2 This will return the number of mod log records from the last 24 hours: Code: SELECT COUNT(*) FROM xf_moderator_log WHERE log_date > UNIX_TIMESTAMP() - 24*60*60; Upvote 0 Downvote
This will return the number of mod log records from the last 24 hours: Code: SELECT COUNT(*) FROM xf_moderator_log WHERE log_date > UNIX_TIMESTAMP() - 24*60*60;
Mr.Smith Member Nov 19, 2011 #3 Thanks jake Could you make it a little more detailed with returning usernames and log numbers of individual mods? Thanks a lot Upvote 0 Downvote
Thanks jake Could you make it a little more detailed with returning usernames and log numbers of individual mods? Thanks a lot
Jake Bunce Well-known member Nov 19, 2011 #4 This should do it: Code: SELECT user.username AS moderatorName, COUNT(*) AS count FROM xf_moderator_log AS modlog LEFT JOIN xf_user AS user ON (user.user_id = modlog.user_id) WHERE modlog.log_date > UNIX_TIMESTAMP() - 24*60*60 GROUP BY modlog.user_id; Upvote 0 Downvote
This should do it: Code: SELECT user.username AS moderatorName, COUNT(*) AS count FROM xf_moderator_log AS modlog LEFT JOIN xf_user AS user ON (user.user_id = modlog.user_id) WHERE modlog.log_date > UNIX_TIMESTAMP() - 24*60*60 GROUP BY modlog.user_id;
Mr.Smith Member Nov 19, 2011 #5 thanks Jake. any idea how do I add it on a xenforo page to show it to mods (only staff)? sorry I am a little new to this Upvote 0 Downvote
thanks Jake. any idea how do I add it on a xenforo page to show it to mods (only staff)? sorry I am a little new to this