Version 0.1.9
This commit is contained in:
@@ -32,7 +32,7 @@ class functions_mchat
|
||||
/** @var string */
|
||||
protected $table_prefix;
|
||||
|
||||
/**
|
||||
/**
|
||||
* The database tables
|
||||
*
|
||||
* @var string
|
||||
|
||||
@@ -542,7 +542,7 @@ class render_helper
|
||||
if (!$this->config['mchat_enable'] || !$mchat_add_mess || !check_form_key('mchat_posting', -1))
|
||||
{
|
||||
// Forbidden (for jQ AJAX request)
|
||||
if ($this->request->is_ajax()) // FOR DEBUG
|
||||
if ($this->request->is_ajax())
|
||||
throw new \phpbb\exception\http_exception(403, 'MCHAT_ERROR_FORBIDDEN');
|
||||
}
|
||||
|
||||
@@ -814,14 +814,6 @@ class render_helper
|
||||
// If read mode request set true
|
||||
$mchat_read_mode = true;
|
||||
|
||||
/**
|
||||
* Event render_helper_edit
|
||||
*
|
||||
* @event dmzx.mchat.core.render_helper_edit
|
||||
* @since 0.1.4
|
||||
*/
|
||||
$this->dispatcher->trigger_event('dmzx.mchat.core.render_helper_edit');
|
||||
|
||||
break;
|
||||
|
||||
// Delete function...
|
||||
@@ -853,14 +845,6 @@ class render_helper
|
||||
throw new \phpbb\exception\http_exception(403, 'MCHAT_ERROR_FORBIDDEN');
|
||||
}
|
||||
|
||||
/**
|
||||
* Event render_helper_delete
|
||||
*
|
||||
* @event dmzx.mchat.core.render_helper_delete
|
||||
* @since 0.1.4
|
||||
*/
|
||||
$this->dispatcher->trigger_event('dmzx.mchat.core.render_helper_delete');
|
||||
|
||||
// Run delete!
|
||||
$sql = 'DELETE FROM ' . $this->mchat_table . '
|
||||
WHERE message_id = ' . (int) $message_id;
|
||||
|
||||
@@ -67,7 +67,7 @@ class listener implements EventSubscriberInterface
|
||||
*
|
||||
*/
|
||||
|
||||
public function __construct(\dmzx\mchat\core\render_helper $render_helper, \phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\controller\helper $controller_helper, \phpbb\template\template $template, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, $phpbb_container, $phpEx, $table_prefix,$mchat_table)
|
||||
public function __construct(\dmzx\mchat\core\render_helper $render_helper, \phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\controller\helper $controller_helper, \phpbb\template\template $template, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, $phpbb_container, $phpEx, $table_prefix, $mchat_table)
|
||||
{
|
||||
$this->render_helper = $render_helper;
|
||||
$this->auth = $auth;
|
||||
@@ -153,26 +153,26 @@ class listener implements EventSubscriberInterface
|
||||
if ($event['mode'] == 'post' || $event['mode'] == 'reply' || $event['mode'] == 'quote'|| $event['mode'] == 'edit' && (isset($this->config['mchat_enable']) && $this->config['mchat_enable']) && (isset($this->config['mchat_new_posts']) && $this->config['mchat_new_posts']))
|
||||
{
|
||||
|
||||
if ($event['mode'] == 'post' && (isset($this->config['mchat_new_posts_topic']) && $this->config['mchat_new_posts_topic']))
|
||||
{
|
||||
if ($event['mode'] == 'post' && (isset($this->config['mchat_new_posts_topic']) && $this->config['mchat_new_posts_topic']))
|
||||
{
|
||||
$mchat_new_data = $this->user->lang['MCHAT_NEW_TOPIC'];
|
||||
}
|
||||
else if ($event['mode'] == 'quote' && (isset($this->config['mchat_new_posts_quote']) && $this->config['mchat_new_posts_quote']))
|
||||
{
|
||||
}
|
||||
else if ($event['mode'] == 'quote' && (isset($this->config['mchat_new_posts_quote']) && $this->config['mchat_new_posts_quote']))
|
||||
{
|
||||
$mchat_new_data = $this->user->lang['MCHAT_NEW_QUOTE'];
|
||||
}
|
||||
else if ($event['mode'] == 'edit' && (isset($this->config['mchat_new_posts_edit']) && $this->config['mchat_new_posts_edit']))
|
||||
{
|
||||
}
|
||||
else if ($event['mode'] == 'edit' && (isset($this->config['mchat_new_posts_edit']) && $this->config['mchat_new_posts_edit']))
|
||||
{
|
||||
$mchat_new_data = $this->user->lang['MCHAT_NEW_EDIT'];
|
||||
}
|
||||
else if ($event['mode'] == 'reply' && (isset($this->config['mchat_new_posts_reply']) && $this->config['mchat_new_posts_reply']))
|
||||
{
|
||||
}
|
||||
else if ($event['mode'] == 'reply' && (isset($this->config['mchat_new_posts_reply']) && $this->config['mchat_new_posts_reply']))
|
||||
{
|
||||
$mchat_new_data = $this->user->lang['MCHAT_NEW_REPLY'];
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Data...
|
||||
$message = utf8_normalize_nfc($mchat_new_data . ': [url=' . generate_board_url() . '/viewtopic.' . $this->phpEx . '?p=' . $event['data']['post_id'] . '#p' . $event['data']['post_id'] . ']' . $event['post_data']['post_subject'] . '[/url] '. $this->user->lang['MCHAT_IN'] .' [url=' . generate_board_url() . '/viewforum.' . $this->phpEx . '?f=' . $event['forum_id'] . ']' . $event['post_data']['forum_name'] . ' [/url] ' . $this->user->lang['MCHAT_IN_SECTION']);
|
||||
|
||||
@@ -82,7 +82,7 @@ class mchat_schema extends \phpbb\db\migration\migration
|
||||
|
||||
$this->table_prefix . 'mchat' => array(
|
||||
'COLUMNS' => array(
|
||||
'message_id' => array('UINT', NULL, 'auto_increment'),
|
||||
'message_id' => array('UINT', null, 'auto_increment'),
|
||||
'user_id' => array('UINT', 0),
|
||||
'user_ip' => array('VCHAR:40', ''),
|
||||
'message' => array('MTEXT_UNI', ''),
|
||||
|
||||
Reference in New Issue
Block a user