1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-07 07:06:30 +02:00

PHP7 fix for message_handler. Plugin Builder now includes specific keyword drop-down menu for use on e107.org

This commit is contained in:
Cameron
2016-04-12 19:56:29 -07:00
parent 21017e78f1
commit 4a40104073
3 changed files with 48 additions and 5 deletions

View File

@@ -934,6 +934,8 @@ class eMessage
public function addAuto($update, $type = 'update', $success = false, $failed = false, $output = false)
{
$sql = e107::getDb();
if (($type == 'update' && $update) || ($type == 'insert' && $update !== false))
{
$this->add(($success ? $success : ($type == 'update' ? LAN_UPDATED : LAN_CREATED)), E_MESSAGE_SUCCESS);
@@ -942,7 +944,7 @@ class eMessage
{
$this->add(($success ? $success : LAN_DELETED), E_MESSAGE_SUCCESS);
}
elseif (!mysql_errno())
elseif (!$sql->getLastErrorNumber())
{
if ($type == 'update')
{
@@ -968,7 +970,7 @@ class eMessage
break;
}
$text = ($failed ? $failed : $msg." - ".LAN_TRY_AGAIN)."<br />".LAN_ERROR." ".mysql_errno().": ".mysql_error();
$text = ($failed ? $failed : $msg." - ".LAN_TRY_AGAIN)."<br />".LAN_ERROR." ".$sql->getLastErrorNumber().": ".$sql->getLastErrorText();
$this->add($text, E_MESSAGE_ERROR);
}