Update version 0.0.10
Update version 0.0.10
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"type": "phpbb-extension",
|
"type": "phpbb-extension",
|
||||||
"description": "mChat Extension for phpbb 3.1.x",
|
"description": "mChat Extension for phpbb 3.1.x",
|
||||||
"homepage": "http://www.dmzx-web.net",
|
"homepage": "http://www.dmzx-web.net",
|
||||||
"version": "0.0.9",
|
"version": "0.0.10",
|
||||||
"time": "2015-03-10",
|
"time": "2015-03-10",
|
||||||
"keywords": ["phpbb", "extension", "mchat"],
|
"keywords": ["phpbb", "extension", "mchat"],
|
||||||
"license": "GPL-2.0",
|
"license": "GPL-2.0",
|
||||||
|
|||||||
@@ -889,20 +889,21 @@ class render_helper
|
|||||||
if ($this->config_mchat['whois'])
|
if ($this->config_mchat['whois'])
|
||||||
{
|
{
|
||||||
// Grab group details for legend display for who is online on the custom page.
|
// Grab group details for legend display for who is online on the custom page.
|
||||||
|
$order_legend = ($this->config['legend_sort_groupname']) ? 'group_name' : 'group_legend';
|
||||||
if ($this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
|
if ($this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
|
||||||
{
|
{
|
||||||
$sql = 'SELECT group_id, group_name, group_colour, group_type FROM ' . GROUPS_TABLE . '
|
$sql = 'SELECT group_id, group_name, group_colour, group_type FROM ' . GROUPS_TABLE . '
|
||||||
WHERE group_legend = 1
|
WHERE group_legend <> 0
|
||||||
ORDER BY group_name ASC';
|
ORDER BY ' . $order_legend . ' ASC';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type FROM ' . GROUPS_TABLE . ' g
|
$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type FROM ' . GROUPS_TABLE . ' g
|
||||||
LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (g.group_id = ug.group_id AND ug.user_id = ' . $this->user->data['user_id'] . ' AND ug.user_pending = 0)
|
LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (g.group_id = ug.group_id AND ug.user_id = ' . $this->user->data['user_id'] . ' AND ug.user_pending = 0)
|
||||||
WHERE g.group_legend = 1
|
WHERE g.group_legend <> 0
|
||||||
AND (g.group_type <> ' . GROUP_HIDDEN . '
|
AND (g.group_type <> ' . GROUP_HIDDEN . '
|
||||||
OR ug.user_id = ' . (int) $this->user->data['user_id'] . ')
|
OR ug.user_id = ' . (int) $this->user->data['user_id'] . ')
|
||||||
ORDER BY g.group_name ASC';
|
ORDER BY g.' . $order_legend . ' ASC';
|
||||||
}
|
}
|
||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
$legend = array();
|
$legend = array();
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ class listener implements EventSubscriberInterface
|
|||||||
static public function getSubscribedEvents()
|
static public function getSubscribedEvents()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
'core.viewonline_overwrite_location' => 'add_page_viewonline',
|
||||||
'core.user_setup' => 'load_language_on_setup',
|
'core.user_setup' => 'load_language_on_setup',
|
||||||
'core.page_header' => 'add_page_header_link',
|
'core.page_header' => 'add_page_header_link',
|
||||||
'core.index_modify_page_title' => 'display_mchat_on_index',
|
'core.index_modify_page_title' => 'display_mchat_on_index',
|
||||||
@@ -66,6 +67,17 @@ class listener implements EventSubscriberInterface
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function add_page_viewonline($event)
|
||||||
|
{
|
||||||
|
global $user, $phpbb_container, $phpEx;
|
||||||
|
|
||||||
|
if (strrpos($event['row']['session_page'], 'app.' . $phpEx . '/chat') === 0)
|
||||||
|
{
|
||||||
|
$event['location'] = $user->lang('MCHAT_TITLE');
|
||||||
|
$event['location_url'] = $phpbb_container->get('controller.helper')->route('dmzx_mchat_controller');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function load_language_on_setup($event)
|
public function load_language_on_setup($event)
|
||||||
{
|
{
|
||||||
$lang_set_ext = $event['lang_set_ext'];
|
$lang_set_ext = $event['lang_set_ext'];
|
||||||
@@ -144,7 +156,7 @@ class listener implements EventSubscriberInterface
|
|||||||
$uid = $bitfield = $options = ''; // will be modified by generate_text_for_storage
|
$uid = $bitfield = $options = ''; // will be modified by generate_text_for_storage
|
||||||
generate_text_for_storage($message, $uid, $bitfield, $options, true, false, false);
|
generate_text_for_storage($message, $uid, $bitfield, $options, true, false, false);
|
||||||
$sql_ary = array(
|
$sql_ary = array(
|
||||||
'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $event['forum_id'],
|
'forum_id' => $event['forum_id'],
|
||||||
'post_id' => $event['post_id'],
|
'post_id' => $event['post_id'],
|
||||||
'user_id' => $this->user->data['user_id'],
|
'user_id' => $this->user->data['user_id'],
|
||||||
'user_ip' => $this->user->data['session_ip'],
|
'user_ip' => $this->user->data['session_ip'],
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class mchat_schema extends \phpbb\db\migration\migration
|
|||||||
array('config.add', array('mchat_new_posts_edit', false)),
|
array('config.add', array('mchat_new_posts_edit', false)),
|
||||||
array('config.add', array('mchat_new_posts_quote', false)),
|
array('config.add', array('mchat_new_posts_quote', false)),
|
||||||
array('config.add', array('mchat_stats_index', false)),
|
array('config.add', array('mchat_stats_index', false)),
|
||||||
array('config.add', array('mchat_version','0.0.9')),
|
array('config.add', array('mchat_version','0.0.10')),
|
||||||
|
|
||||||
array('permission.add', array('u_mchat_use')),
|
array('permission.add', array('u_mchat_use')),
|
||||||
array('permission.add', array('u_mchat_view')),
|
array('permission.add', array('u_mchat_view')),
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<!-- IF MCHAT_ENABLE and U_MCHAT --><li class="small-icon icon-bump"><a href="{U_MCHAT}" title="{L_MCHAT_TITLE}">{L_MCHAT_TITLE}</a></li><!-- ENDIF -->
|
<!-- IF S_USER_LOGGED_IN and U_MCHAT --><li class="small-icon icon-bump"><a href="{U_MCHAT}" title="{L_MCHAT_TITLE}">{L_MCHAT_TITLE}</a></li><!-- ENDIF -->
|
||||||
Reference in New Issue
Block a user