2022-03-04, 04:18 PM
Hi
why hook is no between array and query but after update user? this solution is more problematic
why hook is no between array and query but after update user? this solution is more problematic
function insert_warning()
{
global $db, $mybb, $plugins;
$warning = &$this->data;
$this->write_warning_data = array(
"uid" => (int)$warning['uid'],
"tid" => (int)$warning['type'],
"pid" => (int)$warning['pid'],
"title" => $db->escape_string($warning['title']),
"points" => (int)$warning['points'],
"dateline" => TIME_NOW,
"issuedby" => $mybb->user['uid'],
"expires" => (int)$warning['expires'],
"expired" => 0,
"revokereason" => '',
"notes" => $db->escape_string($warning['notes'])
);
$this->write_warning_data['wid'] = $db->insert_query("warnings", $this->write_warning_data);
$this->update_user();
$plugins->run_hooks("datahandler_warnings_insert_warning", $this);
return $this->write_warning_data;
}