1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Expand data for chatbox_menu 'user_chatbox_post_created' event

Add post id, nick and datestamp data to existing event data.
This commit is contained in:
Arun S. Sekher 2017-08-17 11:41:49 +04:00
parent b3d1775d41
commit 2dfa6c1e25

View File

@ -179,11 +179,15 @@ if((isset($_POST['chat_submit']) || e_AJAX_REQUEST) && $_POST['cmessage'] != '')
}
if(!$emessage)
{
$sql->insert("chatbox", "0, '$nick', '$cmessage', '".time()."', '0' , '$ip' ");
$edata_cb = array("cmessage" => $cmessage, "ip" => $ip);
$e_event->trigger("cboxpost", $edata_cb); // deprecated
e107::getEvent()->trigger('user_chatbox_post_created', $edata_cb);
$e107cache->clear("nq_chatbox");
$insertId = $sql->insert("chatbox", "0, '{$nick}', '{$cmessage}', '{$datestamp}', '0' , '{$ip}' ");
if($insertId)
{
$edata_cb = array("id" => $insertId, "nick" => $nick, "cmessage" => $cmessage, "datestamp" => $datestamp, "ip" => $ip);
$e_event->trigger("cboxpost", $edata_cb); // deprecated
e107::getEvent()->trigger('user_chatbox_post_created', $edata_cb);
$e107cache->clear("nq_chatbox");
}
}
}
}