• Welcome to Simple Machines Community Forum. Please login or sign up.



This function handles the moderation log (if enabled).


mixed logAction (string $action[, array $extra[, string $log_type]])

Parameter $action

Expected type: String
Description: A string indicating which action was carried out

Parameter $extra

Expected type: Array
Description: An array containing any relevant information about the event being logged (contents varies depending on what's being done)

Parameter $log_type

Expected type: Enumerated String
Description: Which type of log this is associated with

Possible string values
Allowed values Description
'admin' Admin log
'moderate' Moderation log (default value)
'user' User log

Return value

Expected type: Mixed

Possible types
Allowed values Description
Boolean False if the mod log is disabled or the specified log type is invalid
Integer The ID of the new log entry


  • Only logs things if the moderation log is enabled (returns false otherwise)
  • Member ID and user's IP address are pulled from global variables ($ID_MEMBER and $user_info['ip'] respectively)