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

MySQL + PHP - Get action from xf_moderator_log

#1
Hey everyone!

I want to display all Actions a moderator has done. I currently have the Addon Staff Activity installed for some easy things like replies. I now want to display the table a bit more detailed so you will see how often a moderator has locked a thread as an example.

Please help because it is not working currently.

Thanks!
 
#2
Hello,

Moderator logs is available in your ACP in the "Tools" tab (admin.php?logs/moderator)

You could take this as an example and see how this is managed.
 
#8
Can you post the entire lines of your request please ? (including PHP code)
$modLockCount = $db->fetchAll("SELECT COUNT(action) FROM xf_moderator_log WHERE `action` = 'lock'
", array($v['user_id'],$datelineStart,$datelineEnd));

Copied from Addon which stated above, other things like this work:

$moderationCount = $db->fetchOne("
SELECT COUNT(moderator_log_id)
FROM xf_moderator_log
WHERE user_id = ?
AND log_date >= ?
AND log_date <= ?
", array($v['user_id'],$datelineStart,$datelineEnd));
 
#9
$modLockCount = $db->fetchAll("SELECT COUNT(action) FROM xf_moderator_log WHERE `action` = 'lock'
", array($v['user_id'],$datelineStart,$datelineEnd));
Should be:
PHP:
$modLockCount = $db->fetchOne("SELECT COUNT(action) FROM xf_moderator_log WHERE `action` = 'lock'
");