From 5f8c5d3f09db01e477f89b22f4996f6617ddd738 Mon Sep 17 00:00:00 2001 From: dmzx Date: Sat, 26 Mar 2016 09:15:07 +0100 Subject: [PATCH] Version 2.0.0-RC3 --- README.md | 6 +- acp/acp_mchat_info.php | 9 +- acp/acp_mchat_module.php | 8 +- ...hat.html => acp_mchat_globalsettings.html} | 135 +++----- adm/style/acp_mchat_globalusersettings.html | 28 ++ .../acp_mchat_globalusersettings_content.html | 102 ++++++ adm/style/event/acp_users_prefs_append.html | 51 +-- composer.json | 10 +- config/config_2_0_0.yml | 174 ++++++++++ config/services.yml | 27 +- config/user_config_keys.yml | 9 - controller/acp_controller.php | 189 ++++++----- controller/main_controller.php | 2 +- controller/ucp_controller.php | 108 ++++-- core/functions.php | 77 +++-- core/mchat.php | 314 ++++++++++-------- core/settings.php | 159 +++++++++ event/acp_listener.php | 195 ++++++----- event/main_listener.php | 23 +- ext.php | 27 ++ language/en/common.php | 9 +- language/en/info_acp_mchat.php | 6 +- language/en/mchat.php | 11 +- language/en/mchat_acp.php | 74 ++--- language/en/mchat_ucp.php | 33 +- language/en/permissions_mchat.php | 17 +- ...{install_mchat.php => mchat_2_0_0_rc3.php} | 163 +++++---- .../event/index_body_block_online_append.html | 4 - .../index_body_forumlist_body_after.html | 1 - .../event/index_body_markforums_before.html | 1 - .../overall_footer_copyright_append.html | 9 - .../overall_header_navigation_append.html | 3 - styles/all/template/javascript/mchat.js | 125 ++++--- styles/all/template/mchat_body.html | 224 ------------- styles/all/template/mchat_header.html | 4 - styles/all/template/mchat_messages.html | 27 -- styles/all/template/mchat_navlink.html | 1 - styles/all/template/ucp_mchat.html | 77 ----- styles/all/theme/images/ban.gif | Bin 3176 -> 0 bytes styles/all/theme/images/bg_button.gif | Bin 182 -> 0 bytes styles/all/theme/images/del.gif | Bin 928 -> 0 bytes styles/all/theme/images/edit.gif | Bin 404 -> 0 bytes styles/all/theme/images/ip.gif | Bin 941 -> 0 bytes styles/all/theme/images/like.png | Bin 784 -> 0 bytes styles/all/theme/images/message.gif | Bin 576 -> 0 bytes styles/all/theme/images/quota.png | Bin 306 -> 0 bytes styles/black/theme/images/message_icons.png | Bin 0 -> 1939 bytes styles/black/theme/mchat_custom.css | 60 ++-- styles/elegance/theme/mchat_custom.css | 60 ++-- styles/latte/theme/mchat_custom.css | 60 ++-- .../event/overall_header_head_append.html | 0 styles/metro_blue/template/mchat_navlink.html | 1 + .../theme/images/tab-icon-mchat.svg | 1 + .../theme/mchat_custom.css | 4 +- styles/pbtech/template/mchat_header.html | 2 +- styles/pbtech/theme/mchat_custom.css | 6 +- styles/pbwow3/template/mchat_header.html | 2 +- styles/pbwow3/theme/images/message_icons.png | Bin 0 -> 1939 bytes styles/pbwow3/theme/mchat_custom.css | 8 +- .../event/index_body_block_online_append.html | 7 + .../index_body_forumlist_body_after.html | 1 + .../event/index_body_markforums_before.html | 1 + .../overall_footer_copyright_append.html | 3 + .../event/overall_header_head_append.html | 0 .../overall_header_navigation_append.html | 3 + styles/prosilver/template/mchat_body.html | 107 ++++++ styles/prosilver/template/mchat_header.html | 4 + styles/prosilver/template/mchat_messages.html | 16 + .../template/mchat_messages_icons.html | 20 ++ styles/prosilver/template/mchat_navlink.html | 5 + styles/prosilver/template/mchat_panel.html | 74 +++++ .../template/mchat_rules.html | 0 .../prosilver/template/mchat_script_data.html | 53 +++ .../template/mchat_whois.html | 0 styles/prosilver/template/ucp_mchat.html | 161 +++++++++ .../{all => prosilver}/theme/images/error.gif | Bin .../theme/images/icon_mchat.png | Bin .../{all => prosilver}/theme/images/load.gif | Bin .../prosilver/theme/images/message_icons.png | Bin 0 -> 1927 bytes styles/{all => prosilver}/theme/images/ok.gif | Bin .../theme/images/paused.gif | Bin styles/{all => prosilver}/theme/mchat.css | 183 +++++++--- styles/simplicity/theme/mchat_custom.css | 60 ++-- ucp/ucp_mchat_module.php | 2 +- 84 files changed, 2046 insertions(+), 1300 deletions(-) rename adm/style/{acp_mchat.html => acp_mchat_globalsettings.html} (50%) create mode 100644 adm/style/acp_mchat_globalusersettings.html create mode 100644 adm/style/acp_mchat_globalusersettings_content.html create mode 100644 config/config_2_0_0.yml delete mode 100644 config/user_config_keys.yml create mode 100644 core/settings.php create mode 100644 ext.php rename migrations/{install_mchat.php => mchat_2_0_0_rc3.php} (52%) delete mode 100644 styles/all/template/event/index_body_block_online_append.html delete mode 100644 styles/all/template/event/index_body_forumlist_body_after.html delete mode 100644 styles/all/template/event/index_body_markforums_before.html delete mode 100644 styles/all/template/event/overall_footer_copyright_append.html delete mode 100644 styles/all/template/event/overall_header_navigation_append.html delete mode 100644 styles/all/template/mchat_body.html delete mode 100644 styles/all/template/mchat_header.html delete mode 100644 styles/all/template/mchat_messages.html delete mode 100644 styles/all/template/mchat_navlink.html delete mode 100644 styles/all/template/ucp_mchat.html delete mode 100644 styles/all/theme/images/ban.gif delete mode 100644 styles/all/theme/images/bg_button.gif delete mode 100644 styles/all/theme/images/del.gif delete mode 100644 styles/all/theme/images/edit.gif delete mode 100644 styles/all/theme/images/ip.gif delete mode 100644 styles/all/theme/images/like.png delete mode 100644 styles/all/theme/images/message.gif delete mode 100644 styles/all/theme/images/quota.png create mode 100644 styles/black/theme/images/message_icons.png rename styles/{we_universal => metro_blue}/template/event/overall_header_head_append.html (100%) create mode 100644 styles/metro_blue/template/mchat_navlink.html create mode 100644 styles/metro_blue/theme/images/tab-icon-mchat.svg rename styles/{we_universal => metro_blue}/theme/mchat_custom.css (64%) create mode 100644 styles/pbwow3/theme/images/message_icons.png create mode 100644 styles/prosilver/template/event/index_body_block_online_append.html create mode 100644 styles/prosilver/template/event/index_body_forumlist_body_after.html create mode 100644 styles/prosilver/template/event/index_body_markforums_before.html create mode 100644 styles/prosilver/template/event/overall_footer_copyright_append.html rename styles/{all => prosilver}/template/event/overall_header_head_append.html (100%) create mode 100644 styles/prosilver/template/event/overall_header_navigation_append.html create mode 100644 styles/prosilver/template/mchat_body.html create mode 100644 styles/prosilver/template/mchat_header.html create mode 100644 styles/prosilver/template/mchat_messages.html create mode 100644 styles/prosilver/template/mchat_messages_icons.html create mode 100644 styles/prosilver/template/mchat_navlink.html create mode 100644 styles/prosilver/template/mchat_panel.html rename styles/{all => prosilver}/template/mchat_rules.html (100%) create mode 100644 styles/prosilver/template/mchat_script_data.html rename styles/{all => prosilver}/template/mchat_whois.html (100%) create mode 100644 styles/prosilver/template/ucp_mchat.html rename styles/{all => prosilver}/theme/images/error.gif (100%) rename styles/{all => prosilver}/theme/images/icon_mchat.png (100%) rename styles/{all => prosilver}/theme/images/load.gif (100%) create mode 100644 styles/prosilver/theme/images/message_icons.png rename styles/{all => prosilver}/theme/images/ok.gif (100%) rename styles/{all => prosilver}/theme/images/paused.gif (100%) rename styles/{all => prosilver}/theme/mchat.css (50%) diff --git a/README.md b/README.md index 79d6457..52d794d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# mChat Extension for phpBB 3.1 +# mChat Extension [![Build Status](https://travis-ci.org/dmzx/mChat-Extension.svg?branch=master)](https://travis-ci.org/dmzx/mChat-Extension) @@ -9,12 +9,12 @@ 3. In the `ext` directory of your phpBB board, create a new directory named `dmzx` (if it does not already exist). 4. Copy the `mchat` folder to `/ext/dmzx/` (if done correctly, you'll have the main extension class at (your forum root)/ext/dmzx/mchat/composer.json). 5. Navigate in the ACP to `Customise -> Manage extensions`. -6. Look for `mChat Extension for phpBB 3.1` under the Disabled Extensions list, and click its `Enable` link. +6. Look for `mChat Extension` under the Disabled Extensions list, and click its `Enable` link. ## Uninstall 1. Navigate in the ACP to `Customise -> Extension Management -> Extensions`. -2. Look for `mChat Extension for phpBB 3.1` under the Enabled Extensions list, and click its `Disable` link. +2. Look for `mChat Extension` under the Enabled Extensions list, and click its `Disable` link. 3. To permanently uninstall, click `Delete Data` and then delete the `/ext/dmzx/mchat` folder. ## License diff --git a/acp/acp_mchat_info.php b/acp/acp_mchat_info.php index f18ee57..2777549 100644 --- a/acp/acp_mchat_info.php +++ b/acp/acp_mchat_info.php @@ -19,8 +19,13 @@ class acp_mchat_info 'filename' => '\dmzx\mchat\acp\acp_mchat_module', 'title' => 'ACP_CAT_MCHAT', 'modes' => array( - 'configuration' => array( - 'title' => 'ACP_MCHAT_CONFIG', + 'globalsettings' => array( + 'title' => 'ACP_MCHAT_GLOBALSETTINGS', + 'auth' => 'ext_dmzx/mchat && acl_a_mchat', + 'cat' => array('ACP_CAT_MCHAT'), + ), + 'globalusersettings' => array( + 'title' => 'ACP_MCHAT_GLOBALUSERSETTINGS', 'auth' => 'ext_dmzx/mchat && acl_a_mchat', 'cat' => array('ACP_CAT_MCHAT'), ), diff --git a/acp/acp_mchat_module.php b/acp/acp_mchat_module.php index 243c9d2..7d062eb 100644 --- a/acp/acp_mchat_module.php +++ b/acp/acp_mchat_module.php @@ -20,14 +20,14 @@ class acp_mchat_module global $phpbb_container, $user; // Add the ACP lang file - $user->add_lang_ext('dmzx/mchat', 'mchat_acp'); + $user->add_lang_ext('dmzx/mchat', array('mchat_acp', 'mchat_ucp')); // Set template - $this->tpl_name = 'acp_mchat'; - $this->page_title = 'MCHAT_ACP_TITLE'; + $this->tpl_name = 'acp_mchat_' . strtolower($mode); + $this->page_title = 'MCHAT_ACP_' . strtoupper($mode) . '_TITLE'; // Get an instance of the ACP controller and display the options $controller = $phpbb_container->get('dmzx.mchat.acp.controller'); - $controller->display_options($this->u_action); + $controller->$mode($this->u_action); } } diff --git a/adm/style/acp_mchat.html b/adm/style/acp_mchat_globalsettings.html similarity index 50% rename from adm/style/acp_mchat.html rename to adm/style/acp_mchat_globalsettings.html index 3c875b8..6ba3c16 100644 --- a/adm/style/acp_mchat.html +++ b/adm/style/acp_mchat_globalsettings.html @@ -4,6 +4,13 @@ {L_MCHAT_VERSION}{L_COLON} {MCHAT_VERSION} + +
+

{L_WARNING}

+

{MCHAT_ERROR}

+
+ +
@@ -18,27 +25,18 @@
{L_MCHAT_SETTINGS_INDEX} -
-
-
-
-
-
-
-
-
-

{L_MCHAT_INDEX_HEIGHT_EXPLAIN}
-

- {L_MCHAT_MESSAGE_NUM_EXPLAIN}
-
+

+ {L_MCHAT_MESSAGE_NUM_INDEX_EXPLAIN}
+
+
{L_MCHAT_SETTINGS_CUSTOM}
@@ -53,9 +51,9 @@
-

- {L_MCHAT_MESSAGE_LIMIT_EXPLAIN}
-
+

+ {L_MCHAT_MESSAGE_NUM_CUSTOM_EXPLAIN}
+
@@ -66,9 +64,9 @@
{L_MCHAT_SETTINGS_ARCHIVE}
-

- {L_MCHAT_ARCHIVE_LIMIT_EXPLAIN}
-
+

+ {L_MCHAT_MESSAGE_NUM_ARCHIVE_EXPLAIN}
+
@@ -85,7 +83,7 @@

- {L_MCHAT_EDIT_DELETE_LIMIT_EXPLAIN}
+ {L_MCHAT_EDIT_DELETE_LIMIT_EXPLAIN}
@@ -94,39 +92,6 @@
-
-

- {L_MCHAT_MESSAGE_TOP_EXPLAIN}
-
-
-
-
-

- {L_MCHAT_AVATARS_EXPLAIN}
-
-
-
-
-

{L_MCHAT_DATE_FORMAT_EXPLAIN}
-
- -
-
style="display:none;">
-
-
-

- {L_MCHAT_RELATIVE_TIME_EXPLAIN}
-
-
-
-
-

- {L_MCHAT_PAUSE_ON_INPUT_EXPLAIN}
-
-
-

{L_MCHAT_FLOOD_TIME_EXPLAIN}
@@ -168,28 +133,40 @@
{L_MCHAT_SETTINGS_POSTS}
-

- {L_MCHAT_NEW_POSTS_TOPIC_EXPLAIN}
-
-
+
+
+ + +
-

- {L_MCHAT_NEW_POSTS_REPLY_EXPLAIN}
-
-
+
+
+ + +
-

- {L_MCHAT_NEW_POSTS_EDIT_EXPLAIN}
-
-
+
+
+ + +
-

- {L_MCHAT_NEW_POSTS_QUOTE_EXPLAIN}
-
-
+
+
+ + +
+
+
+
+ {L_MCHAT_SETTINGS_STATS} +
+

+ {L_MCHAT_WHOIS_REFRESH_EXPLAIN}
+
@@ -211,25 +188,7 @@
-
- {L_MCHAT_SETTINGS_STATS} -
-
-
-
-
-
-

- {L_MCHAT_STATS_INDEX_EXPLAIN}
-
-
-
-
-

- {L_MCHAT_WHOIS_REFRESH_EXPLAIN}
-
-
-
+

  diff --git a/adm/style/acp_mchat_globalusersettings.html b/adm/style/acp_mchat_globalusersettings.html new file mode 100644 index 0000000..ac1295e --- /dev/null +++ b/adm/style/acp_mchat_globalusersettings.html @@ -0,0 +1,28 @@ + + +

{L_MCHAT_TITLE}

+ +{L_MCHAT_VERSION}{L_COLON} {MCHAT_VERSION} + +
{L_MCHAT_GLOBALUSERSETTINGS_EXPLAIN}
+ + +
+

{L_WARNING}

+

{MCHAT_ERROR}

+
+ + + +
+ {L_MCHAT_ACP_GLOBALUSERSETTINGS_TITLE} + +
+

+   + + {S_FORM_TOKEN} +

+ + + diff --git a/adm/style/acp_mchat_globalusersettings_content.html b/adm/style/acp_mchat_globalusersettings_content.html new file mode 100644 index 0000000..899e7b2 --- /dev/null +++ b/adm/style/acp_mchat_globalusersettings_content.html @@ -0,0 +1,102 @@ +
+
+
+ + +
+
+
+
+
+ + +
+
+
+

{L_MCHAT_STATS_INDEX_EXPLAIN}
+
+ + +
+
+
+
+
+ + +
+
+
+
+

{L_MCHAT_MESSAGE_TOP_EXPLAIN}
+
+ + +
+
+
+
+
+ + +
+
+
+
+
+ + +
+
+
+
+
+ + +
+
+
+
+
+ + +
+
+
+
+
+ + +
+
+
+

{L_MCHAT_PAUSE_ON_INPUT_EXPLAIN}
+
+ + +
+
+
+

{L_MCHAT_DATE_FORMAT_EXPLAIN}
+
+ +
+
style="display:none;"> disabled />
+
+
+

{L_MCHAT_RELATIVE_TIME_EXPLAIN}
+
+ + +
+
+
+
+
+
+ + +
+
diff --git a/adm/style/event/acp_users_prefs_append.html b/adm/style/event/acp_users_prefs_append.html index 7a3648a..44f9033 100644 --- a/adm/style/event/acp_users_prefs_append.html +++ b/adm/style/event/acp_users_prefs_append.html @@ -1,52 +1,5 @@
+

{L_MCHAT_ACP_USER_PREFS_EXPLAIN}

{L_MCHAT_PREFERENCES} -
-
-
- - -
-
-
-
-
- - -
-
-
-
-
- - -
-
-
-
-
- - -
-
-
-
-
- - -
-
-
-
-
- - -
-
-
-
-
- - -
-
+
diff --git a/composer.json b/composer.json index 8ad3513..5838f23 100644 --- a/composer.json +++ b/composer.json @@ -1,10 +1,10 @@ { "name": "dmzx/mchat", "type": "phpbb-extension", - "description": "mChat Extension for phpBB 3.1", + "description": "mChat Extension", "homepage": "http://www.dmzx-web.net", - "version": "1.0.0-RC2", - "time": "2015-03-10", + "version": "2.0.0-RC3", + "time": "2016-03-24", "keywords": ["phpbb", "extension", "mchat"], "license": "GPL-2.0", "authors": [ @@ -32,9 +32,9 @@ "phpbb/epv": "dev-master" }, "extra": { - "display-name": "mChat Extension for phpBB 3.1", + "display-name": "mChat Extension", "soft-require": { - "phpbb/phpbb": ">=3.1.7-PL1,<3.2.0@dev" + "phpbb/phpbb": ">=3.1.7-PL1,<3.3.0@dev" }, "version-check": { "host": "www.dmzx-web.net", diff --git a/config/config_2_0_0.yml b/config/config_2_0_0.yml new file mode 100644 index 0000000..927cc06 --- /dev/null +++ b/config/config_2_0_0.yml @@ -0,0 +1,174 @@ +parameters: + # Global settings that only the administrator is allowed to modify. + # The values are stored in the phpbb_config table and can be + # accessed using the \phpbb\config\config $config class. + dmzx.mchat.config_global: + mchat_bbcode_disallowed: + default: '' + validation: + - 'string' + - false + - 0 + - 255 + mchat_custom_height: + default: 350 + validation: + - 'num' + - false + - 50 + - 1000 + mchat_custom_page: + default: 1 + mchat_edit_delete_limit: + default: 0 + mchat_flood_time: + default: 0 + validation: + - 'num' + - false + - 0 + - 60 + mchat_index_height: + default: 250 + validation: + - 'num' + - false + - 50 + - 1000 + mchat_live_updates: + default: 1 + mchat_max_message_lngth: + default: 500 + validation: + - 'num' + - false + - 0 + - 1000 + mchat_message_num_archive: + default: 25 + validation: + - 'num' + - false + - 10 + - 100 + mchat_message_num_custom: + default: 10 + validation: + - 'num' + - false + - 5 + - 50 + mchat_message_num_index: + default: 10 + validation: + - 'num' + - false + - 5 + - 50 + mchat_navbar_link: + default: 1 + mchat_override_min_post_chars: + default: 0 + mchat_override_smilie_limit: + default: 0 + mchat_posts_edit: + default: 0 + mchat_posts_quote: + default: 0 + mchat_posts_reply: + default: 0 + mchat_posts_topic: + default: 0 + mchat_prune: + default: 0 + mchat_prune_num: + default: 0 + mchat_refresh: + default: 10 + validation: + - 'num' + - false + - 5 + - 60 + mchat_rules: + default: '' + validation: + - 'string' + - false + - 0 + - 255 + mchat_static_message: + default: '' + validation: + - 'string' + - false + - 0 + - 255 + mchat_timeout: + default: 0 + validation: + - 'num' + - false + - 0 + - -1 # This value is replaced with $config['session_length'] in the \dmzx\mchat\core\settings class + mchat_whois: + default: 1 + mchat_whois_refresh: + default: 60 + validation: + - 'num' + - false + - 10 + - 300 + + # User-specific settings for which the administrator can set default + # values as well as adjust permissions to allow users to customize them. + # For each setting a new column is added to the phpbb_users table. + dmzx.mchat.config_ucp: + mchat_avatars: + default: 1 + type: 'BOOL' + mchat_capital_letter: + default: 1 + type: 'BOOL' + mchat_character_count: + default: 1 + type: 'BOOL' + mchat_date: + default: 'D M d, Y g:i a' + type: 'VCHAR:64' + validation: + - 'string' + - false + - 0 + - 64 + mchat_index: + default: 1 + type: 'BOOL' + mchat_input_area: + default: 1 + type: 'BOOL' + mchat_location: + default: 1 + type: 'BOOL' + mchat_message_top: + default: 1 + type: 'BOOL' + mchat_pause_on_input: + default: 0 + type: 'BOOL' + mchat_posts: + default: 1 + type: 'BOOL' + mchat_relative_time: + default: 1 + type: 'BOOL' + mchat_sound: + default: 1 + type: 'BOOL' + mchat_stats_index: + default: 0 + type: 'BOOL' + mchat_whois_index: + default: 1 + type: 'BOOL' diff --git a/config/services.yml b/config/services.yml index 99292f8..a47a3cf 100644 --- a/config/services.yml +++ b/config/services.yml @@ -1,18 +1,18 @@ imports: - { resource: tables.yml } - - { resource: user_config_keys.yml } + - { resource: config_2_0_0.yml } services: dmzx.mchat.acp.controller: class: dmzx\mchat\controller\acp_controller arguments: - - '@config' - '@template' - '@log' - '@user' - '@dbal.conn' - '@cache' - '@request' + - '@dmzx.mchat.settings' - '%dmzx.mchat.table.mchat%' - '%dmzx.mchat.table.mchat_deleted_messages%' - '%core.root_path%' @@ -20,12 +20,14 @@ services: dmzx.mchat.ucp.controller: class: dmzx\mchat\controller\ucp_controller arguments: - - '@config' - '@template' - '@user' + - '@auth' - '@dbal.conn' - '@request' - - '%user_config_keys%' + - '@dmzx.mchat.settings' + - '%core.root_path%' + - '%core.php_ext%' dmzx.mchat.main.controller: class: dmzx\mchat\controller\main_controller arguments: @@ -36,7 +38,7 @@ services: class: dmzx\mchat\core\mchat arguments: - '@dmzx.mchat.functions' - - '@config' + - '@dmzx.mchat.settings' - '@controller.helper' - '@template' - '@user' @@ -50,7 +52,7 @@ services: dmzx.mchat.functions: class: dmzx\mchat\core\functions arguments: - - '@config' + - '@dmzx.mchat.settings' - '@user' - '@auth' - '@log' @@ -61,19 +63,28 @@ services: - '%dmzx.mchat.table.mchat%' - '%dmzx.mchat.table.mchat_deleted_messages%' - '%dmzx.mchat.table.mchat_sessions%' + dmzx.mchat.settings: + class: dmzx\mchat\core\settings + arguments: + - '@user' + - '@config' + - '@auth' + - '%dmzx.mchat.config_global%' + - '%dmzx.mchat.config_ucp%' dmzx.mchat.acp.listener: class: dmzx\mchat\event\acp_listener arguments: - '@template' - '@request' - '@user' - - '%user_config_keys%' + - '@dmzx.mchat.settings' + - '%core.root_path%' + - '%core.php_ext%' tags: - { name: event.listener } dmzx.mchat.main.listener: class: dmzx\mchat\event\main_listener arguments: - - '@dmzx.mchat.functions' - '@dmzx.mchat.core' - '@controller.helper' - '@user' diff --git a/config/user_config_keys.yml b/config/user_config_keys.yml deleted file mode 100644 index cc1afdc..0000000 --- a/config/user_config_keys.yml +++ /dev/null @@ -1,9 +0,0 @@ -parameters: - user_config_keys: - - user_mchat_index - - user_mchat_sound - - user_mchat_stats_index - - user_mchat_topics - - user_mchat_avatars - - user_mchat_capital_letter - - user_mchat_input_area diff --git a/controller/acp_controller.php b/controller/acp_controller.php index 3bc16d0..2c85d7d 100644 --- a/controller/acp_controller.php +++ b/controller/acp_controller.php @@ -13,9 +13,6 @@ namespace dmzx\mchat\controller; class acp_controller { - /** @var \phpbb\config\config */ - protected $config; - /** @var \phpbb\template\template */ protected $template; @@ -34,6 +31,9 @@ class acp_controller /** @var \phpbb\request\request */ protected $request; + /** @var \dmzx\mchat\core\settings */ + protected $settings; + /** @var string */ protected $mchat_table; @@ -49,27 +49,27 @@ class acp_controller /** * Constructor * - * @param \phpbb\config\config $config * @param \phpbb\template\template $template * @param \phpbb\log\log_interface $log * @param \phpbb\user $user * @param \phpbb\db\driver\driver_interface $db * @param \phpbb\cache\service $cache * @param \phpbb\request\request $request + * @param \dmzx\mchat\core\settings $settings * @param string $mchat_table * @param string $mchat_deleted_messages_table * @param string $root_path * @param string $php_ext */ - public function __construct(\phpbb\config\config $config, \phpbb\template\template $template, \phpbb\log\log_interface $log, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, \phpbb\request\request $request, $mchat_table, $mchat_deleted_messages_table, $root_path, $php_ext) + public function __construct(\phpbb\template\template $template, \phpbb\log\log_interface $log, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, \phpbb\request\request $request, \dmzx\mchat\core\settings $settings, $mchat_table, $mchat_deleted_messages_table, $root_path, $php_ext) { - $this->config = $config; $this->template = $template; $this->log = $log; $this->user = $user; $this->db = $db; $this->cache = $cache; $this->request = $request; + $this->settings = $settings; $this->mchat_table = $mchat_table; $this->mchat_deleted_messages_table = $mchat_deleted_messages_table; $this->root_path = $root_path; @@ -79,48 +79,13 @@ class acp_controller /** * Display the options the admin can configure for this extension * - * @param $u_action + * @param string $u_action */ - public function display_options($u_action) + public function globalsettings($u_action) { add_form_key('acp_mchat'); - $mchat_config = array( - 'mchat_archive_limit' => array('default' => 25, 'validation' => array('num', false, 25, 50)), - 'mchat_avatars' => array('default' => 1, 'validation' => array()), - 'mchat_bbcode_disallowed' => array('default' => '', 'validation' => array('string', false, 0, 255)), - 'mchat_custom_height' => array('default' => 350, 'validation' => array('num', false, 50, 1000)), - 'mchat_custom_page' => array('default' => 1, 'validation' => array()), - 'mchat_relative_time' => array('default' => 1, 'validation' => array()), - 'mchat_date' => array('default' => 'D M d, Y g:i a', 'validation' => array('string', false, 0, 255)), - 'mchat_edit_delete_limit' => array('default' => 0, 'validation' => array()), - 'mchat_flood_time' => array('default' => 0, 'validation' => array('num', false, 0, 30)), - 'mchat_index_height' => array('default' => 250, 'validation' => array('num', false, 50, 1000)), - 'mchat_live_updates' => array('default' => 1, 'validation' => array()), - 'mchat_location' => array('default' => 0, 'validation' => array()), - 'mchat_max_message_lngth' => array('default' => 500, 'validation' => array('num', false, 0, 500)), - 'mchat_message_limit' => array('default' => 10, 'validation' => array('num', false, 10, 30)), - 'mchat_message_num' => array('default' => 10, 'validation' => array('num', false, 10, 50)), - 'mchat_message_top' => array('default' => 1, 'validation' => array()), - 'mchat_navbar_link' => array('default' => 1, 'validation' => array()), - 'mchat_new_posts_edit' => array('default' => 0, 'validation' => array()), - 'mchat_new_posts_quote' => array('default' => 0, 'validation' => array()), - 'mchat_new_posts_reply' => array('default' => 0, 'validation' => array()), - 'mchat_new_posts_topic' => array('default' => 0, 'validation' => array()), - 'mchat_on_index' => array('default' => 1, 'validation' => array()), - 'mchat_override_min_post_chars' => array('default' => 0, 'validation' => array()), - 'mchat_override_smilie_limit' => array('default' => 0, 'validation' => array()), - 'mchat_pause_on_input' => array('default' => 0, 'validation' => array()), - 'mchat_prune' => array('default' => 0, 'validation' => array()), - 'mchat_prune_num' => array('default' => 0, 'validation' => array()), - 'mchat_refresh' => array('default' => 10, 'validation' => array('num', false, 5, 60)), - 'mchat_rules' => array('default' => '', 'validation' => array('string', false, 0, 255)), - 'mchat_static_message' => array('default' => '', 'validation' => array('string', false, 0, 255)), - 'mchat_stats_index' => array('default' => 0, 'validation' => array()), - 'mchat_timeout' => array('default' => 0, 'validation' => array('num', false, 0, (int) $this->config['session_length'])), - 'mchat_whois' => array('default' => 1, 'validation' => array()), - 'mchat_whois_refresh' => array('default' => 60, 'validation' => array('num', false, 30, 300)), - ); + $error = array(); if ($this->request->is_set_post('mchat_purge')) { @@ -139,35 +104,37 @@ class acp_controller } else if ($this->request->is_set_post('submit')) { + $mchat_new_config = array(); + $validation = array(); + foreach ($this->settings->global as $config_name => $config_data) + { + $default = $this->settings->cfg($config_name); + settype($default, gettype($config_data['default'])); + $mchat_new_config[$config_name] = $this->request->variable($config_name, $default, is_string($default)); + if (isset($config_data['validation'])) + { + $validation[$config_name] = $config_data['validation']; + } + } + if (!function_exists('validate_data')) { include($this->root_path . 'includes/functions_user.' . $this->php_ext); } - $mchat_new_config = array(); - $validation = array(); - foreach ($mchat_config as $key => $value) - { - $mchat_new_config[$key] = $this->request->variable($key, $value['default'], is_string($value['default'])); - if (!empty($value['validation'])) - { - $validation[$key] = $value['validation']; - } - } - - $error = validate_data($mchat_new_config, $validation); + $error = array_merge($error, validate_data($mchat_new_config, $validation)); if (!check_form_key('acp_mchat')) { $error[] = 'FORM_INVALID'; } - if (empty($error)) + if (!$error) { // Set the options the user configured foreach ($mchat_new_config as $config_name => $config_value) { - $this->config->set($config_name, $config_value); + $this->settings->set_cfg($config_name, $config_value); } // Add an entry into the log table @@ -180,36 +147,94 @@ class acp_controller $error = array_map(array($this->user, 'lang'), $error); } - $dateformat_options = ''; - foreach ($this->user->lang['dateformats'] as $format => $null) + foreach (array_keys($this->settings->global) as $key) { - $dateformat_options .= ''; - } - - $s_custom = false; - $dateformat_options .= ''; - - foreach (array_keys($mchat_config) as $key) - { - $this->template->assign_var(strtoupper($key), $this->config[$key]); + $this->template->assign_var(strtoupper($key), $this->settings->cfg($key)); } $this->template->assign_vars(array( - 'MCHAT_ERROR' => !empty($error) ? implode('
', $error) : '', - 'MCHAT_VERSION' => $this->config['mchat_version'], + 'MCHAT_ERROR' => $error ? implode('
', $error) : '', + 'MCHAT_VERSION' => $this->settings->cfg('mchat_version'), 'MCHAT_FOUNDER' => $this->user->data['user_type'] == USER_FOUNDER, 'L_MCHAT_BBCODES_DISALLOWED_EXPLAIN' => $this->user->lang('MCHAT_BBCODES_DISALLOWED_EXPLAIN', 'root_path}adm/index.$this->php_ext", 'i=bbcodes', true, $this->user->session_id) . '">', ''), - 'L_MCHAT_TIMEOUT_EXPLAIN' => $this->user->lang('MCHAT_USER_TIMEOUT_EXPLAIN','root_path}adm/index.$this->php_ext", 'i=board&mode=load', true, $this->user->session_id) . '">', '', $this->config['session_length']), - 'S_MCHAT_DATEFORMAT_OPTIONS' => $dateformat_options, - 'S_CUSTOM_DATEFORMAT' => $s_custom, + 'L_MCHAT_TIMEOUT_EXPLAIN' => $this->user->lang('MCHAT_USER_TIMEOUT_EXPLAIN','root_path}adm/index.$this->php_ext", 'i=board&mode=load', true, $this->user->session_id) . '">', '', $this->settings->cfg('session_length')), + 'U_ACTION' => $u_action, + )); + } + + /** + * @param string $u_action + */ + public function globalusersettings($u_action) + { + add_form_key('acp_mchat'); + + $this->user->add_lang_ext('dmzx/mchat', 'mchat_ucp'); + + $error = array(); + + if ($this->request->is_set_post('submit')) + { + $mchat_new_config = array(); + $validation = array(); + foreach ($this->settings->ucp as $config_name => $config_data) + { + $default = $this->settings->cfg($config_name, true); + settype($default, gettype($config_data['default'])); + $mchat_new_config[$config_name] = $this->request->variable('user_' . $config_name, $default, is_string($default)); + + if (isset($config_data['validation'])) + { + $validation[$config_name] = $config_data['validation']; + } + } + + if (!function_exists('validate_data')) + { + include($this->root_path . 'includes/functions_user.' . $this->php_ext); + } + + $error = array_merge($error, validate_data($mchat_new_config, $validation)); + + if (!check_form_key('acp_mchat')) + { + $error[] = 'FORM_INVALID'; + } + + if (!$error) + { + // Set the options the user configured + foreach ($mchat_new_config as $config_name => $config_value) + { + $this->settings->set_cfg($config_name, $config_value); + } + + // Add an entry into the log table + $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_MCHAT_CONFIG_UPDATE', false, array($this->user->data['username'])); + + trigger_error($this->user->lang('MCHAT_CONFIG_SAVED') . adm_back_link($u_action)); + } + + // Replace "error" strings with their real, localised form + $error = array_map(array($this->user, 'lang'), $error); + } + + foreach (array_keys($this->settings->ucp) as $key) + { + $this->template->assign_var(strtoupper($key), $this->settings->cfg($key, true)); + } + + // Force global date format for $selected value, not user-specific + $selected = $this->settings->cfg('mchat_date', true); + $date_template_data = $this->settings->get_date_template_data($selected); + $this->template->assign_vars($date_template_data); + + $notifications_template_data = $this->settings->get_enabled_post_notifications_lang(); + $this->template->assign_var('MCHAT_POSTS_ENABLED_LANG', $notifications_template_data); + + $this->template->assign_vars(array( + 'MCHAT_ERROR' => $error ? implode('
', $error) : '', + 'MCHAT_VERSION' => $this->settings->cfg('mchat_version'), 'U_ACTION' => $u_action, )); } diff --git a/controller/main_controller.php b/controller/main_controller.php index 7caec63..ed9349e 100644 --- a/controller/main_controller.php +++ b/controller/main_controller.php @@ -54,7 +54,7 @@ class main_controller * Controller for mChat actions called with Ajax requests * * @param string $action The action to perform, one of add|edit|del|refresh|whois - * @return A Symfony JsonResponse object + * @return \Symfony\Component\HttpFoundation\JsonResponse A Symfony JsonResponse object */ public function action($action) { diff --git a/controller/ucp_controller.php b/controller/ucp_controller.php index 4d75e7a..37a4db4 100644 --- a/controller/ucp_controller.php +++ b/controller/ucp_controller.php @@ -13,42 +13,52 @@ namespace dmzx\mchat\controller; class ucp_controller { - /** @var \phpbb\config\config */ - protected $config; - /** @var \phpbb\template\template */ protected $template; /** @var \phpbb\user */ protected $user; + /** @var \phpbb\auth\auth */ + protected $auth; + /** @var \phpbb\db\driver\driver_interface */ protected $db; /** @var \phpbb\request\request */ protected $request; - /** @var array */ - protected $user_config_keys; + /** @var \dmzx\mchat\core\settings */ + protected $settings; + + /** @var string */ + protected $root_path; + + /** @var string */ + protected $php_ext; /** * Constructor * - * @param \phpbb\config\config $config * @param \phpbb\template\template $template * @param \phpbb\user $user + * @param \phpbb\auth\auth $auth * @param \phpbb\db\driver\driver_interface $db * @param \phpbb\request\request $request - * @param array $user_config_keys + * @param \dmzx\mchat\core\settings $settings + * @param string $root_path + * @param string $php_ext */ - public function __construct(\phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, \phpbb\request\request $request, $user_config_keys) + public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db, \phpbb\request\request $request, \dmzx\mchat\core\settings $settings, $root_path, $php_ext) { - $this->config = $config; - $this->template = $template; - $this->user = $user; - $this->db = $db; - $this->request = $request; - $this->user_config_keys = $user_config_keys; + $this->template = $template; + $this->user = $user; + $this->auth = $auth; + $this->db = $db; + $this->request = $request; + $this->settings = $settings; + $this->root_path = $root_path; + $this->php_ext = $php_ext; } /** @@ -56,7 +66,7 @@ class ucp_controller * * @param $u_action */ - public function display_options($u_action) + public function configuration($u_action) { add_form_key('ucp_mchat'); @@ -64,21 +74,39 @@ class ucp_controller if ($this->request->is_set_post('submit')) { + $mchat_new_config = array(); + $validation = array(); + foreach ($this->settings->ucp as $config_name => $config_data) + { + if ($this->auth->acl_get('u_' . $config_name)) + { + $default = $this->user->data['user_' . $config_name]; + settype($default, gettype($config_data['default'])); + $mchat_new_config['user_' . $config_name] = $this->request->variable('user_' . $config_name, $default, is_string($default)); + + if (isset($config_data['validation'])) + { + $validation['user_' . $config_name] = $config_data['validation']; + } + } + } + + if (!function_exists('validate_data')) + { + include($this->root_path . 'includes/functions_user.' . $this->php_ext); + } + + $error = array_merge($error, validate_data($mchat_new_config, $validation)); + if (!check_form_key('ucp_mchat')) { $error[] = 'FORM_INVALID'; } - if (empty($error)) + if (!$error) { - $data = array(); - foreach ($this->user_config_keys as $config_key) - { - $data[$config_key] = $this->request->variable($config_key, (int) $this->user->data[$config_key]); - } - $sql = 'UPDATE ' . USERS_TABLE . ' - SET ' . $this->db->sql_build_array('UPDATE', $data) . ' + SET ' . $this->db->sql_build_array('UPDATE', $mchat_new_config) . ' WHERE user_id = ' . (int) $this->user->data['user_id']; $this->db->sql_query($sql); @@ -91,19 +119,35 @@ class ucp_controller $error = array_map(array($this->user, 'lang'), $error); } - foreach ($this->user_config_keys as $config_key) + $auth_count = 0; + + foreach (array_keys($this->settings->ucp) as $config_name) { - $this->template->assign_var(strtoupper($config_key), $this->user->data[$config_key]); + $upper = strtoupper($config_name); + $auth = $this->auth->acl_get('u_' . $config_name); + + $this->template->assign_vars(array( + $upper => $this->settings->cfg($config_name), + $upper . '_AUTH' => $auth, + )); + + if ($auth) + { + $auth_count++; + } } - $this->template->assign_vars(array( - 'ERROR' => sizeof($error) ? implode('
', $error) : '', - 'S_UCP_ACTION' => $u_action, + $selected = $this->settings->cfg('mchat_date'); + $date_template_data = $this->settings->get_date_template_data($selected); + $this->template->assign_vars($date_template_data); - 'S_MCHAT_TOPICS' => $this->config['mchat_new_posts_edit'] || $this->config['mchat_new_posts_quote'] || $this->config['mchat_new_posts_reply'] || $this->config['mchat_new_posts_topic'], - 'S_MCHAT_INDEX' => $this->config['mchat_on_index'], - 'S_MCHAT_INDEX_STATS' => $this->config['mchat_stats_index'], - 'S_MCHAT_AVATARS' => $this->config['mchat_avatars'], + $notifications_template_data = $this->settings->get_enabled_post_notifications_lang(); + $this->template->assign_var('MCHAT_POSTS_ENABLED_LANG', $notifications_template_data); + + $this->template->assign_vars(array( + 'ERROR' => sizeof($error) ? implode('
', $error) : '', + 'MCHAT_AUTH_COUNT' => $auth_count, + 'S_UCP_ACTION' => $u_action, )); } } diff --git a/core/functions.php b/core/functions.php index 2feb93f..023a6a2 100644 --- a/core/functions.php +++ b/core/functions.php @@ -13,8 +13,8 @@ namespace dmzx\mchat\core; class functions { - /** @var \phpbb\config\config */ - protected $config; + /** @var \dmzx\mchat\core\settings */ + protected $settings; /** @var \phpbb\user */ protected $user; @@ -52,7 +52,7 @@ class functions /** * Constructor * - * @param \phpbb\config\config $config + * @param \dmzx\mchat\core\settings $settings * @param \phpbb\user $user * @param \phpbb\auth\auth $auth * @param \phpbb\log\log_interface $log @@ -64,9 +64,9 @@ class functions * @param string $mchat_deleted_messages_table * @param string $mchat_sessions_table */ - function __construct(\phpbb\config\config $config, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\log\log_interface $log, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, $root_path, $php_ext, $mchat_table, $mchat_deleted_messages_table, $mchat_sessions_table) + function __construct(\dmzx\mchat\core\settings $settings, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\log\log_interface $log, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, $root_path, $php_ext, $mchat_table, $mchat_deleted_messages_table, $mchat_sessions_table) { - $this->config = $config; + $this->settings = $settings; $this->user = $user; $this->auth = $auth; $this->log = $log; @@ -119,7 +119,19 @@ class functions */ protected function mchat_session_time() { - return !empty($this->config['mchat_timeout']) ? $this->config['mchat_timeout'] : (!empty($this->config['load_online_time']) ? $this->config['load_online_time'] * 60 : $this->config['session_length']); + $mchat_timeout = $this->settings->cfg('mchat_timeout'); + if ($mchat_timeout) + { + return $mchat_timeout; + } + + $load_online_time = $this->settings->cfg('load_online_time'); + if ($load_online_time) + { + return $load_online_time * 60; + } + + return $this->settings->cfg('session_length'); } /** @@ -216,11 +228,11 @@ class functions */ public function mchat_prune() { - if ($this->config['mchat_prune']) + if ($this->settings->cfg('mchat_prune')) { $mchat_total_messages = $this->mchat_total_message_count(); - if ($mchat_total_messages > $this->config['mchat_prune_num']) + if ($mchat_total_messages > $this->settings->cfg('mchat_prune_num')) { $sql = 'SELECT message_id FROM '. $this->mchat_table . ' @@ -230,10 +242,10 @@ class functions $this->db->sql_freeresult($result); // Compute new oldest message id - $delete_id = $mchat_total_messages - $this->config['mchat_prune_num'] + $first_id; + $delete_id = $mchat_total_messages - $this->settings->cfg('mchat_prune_num') + $first_id; // Delete older messages - $this->mchat_action('prune', null, $delete_id, $this->user->data['username']); + $this->mchat_action('prune', null, $delete_id); } } } @@ -258,6 +270,16 @@ class functions */ public function mchat_get_messages($sql_where, $total = 0, $offset = 0) { + // Exclude post notifications + if (!$this->settings->cfg('mchat_posts')) + { + if (!empty($sql_where)) + { + $sql_where = '(' . $sql_where . ') AND '; + } + $sql_where .= 'm.forum_id = 0'; + } + $sql_array = array( 'SELECT' => 'm.*, u.username, u.user_colour, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, u.user_allow_pm', 'FROM' => array($this->mchat_table => 'm'), @@ -276,6 +298,15 @@ class functions $rows = $this->db->sql_fetchrowset($result); $this->db->sql_freeresult($result); + // Set deleted users to ANONYMOUS + foreach ($rows as $i => $row) + { + if (!isset($row['username'])) + { + $rows[$i]['user_id'] = ANONYMOUS; + } + } + return $rows; } @@ -287,7 +318,7 @@ class functions public function mchat_legend() { // 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'; + $order_legend = $this->settings->cfg('legend_sort_groupname') ? 'group_name' : 'group_legend'; if ($this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) { $sql = 'SELECT group_id, group_name, group_colour, group_type @@ -361,7 +392,7 @@ class functions */ public function mchat_sql_append_forbidden_bbcodes($sql_where) { - $disallowed_bbcodes = explode('|', $this->config['mchat_bbcode_disallowed']); + $disallowed_bbcodes = explode('|', $this->settings->cfg('mchat_bbcode_disallowed')); if (!empty($disallowed_bbcodes)) { @@ -380,13 +411,13 @@ class functions public function mchat_insert_posting($mode, $data) { $mode_config = array( - 'post' => $this->config['mchat_new_posts_topic'], - 'quote' => $this->config['mchat_new_posts_quote'], - 'edit' => $this->config['mchat_new_posts_edit'], - 'reply' => $this->config['mchat_new_posts_reply'], + 'post' => 'mchat_posts_topic', + 'quote' => 'mchat_posts_quote', + 'edit' => 'mchat_posts_edit', + 'reply' => 'mchat_posts_reply', ); - if (empty($mode_config[$mode])) + if (empty($mode_config[$mode]) || !$this->settings->cfg($mode_config[$mode])) { return; } @@ -420,7 +451,7 @@ class functions */ public function mchat_is_user_flooding() { - if (!$this->config['mchat_flood_time'] || $this->auth->acl_get('u_mchat_flood_ignore')) + if (!$this->settings->cfg('mchat_flood_time') || $this->auth->acl_get('u_mchat_flood_ignore')) { return false; } @@ -433,7 +464,7 @@ class functions $message_time = (int) $this->db->sql_fetchfield('message_time'); $this->db->sql_freeresult($result); - return $message_time && time() - $message_time < $this->config['mchat_flood_time']; + return $message_time && time() - $message_time < $this->settings->cfg('mchat_flood_time'); } /** @@ -486,10 +517,9 @@ class functions * @param string $action One of add|edit|del|prune * @param array $sql_ary * @param int $message_id - * @param string $log_username * @return bool */ - public function mchat_action($action, $sql_ary = null, $message_id = 0, $log_username = '') + public function mchat_action($action, $sql_ary = null, $message_id = 0) { $is_new_session = false; @@ -507,7 +537,7 @@ class functions $this->user->update_session_infos(); $is_new_session = $this->mchat_add_user_session(); $this->db->sql_query('UPDATE ' . $this->mchat_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE message_id = ' . (int) $message_id); - $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EDITED_MCHAT', false, array($log_username)); + $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EDITED_MCHAT', false, array($this->user->data['username'])); break; // User deletes a message @@ -517,7 +547,7 @@ class functions $this->db->sql_query('DELETE FROM ' . $this->mchat_table . ' WHERE message_id = ' . (int) $message_id); $this->db->sql_query('INSERT INTO ' . $this->mchat_deleted_messages_table . ' ' . $this->db->sql_build_array('INSERT', array('message_id' => (int) $message_id))); $this->cache->destroy('sql', $this->mchat_deleted_messages_table); - $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DELETED_MCHAT', false, array($log_username)); + $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DELETED_MCHAT', false, array($this->user->data['username'])); break; // User triggers messages to be pruned @@ -539,7 +569,6 @@ class functions $this->db->sql_query('DELETE FROM ' . $this->mchat_table . ' WHERE ' .$this->db->sql_in_set('message_id', $prune_ids)); $this->db->sql_multi_insert($this->mchat_deleted_messages_table, $rows); $this->cache->destroy('sql', $this->mchat_deleted_messages_table); - // $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_MCHAT_TABLE_PRUNED', false, array($log_username)); break; } diff --git a/core/mchat.php b/core/mchat.php index 6736581..ea76981 100644 --- a/core/mchat.php +++ b/core/mchat.php @@ -16,8 +16,8 @@ class mchat /** @var \dmzx\mchat\core\functions */ protected $functions; - /** @var \phpbb\config\config */ - protected $config; + /** @var \dmzx\mchat\core\settings */ + protected $settings; /** @var \phpbb\controller\helper */ protected $helper; @@ -56,7 +56,7 @@ class mchat * Constructor * * @param \dmzx\mchat\core\functions $functions - * @param \phpbb\config\config $config + * @param \dmzx\mchat\core\settings $settings * @param \phpbb\controller\helper $helper * @param \phpbb\template\template $template * @param \phpbb\user $user @@ -68,10 +68,10 @@ class mchat * @param string $root_path * @param string $php_ext */ - public function __construct(\dmzx\mchat\core\functions $functions, \phpbb\config\config $config, \phpbb\controller\helper $helper, \phpbb\template\template $template, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \phpbb\request\request $request, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\extension\manager $extension_manager, $root_path, $php_ext) + public function __construct(\dmzx\mchat\core\functions $functions, \dmzx\mchat\core\settings $settings, \phpbb\controller\helper $helper, \phpbb\template\template $template, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \phpbb\request\request $request, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\extension\manager $extension_manager, $root_path, $php_ext) { $this->functions = $functions; - $this->config = $config; + $this->settings = $settings; $this->helper = $helper; $this->template = $template; $this->user = $user; @@ -82,6 +82,11 @@ class mchat $this->extension_manager = $extension_manager; $this->root_path = $root_path; $this->php_ext = $php_ext; + + $this->template->assign_vars(array( + 'IS_PHPBB31' => $this->settings->is_phpbb31, + 'IS_PHPBB32' => $this->settings->is_phpbb32, + )); } /** @@ -96,12 +101,7 @@ class mchat $this->assign_whois(); - if (!$this->config['mchat_on_index']) - { - return; - } - - if (!$this->user->data['user_mchat_index']) + if (!$this->settings->cfg('mchat_index')) { return; } @@ -111,6 +111,8 @@ class mchat $this->assign_bbcodes_smilies(); $this->render_page('index'); + + $this->template->assign_var('MCHAT_IS_INDEX', true); } /** @@ -125,7 +127,7 @@ class mchat throw new \phpbb\exception\http_exception(403, 'NOT_AUTHORISED'); } - if (!$this->config['mchat_custom_page']) + if (!$this->settings->cfg('mchat_custom_page')) { throw new \phpbb\exception\http_exception(403, 'MCHAT_NO_CUSTOM_PAGE'); } @@ -138,7 +140,7 @@ class mchat $this->assign_bbcodes_smilies(); - $this->template->assign_var('MCHAT_CUSTOM_PAGE', true); + $this->template->assign_var('MCHAT_IS_CUSTOM_PAGE', true); $this->render_page('custom'); @@ -165,7 +167,7 @@ class mchat $this->functions->mchat_prune(); - $this->template->assign_var('MCHAT_ARCHIVE_PAGE', true); + $this->template->assign_var('MCHAT_IS_ARCHIVE_PAGE', true); $this->render_page('archive'); @@ -219,13 +221,13 @@ class mchat } $lang_rules = $this->user->lang('MCHAT_RULES_MESSAGE'); - if (!$this->config['mchat_rules'] && !$lang_rules) + if (!$this->settings->cfg('mchat_rules') && !$lang_rules) { throw new \phpbb\exception\http_exception(404, 'MCHAT_NO_RULES'); } // If the rules are defined in the language file use them, else just use the entry in the database - $mchat_rules = $lang_rules ?: $this->config['mchat_rules']; + $mchat_rules = $lang_rules ?: $this->settings->cfg('mchat_rules'); $mchat_rules = htmlspecialchars_decode($mchat_rules); $mchat_rules = str_replace("\n", '
', $mchat_rules); @@ -253,7 +255,7 @@ class mchat $message = $this->request->variable('message', '', true); - if ($this->user->data['user_mchat_capital_letter']) + if ($this->settings->cfg('mchat_capital_letter')) { $message = utf8_ucfirst($message); } @@ -306,7 +308,7 @@ class mchat } $is_archive = $this->request->variable('archive', 0); - $this->template->assign_var('MCHAT_ARCHIVE_PAGE', $is_archive); + $this->template->assign_var('MCHAT_IS_ARCHIVE_PAGE', $is_archive); $message = $this->request->variable('message', '', true); @@ -314,7 +316,7 @@ class mchat 'edit_time' => time(), )); - $this->functions->mchat_action('edit', $sql_ary, $message_id, $author['username']); + $this->functions->mchat_action('edit', $sql_ary, $message_id); /** * Event render_helper_edit @@ -362,7 +364,7 @@ class mchat */ $this->dispatcher->dispatch('dmzx.mchat.core.render_helper_delete'); - $this->functions->mchat_action('del', null, $message_id, $author['username']); + $this->functions->mchat_action('del', null, $message_id); return array('del' => true); } @@ -380,7 +382,7 @@ class mchat } // Keep the session alive forever if there is no user session timeout - if (!$this->config['mchat_timeout']) + if (!$this->settings->cfg('mchat_timeout')) { $this->user->update_session_infos(); } @@ -393,21 +395,15 @@ class mchat $sql_where = 'm.message_id > ' . (int) $message_last_id; // Request edited messages - if ($this->config['mchat_live_updates'] && $message_last_id > 0) + if ($this->settings->cfg('mchat_live_updates') && $message_last_id > 0) { $sql_where .= sprintf(' OR (m.message_id BETWEEN %d AND %d AND m.edit_time > 0)', (int) $message_first_id , (int) $message_last_id); - if ($this->config['mchat_edit_delete_limit']) + if ($this->settings->cfg('mchat_edit_delete_limit')) { - $sql_where .= sprintf(' AND m.message_time > %d', time() - $this->config['mchat_edit_delete_limit']); + $sql_where .= sprintf(' AND m.message_time > %d', time() - $this->settings->cfg('mchat_edit_delete_limit')); } } - // Exclude post notifications - if (!$this->user->data['user_mchat_topics']) - { - $sql_where = '(' . $sql_where . ') AND m.forum_id = 0'; - } - $rows = $this->functions->mchat_get_messages($sql_where); $rows_refresh = array(); $rows_edit = array(); @@ -447,7 +443,7 @@ class mchat } // Assign deleted messages - if ($this->config['mchat_live_updates'] && $message_last_id > 0) + if ($this->settings->cfg('mchat_live_updates') && $message_last_id > 0) { $deleted_message_ids = $this->functions->mchat_deleted_ids($message_first_id); if ($deleted_message_ids) @@ -478,8 +474,8 @@ class mchat { $this->template->assign_vars(array( 'MCHAT_ALLOW_VIEW' => $this->auth->acl_get('u_mchat_view'), - 'MCHAT_NAVBAR_LINK' => $this->config['mchat_navbar_link'], - 'S_MCHAT_CUSTOM_PAGE' => $this->config['mchat_custom_page'], + 'MCHAT_NAVBAR_LINK' => $this->settings->cfg('mchat_navbar_link'), + 'MCHAT_CUSTOM_PAGE' => $this->settings->cfg('mchat_custom_page'), 'U_MCHAT' => $this->helper->route('dmzx_mchat_controller'), )); } @@ -496,51 +492,50 @@ class mchat // If the static message is defined in the language file use it, else the entry in the database is used $lang_static_message = $this->user->lang('MCHAT_STATIC_MESSAGE'); - $static_message = $lang_static_message ?: $this->config['mchat_static_message']; + $static_message = $lang_static_message ?: $this->settings->cfg('mchat_static_message'); + + $u_mchat_use = $this->auth->acl_get('u_mchat_use'); $this->template->assign_vars(array( - 'U_MCHAT_CUSTOM_PAGE' => $this->helper->route('dmzx_mchat_controller'), - 'MCHAT_REFRESH_JS' => 1000 * $this->config['mchat_refresh'], - 'MCHAT_INPUT_TYPE' => $this->user->data['user_mchat_input_area'], - 'MCHAT_RULES' => $this->user->lang('MCHAT_RULES_MESSAGE') || $this->config['mchat_rules'], - 'MCHAT_ALLOW_USE' => $this->auth->acl_get('u_mchat_use'), - 'MCHAT_ALLOW_SMILES' => $this->config['allow_smilies'] && $this->auth->acl_get('u_mchat_smilies'), - 'S_BBCODE_ALLOWED' => $this->config['allow_bbcode'] && $this->auth->acl_get('u_mchat_bbcode'), - 'MCHAT_MESSAGE_TOP' => $this->config['mchat_message_top'], - 'MCHAT_ARCHIVE_URL' => $this->helper->route('dmzx_mchat_page_controller', array('page' => 'archive')), - 'MCHAT_INDEX_HEIGHT' => $this->config['mchat_index_height'], - 'MCHAT_CUSTOM_HEIGHT' => $this->config['mchat_custom_height'], - 'MCHAT_READ_ARCHIVE_BUTTON' => $this->auth->acl_get('u_mchat_archive'), + 'MCHAT_ALLOW_USE' => $u_mchat_use, + 'S_BBCODE_ALLOWED' => $this->settings->cfg('allow_bbcode') && $this->auth->acl_get('u_mchat_bbcode'), + 'MCHAT_ALLOW_SMILES' => $this->settings->cfg('allow_smilies') && $this->auth->acl_get('u_mchat_smilies'), + 'MCHAT_INPUT_AREA' => $this->settings->cfg('mchat_input_area'), + 'MCHAT_MESSAGE_TOP' => $this->settings->cfg('mchat_message_top'), + 'MCHAT_INDEX_HEIGHT' => $this->settings->cfg('mchat_index_height'), + 'MCHAT_CUSTOM_HEIGHT' => $this->settings->cfg('mchat_custom_height'), + 'MCHAT_LIVE_UPDATES' => $this->settings->cfg('mchat_live_updates'), + 'MCHAT_LOCATION' => $this->settings->cfg('mchat_location'), + 'MCHAT_CHARACTER_COUNT' => $this->settings->cfg('mchat_character_count'), + 'MCHAT_SOUND' => $this->settings->cfg('mchat_sound'), + 'MCHAT_SOUND_DISABLED' => !$this->settings->cfg('mchat_sound') && !$this->settings->cfg('mchat_sound', true), + 'MCHAT_INDEX' => $this->settings->cfg('mchat_index'), + 'MCHAT_PAUSE_ON_INPUT' => $this->settings->cfg('mchat_pause_on_input'), + 'MCHAT_MESSAGE_LNGTH' => $this->settings->cfg('mchat_max_message_lngth'), + 'MCHAT_WHOIS_INDEX' => $this->settings->cfg('mchat_whois_index'), + 'MCHAT_WHOIS_REFRESH' => $this->settings->cfg('mchat_whois') ? $this->settings->cfg('mchat_whois_refresh') * 1000 : 0, + 'MCHAT_REFRESH_JS' => $this->settings->cfg('mchat_refresh') * 1000, + 'MCHAT_ARCHIVE' => $this->auth->acl_get('u_mchat_archive'), + 'MCHAT_RULES' => $this->user->lang('MCHAT_RULES_MESSAGE') || $this->settings->cfg('mchat_rules'), + 'MCHAT_WHOIS_REFRESH_EXPLAIN' => $this->user->lang('MCHAT_WHO_IS_REFRESH_EXPLAIN', $this->settings->cfg('mchat_whois_refresh')), + 'MCHAT_SESSION_TIMELEFT' => $this->user->lang('MCHAT_SESSION_ENDS', gmdate('H:i:s', (int) $this->settings->cfg('mchat_timeout'))), 'MCHAT_STATIC_MESS' => htmlspecialchars_decode($static_message), - 'L_MCHAT_COPYRIGHT' => base64_decode('PHNwYW4gY2xhc3M9Im1jaGF0LWNvcHlyaWdodCIgdGl0bGU9ImRtenggJmJ1bGw7IGthc2ltaSAmYnVsbDsgUk1jR2lycjgzIj4mY29weTs8L3NwYW4+'), - 'MCHAT_MESSAGE_LNGTH' => $this->config['mchat_max_message_lngth'], - 'MCHAT_MESS_LONG' => $this->user->lang('MCHAT_MESS_LONG', $this->config['mchat_max_message_lngth']), - 'MCHAT_USER_TIMEOUT_TIME' => gmdate('H:i:s', (int) $this->config['mchat_timeout']), - 'MCHAT_WHOIS_REFRESH' => $this->config['mchat_whois'] ? 1000 * $this->config['mchat_whois_refresh'] : 0, - 'MCHAT_WHOIS_REFRESH_EXPLAIN' => $this->user->lang('MCHAT_WHO_IS_REFRESH_EXPLAIN', $this->config['mchat_whois_refresh']), - 'MCHAT_PAUSE_ON_INPUT' => $this->config['mchat_pause_on_input'], - 'MCHAT_REFRESH_YES' => $this->user->lang('MCHAT_REFRESH_YES', $this->config['mchat_refresh']), - 'MCHAT_LIVE_UPDATES' => $this->config['mchat_live_updates'], - 'S_MCHAT_LOCATION' => $this->config['mchat_location'], - 'S_MCHAT_SOUND_YES' => $this->user->data['user_mchat_sound'], - 'U_MORE_SMILIES' => generate_board_url() . append_sid("/{$this->root_path}/posting.{$this->php_ext}", 'mode=smilies'), + 'MCHAT_MESS_LONG' => addslashes($this->user->lang('MCHAT_MESS_LONG', $this->settings->cfg('mchat_max_message_lngth'))), + 'MCHAT_REFRESH_YES' => addslashes($this->user->lang('MCHAT_REFRESH_YES', $this->settings->cfg('mchat_refresh'))), + 'U_MCHAT_CUSTOM_PAGE' => $this->helper->route('dmzx_mchat_controller'), 'U_MCHAT_RULES' => $this->helper->route('dmzx_mchat_page_controller', array('page' => 'rules')), - 'S_MCHAT_ON_INDEX' => $this->config['mchat_on_index'] && $this->user->data['user_mchat_index'], + 'U_MCHAT_ARCHIVE_URL' => $this->helper->route('dmzx_mchat_page_controller', array('page' => 'archive')), )); - $md_manager = $this->extension_manager->create_extension_metadata_manager('dmzx/mchat', $this->template); - $md_manager->get_metadata('all'); - $md_manager->output_template_data(); - // The template needs some language variables if we display relative time for messages - if ($this->config['mchat_relative_time'] && $page != 'archive') + if ($this->settings->cfg('mchat_relative_time') && $page != 'archive') { $minutes_limit = $this->get_relative_minutes_limit(); for ($i = 0; $i < $minutes_limit; $i++) { $this->template->assign_block_vars('mchattime', array( 'KEY' => $i, - 'LANG' => $this->user->lang('MCHAT_MINUTES_AGO', $i), + 'LANG' => addslashes($this->user->lang('MCHAT_MINUTES_AGO', $i)), 'IS_LAST' => $i + 1 === $minutes_limit, )); } @@ -551,8 +546,8 @@ class mchat 'edit' => $this->auth_message('u_mchat_edit', true, time()), 'del' => $this->auth_message('u_mchat_delete', true, time()), 'refresh' => $page != 'archive' && $this->auth->acl_get('u_mchat_view'), - 'add' => $page != 'archive' && $this->auth->acl_get('u_mchat_use'), - 'whois' => $page != 'archive' && $this->config['mchat_whois'], + 'add' => $page != 'archive' && $u_mchat_use, + 'whois' => $page != 'archive' && $this->settings->cfg('mchat_whois'), ))); foreach ($actions as $i => $action) @@ -564,10 +559,9 @@ class mchat )); } - $sql_where = $this->user->data['user_mchat_topics'] ? '' : 'm.forum_id = 0'; - $limit = $page == 'archive' ? $this->config['mchat_archive_limit'] : $this->config[$page == 'index' ? 'mchat_message_num' : 'mchat_message_limit']; + $limit = $this->settings->cfg('mchat_message_num_' . $page); $start = $page == 'archive' ? $this->request->variable('start', 0) : 0; - $rows = $this->functions->mchat_get_messages($sql_where, $limit, $start); + $rows = $this->functions->mchat_get_messages('', $limit, $start); $this->assign_global_template_data(); $this->assign_messages($rows, $page); @@ -582,13 +576,15 @@ class mchat } // Render legend - if ($page != 'index' && $this->config['mchat_whois']) + if ($page != 'index' && $this->settings->cfg('mchat_whois')) { $legend = $this->functions->mchat_legend(); - $this->template->assign_var('LEGEND', implode(', ', $legend)); + $this->template->assign_var('LEGEND', implode($this->user->lang('COMMA_SEPARATOR'), $legend)); } - if ($this->auth->acl_get('u_mchat_use')) + $this->assign_authors(); + + if ($u_mchat_use) { add_form_key('mchat'); } @@ -602,6 +598,30 @@ class mchat $this->dispatcher->dispatch('dmzx.mchat.core.render_helper_aft'); } + /** + * Assigns author names and homepages for copyright + */ + protected function assign_authors() + { + $md_manager = $this->extension_manager->create_extension_metadata_manager('dmzx/mchat', $this->template); + $meta = $md_manager->get_metadata(); + + $author_names = array(); + $author_homepages = array(); + + foreach ($meta['authors'] as $author) + { + $author_names[] = $author['name']; + $author_homepages[] = sprintf('%2$s', $author['homepage'], $author['name']); + } + + $this->template->assign_vars(array( + 'MCHAT_DISPLAY_NAME' => $meta['extra']['display-name'], + 'MCHAT_AUTHOR_NAMES' => implode(' • ', $author_names), + 'MCHAT_AUTHOR_HOMEPAGES' => implode(' • ', $author_homepages), + )); + } + /** * Assigns common template data that is required for displaying messages */ @@ -612,13 +632,14 @@ class mchat 'MCHAT_ALLOW_PM' => $this->auth->acl_get('u_mchat_pm'), 'MCHAT_ALLOW_LIKE' => $this->auth->acl_get('u_mchat_like'), 'MCHAT_ALLOW_QUOTE' => $this->auth->acl_get('u_mchat_quote'), - 'MCHAT_EDIT_DELETE_LIMIT' => 1000 * $this->config['mchat_edit_delete_limit'], - 'MCHAT_EDIT_DELETE_IGNORE' => $this->config['mchat_edit_delete_limit'] && $this->auth->acl_get('m_'), - 'MCHAT_RELATIVE_TIME' => $this->config['mchat_relative_time'], - 'MCHAT_USER_TIMEOUT' => 1000 * $this->config['mchat_timeout'], + 'MCHAT_ALLOW_PERMISSIONS' => $this->auth->acl_get('a_authusers'), + 'MCHAT_EDIT_DELETE_LIMIT' => 1000 * $this->settings->cfg('mchat_edit_delete_limit'), + 'MCHAT_EDIT_DELETE_IGNORE' => $this->settings->cfg('mchat_edit_delete_limit') && $this->auth->acl_get('m_'), + 'MCHAT_RELATIVE_TIME' => $this->settings->cfg('mchat_relative_time'), + 'MCHAT_USER_TIMEOUT' => 1000 * $this->settings->cfg('mchat_timeout'), 'S_MCHAT_AVATARS' => $this->display_avatars(), 'EXT_URL' => generate_board_url() . '/ext/dmzx/mchat/', - 'STYLE_PATH' => generate_board_url() . '/styles/' . $this->user->style['style_path'], + 'STYLE_PATH' => generate_board_url() . '/styles/' . rawurlencode($this->user->style['style_path']), )); } @@ -629,7 +650,7 @@ class mchat */ protected function display_avatars() { - return $this->config['mchat_avatars'] && $this->user->optionget('viewavatars') && $this->user->data['user_mchat_avatars']; + return $this->settings->cfg('mchat_avatars') && $this->user->optionget('viewavatars') && $this->settings->cfg('mchat_avatars'); } /** @@ -646,7 +667,7 @@ class mchat } // Reverse the array if messages appear at the bottom - if (!$this->config['mchat_message_top']) + if (!$this->settings->cfg('mchat_message_top')) { $rows = array_reverse($rows); } @@ -681,8 +702,7 @@ class mchat continue; } - $message_edit = $row['message']; - decode_message($message_edit, $row['bbcode_uid']); + $message_for_edit = generate_text_for_edit($row['message'], $row['bbcode_uid'], $row['bbcode_options']); if (in_array($row['user_id'], $foes)) { @@ -699,31 +719,32 @@ class mchat $message_age = time() - $row['message_time']; $minutes_ago = $this->get_minutes_ago($message_age, $page); - $datetime = $this->user->format_date($row['message_time'], $this->config['mchat_date']); + $datetime = $this->user->format_date($row['message_time'], $this->settings->cfg('mchat_date')); + + $is_poster = $row['user_id'] != ANONYMOUS && $this->user->data['user_id'] == $row['user_id']; $this->template->assign_block_vars('mchatrow', array( - 'MCHAT_ALLOW_BAN' => $this->auth->acl_get('a_authusers'), - 'MCHAT_ALLOW_EDIT' => $this->auth_message('u_mchat_edit', $row['user_id'], $row['message_time']), - 'MCHAT_ALLOW_DEL' => $this->auth_message('u_mchat_delete', $row['user_id'], $row['message_time']), - 'MCHAT_USER_AVATAR' => $user_avatars[$row['user_id']], - 'U_VIEWPROFILE' => $row['user_id'] != ANONYMOUS ? append_sid("{$board_url}{$this->root_path}memberlist.{$this->php_ext}", 'mode=viewprofile&u=' . $row['user_id']) : '', - 'MCHAT_IS_POSTER' => $row['user_id'] != ANONYMOUS && $this->user->data['user_id'] == $row['user_id'], - 'MCHAT_PM' => $row['user_id'] != ANONYMOUS && $this->user->data['user_id'] != $row['user_id'] && $this->config['allow_privmsg'] && $this->auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_')) ? append_sid("{$board_url}{$this->root_path}ucp.{$this->php_ext}", 'i=pm&mode=compose&u=' . $row['user_id']) : '', - 'MCHAT_MESSAGE_EDIT' => $message_edit, - 'MCHAT_MESSAGE_ID' => $row['message_id'], - 'MCHAT_USERNAME_FULL' => $username_full, - 'MCHAT_USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST')), - 'MCHAT_USERNAME_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST')), - 'MCHAT_WHOIS_USER' => $this->user->lang('MCHAT_WHOIS_USER', $row['user_ip']), - 'MCHAT_U_IP' => $this->helper->route('dmzx_mchat_page_controller', array('page' => 'whois', 'ip' => $row['user_ip'])), - 'MCHAT_U_BAN' => append_sid("{$board_url}{$this->root_path}adm/index.{$this->php_ext}" ,'i=permissions&mode=setting_user_global&user_id[0]=' . $row['user_id'], true, $this->user->session_id), - 'MCHAT_MESSAGE' => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']), - 'MCHAT_TIME' => $minutes_ago === -1 ? $datetime : $this->user->lang('MCHAT_MINUTES_AGO', $minutes_ago), - 'MCHAT_DATETIME' => $datetime, - 'MCHAT_MINUTES_AGO' => $minutes_ago, - 'MCHAT_RELATIVE_UPDATE' => 60 - $message_age % 60, - 'MCHAT_MESSAGE_TIME' => $row['message_time'], - 'MCHAT_EDIT_TIME' => $row['edit_time'], + 'MCHAT_ALLOW_EDIT' => $this->auth_message('u_mchat_edit', $row['user_id'], $row['message_time']), + 'MCHAT_ALLOW_DEL' => $this->auth_message('u_mchat_delete', $row['user_id'], $row['message_time']), + 'MCHAT_USER_AVATAR' => $user_avatars[$row['user_id']], + 'U_VIEWPROFILE' => $row['user_id'] != ANONYMOUS ? append_sid("{$board_url}{$this->root_path}memberlist.{$this->php_ext}", 'mode=viewprofile&u=' . $row['user_id']) : '', + 'MCHAT_IS_POSTER' => $is_poster, + 'MCHAT_PM' => !$is_poster && $this->settings->cfg('allow_privmsg') && $this->auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_')) ? append_sid("{$board_url}{$this->root_path}ucp.{$this->php_ext}", 'i=pm&mode=compose&u=' . $row['user_id']) : '', + 'MCHAT_MESSAGE_EDIT' => $message_for_edit['text'], + 'MCHAT_MESSAGE_ID' => $row['message_id'], + 'MCHAT_USERNAME_FULL' => $username_full, + 'MCHAT_USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST')), + 'MCHAT_USERNAME_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST')), + 'MCHAT_WHOIS_USER' => $this->user->lang('MCHAT_WHOIS_USER', $row['user_ip']), + 'MCHAT_U_IP' => $this->helper->route('dmzx_mchat_page_controller', array('page' => 'whois', 'ip' => $row['user_ip'])), + 'MCHAT_U_PERMISSIONS' => append_sid("{$board_url}{$this->root_path}adm/index.{$this->php_ext}" ,'i=permissions&mode=setting_user_global&user_id[0]=' . $row['user_id'], true, $this->user->session_id), + 'MCHAT_MESSAGE' => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']), + 'MCHAT_TIME' => $minutes_ago === -1 ? $datetime : $this->user->lang('MCHAT_MINUTES_AGO', $minutes_ago), + 'MCHAT_DATETIME' => $datetime, + 'MCHAT_MINUTES_AGO' => $minutes_ago, + 'MCHAT_RELATIVE_UPDATE' => 60 - $message_age % 60, + 'MCHAT_MESSAGE_TIME' => $row['message_time'], + 'MCHAT_EDIT_TIME' => $row['edit_time'], )); } } @@ -738,7 +759,7 @@ class mchat */ protected function get_minutes_ago($message_age, $page) { - if ($this->config['mchat_relative_time'] && $page != 'archive') + if ($this->settings->cfg('mchat_relative_time') && $page != 'archive') { $minutes_ago = floor($message_age / 60); if ($minutes_ago < $this->get_relative_minutes_limit()) @@ -759,11 +780,11 @@ class mchat */ protected function get_relative_minutes_limit() { - $timeout = $this->config['session_length']; + $timeout = $this->settings->cfg('session_length'); - if ($this->config['mchat_timeout']) + if ($this->settings->cfg('mchat_timeout')) { - $timeout = $this->config['mchat_timeout']; + $timeout = $this->settings->cfg('mchat_timeout'); } return min(max((int) ceil($timeout / 60), 1), 60); @@ -775,7 +796,7 @@ class mchat protected function assign_bbcodes_smilies() { // Display BBCodes - if ($this->config['allow_bbcode'] && $this->auth->acl_get('u_mchat_bbcode')) + if ($this->settings->cfg('allow_bbcode') && $this->auth->acl_get('u_mchat_bbcode')) { $bbcode_template_vars = array( 'quote' => array( @@ -787,22 +808,22 @@ class mchat 'template_var' => 'S_BBCODE_IMG', ), 'url' => array( - 'allow' => $this->config['allow_post_links'], + 'allow' => $this->settings->cfg('allow_post_links'), 'template_var' => 'S_LINKS_ALLOWED', ), 'flash' => array( - 'allow' => $this->config['allow_post_flash'], + 'allow' => $this->settings->cfg('allow_post_flash'), 'template_var' => 'S_BBCODE_FLASH', ), ); foreach ($bbcode_template_vars as $bbcode => $option) { - $is_disallowed = preg_match('#(^|\|)' . $bbcode . '($|\|)#Usi', $this->config['mchat_bbcode_disallowed']) || !$option['allow']; + $is_disallowed = preg_match('#(^|\|)' . $bbcode . '($|\|)#Usi', $this->settings->cfg('mchat_bbcode_disallowed')) || !$option['allow']; $this->template->assign_var($option['template_var'], !$is_disallowed); } - $this->template->assign_var('S_DISALLOWED_BBCODES', str_replace('=', '-', $this->config['mchat_bbcode_disallowed'])); + $this->template->assign_var('MCHAT_DISALLOWED_BBCODES', addslashes(str_replace('=', '-', $this->settings->cfg('mchat_bbcode_disallowed')))); if (!function_exists('display_custom_bbcodes')) { @@ -814,7 +835,7 @@ class mchat } // Display smilies - if ($this->config['allow_smilies'] && $this->auth->acl_get('u_mchat_smilies')) + if ($this->settings->cfg('allow_smilies') && $this->auth->acl_get('u_mchat_smilies')) { if (!function_exists('generate_smilies')) { @@ -842,16 +863,26 @@ class mchat return $sql_ary; } + /** Inserts a message with posting information into the database + * + * @param string $mode One of post|quote|edit|reply + * @param $data The post data + */ + public function insert_posting($mode, $data) + { + $this->functions->mchat_insert_posting($mode, $data); + } + /** * Assigns whois and stats at the bottom of the index page */ protected function assign_whois() { - if ($this->config['mchat_whois'] || $this->config['mchat_stats_index'] && $this->user->data['user_mchat_stats_index']) + if ($this->settings->cfg('mchat_whois') || $this->settings->cfg('mchat_stats_index') && $this->settings->cfg('mchat_stats_index')) { $mchat_stats = $this->functions->mchat_active_users(); $this->template->assign_vars(array( - 'MCHAT_INDEX_STATS' => $this->config['mchat_stats_index'] && $this->user->data['user_mchat_stats_index'], + 'MCHAT_STATS_INDEX' => $this->settings->cfg('mchat_stats_index') && $this->settings->cfg('mchat_stats_index'), 'MCHAT_USERS_COUNT' => $mchat_stats['mchat_users_count'], 'MCHAT_USERS_LIST' => $mchat_stats['online_userlist'] ?: '', 'MCHAT_ONLINE_EXPLAIN' => $mchat_stats['refresh_message'], @@ -879,7 +910,7 @@ class mchat return true; } - $can_edit_delete = $this->config['mchat_edit_delete_limit'] == 0 || $message_time >= time() - $this->config['mchat_edit_delete_limit']; + $can_edit_delete = $this->settings->cfg('mchat_edit_delete_limit') == 0 || $message_time >= time() - $this->settings->cfg('mchat_edit_delete_limit'); return $can_edit_delete && $this->user->data['user_id'] == $author_id && $this->user->data['is_registered']; } @@ -900,33 +931,33 @@ class mchat throw new \phpbb\exception\http_exception(501, 'MCHAT_NOACCESS'); } - // Must not exceed character limit, excluding whitespaces - if ($this->config['mchat_max_message_lngth']) + // Must not exceed character limit + if ($this->settings->cfg('mchat_max_message_lngth')) { - $message_chars = preg_replace('#\s#m', '', $message); - if (utf8_strlen($message_chars) > $this->config['mchat_max_message_lngth']) + if (utf8_strlen($message_chars) > $this->settings->cfg('mchat_max_message_lngth')) { - throw new \phpbb\exception\http_exception(413, 'MCHAT_MESS_LONG', array($this->config['mchat_max_message_lngth'])); + throw new \phpbb\exception\http_exception(413, 'MCHAT_MESS_LONG', array($this->settings->cfg('mchat_max_message_lngth'))); } } - // We override the $this->config['min_post_chars'] entry? - if ($this->config['mchat_override_min_post_chars']) + $cfg_min_post_chars = $this->settings->cfg('min_post_chars'); + $cfg_max_post_smilies = $this->settings->cfg('max_post_smilies'); + + // We override the $this->settings->cfg('min_post_chars') entry? + if ($this->settings->cfg('mchat_override_min_post_chars')) { - $old_cfg['min_post_chars'] = $this->config['min_post_chars']; - $this->config['min_post_chars'] = 0; + $this->settings->set_cfg('min_post_chars', 0); } // We do the same for the max number of smilies? - if ($this->config['mchat_override_smilie_limit']) + if ($this->settings->cfg('mchat_override_smilie_limit')) { - $old_cfg['max_post_smilies'] = $this->config['max_post_smilies']; - $this->config['max_post_smilies'] = 0; + $this->settings->cfg('max_post_smilies', 0); } - $mchat_bbcode = $this->config['allow_bbcode'] && $this->auth->acl_get('u_mchat_bbcode'); - $mchat_urls = $this->config['allow_post_links'] && $this->auth->acl_get('u_mchat_urls'); - $mchat_smilies = $this->config['allow_smilies'] && $this->auth->acl_get('u_mchat_smilies'); + $mchat_bbcode = $this->settings->cfg('allow_bbcode') && $this->auth->acl_get('u_mchat_bbcode'); + $mchat_urls = $this->settings->cfg('allow_post_links') && $this->auth->acl_get('u_mchat_urls'); + $mchat_smilies = $this->settings->cfg('allow_smilies') && $this->auth->acl_get('u_mchat_smilies'); // Add function part code from http://wiki.phpbb.com/Parsing_text $uid = $bitfield = $options = ''; @@ -939,26 +970,19 @@ class mchat } // Disallowed bbcodes - if ($this->config['mchat_bbcode_disallowed']) + if ($this->settings->cfg('mchat_bbcode_disallowed')) { $bbcode_replace = array( - '#\[(' . $this->config['mchat_bbcode_disallowed'] . ')[^\[\]]+\]#Usi', - '#\[/(' . $this->config['mchat_bbcode_disallowed'] . ')[^\[\]]+\]#Usi', + '#\[(' . $this->settings->cfg('mchat_bbcode_disallowed') . ')[^\[\]]+\]#Usi', + '#\[/(' . $this->settings->cfg('mchat_bbcode_disallowed') . ')[^\[\]]+\]#Usi', ); $message = preg_replace($bbcode_replace, '', $message); } // Reset the config settings - if (isset($old_cfg['min_post_chars'])) - { - $this->config['min_post_chars'] = $old_cfg['min_post_chars']; - } - - if (isset($old_cfg['max_post_smilies'])) - { - $this->config['max_post_smilies'] = $old_cfg['max_post_smilies']; - } + $this->settings->set_cfg('min_post_chars', $cfg_min_post_chars); + $this->settings->set_cfg('max_post_smilies', $cfg_max_post_smilies); return array_merge($merge_ary, array( 'message' => str_replace("'", ''', $message), diff --git a/core/settings.php b/core/settings.php new file mode 100644 index 0000000..bd71852 --- /dev/null +++ b/core/settings.php @@ -0,0 +1,159 @@ +user = $user; + $this->config = $config; + $this->auth = $auth; + $this->global = $global; + $this->ucp = $ucp; + + $this->is_phpbb31 = phpbb_version_compare($config['version'], '3.1.0@dev', '>=') && phpbb_version_compare($config['version'], '3.2.0@dev', '<'); + $this->is_phpbb32 = phpbb_version_compare($config['version'], '3.2.0@dev', '>=') && phpbb_version_compare($config['version'], '3.3.0@dev', '<'); + + $this->inject_core_config_values(); + } + + /** + * Writes phpBB config values into the mChat config for validating input data + */ + protected function inject_core_config_values() + { + // Limit mChat session timeout to phpBB session length + $this->global['mchat_timeout']['validation'][self::VALIDATE_MAX_VALUE] = (int) $this->cfg('session_length'); + } + + /** + * @param string $config + * @param bool $force_global + * @return string + */ + public function cfg($config, $force_global = false) + { + return $this->cfg_user($config, $this->user->data, $this->auth, $force_global); + } + + /** + * @param string $config + * @param array $user_data + * @param \phpbb\auth\auth $auth + * @param bool $force_global + * @return string + */ + public function cfg_user($config, $user_data, $auth, $force_global = false) + { + if (!$force_global && isset($this->ucp[$config]) && $auth->acl_get('u_' . $config)) + { + return $user_data['user_' . $config]; + } + + return $this->config[$config]; + } + + /** + * @param $config + * @param $value + */ + public function set_cfg($config, $value) + { + $this->config->set($config, $value); + } + + /** + * @param string $selected + * @return array + */ + public function get_date_template_data($selected) + { + $dateformat_options = ''; + + foreach ($this->user->lang['dateformats'] as $format => $null) + { + $dateformat_options .= ''; + } + + $s_custom = false; + + $dateformat_options .= ''; + + return array( + 'S_MCHAT_DATEFORMAT_OPTIONS' => $dateformat_options, + 'A_MCHAT_DEFAULT_DATEFORMAT' => addslashes($this->ucp['mchat_date']['default']), + 'S_MCHAT_CUSTOM_DATEFORMAT' => $s_custom, + ); + } + + /** + * @return string + */ + public function get_enabled_post_notifications_lang() + { + $enabled_notifications_lang = array(); + + foreach (array('topic', 'reply', 'quote', 'edit') as $notification) + { + if ($this->cfg('mchat_posts_' . $notification)) + { + $enabled_notifications_lang[] = $this->user->lang('MCHAT_POSTS_' . strtoupper($notification)); + } + } + + return implode($this->user->lang('COMMA_SEPARATOR'), $enabled_notifications_lang); + } +} diff --git a/event/acp_listener.php b/event/acp_listener.php index 7d098c1..070f631 100644 --- a/event/acp_listener.php +++ b/event/acp_listener.php @@ -24,23 +24,33 @@ class acp_listener implements EventSubscriberInterface /** @var \phpbb\user */ protected $user; - /** @var array */ - protected $user_config_keys; + /** @var \dmzx\mchat\core\settings */ + protected $settings; + + /** @var string */ + protected $root_path; + + /** @var string */ + protected $php_ext; /** * Constructor * - * @param \phpbb\template\template $template - * @param \phpbb\request\request $request - * @param \phpbb\user $user - * @param array $user_config_keys + * @param \phpbb\template\template $template + * @param \phpbb\request\request $request + * @param \phpbb\user $user + * @param \dmzx\mchat\core\settings $settings + * @param string $root_path + * @param string $php_ext */ - public function __construct(\phpbb\template\template $template, \phpbb\request\request $request, \phpbb\user $user, $user_config_keys) + public function __construct(\phpbb\template\template $template, \phpbb\request\request $request, \phpbb\user $user, \dmzx\mchat\core\settings $settings, $root_path, $php_ext) { - $this->template = $template; - $this->request = $request; - $this->user = $user; - $this->user_config_keys = $user_config_keys; + $this->template = $template; + $this->request = $request; + $this->user = $user; + $this->settings = $settings; + $this->root_path = $root_path; + $this->php_ext = $php_ext; } /** @@ -50,7 +60,6 @@ class acp_listener implements EventSubscriberInterface { return array( 'core.permissions' => 'permissions', - 'core.acp_users_prefs_modify_data' => 'acp_users_prefs_modify_data', 'core.acp_users_prefs_modify_sql' => 'acp_users_prefs_modify_sql', 'core.acp_users_prefs_modify_template_data' => 'acp_users_prefs_modify_template_data', ); @@ -61,83 +70,83 @@ class acp_listener implements EventSubscriberInterface */ public function permissions($event) { - $event['permissions'] = array_merge($event['permissions'], array( - 'u_mchat_use' => array( - 'lang' => 'ACL_U_MCHAT_USE', - 'cat' => 'mChat' + $mchat_permissions = array(); + + $permission_categories = array( + 'mchat' => array( + 'u_mchat_use', + 'u_mchat_view', + 'u_mchat_edit', + 'u_mchat_delete', + 'u_mchat_ip', + 'u_mchat_pm', + 'u_mchat_like', + 'u_mchat_quote', + 'u_mchat_flood_ignore', + 'u_mchat_archive', + 'u_mchat_bbcode', + 'u_mchat_smilies', + 'u_mchat_urls', + 'a_mchat', ), - 'u_mchat_view' => array( - 'lang' => 'ACL_U_MCHAT_VIEW', - 'cat' => 'mChat' - ), - 'u_mchat_edit' => array( - 'lang' => 'ACL_U_MCHAT_EDIT', - 'cat' => 'mChat' - ), - 'u_mchat_delete' => array( - 'lang' => 'ACL_U_MCHAT_DELETE', - 'cat' => 'mChat' - ), - 'u_mchat_ip' => array( - 'lang' => 'ACL_U_MCHAT_IP', - 'cat' => 'mChat' - ), - 'u_mchat_pm' => array( - 'lang' => 'ACL_U_MCHAT_PM', - 'cat' => 'mChat' - ), - 'u_mchat_like' => array( - 'lang' => 'ACL_U_MCHAT_LIKE', - 'cat' => 'mChat' - ), - 'u_mchat_quote' => array( - 'lang' => 'ACL_U_MCHAT_QUOTE', - 'cat' => 'mChat' - ), - 'u_mchat_flood_ignore' => array( - 'lang' => 'ACL_U_MCHAT_FLOOD_IGNORE', - 'cat' => 'mChat' - ), - 'u_mchat_archive' => array( - 'lang' => 'ACL_U_MCHAT_ARCHIVE', - 'cat' => 'mChat' - ), - 'u_mchat_bbcode' => array( - 'lang' => 'ACL_U_MCHAT_BBCODE', - 'cat' => 'mChat' - ), - 'u_mchat_smilies' => array( - 'lang' => 'ACL_U_MCHAT_SMILIES', - 'cat' => 'mChat' - ), - 'u_mchat_urls' => array( - 'lang' => 'ACL_U_MCHAT_URLS', - 'cat' => 'mChat' - ), - 'a_mchat' => array( - 'lang' => 'ACL_A_MCHAT', - 'cat' => 'mChat' - ), - )); + 'mchat_user_config' => array_map(function($key) { return 'u_' . $key; }, array_keys($this->settings->ucp)), + ); + + foreach ($permission_categories as $cat => $permissions) + { + foreach ($permissions as $permission) + { + $mchat_permissions[$permission] = array( + 'lang' => 'ACL_' . strtoupper($permission), + 'cat' => $cat, + ); + } + } + + $event['permissions'] = array_merge($event['permissions'], $mchat_permissions); $event['categories'] = array_merge($event['categories'], array( - 'mChat' => 'ACP_CAT_MCHAT', + 'mchat' => 'ACP_CAT_MCHAT', + 'mchat_user_config' => 'ACP_CAT_MCHAT_USER_CONFIG' )); } /** * @param object $event The event object */ - public function acp_users_prefs_modify_data($event) + public function acp_users_prefs_modify_sql($event) { - $data = $event['data']; + $sql_ary = array(); + $validation = array(); - foreach ($this->user_config_keys as $config_key) + $user_id = $event['user_row']['user_id']; + + $auth = new \phpbb\auth\auth(); + $userdata = $auth->obtain_user_data($user_id); + $auth->acl($userdata); + + foreach ($this->settings->ucp as $config_name => $config_data) { - $data[$config_key] = $this->request->variable($config_key, (int) $event['user_row'][$config_key]); + if ($auth->acl_get('u_' . $config_name)) + { + $default = $event['user_row']['user_' . $config_name]; + settype($default, gettype($config_data['default'])); + $sql_ary['user_' . $config_name] = $this->request->variable('user_' . $config_name, $default, is_string($default)); + + if (isset($config_data['validation'])) + { + $validation['user_' . $config_name] = $config_data['validation']; + } + } } - $event['data'] = $data; + if (!function_exists('validate_data')) + { + include($this->root_path . 'includes/functions_user.' . $this->php_ext); + } + + $event['error'] = array_merge($event['error'], validate_data($sql_ary, $validation)); + $event['sql_ary'] = array_merge($event['sql_ary'], $sql_ary); } /** @@ -147,24 +156,26 @@ class acp_listener implements EventSubscriberInterface { $this->user->add_lang_ext('dmzx/mchat', 'mchat_ucp'); - foreach ($this->user_config_keys as $config_key) + $user_id = $event['user_row']['user_id']; + + $auth = new \phpbb\auth\auth(); + $userdata = $auth->obtain_user_data($user_id); + $auth->acl($userdata); + + $selected = $this->settings->cfg_user('mchat_date', $event['user_row'], $auth); + $date_template_data = $this->settings->get_date_template_data($selected); + $this->template->assign_vars($date_template_data); + + $notifications_template_data = $this->settings->get_enabled_post_notifications_lang(); + $this->template->assign_var('MCHAT_POSTS_ENABLED_LANG', $notifications_template_data); + + foreach (array_keys($this->settings->ucp) as $config_name) { - $this->template->assign_var(strtoupper($config_key), $event['data'][$config_key]); + $upper = strtoupper($config_name); + $this->template->assign_vars(array( + $upper => $this->settings->cfg_user($config_name, $event['user_row'], $auth), + $upper . '_NOAUTH' => !$auth->acl_get('u_' . $config_name, $user_id), + )); } } - - /** - * @param object $event The event object - */ - public function acp_users_prefs_modify_sql($event) - { - $sql_ary = $event['sql_ary']; - - foreach ($this->user_config_keys as $config_key) - { - $sql_ary[$config_key] = $event['data'][$config_key]; - } - - $event['sql_ary'] = $sql_ary; - } } diff --git a/event/main_listener.php b/event/main_listener.php index 8d7f69e..8709f10 100644 --- a/event/main_listener.php +++ b/event/main_listener.php @@ -15,9 +15,6 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; class main_listener implements EventSubscriberInterface { - /** @var \dmzx\mchat\core\functions */ - protected $functions; - /** @var \dmzx\mchat\core\mchat */ protected $mchat; @@ -31,17 +28,15 @@ class main_listener implements EventSubscriberInterface protected $php_ext; /** - * Constructor - * - * @param \dmzx\mchat\core\functions $functions - * @param \dmzx\mchat\core\mchat $mchat - * @param \phpbb\controller\helper $helper - * @param \phpbb\user $user - * @param string $php_ext - */ - public function __construct(\dmzx\mchat\core\functions $functions, \dmzx\mchat\core\mchat $mchat, \phpbb\controller\helper $helper, \phpbb\user $user, $php_ext) + * Constructor + * + * @param \dmzx\mchat\core\mchat $mchat + * @param \phpbb\controller\helper $helper + * @param \phpbb\user $user + * @param string $php_ext + */ + public function __construct(\dmzx\mchat\core\mchat $mchat, \phpbb\controller\helper $helper, \phpbb\user $user, $php_ext) { - $this->functions = $functions; $this->mchat = $mchat; $this->helper = $helper; $this->user = $user; @@ -113,7 +108,7 @@ class main_listener implements EventSubscriberInterface */ public function posting_modify_submit_post_after($event) { - $this->functions->mchat_insert_posting($event['mode'], array( + $this->mchat->insert_posting($event['mode'], array( 'forum_id' => $event['forum_id'], 'forum_name' => $event['post_data']['forum_name'], 'post_id' => $event['data']['post_id'], diff --git a/ext.php b/ext.php new file mode 100644 index 0000000..5ebaaaa --- /dev/null +++ b/ext.php @@ -0,0 +1,27 @@ +container->get('config'); + return phpbb_version_compare($config['version'], '3.1.7-PL1', '>='); + } +} diff --git a/language/en/common.php b/language/en/common.php index e043710..f4295e2 100644 --- a/language/en/common.php +++ b/language/en/common.php @@ -59,9 +59,8 @@ $lang = array_merge($lang, array( ), // Post notification messages (%1$s is replaced with a link to the new/edited post, %2$s is replaced with a link to the forum) - 'MCHAT_NEW_POST' => 'Posted a new topic: %1$s in %2$s', - 'MCHAT_NEW_REPLY' => 'Posted a reply: %1$s in %2$s', - 'MCHAT_NEW_QUOTE' => 'Replied with a quote: %1$s in %2$s', - 'MCHAT_NEW_EDIT' => 'Edited a post: %1$s in %2$s', - + 'MCHAT_NEW_POST' => 'posted a new topic: %1$s in %2$s', + 'MCHAT_NEW_REPLY' => 'posted a reply: %1$s in %2$s', + 'MCHAT_NEW_QUOTE' => 'replied with a quote: %1$s in %2$s', + 'MCHAT_NEW_EDIT' => 'edited a post: %1$s in %2$s', )); diff --git a/language/en/info_acp_mchat.php b/language/en/info_acp_mchat.php index 6711913..3a35931 100644 --- a/language/en/info_acp_mchat.php +++ b/language/en/info_acp_mchat.php @@ -37,7 +37,11 @@ if (empty($lang) || !is_array($lang)) $lang = array_merge($lang, array( // Module titles 'ACP_CAT_MCHAT' => 'mChat', - 'ACP_MCHAT_CONFIG' => 'Configuration', + 'ACP_CAT_MCHAT_USER_CONFIG' => 'mChat in UCP', + 'ACP_MCHAT_GLOBALSETTINGS' => 'Global settings', + 'ACP_MCHAT_GLOBALUSERSETTINGS' => 'Global user settings', + + 'MCHAT_ACP_USER_PREFS_EXPLAIN' => 'Below are listed all mChat preferences of the selected user. Settings for which the selected user does not have permission to customise are disabled. These settings can be changed in the Global user settings mChat configuration section.', // Log entries (%1$s is replaced with the user name who triggered the event) 'LOG_MCHAT_CONFIG_UPDATE' => 'mChat configuration updated
» %1$s', diff --git a/language/en/mchat.php b/language/en/mchat.php index 8a93aad..a6ed9c9 100644 --- a/language/en/mchat.php +++ b/language/en/mchat.php @@ -46,7 +46,7 @@ $lang = array_merge($lang, array( 'MCHAT_NEW_CHAT' => 'New chat message!', 'MCHAT_SEND_PM' => 'Send private message', 'MCHAT_LIKE' => 'Like this post', - 'MCHAT_LIKES' => 'Likes this post', + 'MCHAT_LIKES' => 'likes this post', 'MCHAT_FLOOD' => 'You can not post another message so soon after your last', 'MCHAT_FOE' => 'This message was made by %1$s who is currently on your ignore list.', 'MCHAT_RULES' => 'Rules', @@ -67,11 +67,11 @@ $lang = array_merge($lang, array( 'MCHAT_REFRESH_YES' => 'Updates every %1$d seconds', 'MCHAT_RESPOND' => 'Respond to user', 'MCHAT_RESET_QUESTION' => 'Clear the input area?', + 'MCHAT_SESSION_ENDS' => 'Chat session ends in %1$s', 'MCHAT_SESSION_OUT' => 'Chat session has expired', - 'MCHAT_SESSION_ENDS' => 'Chat session ends in', 'MCHAT_SMILES' => 'Smilies', 'MCHAT_TOTALMESSAGES' => 'Total messages: %1$d', - 'MCHAT_USESOUND' => 'Use sound', + 'MCHAT_USESOUND' => 'Play sound', 'MCHAT_WHO_IS_REFRESH_EXPLAIN' => 'Refreshes every %1$d seconds', 'MCHAT_MINUTES_AGO' => array( 0 => 'just now', @@ -79,6 +79,11 @@ $lang = array_merge($lang, array( 2 => '%1$d minutes ago', ), + // These messages are formatted with JavaScript, hence {} and no $d + 'MCHAT_CHARACTER_COUNT' => '{current} characters', + 'MCHAT_CHARACTER_COUNT_LIMIT' => '{current} out of {max} characters', + 'MCHAT_SESSION_ENDS_JS' => 'Chat session ends in {timeleft}', + // Custom translations for administrators 'MCHAT_RULES_MESSAGE' => '', 'MCHAT_STATIC_MESSAGE' => '', diff --git a/language/en/mchat_acp.php b/language/en/mchat_acp.php index 69567c7..73182eb 100644 --- a/language/en/mchat_acp.php +++ b/language/en/mchat_acp.php @@ -35,7 +35,7 @@ if (empty($lang) || !is_array($lang)) // ’ » “ ” … $lang = array_merge($lang, array( - // ACP configuration sections + // ACP Configuration sections 'MCHAT_SETTINGS_INDEX' => 'Index page settings', 'MCHAT_SETTINGS_CUSTOM' => 'Custom page settings', 'MCHAT_SETTINGS_ARCHIVE' => 'Archive page settings', @@ -44,85 +44,65 @@ $lang = array_merge($lang, array( 'MCHAT_SETTINGS_PRUNE' => 'Pruning settings', 'MCHAT_SETTINGS_STATS' => 'Who is chatting settings', + 'MCHAT_GLOBALUSERSETTINGS_EXPLAIN' => 'Settings for which a user does not have permission to customise are applied as configured below.
Go to the mChat UCP tab of the user permissions section to adjust customisation permissions.
Go to the Preferences form in the user management section to see the status of each user’s settings.', + // ACP settings - 'MCHAT_ACP_TITLE' => 'mChat Configuration', + 'MCHAT_ACP_GLOBALSETTINGS_TITLE' => 'mChat Global settings', + 'MCHAT_ACP_GLOBALUSERSETTINGS_TITLE' => 'mChat Global user settings', 'MCHAT_VERSION' => 'Version', 'MCHAT_RULES' => 'Rules', - 'MCHAT_RULES_EXPLAIN' => 'Enter the rules of the forum here. HTML code is allowed. You are limited to 255 characters.
This message can be translated: edit the MCHAT_RULES_MESSAGE language key in /ext/dmzx/mchat/language/XX/common.php.', + 'MCHAT_RULES_EXPLAIN' => 'Enter the rules of the forum here. HTML code is allowed. You are limited to 255 characters.
This message can be translated: edit the MCHAT_RULES_MESSAGE language key in /ext/dmzx/mchat/language/XX/mchat.php.', 'MCHAT_CONFIG_SAVED' => 'mChat configuration has been updated', 'MCHAT_AVATARS' => 'Display avatars', 'MCHAT_AVATARS_EXPLAIN' => 'If set to yes, resized user avatars will be displayed', - 'MCHAT_ON_INDEX' => 'Display mChat on the index page', + 'MCHAT_INDEX' => 'Display mChat on the index page', 'MCHAT_INDEX_HEIGHT' => 'Index page height', - 'MCHAT_INDEX_HEIGHT_EXPLAIN' => 'The height of the chat box in pixels on the index page.
You are limited from 50 to 1000.', - 'MCHAT_LOCATION' => 'Location of mChat on the index page', + 'MCHAT_INDEX_HEIGHT_EXPLAIN' => 'The height of the chat box in pixels on the index page.
You are limited from 50 to 1000. Default is 250.', 'MCHAT_TOP_OF_FORUM' => 'Top', 'MCHAT_BOTTOM_OF_FORUM' => 'Bottom', 'MCHAT_REFRESH' => 'Refresh interval', - 'MCHAT_REFRESH_EXPLAIN' => 'Number of seconds before the chat refreshes.
You are limited from 5 to 60 seconds.', + 'MCHAT_REFRESH_EXPLAIN' => 'Number of seconds before the chat refreshes.
You are limited from 5 to 60 seconds. Default is 10.', 'MCHAT_LIVE_UPDATES' => 'Live updates of edited and deleted messages', 'MCHAT_LIVE_UPDATES_EXPLAIN' => 'When a user edits or deletes messages, the changes are updated live for all others, without them having to refresh the page. Disable this if you experience performance issues.', 'MCHAT_PRUNE' => 'Enable message pruning', 'MCHAT_PRUNE_EXPLAIN' => 'Only occurs if a user views the custom or archive pages.', 'MCHAT_PRUNE_NUM' => 'Number of messages to retain when pruning', - 'MCHAT_MESSAGE_LIMIT' => 'Initial number of messages to display on the custom page', - 'MCHAT_MESSAGE_LIMIT_EXPLAIN' => 'Recommended from 10 to 30.', - 'MCHAT_MESSAGE_NUM' => 'Initial number of messages to display on the index page', - 'MCHAT_MESSAGE_NUM_EXPLAIN' => 'Recommended from 10 to 50.', 'MCHAT_NAVBAR_LINK' => 'Display link to the custom page in the navbar', - 'MCHAT_ARCHIVE_LIMIT' => 'Number of messages to display on the archive page', - 'MCHAT_ARCHIVE_LIMIT_EXPLAIN' => 'The maximum number of messages to show per page on the archive page.
Recommended from 25 to 50.', + 'MCHAT_MESSAGE_NUM_CUSTOM' => 'Initial number of messages to display on the custom page', + 'MCHAT_MESSAGE_NUM_CUSTOM_EXPLAIN' => 'You are limited from 5 to 50. Default is 10.', + 'MCHAT_MESSAGE_NUM_INDEX' => 'Initial number of messages to display on the index page', + 'MCHAT_MESSAGE_NUM_INDEX_EXPLAIN' => 'You are limited from 5 to 50. Default is 10.', + 'MCHAT_MESSAGE_NUM_ARCHIVE' => 'Number of messages to display on the archive page', + 'MCHAT_MESSAGE_NUM_ARCHIVE_EXPLAIN' => 'The maximum number of messages to show per page on the archive page.
You are limited from 10 to 100. Default is 25.', 'MCHAT_FLOOD_TIME' => 'Flood time', - 'MCHAT_FLOOD_TIME_EXPLAIN' => 'The number of seconds a user must wait before posting another message in the chat.
Recommended 5 to 30, set to 0 to disable.', + 'MCHAT_FLOOD_TIME_EXPLAIN' => 'The number of seconds a user must wait before posting another message in the chat.
You are limited from 5 to 60 seconds. Default is 0. Set to 0 to disable.', 'MCHAT_EDIT_DELETE_LIMIT' => 'Time limit for editing and deleting messages', 'MCHAT_EDIT_DELETE_LIMIT_EXPLAIN' => 'Messages older than the specified number of seconds cannot be edited or deleted by the author any more.
Users who have edit/delete permission as well as moderator permission are exempt from this time limit.
Set to 0 to allow unlimited editing and deleting.', 'MCHAT_MAX_MESSAGE_LENGTH' => 'Maximum message length', - 'MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN' => 'Maximum number of characters allowed per message posted.
Recommended from 100 to 500, set to 0 to disable.', + 'MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN' => 'Maximum number of characters allowed per message posted.
You are limited from 0 to 1000. Default is 500. Set to 0 to disable.', 'MCHAT_CUSTOM_PAGE' => 'Enable custom Page', 'MCHAT_CUSTOM_PAGE_EXPLAIN' => 'Allow the use of the custom page', 'MCHAT_CUSTOM_HEIGHT' => 'Custom page height', - 'MCHAT_CUSTOM_HEIGHT_EXPLAIN' => 'The height of the chat box in pixels on the custom page.
You are limited from 50 to 1000.', - 'MCHAT_DATE_FORMAT' => 'Date format', - 'MCHAT_DATE_FORMAT_EXPLAIN' => 'The syntax used is identical to the PHP date() function.', - 'MCHAT_CUSTOM_DATEFORMAT' => 'Custom…', - 'MCHAT_RELATIVE_TIME' => 'Display relative time for new messages', - 'MCHAT_RELATIVE_TIME_EXPLAIN' => 'Displays "just now", "1 minute ago" and so on for each message. Displays the full date for messages older than the current session length but limited to 60 minutes.
Set to No to always display the full date.', + 'MCHAT_CUSTOM_HEIGHT_EXPLAIN' => 'The height of the chat box in pixels on the custom page.
You are limited from 50 to 1000. Default is 350.', 'MCHAT_BBCODES_DISALLOWED' => 'Disallowed bbcodes', 'MCHAT_BBCODES_DISALLOWED_EXPLAIN' => 'Here you can input the bbcodes that are not to be used in a message.
Separate bbcodes with a vertical bar, for example:
b|i|u|code|list|list=|flash|quote and/or a %1$scustom bbcode tag name%2$s', 'MCHAT_STATIC_MESSAGE' => 'Static message', - 'MCHAT_STATIC_MESSAGE_EXPLAIN' => 'Here you can define a static message to display to users of the chat. HTML code is allowed.
Set to empty to disable the display. You are limited to 255 characters.
This message can be translated: edit the MCHAT_STATIC_MESSAGE language key in /ext/dmzx/mchat/language/XX/common.php.', + 'MCHAT_STATIC_MESSAGE_EXPLAIN' => 'Here you can define a static message to display to users of the chat. HTML code is allowed.
Set to empty to disable the display. You are limited to 255 characters.
This message can be translated: edit the MCHAT_STATIC_MESSAGE language key in /ext/dmzx/mchat/language/XX/mchat.php.', 'MCHAT_USER_TIMEOUT' => 'User session timeout', 'MCHAT_USER_TIMEOUT_EXPLAIN' => 'Set the amount of time in seconds until a user session in the chat ends.
Set to 0 for no timeout. Careful, the session of a user reading mChat will never expire!
You are limited to the %1$sforum config setting for sessions%2$s which is currently set to %3$d seconds', 'MCHAT_OVERRIDE_SMILIE_LIMIT' => 'Override smilie limit', 'MCHAT_OVERRIDE_SMILIE_LIMIT_EXPLAIN' => 'Set to yes to override the forums smilie limit setting for chat messages', 'MCHAT_OVERRIDE_MIN_POST_CHARS' => 'Override minimum characters limit', 'MCHAT_OVERRIDE_MIN_POST_CHARS_EXPLAIN' => 'Set to yes to override the forums minimum characters setting for chat messages', - 'MCHAT_NEW_POSTS_TOPIC' => 'Display new topics', - 'MCHAT_NEW_POSTS_TOPIC_EXPLAIN' => 'Allow topics from the forum to be posted in the chat.', - 'MCHAT_NEW_POSTS_REPLY' => 'Display new replies', - 'MCHAT_NEW_POSTS_REPLY_EXPLAIN' => 'Allow replies from the forum to be posted in the chat.', - 'MCHAT_NEW_POSTS_EDIT' => 'Display edited posts', - 'MCHAT_NEW_POSTS_EDIT_EXPLAIN' => 'Allow edited posts from the forum to be posted in the chat.', - 'MCHAT_NEW_POSTS_QUOTE' => 'Display quoted posts', - 'MCHAT_NEW_POSTS_QUOTE_EXPLAIN' => 'Allow quoted posts from the forum to be posted in the chat.', - 'MCHAT_WHOIS' => 'Display Who is chatting below the chat', - 'MCHAT_STATS_INDEX' => 'Display Who is chatting in the stats section', - 'MCHAT_STATS_INDEX_EXPLAIN' => 'Displays who is chatting below the Who is online section on the index page', + 'MCHAT_WHOIS_REFRESH' => 'Who is chatting refresh interval', - 'MCHAT_WHOIS_REFRESH_EXPLAIN' => 'Number of seconds before who is chatting refreshes.
You are limited from 30 to 300 seconds.', - 'MCHAT_MESSAGE_TOP' => 'Location of new chat messages', - 'MCHAT_MESSAGE_TOP_EXPLAIN' => 'New messages will appear at the top or at the bottom in the chat.', - 'MCHAT_BOTTOM' => 'Bottom', - 'MCHAT_TOP' => 'Top', - 'MCHAT_PAUSE_ON_INPUT' => 'Pause on input', - 'MCHAT_PAUSE_ON_INPUT_EXPLAIN' => 'Do not autoupdate upon a user entering a message in the input area', + 'MCHAT_WHOIS_REFRESH_EXPLAIN' => 'Number of seconds before who is chatting refreshes.
You are limited from 10 to 300 seconds. Default is 60.', + 'MCHAT_SOUND' => 'Play sounds for new, edited and deleted messages', 'MCHAT_PURGE' => 'Delete all messages now', 'MCHAT_PURGE_CONFIRM' => 'Confirm deleting all messages', 'MCHAT_PURGED' => 'All mChat messages have been successfully deleted', // Error reporting - 'TOO_SMALL_MCHAT_ARCHIVE_LIMIT' => 'The archive limit value is too small.', - 'TOO_LARGE_MCHAT_ARCHIVE_LIMIT' => 'The archive limit value is too large.', 'TOO_LONG_MCHAT_BBCODE_DISALLOWED' => 'The disallowed bbcodes value is too long.', 'TOO_SMALL_MCHAT_CUSTOM_HEIGHT' => 'The custom height value is too small.', 'TOO_LARGE_MCHAT_CUSTOM_HEIGHT' => 'The custom height value is too large.', @@ -134,10 +114,12 @@ $lang = array_merge($lang, array( 'TOO_LARGE_MCHAT_INDEX_HEIGHT' => 'The index height value is too large.', 'TOO_SMALL_MCHAT_MAX_MESSAGE_LNGTH' => 'The max message length value is too small.', 'TOO_LARGE_MCHAT_MAX_MESSAGE_LNGTH' => 'The max message length value is too large.', - 'TOO_SMALL_MCHAT_MESSAGE_LIMIT' => 'The message limit value is too small.', - 'TOO_LARGE_MCHAT_MESSAGE_LIMIT' => 'The message limit value is too large.', - 'TOO_SMALL_MCHAT_MESSAGE_NUM' => 'The number of messages to display on the index page is too small.', - 'TOO_LARGE_MCHAT_MESSAGE_NUM' => 'The number of messages to display on the index page is too large.', + 'TOO_SMALL_MCHAT_MESSAGE_NUM_CUSTOM' => 'The number of message to display on the custom page is too small.', + 'TOO_LARGE_MCHAT_MESSAGE_NUM_CUSTOM' => 'The number of message to display on the custom page is too large.', + 'TOO_SMALL_MCHAT_MESSAGE_NUM_INDEX' => 'The number of messages to display on the index page is too small.', + 'TOO_LARGE_MCHAT_MESSAGE_NUM_INDEX' => 'The number of messages to display on the index page is too large.', + 'TOO_SMALL_MCHAT_MESSAGE_NUM_ARCHIVE' => 'The number of message to display on the archive page is too small.', + 'TOO_LARGE_MCHAT_MESSAGE_NUM_ARCHIVE' => 'The number of message to display on the archive page is too large.', 'TOO_SMALL_MCHAT_REFRESH' => 'The refresh value is too small.', 'TOO_LARGE_MCHAT_REFRESH' => 'The refresh value is too large.', 'TOO_LONG_MCHAT_STATIC_MESSAGE' => 'The static message value is too long.', diff --git a/language/en/mchat_ucp.php b/language/en/mchat_ucp.php index f047d49..b1fdea1 100644 --- a/language/en/mchat_ucp.php +++ b/language/en/mchat_ucp.php @@ -36,15 +36,36 @@ if (empty($lang) || !is_array($lang)) $lang = array_merge($lang, array( 'MCHAT_PREFERENCES' => 'mChat preferences', + 'MCHAT_NO_SETTINGS' => 'You are not authorised to customise any settings.', - 'MCHAT_DISPLAY' => 'Display on index', + 'MCHAT_INDEX' => 'Display on the index page', 'MCHAT_SOUND' => 'Enable sound', - 'MCHAT_DISPLAY_STATS_INDEX' => 'Display who is chatting on index', - 'MCHAT_DISPLAY_NEW_TOPICS' => 'Display new topics in the chat', - 'MCHAT_DISPLAY_AVATARS' => 'Display avatars in the chat', + 'MCHAT_WHOIS_INDEX' => 'Display Who is chatting below the chat', + 'MCHAT_STATS_INDEX' => 'Display Who is chatting in the stats section', + 'MCHAT_STATS_INDEX_EXPLAIN' => 'Displays who is chatting below the Who is online section on the index page.', + 'MCHAT_AVATARS' => 'Display avatars', 'MCHAT_CAPITAL_LETTER' => 'Capital first letter in your messages', 'MCHAT_CHAT_AREA' => 'Input type', - 'MCHAT_CHAT_AREA_EXPLAIN' => 'The type of area to use for writing messages', - 'MCHAT_INPUT_AREA' => 'Input area', + 'MCHAT_INPUT_AREA' => 'Input field', 'MCHAT_TEXT_AREA' => 'Text area', + 'MCHAT_POSTS' => 'Display new posts (currently all disabled, can be enabled in the mChat Global Settings section in the ACP)', + 'MCHAT_CHARACTER_COUNT' => 'Display number of characters when typing a message', + 'MCHAT_RELATIVE_TIME' => 'Display relative time for new messages', + 'MCHAT_RELATIVE_TIME_EXPLAIN' => 'Displays "just now", "1 minute ago" and so on for each message. Set to No to always display the full date.', + 'MCHAT_PAUSE_ON_INPUT' => 'Pause on input', + 'MCHAT_PAUSE_ON_INPUT_EXPLAIN' => 'Do not update mChat upon entering a message', + 'MCHAT_MESSAGE_TOP' => 'Location of new chat messages', + 'MCHAT_MESSAGE_TOP_EXPLAIN' => 'New messages will appear at the top or at the bottom in the chat.', + 'MCHAT_LOCATION' => 'Location on the index page', + 'MCHAT_BOTTOM' => 'Bottom', + 'MCHAT_TOP' => 'Top', + + 'MCHAT_POSTS_TOPIC' => 'Display new topics', + 'MCHAT_POSTS_REPLY' => 'Display new replies', + 'MCHAT_POSTS_EDIT' => 'Display edited posts', + 'MCHAT_POSTS_QUOTE' => 'Display quoted posts', + + 'MCHAT_DATE_FORMAT' => 'Date format', + 'MCHAT_DATE_FORMAT_EXPLAIN' => 'The syntax used is identical to the PHP date() function.', + 'MCHAT_CUSTOM_DATEFORMAT' => 'Custom…', )); diff --git a/language/en/permissions_mchat.php b/language/en/permissions_mchat.php index 38c77f8..4e3751c 100644 --- a/language/en/permissions_mchat.php +++ b/language/en/permissions_mchat.php @@ -45,9 +45,24 @@ $lang = array_merge($lang, array( 'ACL_U_MCHAT_QUOTE' => 'Can quote messages', 'ACL_U_MCHAT_FLOOD_IGNORE' => 'Can ignore flood limit', 'ACL_U_MCHAT_ARCHIVE' => 'Can view the archive', - 'ACL_U_MCHAT_BBCODE' => 'Can use bbcodes', + 'ACL_U_MCHAT_BBCODE' => 'Can use BBCodes', 'ACL_U_MCHAT_SMILIES' => 'Can use smilies', 'ACL_U_MCHAT_URLS' => 'Can post URLs', + 'ACL_U_MCHAT_AVATARS' => 'Can customise Display avatars', + 'ACL_U_MCHAT_CAPITAL_LETTER' => 'Can customise Capital first letter', + 'ACL_U_MCHAT_CHARACTER_COUNT' => 'Can customise Display number of characters', + 'ACL_U_MCHAT_DATE' => 'Can customise Date format', + 'ACL_U_MCHAT_INDEX' => 'Can customise Display on index', + 'ACL_U_MCHAT_INPUT_AREA' => 'Can customise Input type', + 'ACL_U_MCHAT_LOCATION' => 'Can customise Location of mChat on the index page', + 'ACL_U_MCHAT_MESSAGE_TOP' => 'Can customise Location of new chat messages', + 'ACL_U_MCHAT_PAUSE_ON_INPUT' => 'Can customise Pause on input', + 'ACL_U_MCHAT_POSTS' => 'Can customise Display new post', + 'ACL_U_MCHAT_RELATIVE_TIME' => 'Can customise Display relative time', + 'ACL_U_MCHAT_SOUND' => 'Can customise Play sounds', + 'ACL_U_MCHAT_WHOIS_INDEX' => 'Can customise Display who is chatting below the chat', + 'ACL_U_MCHAT_STATS_INDEX' => 'Can customise Display who is chatting in the stats section', + 'ACL_A_MCHAT' => 'Can manage mChat settings', )); diff --git a/migrations/install_mchat.php b/migrations/mchat_2_0_0_rc3.php similarity index 52% rename from migrations/install_mchat.php rename to migrations/mchat_2_0_0_rc3.php index 7325cd4..b0d1b30 100644 --- a/migrations/install_mchat.php +++ b/migrations/mchat_2_0_0_rc3.php @@ -11,59 +11,60 @@ namespace dmzx\mchat\migrations; -class install_mchat extends \phpbb\db\migration\migration +class mchat_2_0_0_rc3 extends \phpbb\db\migration\migration { - public function effectively_installed() - { - return isset($this->config['mchat_version']) && version_compare($this->config['mchat_version'], '1.0.0-RC2', '>='); - } + /** @const string */ + const MCHAT_VERSION = '2.0.0-RC3'; + + /** @var array */ + protected $mchat_config = null; static public function depends_on() { - return array('\phpbb\db\migration\data\v31x\v311'); + return array('\phpbb\db\migration\data\v31x\v317pl1'); + } + + public function effectively_installed() + { + return isset($this->config['mchat_version']) && version_compare($this->config['mchat_version'], self::MCHAT_VERSION, '>='); + } + + protected function get_config() + { + if ($this->mchat_config == null) + { + $yml_config_file = $this->phpbb_root_path . '/ext/dmzx/mchat/config/config_2_0_0.yml'; + $yml_data = \Symfony\Component\Yaml\Yaml::parse($yml_config_file); + $this->mchat_config = $yml_data['parameters']; + } + + return $this->mchat_config; } public function update_data() { - return array( - // Add configs - array('config.add', array('mchat_version', '1.0.0-RC2')), - array('config.add', array('mchat_archive_limit', 25)), - array('config.add', array('mchat_avatars', 1)), - array('config.add', array('mchat_bbcode_disallowed', '')), - array('config.add', array('mchat_custom_height', 350)), - array('config.add', array('mchat_custom_page', 1)), - array('config.add', array('mchat_relative_time', 1)), - array('config.add', array('mchat_date', 'D M d, Y g:i a')), - array('config.add', array('mchat_edit_delete_limit', 0)), - array('config.add', array('mchat_flood_time', 0)), - array('config.add', array('mchat_index_height', 250)), - array('config.add', array('mchat_live_updates', 1)), - array('config.add', array('mchat_location', 0)), - array('config.add', array('mchat_max_message_lngth', 500)), - array('config.add', array('mchat_message_limit', 10)), - array('config.add', array('mchat_message_num', 10)), - array('config.add', array('mchat_navbar_link', 1)), - array('config.add', array('mchat_message_top', 1)), - array('config.add', array('mchat_new_posts_edit', 0)), - array('config.add', array('mchat_new_posts_quote', 0)), - array('config.add', array('mchat_new_posts_reply', 0)), - array('config.add', array('mchat_new_posts_topic', 0)), - array('config.add', array('mchat_on_index', 1)), - array('config.add', array('mchat_override_min_post_chars', 0)), - array('config.add', array('mchat_override_smilie_limit', 0)), - array('config.add', array('mchat_pause_on_input', 0)), - array('config.add', array('mchat_prune', 0)), - array('config.add', array('mchat_prune_num', 0)), - array('config.add', array('mchat_refresh', 10)), - array('config.add', array('mchat_rules', '')), - array('config.add', array('mchat_static_message', '')), - array('config.add', array('mchat_stats_index', 0)), - array('config.add', array('mchat_timeout', 0)), - array('config.add', array('mchat_whois', 1)), - array('config.add', array('mchat_whois_refresh', 60)), + $config = $this->get_config(); + $update_data = array(); - // Add permissions + // Add configs + foreach (array('dmzx.mchat.config_global', 'dmzx.mchat.config_ucp') as $section) + { + foreach ($config[$section] as $key => $value) + { + $update_data[] = array('config.add', array($key, $value['default'])); + } + } + + // Add user permissions for customizing config values + foreach ($config['dmzx.mchat.config_ucp'] as $key => $value) + { + $update_data[] = array('permission.add', array('u_' . $key, true)); + } + + return array_merge($update_data, array( + array('config.add', array('mchat_version', self::MCHAT_VERSION)), + + // Add user permissions array('permission.add', array('u_mchat_use', true)), array('permission.add', array('u_mchat_view', true)), array('permission.add', array('u_mchat_edit', true)), @@ -77,23 +78,17 @@ class install_mchat extends \phpbb\db\migration\migration array('permission.add', array('u_mchat_bbcode', true)), array('permission.add', array('u_mchat_smilies', true)), array('permission.add', array('u_mchat_urls', true)), + + // Add admin permissions array('permission.add', array('a_mchat', true)), // Set permissions - array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_use', 'group')), - array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_view', 'group')), array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_edit', 'group')), array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_delete', 'group')), array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_ip', 'group')), - array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_pm', 'group')), - array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_like', 'group')), - array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_quote', 'group')), array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_flood_ignore', 'group')), - array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_archive', 'group')), - array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_bbcode', 'group')), - array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_smilies', 'group')), - array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_urls', 'group')), array('permission.permission_set', array('ADMINISTRATORS', 'a_mchat', 'group')), + array('permission.permission_set', array('REGISTERED', 'u_mchat_use', 'group')), array('permission.permission_set', array('REGISTERED', 'u_mchat_view', 'group')), array('permission.permission_set', array('REGISTERED', 'u_mchat_pm', 'group')), @@ -104,6 +99,17 @@ class install_mchat extends \phpbb\db\migration\migration array('permission.permission_set', array('REGISTERED', 'u_mchat_smilies', 'group')), array('permission.permission_set', array('REGISTERED', 'u_mchat_urls', 'group')), + array('permission.permission_set', array('REGISTERED', 'u_mchat_avatars', 'group')), + array('permission.permission_set', array('REGISTERED', 'u_mchat_capital_letter', 'group')), + array('permission.permission_set', array('REGISTERED', 'u_mchat_character_count', 'group')), + array('permission.permission_set', array('REGISTERED', 'u_mchat_index', 'group')), + array('permission.permission_set', array('REGISTERED', 'u_mchat_input_area', 'group')), + array('permission.permission_set', array('REGISTERED', 'u_mchat_location', 'group')), + array('permission.permission_set', array('REGISTERED', 'u_mchat_message_top', 'group')), + array('permission.permission_set', array('REGISTERED', 'u_mchat_posts', 'group')), + array('permission.permission_set', array('REGISTERED', 'u_mchat_relative_time', 'group')), + array('permission.permission_set', array('REGISTERED', 'u_mchat_sound', 'group')), + // Add ACP extension category array('module.add', array( 'acp', @@ -115,17 +121,13 @@ class install_mchat extends \phpbb\db\migration\migration array('module.add', array( 'acp', 'ACP_CAT_MCHAT', - array( - 'module_basename' => '\dmzx\mchat\acp\acp_mchat_module', - 'modes' => array('configuration'), - 'module_auth' => 'acl_a_mchat', - ), + array('module_basename' => '\dmzx\mchat\acp\acp_mchat_module'), )), // Add UCP category array('module.add', array( 'ucp', - false, + 0, 'UCP_MCHAT_CONFIG' )), @@ -133,17 +135,21 @@ class install_mchat extends \phpbb\db\migration\migration array('module.add', array( 'ucp', 'UCP_MCHAT_CONFIG', - array( - 'module_basename' => '\dmzx\mchat\ucp\ucp_mchat_module', - 'modes' => array('configuration'), - 'auth' => 'acl_u_mchat_use', - ), + array('module_basename' => '\dmzx\mchat\ucp\ucp_mchat_module'), )), - ); + )); } public function update_schema() { + $config = $this->get_config(); + $user_columns = array(); + + foreach ($config['dmzx.mchat.config_ucp'] as $key => $value) + { + $user_columns['user_' . $key] = array($value['type'], $value['default']); + } + return array( 'add_tables' => array( $this->table_prefix . 'mchat' => array( @@ -181,21 +187,21 @@ class install_mchat extends \phpbb\db\migration\migration ), 'add_columns' => array( - $this->table_prefix . 'users' => array( - 'user_mchat_index' => array('BOOL', '1'), - 'user_mchat_sound' => array('BOOL', '1'), - 'user_mchat_stats_index' => array('BOOL', '1'), - 'user_mchat_topics' => array('BOOL', '1'), - 'user_mchat_avatars' => array('BOOL', '1'), - 'user_mchat_capital_letter' => array('BOOL', '1'), - 'user_mchat_input_area' => array('BOOL', '1'), - ), + $this->table_prefix . 'users' => $user_columns, ), ); } public function revert_schema() { + $config = $this->get_config(); + $user_columns = array(); + + foreach (array_keys($config['dmzx.mchat.config_ucp']) as $key) + { + $user_columns[] = 'user_' . $key; + } + return array( 'drop_tables' => array( $this->table_prefix . 'mchat', @@ -204,14 +210,7 @@ class install_mchat extends \phpbb\db\migration\migration ), 'drop_columns' => array( - $this->table_prefix . 'users' => array( - 'user_mchat_index', - 'user_mchat_sound', - 'user_mchat_stats_index', - 'user_mchat_topics', - 'user_mchat_avatars', - 'user_mchat_input_area', - ), + $this->table_prefix . 'users' => $user_columns, ), ); } diff --git a/styles/all/template/event/index_body_block_online_append.html b/styles/all/template/event/index_body_block_online_append.html deleted file mode 100644 index a0d1876..0000000 --- a/styles/all/template/event/index_body_block_online_append.html +++ /dev/null @@ -1,4 +0,0 @@ - -

{L_MCHAT_WHO_IS_CHATTING}

-

{MCHAT_USERS_COUNT} {MCHAT_ONLINE_EXPLAIN}
{MCHAT_USERS_LIST}

- diff --git a/styles/all/template/event/index_body_forumlist_body_after.html b/styles/all/template/event/index_body_forumlist_body_after.html deleted file mode 100644 index 97619f3..0000000 --- a/styles/all/template/event/index_body_forumlist_body_after.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/styles/all/template/event/index_body_markforums_before.html b/styles/all/template/event/index_body_markforums_before.html deleted file mode 100644 index 9e6870e..0000000 --- a/styles/all/template/event/index_body_markforums_before.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/styles/all/template/event/overall_footer_copyright_append.html b/styles/all/template/event/overall_footer_copyright_append.html deleted file mode 100644 index 62740f3..0000000 --- a/styles/all/template/event/overall_footer_copyright_append.html +++ /dev/null @@ -1,9 +0,0 @@ - -
- {META_DISPLAY_NAME} © {L_POST_BY_AUTHOR} - - diff --git a/styles/all/template/event/overall_header_navigation_append.html b/styles/all/template/event/overall_header_navigation_append.html deleted file mode 100644 index f8a284c..0000000 --- a/styles/all/template/event/overall_header_navigation_append.html +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/styles/all/template/javascript/mchat.js b/styles/all/template/javascript/mchat.js index 6d55da4..99d79e9 100644 --- a/styles/all/template/javascript/mchat.js +++ b/styles/all/template/javascript/mchat.js @@ -16,17 +16,35 @@ if (typeof document.hasFocus === 'undefined') { }; } -Array.prototype.max = function() { - return Math.max.apply(null, this); -}; +if (!Array.prototype.max) { + Array.prototype.max = function() { + return Math.max.apply(null, this); + }; +} -Array.prototype.min = function() { - return Math.min.apply(null, this); -}; +if (!Array.prototype.min) { + Array.prototype.min = function() { + return Math.min.apply(null, this); + }; +} + +if (!String.prototype.format) { + String.prototype.format = function() { + var str = this.toString(); + if (!arguments.length) { + return str; + } + var type = typeof arguments[0]; + var args = 'string' == type || 'number' == type ? arguments : arguments[0]; + jQuery.each(args, function(arg, value) { + str = str.replace(RegExp('\\{' + arg + '\\}', 'gi'), value); + }); + return str; + } +} jQuery.fn.reverse = function(reverse) { - reverse = typeof reverse === 'undefined' ? true : reverse; - return reverse ? jQuery(this.toArray().reverse()) : this; + return reverse === 'undefined' || reverse ? jQuery(this.toArray().reverse()) : this; }; jQuery(function($) { @@ -37,7 +55,7 @@ jQuery(function($) { } $.ajax({ url: mChat.actionUrls[mode], - timeout: 5000, + timeout: Math.min(mChat.refreshTime, 10000), type: 'POST', dataType: 'json', data: data @@ -45,27 +63,29 @@ jQuery(function($) { if (json[mode]) { deferred.resolve(json, status, xhr); } else { - deferred.reject(xhr, status, xhr.responseJSON ? 'session' : 'format'); + deferred.reject(xhr, status, xhr.responseJSON ? 'session' : 'unexpected format'); } }).fail(function(xhr, status, error) { deferred.reject(xhr, status, error); }); return deferred.promise().fail(function(xhr, textStatus, errorThrown) { mChat.sound('error'); - mChat.cached('refresh-load', 'refresh-ok', 'refresh-paused').hide(); - mChat.cached('refresh-error').show(); - if (errorThrown == 'format') { - // Unexpected format - } else if (errorThrown == 'session') { + mChat.cached('status-load', 'status-ok', 'status-paused').hide(); + mChat.cached('status-error').show(); + if (errorThrown == 'session') { mChat.endSession(true); alert(mChat.sessOut); } else if (xhr.status == 400) { + mChat.resetSession(); alert(mChat.flood); } else if (xhr.status == 403) { + mChat.endSession(true); alert(mChat.noAccess); } else if (xhr.status == 413) { + mChat.resetSession(); alert(mChat.mssgLngthLong); } else if (xhr.status == 501) { + mChat.resetSession(); alert(mChat.noMessageInput); } else if (typeof console !== 'undefined' && console.log) { console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown); @@ -78,7 +98,7 @@ jQuery(function($) { if (mChat.cached('input').val() !== '') { if (confirm(mChat.clearConfirm)) { mChat.resetSession(); - mChat.cached('input').val(''); + mChat.cached('input').val('').keyup().trigger('autogrow'); } setTimeout(function() { mChat.cached('input').focus(); @@ -115,23 +135,23 @@ jQuery(function($) { if (mChat.cached('add').prop('disabled')) { return; } - var message = mChat.cached('input').val(); - if ($.trim(message) === '') { + var messageLength = mChat.inputMessageLength(); + if (!messageLength) { + alert(mChat.noMessageInput); return; } - var messChars = message.replace(/\s/g, ''); - if (mChat.mssgLngth && messChars.length > mChat.mssgLngth) { + if (mChat.mssgLngth && messageLength > mChat.mssgLngth) { alert(mChat.mssgLngthLong); return; } mChat.cached('add').prop('disabled', true); mChat.pauseSession(); - mChat.lastInputValue = message; - mChat.cached('input').val(''); - mChat.refresh(message).done(function() { + mChat.lastInputValue = mChat.cached('input').val(); + mChat.cached('input').val('').keyup().trigger('autogrow'); + mChat.refresh(mChat.lastInputValue).done(function() { mChat.resetSession(); }).fail(function() { - mChat.cached('input').val(mChat.lastInputValue); + mChat.cached('input').val(mChat.lastInputValue).keyup().trigger('autogrow'); }).always(function() { mChat.cached('add').prop('disabled', false); setTimeout(function() { @@ -147,7 +167,7 @@ jQuery(function($) { ajaxRequest('edit', true, { message_id: $container.data('mchat-id'), message: $message.val(), - archive: mChat.archiveMode ? 1 : 0 + archive: mChat.archivePage ? 1 : 0 }).done(function(json) { mChat.updateMessages($(json.edit)); mChat.resetSession(); @@ -188,14 +208,17 @@ jQuery(function($) { } }); } - mChat.cached('refresh-ok', 'refresh-error', 'refresh-paused').hide(); - mChat.cached('refresh-load').show(); + mChat.cached('status-ok', 'status-error', 'status-paused').hide(); + mChat.cached('status-load').show(); return ajaxRequest(message ? 'add' : 'refresh', !!message, data).done(function(json) { if (json.add) { var $html = $(json.add); - $('#mchat-no-messages').remove(); + $('.mchat-no-messages').remove(); $html.reverse(mChat.messageTop).hide().each(function(i) { var $message = $(this); + if ($.inArray($message.data('mchat-id'), mChat.messageIds) !== -1) { + return; + } mChat.messageIds.push($message.data('mchat-id')); setTimeout(function() { if (mChat.messageTop) { @@ -210,7 +233,7 @@ jQuery(function($) { var id = $message.prop('id'); setTimeout(function() { $('#' + id).find('[data-mchat-action="edit"], [data-mchat-action="del"]').fadeOut(function() { - $(this).remove(); + $(this).closest('li').remove(); }); }, mChat.editDeleteLimit); } @@ -229,8 +252,8 @@ jQuery(function($) { mChat.whois(); } if (mChat.refreshInterval) { - mChat.cached('refresh-load', 'refresh-error', 'refresh-paused').hide(); - mChat.cached('refresh-ok').show(); + mChat.cached('status-load', 'status-error', 'status-paused').hide(); + mChat.cached('status-ok').show(); } }); }, @@ -320,7 +343,7 @@ jQuery(function($) { }, countDown: function() { mChat.sessionTime -= 1; - mChat.cached('session').html(mChat.sessEnds + ' ' + mChat.timeLeft(mChat.sessionTime)); + mChat.cached('session').html(mChat.sessEnds.format({timeleft: mChat.timeLeft(mChat.sessionTime)})); if (mChat.sessionTime < 1) { mChat.endSession(); } @@ -335,13 +358,13 @@ jQuery(function($) { } }, resetSession: function() { - if (!mChat.archiveMode) { + if (!mChat.archivePage) { clearInterval(mChat.refreshInterval); mChat.refreshInterval = setInterval(mChat.refresh, mChat.refreshTime); if (mChat.userTimeout) { mChat.sessionTime = mChat.userTimeout / 1000; clearInterval(mChat.sessionCountdown); - mChat.cached('session').html(mChat.sessEnds + ' ' + mChat.timeLeft(mChat.sessionTime)); + mChat.cached('session').html(mChat.sessEnds.format({timeleft: mChat.timeLeft(mChat.sessionTime)})); mChat.sessionCountdown = setInterval(mChat.countDown, 1000); } if (mChat.whoisRefresh) { @@ -351,8 +374,8 @@ jQuery(function($) { if (mChat.pause) { mChat.cached('input').one('keypress', mChat.endSession); } - mChat.cached('refresh-ok').show(); - mChat.cached('refresh-load', 'refresh-error', 'refresh-paused').hide(); + mChat.cached('status-ok').show(); + mChat.cached('status-load', 'status-error', 'status-paused').hide(); mChat.cached('refresh-text').html(mChat.refreshYes); } }, @@ -369,8 +392,8 @@ jQuery(function($) { mChat.whois(); } } - mChat.cached('refresh-load', 'refresh-ok', 'refresh-error').hide(); - mChat.cached('refresh-paused').show(); + mChat.cached('status-load', 'status-ok', 'status-error').hide(); + mChat.cached('status-paused').show(); mChat.cached('refresh-text').html(mChat.refreshNo); }, mention: function() { @@ -396,6 +419,9 @@ jQuery(function($) { var quote = mChat.entityDecode($container.data('mchat-message')); insert_text(mChat.likes + '[quote="' + username + '"] ' + quote + '[/quote]'); }, + ip: function() { + popup(this.href, 750, 500); + }, entityDecode: function(text) { var s = decodeURIComponent(text.toString().replace(/\+/g, ' ')); s = s.replace(/</g, '<'); @@ -406,6 +432,9 @@ jQuery(function($) { s = s.replace(/"/g, "'"); return s; }, + inputMessageLength: function() { + return $.trim(mChat.cached('input').val()).replace(/\[\/?[^\[\]]+\]/g, '').length; + }, cached: function() { return $($.map(arguments, function(name) { if (!mChat.cache[name]) { @@ -430,7 +459,7 @@ jQuery(function($) { mChat.hiddenFields[this.name] = this.value; }); - if (!mChat.archiveMode) { + if (!mChat.archivePage) { mChat.resetSession(); if (!mChat.messageTop) { @@ -441,9 +470,7 @@ jQuery(function($) { Cookies.set('mchat_no_sound', 'yes'); } - mChat.cached('user-sound').prop('checked', mChat.playSound && !Cookies.get('mchat_no_sound')); - - mChat.cached('user-sound').change(function() { + mChat.cached('user-sound').prop('checked', mChat.playSound && !Cookies.get('mchat_no_sound')).change(function() { if (this.checked) { Cookies.remove('mchat_no_sound'); } else { @@ -468,10 +495,22 @@ jQuery(function($) { mChat.startRelativeTimeUpdate(mChat.cached('messages')); if (mChat.cached('input').is('input')) { - $('#mchat-form').on('keypress', function(e) { + $('#mchat-form').keypress(function(e) { if (e.which == 13) { mChat.add(); e.preventDefault(); + e.stopImmediatePropagation(); + } + }); + } + + if (mChat.showCharCount) { + $('#mchat-form').keyup(function(e) { + var count = mChat.inputMessageLength(); + var $elem = mChat.cached('character-count'); + $elem.html(mChat.charCount.format({current: count, max: mChat.mssgLngth})).css('visibility', count > 0 ? 'visible' : 'hidden'); + if (mChat.mssgLngth) { + $elem.toggleClass('error', count > mChat.mssgLngth); } }); } diff --git a/styles/all/template/mchat_body.html b/styles/all/template/mchat_body.html deleted file mode 100644 index a7395dd..0000000 --- a/styles/all/template/mchat_body.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - - - -
- -
- - - -
- -
-
    -
  • - -
  • -
- -
- - - - - - - - - -
- -
    -
  • {MCHAT_STATIC_MESS}
  • -
- - - -
    -
  • {L_MCHAT_NOMESSAGE}
  • -
- - -
    style="height:{MCHAT_CUSTOM_HEIGHT}{MCHAT_INDEX_HEIGHT}px"> - -
-
- -
- - - - -
- {S_FORM_TOKEN} - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- -
- -
- - - - - -
- {L_LOADING} - {L_MCHAT_OK} - {L_MCHAT_PAUSE} - {L_ERROR} - {MCHAT_REFRESH_YES} - {L_MCHAT_SESSION_ENDS} {MCHAT_USER_TIMEOUT_TIME} - {L_MCHAT_COPYRIGHT} -
- -
-
-
-
-
- - -
- -
- - - -

{L_MCHAT_WHO_IS_CHATTING}

- -
- {MCHAT_WHOIS_REFRESH_EXPLAIN} - -
- - - -
- {L_LEGEND}{L_COLON} {LEGEND} -
- - - - - diff --git a/styles/all/template/mchat_header.html b/styles/all/template/mchat_header.html deleted file mode 100644 index 4736cd3..0000000 --- a/styles/all/template/mchat_header.html +++ /dev/null @@ -1,4 +0,0 @@ -
-
{L_MCHAT_ARCHIVE_PAGE}{L_MCHAT_TITLE}{L_MCHAT_TITLE}
-
 
-
diff --git a/styles/all/template/mchat_messages.html b/styles/all/template/mchat_messages.html deleted file mode 100644 index fb271d5..0000000 --- a/styles/all/template/mchat_messages.html +++ /dev/null @@ -1,27 +0,0 @@ - -
  • data-mchat-usercolor="{mchatrow.MCHAT_USERNAME_COLOR}" data-mchat-message="{mchatrow.MCHAT_MESSAGE_EDIT}" data-mchat-message-time="{mchatrow.MCHAT_MESSAGE_TIME}" data-mchat-edit-time="{mchatrow.MCHAT_EDIT_TIME}" data-mchat-edit-delete-limit="1"> - - - -
    -
    - style="color:{mchatrow.MCHAT_USERNAME_COLOR}">@ - {mchatrow.MCHAT_USERNAME_FULL} • data-mchat-minutes-ago="{mchatrow.MCHAT_MINUTES_AGO}" data-mchat-relative-update="{mchatrow.MCHAT_RELATIVE_UPDATE}">{mchatrow.MCHAT_TIME} -
    -
    - {L_MCHAT_SEND_PM} - {L_MCHAT_LIKE} - {L_REPLY_WITH_QUOTE} - {mchatrow.MCHAT_WHOIS_USER} - {L_MCHAT_PERMISSIONS} - {L_MCHAT_EDIT} - {L_DELETE} -
    -
    {mchatrow.MCHAT_MESSAGE}
    -
    -
  • - diff --git a/styles/all/template/mchat_navlink.html b/styles/all/template/mchat_navlink.html deleted file mode 100644 index 1681b48..0000000 --- a/styles/all/template/mchat_navlink.html +++ /dev/null @@ -1 +0,0 @@ -
  • {L_MCHAT_TITLE}
  • diff --git a/styles/all/template/ucp_mchat.html b/styles/all/template/ucp_mchat.html deleted file mode 100644 index 2a6d526..0000000 --- a/styles/all/template/ucp_mchat.html +++ /dev/null @@ -1,77 +0,0 @@ - - -

    {L_MCHAT_PREFERENCES}

    - -
    -
    -
    -
    -

    {ERROR}

    - -
    -
    -
    - - -
    -
    - -
    -
    -
    - - -
    -
    - -
    -
    -
    - - -
    -
    - - -
    -
    -
    - - -
    -
    - - -
    -
    -
    - - -
    -
    - -
    -
    -
    - - -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - {S_HIDDEN_FIELDS}  - - {S_FORM_TOKEN} -
    -
    - - diff --git a/styles/all/theme/images/ban.gif b/styles/all/theme/images/ban.gif deleted file mode 100644 index 4fcba9096c81f60b94f527f1ca2b55a5782e55d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3176 zcmV-u443nXP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=00004XF*Lt006O$eEU(80000WV@Og>004R=004l4008;_004mL004C` z008P>0026e000+nl3&F}0004lNkl|r zK?)6NgSMbuu1|0uAuiQL-#}E%3kXgfx^!r|NX#M>?htGmA@rW(poup3DoX$GE#EmD z{^vX27i@E#7ybl{_V@cCgc!i~vyFp;r~fSQ>B-|Zgtu3_zIXfii+8KsQjvh9zAUbk z)Gy-Z1WxyMW7!dv3bjUqTB8A#3bLcqz1{e)7ET^LtP>aoLVc~(Vy$%-fOPPlbTGhp zg4ww9^3|m92eJ~|by-}_E|&ev*#)xri6w;=j(gjY>^PIiBxd9Bk~ABSS@dPc$Gz<+ zCm^dYiA9|chf9I;;gH`k`PV>807uEdml9Hl*tgYW-z0(C?`gz3H z;YprklCrFbf_s`zr^_h6ot+ih0HW~m!ToEUV@Y-|vnH9vf7V2H@B0Ab!6Ezn)IH(= O0000ln-?Cj_0=;r6<;o#x!?(XE| z<gwv++S>pB|L^bbA^8LV00000EC2ui00aOS000FupeK4-sVxFUNfH2ba934PwB4Iy kAy$z63IYUzDIOk-hJnN66fV%gBr*9|uh^`1%MAelJFawYMF0Q* diff --git a/styles/all/theme/images/del.gif b/styles/all/theme/images/del.gif deleted file mode 100644 index 03e317066d577609e5a3d77bf0663b9dfc14fdbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 928 zcmV;R17G}!P)z@;o?%Qu_W%F@AY({UO#lFTB>(_`g8%^e{{R4h=l}px z2mk>USO5SzmjD14Z`WEMkN^M!7D+@wRCwB?kxOWtRUAjp|K9t3GviFsG>uIslQd~+ zW6}_lph%IZ2v$pxwu&yqMOR{>Ah;8{awC+kw2Ll$B3cxR5Ja+2DOyUwq*w!0(-%!l zTAQSFlFak_?!!ez+lfg| zYTI;XY;5dMS*hCe)YQ?m(fl9)@?Nn>E;4UDHuBK1p@Q9_mu^y9F7xwWjn#`aKa>*& zhoWe*R4TP!uGOdKmTpbt;yB5-womcw>kf-3qBtg(&r_?cqeKJ~8M2v}m0J4d+2zL0b8GI`wYsBZLm}t9{>i!% zcf3E0)&xKR5kUZxrU~_=Nz+=4QdEVzNg5*OJuX023!4?sEPI6w077Cd&1w~VKtJB7 z(@ax*2x#aT^nPx)^SxCOW{v)~B_sXg1=YQfO2?XIN(7vTrnMv}#@9l!-JK*NTwzMgL$-<>yo z+hX;){NoLvf_Gbo+S^_!6k^B;GnNyn=Sm1*Jp=+-1xpS8_AmF+E2DXHTnK1D18Q@j zaG>w$3DY*%i?qZcW8_p%PSKTBbY>NzzzakgW;g79ap8eZtq$fzD2Sk{NxGOF9ie0Y zUMO|>hV}K-2NEB!ArJ!*5CZ|O|5kS=yA;Dc8hSM7N3Fe)zXt#UPi)LvBmp1*0000#}m)|~lVyKEK)F&y3L8wrqsKioBBBHbp z3R|RaDX3V*RzyUjQX5jdB?=NXZG!3UCRsPTv$M0avvbbunKNf@_N7qKeow!bA2+?4 zfLnY*#I5uEEb0J_n=ZYdI<&>GNln$lP@)A~q;j4xF73KPa$TS{v$r{}ap1ZB7sd~4 z7HaJw2pA&_^bz8qVazH!k*UQIMVl0&v}g5|?kp}0W_7eTqvPFajC+2QbD^YCLO$lu zL#BtvF;kx^X$li%_xL)5Z>y7oHkx|>u7dXYn({>OJ?GekZ7}H$4(2mH~uWRSjF}Qcks3H56skGeLnV zaG}Zx`$9mcMM!*mDzxpvmOV6>J0h7k`&FtmAc}*S89*$H=@utbEBJ@s2!D>RJ3k*C zJ!mH4?*VUKqcE9y2l_fYU2Ly(m(8_@b2wipBRq!oUmaN&~$^OB*npHt&UU_)Mi*t=L$7Wj-&ril;p4SCCyJK*h z?{<9k{>O0s=3&s8=9e_7bxkg4YXx~mENU~7f>5DUY0JqMe$lr5;DwsLfj0$V;EfR6)!8#=;o{#%;Nrq_wG+!j zqi-kse>i=;{ri_^qc0u%v?p@nS_kyPakvu?cZltAAzM-*44frXNmp1AA*ut>d_>I# zoG^8O^iBgTz}+4HtPjQ}_ru7gj)tc{Xoww}h{X1t3)e?>18f`R|1+|qpq2u P00000NkvXXu0mjft5d?W diff --git a/styles/all/theme/images/like.png b/styles/all/theme/images/like.png deleted file mode 100644 index 85349a2c079c7a23fd53c70b707501ff16a2a455..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 784 zcmV+r1MmEaP)!{PP@a|2piTU3wRlT0MyB9Tb&ywKO`5ckQcR8si8pWD4b7XbCw*4J-Zr}O=I zGMRidH#b*9YpVX>UvfH~79NkMePVoq$WRCc`iHKrt`BQ#YhrP6QP4)b*1#JG+Oe7u zi^XbEsZ^EM>$OLtQQ~O@P1A}rr#3e?M~8-n>IVh}UJ~k;mzSlO;3S<+307TQU1ep* z#Bkl2>6y?vwn#!og!xwyCh)hwlSBFFCTE+UbL6quf##^~rM=#=k--DZbY zq_0@S@$s=r$0;(2#`=*TjM~~-2%F7@a^+6p^z@W#kvVTxDwSluy}b=82gAd|peABf zko#6)x7)$4a-5x={Y9p_WuD9Bu(Puxo!{Tz$KKu^y1TnGOfK=lhm`*pMxznJYPE7+ zVU?4U6OG6+FBA&W2fA;ptgKM4x5DXkqNAe&4u^wp=7|UfgD-To^Ye31lgOM)(aX8H zxxwY-CGz<^uCA_deSHn`Dlhw$jCj`8)&{z}?_*Hu*x1;RZt2%`Ke)?AMn;~> zN5M~SW@g4f{ms2@ps|764Vg?PG&MCT7K;Uqjg5?o*=z>&{^Ny(1#t^+=xNxv@W}xH O0000n>lu9MiYy@rzeBd6N&HyY%b#pX$YXT`J~& z`1JYD-@k{>Ui|s%*NZnF7H&SgX!C*BZ{EHC{Pq5`*Y7@kX_>M7(TkU-uikk3@$0L% zAI{&nf9}S^`5X2=ef9ds&)+96U;pvr=eHlfj58-Zc>3bkpFbYei#%!o=2@@BZ-l>)$_rkDR~!@$;8I|Ngyt^Zxy( zPwV%d@~dBR|LOBruiyXp^?U1~lNzyh@jnCM z5YC_jvL6&D4D53o!kd~~THD%NI77R8dV4s-S;8hynL33foQc6`+EhOVrf>sG5gDFo z9QIoBcH!PUCKlSxQ}_h}h20Iq)xtO=WyNg6Ow9yERm0T7xhCuSd)Zh!nQJ&s<_c#F zb7L3Rln&5QV&(M=V+?2Gb7c+V_VAVBwvuC4WD7Tz@Nv-(Vqo-Qa9}#pq3y6jBj!ZG V!ftKmWgc@p3LiCSH!?6-0|3dy{xSdn diff --git a/styles/all/theme/images/quota.png b/styles/all/theme/images/quota.png deleted file mode 100644 index a7cba5733747003ef8e79bc389ce4536ac8168b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 306 zcmV-20nPr2P)QG?|5CvJoY?18Q^Ef@xc_R% z|69cW9^yr)y6CWiP6kIHVp3E-f({|sEAPPzgCrE= zIB1k^Z-4~T=y{QU7nbumd&18#Q^HA5##u1_1TJ6r00p-Q*s;OabN~PV07*qoM6N<$ Ef_sgP;{X5v diff --git a/styles/black/theme/images/message_icons.png b/styles/black/theme/images/message_icons.png new file mode 100644 index 0000000000000000000000000000000000000000..18b2fd9970b19c0ca4cd2200dde3d566bfdff34b GIT binary patch literal 1939 zcmV;E2WP)000yS1^@s63Y0cZ000MCNkl zQj)HcvJwGH(v=b-;5Lj?7$-2+XRKnp#<-R7guZu{U=U?pt&Ac{KgQdP*BLd86*>Ai zknw_3Hi0p{gJau}u~eToV*I)$6_Z533dT&vCXBNf?=zYh<&55pV;Gk(_GWz831hGa z5F+8ljLUO=VFRCi6MSZ*^O^L<0O&=zD#wOMY=KmVr)hQvUF$s z!PtQDdrrMTu-0Sr`5}_^U1Q=B5DW1U$wJ?wWot8fkXS~umSNJc=p#u8npcwCuaAU( zGu9UH5Bp$Cy`)$?lu8y?pu494h z!KJp}jfA{I8G{%?a}Y?pvDwDO&d zb@csk>-X`D0~n8zY$pvQUa=+PfQbs*Zdwwe-cFRA@H;ZzOXw5tFEK_~Wj`@Cw%+?O zzH-`)W;~YR`_Nfm#+4+*gZFevo+OPVhMz@1>I#aJ+sHeNU7a#GmZ2%z<6EaPuA_pn z_+%F2WX58<&?ev(j5&<$NUXI%2ZI<8Zojt<7|Mh#tq-eCySR`+s`zb5h_?&l7Ls_bnd07R zs_OjlNImp>1!H7}u?=I)WlUq7sbx2i#FhB%%}9F~>H^j6a&7l430JUNfsku41~aZ< z?4j-27_d!1#8@EQ^Nf2*2sxbEk^>XOLRITWdusi`877|O`RwO|{E4oJSO@FQ-7_m4oL_Ra2SbOsw#2$!4;SnZS00z*Ork>U*VoZe8v=g7*jE+*DkT#Fc|e?MZq#>pkQR!2 zz>bp7^kEYnZ7w1)3Zp>eC!b_oWqm6~Kv%GBjHI>%bOnT*=NY4sm{B7C2G39(s8b9A zPSUnU5Oxhy{mj>S8}WrFwxAu-N^hxN&LcV4HIQu6wIn%Z#P99$pEd!peZ0u{fh73u z;WWTPKTQ%$)@j+%I_a9g06T+xrk|um#WrUQ0x`)#=l84xgn%4aR38CxusF;!Mk6r- z!b2hj(kD=-vk8c}bQxt6q}+Z>Q4c%L%!G1;F+2Dg*#tz)cOMCx5&MC$2$+#~!~TvF zui4_}=x<0dAUCz#(|;^3%yRpYcB^+K4*{{Lo06Y^uQ2wH%r`dHgGoHb8Qb|1(ZwPlwjwNIjDTm81n`dp>KFpfqCz}- zC`noec}2upILX2Z#0ZE3!=i-pIx3J3VZ{(n+lG|-hH=0_A(uQQR@o(>$^VU2CHn}3 zlmL$Lp<}vxznk{T%_rxR#CCb)0>;$|N~JwpE#kvgj~_W8e&(jQVw(xp-&U`e`E Z{sB4U5BD+f5DNeR002ovPDHLkV1h!Wo-hCa literal 0 HcmV?d00001 diff --git a/styles/black/theme/mchat_custom.css b/styles/black/theme/mchat_custom.css index d222458..c5fb0fa 100644 --- a/styles/black/theme/mchat_custom.css +++ b/styles/black/theme/mchat_custom.css @@ -8,32 +8,32 @@ */ .icon-mchat { - position: relative; + position: relative; } .icon-mchat:after { - content: '\f086'; - font-family: 'FontAwesome'; - width: 18px; - text-align: center; - position: absolute; - top: 50%; - left: 0; - height: 14px; - margin-top: -7px; - font-size: 12px; - line-height: 14px; - vertical-align: baseline; - font-weight: normal; - font-style: normal; - text-transform: none; - text-indent: 0; - pointer-events: none; + content: '\f086'; + font-family: 'FontAwesome'; + width: 18px; + text-align: center; + position: absolute; + top: 50%; + left: 0; + height: 14px; + margin-top: -7px; + font-size: 12px; + line-height: 14px; + vertical-align: baseline; + font-weight: normal; + font-style: normal; + text-transform: none; + text-indent: 0; + pointer-events: none; } .navbar .nav-tabs .mchat .nav-link { position: relative; - text-indent: 999px; + text-indent: 999px; width: 15px; padding: 0 8px; overflow: hidden; @@ -41,7 +41,7 @@ .navbar .nav-tabs .mchat .nav-link:after { content: '\f086'; - font-family: 'FontAwesome'; + font-family: 'FontAwesome'; position: absolute; top: 50%; margin-top: -7.5px; @@ -51,31 +51,21 @@ font-weight: normal; font-style: normal; text-indent: 0; - text-align: center; + text-align: center; font-size: 15px; left:8px } .rtl .navbar .nav-tabs .mchat .nav-link { - padding-left: 12px; + padding-left: 12px; padding-right: 30px; } .rtl .navbar .nav-tabs .mchat .nav-link:after { - left: auto; + left: auto; right: 8px; } -li.mchat-message { - padding: 5px !important; -} - -li.mchat-message:first-child { - border-top-width: 1px !important; - padding-top: 5px !important; -} - -li.mchat-message:last-child { - border-bottom-width: 1px !important; - padding-bottom: 5px !important; +.mchat-button:before { + background-image: url("./images/message_icons.png"); } diff --git a/styles/elegance/theme/mchat_custom.css b/styles/elegance/theme/mchat_custom.css index d222458..f4f5c3b 100644 --- a/styles/elegance/theme/mchat_custom.css +++ b/styles/elegance/theme/mchat_custom.css @@ -8,32 +8,32 @@ */ .icon-mchat { - position: relative; + position: relative; } .icon-mchat:after { - content: '\f086'; - font-family: 'FontAwesome'; - width: 18px; - text-align: center; - position: absolute; - top: 50%; - left: 0; - height: 14px; - margin-top: -7px; - font-size: 12px; - line-height: 14px; - vertical-align: baseline; - font-weight: normal; - font-style: normal; - text-transform: none; - text-indent: 0; - pointer-events: none; + content: '\f086'; + font-family: 'FontAwesome'; + width: 18px; + text-align: center; + position: absolute; + top: 50%; + left: 0; + height: 14px; + margin-top: -7px; + font-size: 12px; + line-height: 14px; + vertical-align: baseline; + font-weight: normal; + font-style: normal; + text-transform: none; + text-indent: 0; + pointer-events: none; } .navbar .nav-tabs .mchat .nav-link { position: relative; - text-indent: 999px; + text-indent: 999px; width: 15px; padding: 0 8px; overflow: hidden; @@ -41,7 +41,7 @@ .navbar .nav-tabs .mchat .nav-link:after { content: '\f086'; - font-family: 'FontAwesome'; + font-family: 'FontAwesome'; position: absolute; top: 50%; margin-top: -7.5px; @@ -51,31 +51,17 @@ font-weight: normal; font-style: normal; text-indent: 0; - text-align: center; + text-align: center; font-size: 15px; left:8px } .rtl .navbar .nav-tabs .mchat .nav-link { - padding-left: 12px; + padding-left: 12px; padding-right: 30px; } .rtl .navbar .nav-tabs .mchat .nav-link:after { - left: auto; + left: auto; right: 8px; } - -li.mchat-message { - padding: 5px !important; -} - -li.mchat-message:first-child { - border-top-width: 1px !important; - padding-top: 5px !important; -} - -li.mchat-message:last-child { - border-bottom-width: 1px !important; - padding-bottom: 5px !important; -} diff --git a/styles/latte/theme/mchat_custom.css b/styles/latte/theme/mchat_custom.css index d222458..f4f5c3b 100644 --- a/styles/latte/theme/mchat_custom.css +++ b/styles/latte/theme/mchat_custom.css @@ -8,32 +8,32 @@ */ .icon-mchat { - position: relative; + position: relative; } .icon-mchat:after { - content: '\f086'; - font-family: 'FontAwesome'; - width: 18px; - text-align: center; - position: absolute; - top: 50%; - left: 0; - height: 14px; - margin-top: -7px; - font-size: 12px; - line-height: 14px; - vertical-align: baseline; - font-weight: normal; - font-style: normal; - text-transform: none; - text-indent: 0; - pointer-events: none; + content: '\f086'; + font-family: 'FontAwesome'; + width: 18px; + text-align: center; + position: absolute; + top: 50%; + left: 0; + height: 14px; + margin-top: -7px; + font-size: 12px; + line-height: 14px; + vertical-align: baseline; + font-weight: normal; + font-style: normal; + text-transform: none; + text-indent: 0; + pointer-events: none; } .navbar .nav-tabs .mchat .nav-link { position: relative; - text-indent: 999px; + text-indent: 999px; width: 15px; padding: 0 8px; overflow: hidden; @@ -41,7 +41,7 @@ .navbar .nav-tabs .mchat .nav-link:after { content: '\f086'; - font-family: 'FontAwesome'; + font-family: 'FontAwesome'; position: absolute; top: 50%; margin-top: -7.5px; @@ -51,31 +51,17 @@ font-weight: normal; font-style: normal; text-indent: 0; - text-align: center; + text-align: center; font-size: 15px; left:8px } .rtl .navbar .nav-tabs .mchat .nav-link { - padding-left: 12px; + padding-left: 12px; padding-right: 30px; } .rtl .navbar .nav-tabs .mchat .nav-link:after { - left: auto; + left: auto; right: 8px; } - -li.mchat-message { - padding: 5px !important; -} - -li.mchat-message:first-child { - border-top-width: 1px !important; - padding-top: 5px !important; -} - -li.mchat-message:last-child { - border-bottom-width: 1px !important; - padding-bottom: 5px !important; -} diff --git a/styles/we_universal/template/event/overall_header_head_append.html b/styles/metro_blue/template/event/overall_header_head_append.html similarity index 100% rename from styles/we_universal/template/event/overall_header_head_append.html rename to styles/metro_blue/template/event/overall_header_head_append.html diff --git a/styles/metro_blue/template/mchat_navlink.html b/styles/metro_blue/template/mchat_navlink.html new file mode 100644 index 0000000..b84592e --- /dev/null +++ b/styles/metro_blue/template/mchat_navlink.html @@ -0,0 +1 @@ +
  • {L_MCHAT_TITLE}
  • diff --git a/styles/metro_blue/theme/images/tab-icon-mchat.svg b/styles/metro_blue/theme/images/tab-icon-mchat.svg new file mode 100644 index 0000000..18aa309 --- /dev/null +++ b/styles/metro_blue/theme/images/tab-icon-mchat.svg @@ -0,0 +1 @@ + diff --git a/styles/we_universal/theme/mchat_custom.css b/styles/metro_blue/theme/mchat_custom.css similarity index 64% rename from styles/we_universal/theme/mchat_custom.css rename to styles/metro_blue/theme/mchat_custom.css index 7ac850f..3c84c67 100644 --- a/styles/we_universal/theme/mchat_custom.css +++ b/styles/metro_blue/theme/mchat_custom.css @@ -7,6 +7,6 @@ * */ -#mchat-panel { - border-radius: 0; +.page-header-metro .navbar .nav-main-metro-tabs li.icon-mchat > a { + background-image: url("./images/tab-icon-mchat.svg"); } diff --git a/styles/pbtech/template/mchat_header.html b/styles/pbtech/template/mchat_header.html index b937d63..dd18659 100644 --- a/styles/pbtech/template/mchat_header.html +++ b/styles/pbtech/template/mchat_header.html @@ -1,3 +1,3 @@
    -

    {L_MCHAT_ARCHIVE_PAGE}{L_MCHAT_TITLE}{L_MCHAT_TITLE}

    +

    {L_MCHAT_ARCHIVE_PAGE}{L_MCHAT_TITLE}{L_MCHAT_TITLE}

    diff --git a/styles/pbtech/theme/mchat_custom.css b/styles/pbtech/theme/mchat_custom.css index 231ab22..11b638d 100644 --- a/styles/pbtech/theme/mchat_custom.css +++ b/styles/pbtech/theme/mchat_custom.css @@ -8,11 +8,11 @@ */ .icon-mchat > a:before { - content: '\f086'; - font-family: 'FontAwesome'; + content: '\f086'; + font-family: 'FontAwesome'; } -.cp-mini { +#mchat-panel.cp-mini { background-color: #E5E4E3; } diff --git a/styles/pbwow3/template/mchat_header.html b/styles/pbwow3/template/mchat_header.html index b937d63..dd18659 100644 --- a/styles/pbwow3/template/mchat_header.html +++ b/styles/pbwow3/template/mchat_header.html @@ -1,3 +1,3 @@
    -

    {L_MCHAT_ARCHIVE_PAGE}{L_MCHAT_TITLE}{L_MCHAT_TITLE}

    +

    {L_MCHAT_ARCHIVE_PAGE}{L_MCHAT_TITLE}{L_MCHAT_TITLE}

    diff --git a/styles/pbwow3/theme/images/message_icons.png b/styles/pbwow3/theme/images/message_icons.png new file mode 100644 index 0000000000000000000000000000000000000000..18b2fd9970b19c0ca4cd2200dde3d566bfdff34b GIT binary patch literal 1939 zcmV;E2WP)000yS1^@s63Y0cZ000MCNkl zQj)HcvJwGH(v=b-;5Lj?7$-2+XRKnp#<-R7guZu{U=U?pt&Ac{KgQdP*BLd86*>Ai zknw_3Hi0p{gJau}u~eToV*I)$6_Z533dT&vCXBNf?=zYh<&55pV;Gk(_GWz831hGa z5F+8ljLUO=VFRCi6MSZ*^O^L<0O&=zD#wOMY=KmVr)hQvUF$s z!PtQDdrrMTu-0Sr`5}_^U1Q=B5DW1U$wJ?wWot8fkXS~umSNJc=p#u8npcwCuaAU( zGu9UH5Bp$Cy`)$?lu8y?pu494h z!KJp}jfA{I8G{%?a}Y?pvDwDO&d zb@csk>-X`D0~n8zY$pvQUa=+PfQbs*Zdwwe-cFRA@H;ZzOXw5tFEK_~Wj`@Cw%+?O zzH-`)W;~YR`_Nfm#+4+*gZFevo+OPVhMz@1>I#aJ+sHeNU7a#GmZ2%z<6EaPuA_pn z_+%F2WX58<&?ev(j5&<$NUXI%2ZI<8Zojt<7|Mh#tq-eCySR`+s`zb5h_?&l7Ls_bnd07R zs_OjlNImp>1!H7}u?=I)WlUq7sbx2i#FhB%%}9F~>H^j6a&7l430JUNfsku41~aZ< z?4j-27_d!1#8@EQ^Nf2*2sxbEk^>XOLRITWdusi`877|O`RwO|{E4oJSO@FQ-7_m4oL_Ra2SbOsw#2$!4;SnZS00z*Ork>U*VoZe8v=g7*jE+*DkT#Fc|e?MZq#>pkQR!2 zz>bp7^kEYnZ7w1)3Zp>eC!b_oWqm6~Kv%GBjHI>%bOnT*=NY4sm{B7C2G39(s8b9A zPSUnU5Oxhy{mj>S8}WrFwxAu-N^hxN&LcV4HIQu6wIn%Z#P99$pEd!peZ0u{fh73u z;WWTPKTQ%$)@j+%I_a9g06T+xrk|um#WrUQ0x`)#=l84xgn%4aR38CxusF;!Mk6r- z!b2hj(kD=-vk8c}bQxt6q}+Z>Q4c%L%!G1;F+2Dg*#tz)cOMCx5&MC$2$+#~!~TvF zui4_}=x<0dAUCz#(|;^3%yRpYcB^+K4*{{Lo06Y^uQ2wH%r`dHgGoHb8Qb|1(ZwPlwjwNIjDTm81n`dp>KFpfqCz}- zC`noec}2upILX2Z#0ZE3!=i-pIx3J3VZ{(n+lG|-hH=0_A(uQQR@o(>$^VU2CHn}3 zlmL$Lp<}vxznk{T%_rxR#CCb)0>;$|N~JwpE#kvgj~_W8e&(jQVw(xp-&U`e`E Z{sB4U5BD+f5DNeR002ovPDHLkV1h!Wo-hCa literal 0 HcmV?d00001 diff --git a/styles/pbwow3/theme/mchat_custom.css b/styles/pbwow3/theme/mchat_custom.css index 8306eee..8ca08b7 100644 --- a/styles/pbwow3/theme/mchat_custom.css +++ b/styles/pbwow3/theme/mchat_custom.css @@ -8,8 +8,8 @@ */ .icon-mchat > a:before { - content: '\f086'; - font-family: 'FontAwesome'; + content: '\f086'; + font-family: 'FontAwesome'; } #mChat + .forabg .collapse-box a { @@ -20,3 +20,7 @@ content: ''; margin-right: 0; } + +.mchat-button:before { + background-image: url("./images/message_icons.png"); +} diff --git a/styles/prosilver/template/event/index_body_block_online_append.html b/styles/prosilver/template/event/index_body_block_online_append.html new file mode 100644 index 0000000..15e343c --- /dev/null +++ b/styles/prosilver/template/event/index_body_block_online_append.html @@ -0,0 +1,7 @@ + +

    + +
    +

    {L_MCHAT_WHO_IS_CHATTING}

    +

    {MCHAT_USERS_COUNT} {MCHAT_ONLINE_EXPLAIN}
    {MCHAT_USERS_LIST} + diff --git a/styles/prosilver/template/event/index_body_forumlist_body_after.html b/styles/prosilver/template/event/index_body_forumlist_body_after.html new file mode 100644 index 0000000..6ce9680 --- /dev/null +++ b/styles/prosilver/template/event/index_body_forumlist_body_after.html @@ -0,0 +1 @@ + diff --git a/styles/prosilver/template/event/index_body_markforums_before.html b/styles/prosilver/template/event/index_body_markforums_before.html new file mode 100644 index 0000000..1d1501c --- /dev/null +++ b/styles/prosilver/template/event/index_body_markforums_before.html @@ -0,0 +1 @@ + diff --git a/styles/prosilver/template/event/overall_footer_copyright_append.html b/styles/prosilver/template/event/overall_footer_copyright_append.html new file mode 100644 index 0000000..878e6ca --- /dev/null +++ b/styles/prosilver/template/event/overall_footer_copyright_append.html @@ -0,0 +1,3 @@ + +

    {MCHAT_DISPLAY_NAME} © {L_POST_BY_AUTHOR} {MCHAT_AUTHOR_HOMEPAGES}
    + diff --git a/styles/all/template/event/overall_header_head_append.html b/styles/prosilver/template/event/overall_header_head_append.html similarity index 100% rename from styles/all/template/event/overall_header_head_append.html rename to styles/prosilver/template/event/overall_header_head_append.html diff --git a/styles/prosilver/template/event/overall_header_navigation_append.html b/styles/prosilver/template/event/overall_header_navigation_append.html new file mode 100644 index 0000000..924f28d --- /dev/null +++ b/styles/prosilver/template/event/overall_header_navigation_append.html @@ -0,0 +1,3 @@ + + + diff --git a/styles/prosilver/template/mchat_body.html b/styles/prosilver/template/mchat_body.html new file mode 100644 index 0000000..02680b5 --- /dev/null +++ b/styles/prosilver/template/mchat_body.html @@ -0,0 +1,107 @@ + + + + + + + + + + + + + +
    + +
    + + + +
    + +
    +
      +
    • + +
    • +
    + +
    + + + + + + + + + + + +
    + +
      +
    • {MCHAT_STATIC_MESS}
    • +
    + + +
      style="height:{MCHAT_CUSTOM_HEIGHT}{MCHAT_INDEX_HEIGHT}px"> + + + +
    • {L_MCHAT_NOMESSAGE}
    • + +
    +
    + + +
    +
    +
    + + +
    + +
    + + + +

    {L_MCHAT_WHO_IS_CHATTING}

    + +
    + {MCHAT_WHOIS_REFRESH_EXPLAIN} + +
    + + + +
    + {L_LEGEND}{L_COLON} {LEGEND} +
    + + + + + diff --git a/styles/prosilver/template/mchat_header.html b/styles/prosilver/template/mchat_header.html new file mode 100644 index 0000000..68c4d52 --- /dev/null +++ b/styles/prosilver/template/mchat_header.html @@ -0,0 +1,4 @@ +
    +
    {L_MCHAT_ARCHIVE_PAGE}{L_MCHAT_TITLE}{L_MCHAT_TITLE}
    +
     
    +
    diff --git a/styles/prosilver/template/mchat_messages.html b/styles/prosilver/template/mchat_messages.html new file mode 100644 index 0000000..c0e346f --- /dev/null +++ b/styles/prosilver/template/mchat_messages.html @@ -0,0 +1,16 @@ + +
  • data-mchat-usercolor="{mchatrow.MCHAT_USERNAME_COLOR}" data-mchat-message="{mchatrow.MCHAT_MESSAGE_EDIT}" data-mchat-message-time="{mchatrow.MCHAT_MESSAGE_TIME}" data-mchat-edit-time="{mchatrow.MCHAT_EDIT_TIME}" data-mchat-edit-delete-limit="1"> + + + +
    + +
    {mchatrow.MCHAT_USERNAME_FULL} • data-mchat-minutes-ago="{mchatrow.MCHAT_MINUTES_AGO}" data-mchat-relative-update="{mchatrow.MCHAT_RELATIVE_UPDATE}">{mchatrow.MCHAT_TIME}
    +
    {mchatrow.MCHAT_MESSAGE}
    +
    +
  • + diff --git a/styles/prosilver/template/mchat_messages_icons.html b/styles/prosilver/template/mchat_messages_icons.html new file mode 100644 index 0000000..3e2db71 --- /dev/null +++ b/styles/prosilver/template/mchat_messages_icons.html @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/styles/prosilver/template/mchat_navlink.html b/styles/prosilver/template/mchat_navlink.html new file mode 100644 index 0000000..462589b --- /dev/null +++ b/styles/prosilver/template/mchat_navlink.html @@ -0,0 +1,5 @@ +
  • class="small-icon icon-mchat"data-last-responsive="true"> + + class="icon fa fa-weixin" aria-hidden="true">{L_MCHAT_TITLE} + +
  • diff --git a/styles/prosilver/template/mchat_panel.html b/styles/prosilver/template/mchat_panel.html new file mode 100644 index 0000000..109c587 --- /dev/null +++ b/styles/prosilver/template/mchat_panel.html @@ -0,0 +1,74 @@ +
    + + + + + +
    {MCHAT_CHARACTER_COUNT}
    + + +
    + {S_FORM_TOKEN} + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + + + + +
    +
    + + + + +
    + {MCHAT_REFRESH_YES} + {MCHAT_SESSION_TIMELEFT} + + © +
    + +
    +
    diff --git a/styles/all/template/mchat_rules.html b/styles/prosilver/template/mchat_rules.html similarity index 100% rename from styles/all/template/mchat_rules.html rename to styles/prosilver/template/mchat_rules.html diff --git a/styles/prosilver/template/mchat_script_data.html b/styles/prosilver/template/mchat_script_data.html new file mode 100644 index 0000000..90968ad --- /dev/null +++ b/styles/prosilver/template/mchat_script_data.html @@ -0,0 +1,53 @@ + diff --git a/styles/all/template/mchat_whois.html b/styles/prosilver/template/mchat_whois.html similarity index 100% rename from styles/all/template/mchat_whois.html rename to styles/prosilver/template/mchat_whois.html diff --git a/styles/prosilver/template/ucp_mchat.html b/styles/prosilver/template/ucp_mchat.html new file mode 100644 index 0000000..59642ab --- /dev/null +++ b/styles/prosilver/template/ucp_mchat.html @@ -0,0 +1,161 @@ + + +

    {L_MCHAT_PREFERENCES}

    + +
    +
    +
    + + +
    +

    {ERROR}

    +

    {L_MCHAT_NO_SETTINGS}

    +
    + + + +
    + +
    +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    + + +
    +

    {L_MCHAT_STATS_INDEX_EXPLAIN}
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    + +
    + +
    +

    {L_MCHAT_MESSAGE_TOP_EXPLAIN}
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    + + +
    +
    +
    + + +
    +
    + + +
    +

    {L_MCHAT_PAUSE_ON_INPUT_EXPLAIN}
    +
    + + +
    +
    + + +
    +

    {L_MCHAT_DATE_FORMAT_EXPLAIN}
    +
    + +
    +
    style="display:none;">
    +
    + + +
    +

    {L_MCHAT_RELATIVE_TIME_EXPLAIN}
    +
    + + +
    +
    + +
    + +
    +
    +
    + + +
    +
    + +
    + +
    +
    + +
    + {S_HIDDEN_FIELDS}  + + {S_FORM_TOKEN} +
    + +
    + + diff --git a/styles/all/theme/images/error.gif b/styles/prosilver/theme/images/error.gif similarity index 100% rename from styles/all/theme/images/error.gif rename to styles/prosilver/theme/images/error.gif diff --git a/styles/all/theme/images/icon_mchat.png b/styles/prosilver/theme/images/icon_mchat.png similarity index 100% rename from styles/all/theme/images/icon_mchat.png rename to styles/prosilver/theme/images/icon_mchat.png diff --git a/styles/all/theme/images/load.gif b/styles/prosilver/theme/images/load.gif similarity index 100% rename from styles/all/theme/images/load.gif rename to styles/prosilver/theme/images/load.gif diff --git a/styles/prosilver/theme/images/message_icons.png b/styles/prosilver/theme/images/message_icons.png new file mode 100644 index 0000000000000000000000000000000000000000..49ae37772a93fb46405e0484e2873cbc4aaaee2a GIT binary patch literal 1927 zcmV;22YC32P)000yS1^@s63Y0cZ000M0NklrN#2`3GjGbdW$yeEDoRm0QA#>{ z07Y55B}BmO7^g8#Vr#rnJnDB_QlUHRrRP9fRgD|GF$NEgQ6j4h}@madFtjExw7=3EyD z_Ii{)KSHv<9VYIEV=<*34Eo z4q`k`;!f&Ftm2A{112iC-Lxb`yjX;S$ z*DyHwjfPr?;=D-d!W#z4k(jJ>p73k9|} z1u+%~_aftd5<(88mgK+$u~C)!(e7G*V1|h&Sw8!{B+%|e#`TOnNfaa`eMw@k^BDIg z^gCM@8u4sWYzc*1q|e={5PPK+#EY<=Ah2;icQQ`4>ckEaHUY68-;o#xxM#$DhzSvs z!XRWJAjt6pNt{1b#{s#8#G)Rztj#u_1(97AHnpsX*DaOr)932H z6eu6YILn!+Ax10?43W$g88IiNwA8+9*wF(yzU_UrAeQHxFah_Sye{OgoV2;>2As<~O;VL?_<+yb_ie5MbZ z=xB2ZiBgyaM1JyV#x>TrVgz&rZeuvLB%muG#?RwrE*7+_nF&-9bDsc>^fArOA*YAS@(OAiV;0 z+M0lfOP5eKLCWoq6!qY7rYDpmjM>T8$leshd=HSY8L=N2i+~w zC*OS%+Kf%H&RAb$Okkvt&Vq}FXM(cUhZ@;}#z+(3gouFD!~-y;=ab~cs!3v-he*;d zzD2gL*YX@XTtR$>w94{~?R<&o_97r$5jHVKz;j6g_{Rcu3;}0QA)Y;)B&~zIB4RC^ zWMKqi1jK=1K|*;A6-bA$Vvwh8UCQ-_a=<_#mpmy}*(HI=|Bco~_7Mmv0UYB)$8`68 zH|>?1Pc9^h?efS)jB69d=abeD5Fr5qak%l2yF*>vGKFq->@S#hE{~w?nK|1ACA671Y`}8ZS8)jNVTGWPY0@rPzSq&R4avVtY!V{0ID-l|JJ4h( zVY#ygxXDQKuMwPZ4 li { + padding: 0 8px !important; } + } -.mchat-avatar a { - unicode-bidi: normal; -} - -.mchat-avatar img { +.mchat-avatar a, .mchat-avatar img { display: block; } +.mchat-message .mchat-buttons li { + opacity: .3; +} + +.mchat-message:hover .mchat-buttons li { + opacity: .6; +} + +.mchat-message .mchat-buttons li:hover { + opacity: 1; +} + +.mchat-buttons { + float: right; + list-style: none; + margin-top: 1px; +} + +.mchat-message-wrapper .mchat-buttons > li { + float: left; + margin: 0 3px; +} + +.mchat-button { + margin-left: 3px; +} + +.mchat-button.fa { + font-size: 12pt; +} + +.mchat-button span { + display: block; + height: 0; + overflow: hidden; + position: absolute; + width: 1px; +} + +.mchat-icon:before { + content: ''; + background-image: url("./images/message_icons.png"); + background-repeat: no-repeat; + width: 16px; + height: 16px; + display: block; + float: right; +} + +.mchat-icon-mention:before { background-position: -2px -2px; } +.mchat-icon-edit:before { background-position: -22px -2px; } +.mchat-icon-pm:before { background-position: -42px -2px; } +.mchat-icon-quote:before { background-position: -62px -2px; } +.mchat-icon-like:before { background-position: -82px -2px; } +.mchat-icon-delete:before { background-position: -102px -2px; } +.mchat-icon-permissions:before { background-position: -122px -2px; } +.mchat-icon-ip:before { background-position: -142px -2px; } + .mchat-text { clear: both; + overflow: hidden; padding: 0 5px 2px; - font-size: 1.1em; + font-size: 1.2em; } .mchat-text li { @@ -104,6 +161,7 @@ } .mchat-text blockquote, .mchat-text .codebox, .mchat-text ul, .mchat-text ol { + margin-top: 5px; margin-left: 1em; } @@ -111,21 +169,29 @@ color: inherit !important; } -.mchat-mention, .mchat-message-icons > * { +.mchat-mention { cursor: pointer; + width: 16px; + height: 16px; } #mchat-no-message { font-size: 1.2em; } +#mchat-character-count { + float: right; + visibility: hidden; + padding: 5px 0 0; +} + #mchat-panel { text-align: center; max-height: initial; + overflow-y: auto; padding: 0 5px 5px 5px; margin: 0; - border-top-left-radius: 0; - border-top-right-radius: 0; + border-radius: 0; } #mchat-form { @@ -136,7 +202,7 @@ cursor: text; width: 50%; font-size: 1.1em; - padding: 5px; + padding: 5px 5px 4px; margin: 5px 20px; } @@ -150,11 +216,7 @@ } #mchat-bbcodes #format-buttons { - margin: 0; -} - -#mchat-bbcodes #format-buttons input, #mchat-bbcodes #format-buttons select { - margin-bottom: 5px; + margin: 0 0 5px; } #mchat-bbcodes #colour_palette label { @@ -169,32 +231,73 @@ padding: 0; } -#mchat-refresh-ok, #mchat-refresh-load, #mchat-refresh-error, #mchat-refresh-paused { - vertical-align: middle; +#mchat-status-icons { + position: relative; + display: inline-block; + vertical-align: text-top; } -#mchat-refresh-ok, #mchat-refresh-load, #mchat-refresh-error { +#mchat-status-icons i { + top: 0; + left: 0; + width: 16px; + height: 16px; + float: left; +} + +#mchat-status-icons i.fa { + font-size: 12pt; +} + +#mchat-status-error { display: none; + cursor: help; } -#mchat-refresh-load { +.mchat-status-error { + background-image: url("./images/error.gif"); +} + +#mchat-status-ok { + display: none; + cursor: help; +} + +.mchat-status-ok { + background-image: url("./images/ok.gif"); +} + +#mchat-status-load { + display: none; cursor: wait; } -#mchat-refresh-ok, #mchat-refresh-error, #mchat-refresh-paused { +.mchat-status-load { + background-image: url("./images/load.gif"); +} + +#mchat-status-paused { cursor: help; } +.mchat-status-paused { + background-image: url("./images/paused.gif"); +} + #mchat-legend { clear: both; } .mchat-static, #mchat-stats, #mchat-whois, #mchat-refresh, #mchat-legend { - padding: 5px 0; + padding: 5px 0 0; text-align: left; font-size: 1.1em; } +#mchat-panel > #mchat-whois { + float: left; +} + .mchat-copyright { position: relative; top: 1px; @@ -203,22 +306,6 @@ cursor: help; } -#mchat-copyright-footer { - display: inline; -} - -#mchat-copyright-footer li { - display: inline; -} - -#mchat-copyright-footer li:first-child:before{ - content: ""; -} - -#mchat-copyright-footer li:before{ - content: "• "; -} - .mchat-static { padding: 5px 5px 7px !important; } @@ -229,11 +316,11 @@ /* Compatibility with Advanced BBCode Box extension */ -#abbc3_buttons { +#mchat-panel #abbc3_buttons { margin: 0 !important; padding-bottom: 5px; } -#abbc3_buttons .abbc3_buttons_row { +#mchat-panel #abbc3_buttons .abbc3_buttons_row { margin: 0 auto !important; } diff --git a/styles/simplicity/theme/mchat_custom.css b/styles/simplicity/theme/mchat_custom.css index d222458..f4f5c3b 100644 --- a/styles/simplicity/theme/mchat_custom.css +++ b/styles/simplicity/theme/mchat_custom.css @@ -8,32 +8,32 @@ */ .icon-mchat { - position: relative; + position: relative; } .icon-mchat:after { - content: '\f086'; - font-family: 'FontAwesome'; - width: 18px; - text-align: center; - position: absolute; - top: 50%; - left: 0; - height: 14px; - margin-top: -7px; - font-size: 12px; - line-height: 14px; - vertical-align: baseline; - font-weight: normal; - font-style: normal; - text-transform: none; - text-indent: 0; - pointer-events: none; + content: '\f086'; + font-family: 'FontAwesome'; + width: 18px; + text-align: center; + position: absolute; + top: 50%; + left: 0; + height: 14px; + margin-top: -7px; + font-size: 12px; + line-height: 14px; + vertical-align: baseline; + font-weight: normal; + font-style: normal; + text-transform: none; + text-indent: 0; + pointer-events: none; } .navbar .nav-tabs .mchat .nav-link { position: relative; - text-indent: 999px; + text-indent: 999px; width: 15px; padding: 0 8px; overflow: hidden; @@ -41,7 +41,7 @@ .navbar .nav-tabs .mchat .nav-link:after { content: '\f086'; - font-family: 'FontAwesome'; + font-family: 'FontAwesome'; position: absolute; top: 50%; margin-top: -7.5px; @@ -51,31 +51,17 @@ font-weight: normal; font-style: normal; text-indent: 0; - text-align: center; + text-align: center; font-size: 15px; left:8px } .rtl .navbar .nav-tabs .mchat .nav-link { - padding-left: 12px; + padding-left: 12px; padding-right: 30px; } .rtl .navbar .nav-tabs .mchat .nav-link:after { - left: auto; + left: auto; right: 8px; } - -li.mchat-message { - padding: 5px !important; -} - -li.mchat-message:first-child { - border-top-width: 1px !important; - padding-top: 5px !important; -} - -li.mchat-message:last-child { - border-bottom-width: 1px !important; - padding-bottom: 5px !important; -} diff --git a/ucp/ucp_mchat_module.php b/ucp/ucp_mchat_module.php index a8b15f4..f6a1bb1 100644 --- a/ucp/ucp_mchat_module.php +++ b/ucp/ucp_mchat_module.php @@ -28,6 +28,6 @@ class ucp_mchat_module // Get an instance of the UCP controller and display the options $controller = $phpbb_container->get('dmzx.mchat.ucp.controller'); - $controller->display_options($this->u_action); + $controller->$mode($this->u_action); } }