2014-06-25, 02:55 AM
The Admin Log seems like it is overwriting a string I'm sending to it. I'm using the admin_tools_get_admin_log_action hook. Here is my code
Yet it does not edit the string. I believe the fault is actually in the admin log file. The following is what I believe is the problem part.
Any ideas?
function socialgroups_admin_tools_get_admin_log_action()
{
global $mybb, $db, $logitem, $lang_string;
if($logitem['module'] == "user-social_groups")
{
$lang_string = "Edited Group # " . $logitem['data']['gid'] . " ( " . $logitem['data']['name']. " )";
}
}
Yet it does not edit the string. I believe the fault is actually in the admin log file. The following is what I believe is the problem part.
$plugins->run_hooks("admin_tools_get_admin_log_action", $plugin_array);
if(isset($lang->$lang_string))
{
array_unshift($logitem['data'], $lang->$lang_string); // First parameter for sprintf is the format string
$string = call_user_func_array(array($lang, 'sprintf'), $logitem['data']);
if(!$string)
{
$string = $lang->$lang_string; // Fall back to the one in the language pack
}
}
else
{
// Build a default string
$string = $logitem['module'].' - '.$logitem['action'];
if(is_array($logitem['data']) && count($logitem['data']) > 0)
{
$string .= '('.implode(', ', $logitem['data']).')';
}
}
return $string;
}
Any ideas?