33 Commits

Author SHA1 Message Date
9839b5adde Rename mChat to Shoutbox at multiple places 2021-07-01 16:37:49 +02:00
e1cf85da23 Update language files for de for mChat 2.1.4 2021-05-31 21:36:40 +02:00
73fbebce37 Merge remote-tracking branch 'github/master' 2021-05-30 14:23:14 +02:00
dmzx
4e2fcec44a Version 2.1.4 2020-09-11 15:46:11 +02:00
dmzx
4d7253f0f0 Version 2.1.3 2019-08-29 08:41:42 +02:00
dmzx
940161da23 Version 2.1.2 2019-01-17 19:18:50 +01:00
dmzx
698db04f9e Version 2.1.1 2018-10-05 11:24:44 +02:00
dmzx
006a4e404e Version 2.1.0 2018-08-02 11:34:39 +02:00
b8ef65ec10 Rename mchat title to Tippliga Würzburg Shoutbox 2018-05-20 16:18:20 +02:00
88668739e1 Add german language files to mChat 2018-05-20 16:18:02 +02:00
dmzx
cd0f139598 Version 2.0.3 2018-03-05 17:02:04 +01:00
dmzx
d11883ac14 Version 2.0.2 2017-12-09 08:10:07 +01:00
dmzx
0addbac5c0 Version 2.0.2 2017-12-09 08:09:57 +01:00
dmzx
6405c7c7ab Version 2.0.1 2017-04-28 08:00:39 +02:00
dmzx
28f847ecff Version 2.0.0 2016-12-30 11:05:29 +01:00
dmzx
159d1d25b8 Version 2.0.0-RC7 2016-10-16 17:25:31 +02:00
dmzx
233dc89a8a Version 2.0.0-RC6 2016-09-20 22:38:19 +02:00
dmzx
aac8ce6f58 Travis 2016-06-12 13:00:35 +02:00
dmzx
13a8dc2162 Fixed posts not being displayed 2016-04-07 21:13:46 +02:00
dmzx
46380fea08 Update 2016-04-05 19:27:59 +02:00
dmzx
b9a1b38d8c Update 2016-04-05 19:25:07 +02:00
dmzx
172b9734f1 Update 2016-04-05 19:21:38 +02:00
dmzx
78a25e8ab3 Update 2016-04-05 19:18:00 +02:00
dmzx
2c6f1a8990 Update 2016-04-05 19:14:59 +02:00
dmzx
19b96ea4ba 2.0.0-RC5 2016-04-04 22:38:34 +02:00
dmzx
b89c3bec93 Version 2.0.0-RC5 2016-04-04 22:33:08 +02:00
dmzx
3d34f58884 Version 2.0.0-RC5 2016-04-04 22:26:53 +02:00
dmzx
b5f716e448 Version 2.0.0-RC5 2016-04-04 22:17:37 +02:00
dmzx
0d71f9f3f7 Version 2.0.0-RC5 2016-04-04 22:08:48 +02:00
dmzx
1404928202 Version 2.0.0-RC4 2016-04-02 11:49:54 +02:00
dmzx
ca5bcaa947 Version 2.0.0-RC4 2016-04-02 11:36:20 +02:00
dmzx
91dfd6d9fc Merge pull request #45 from jakubsuchybio/master
Fix issue #44 - Replace event for pbtech style from index_body_markforums_before to index_body_markforums_after
2016-03-26 13:10:09 +01:00
jakubsuchybio
463e7b37a9 Fix issue #44 - Replace event for pbtech style from index_body_markforums_before to index_body_markforums_after 2016-03-26 12:19:10 +01:00
151 changed files with 7497 additions and 3294 deletions

View File

@@ -1,67 +0,0 @@
sudo: required
language: php
matrix:
include:
- php: 5.4
env: DB=none;NOTESTS=1
- php: 5.4
env: DB=mysqli #myisam
- php: 5.4
env: DB=mysql
- php: 5.4
env: DB=mariadb
- php: 5.4
env: DB=postgres
- php: 5.4
env: DB=sqlite3
- php: 5.5
env: DB=mysqli
- php: 5.6
env: DB=mysqli
- php: 7.0
env: DB=mysqli
- php: hhvm
env: DB=mysqli
allow_failures:
- php: 7.0
- php: hhvm
fast_finish: true
env:
global:
- EXTNAME="dmzx/mChat-Extension" # CHANGE name of the extension HERE
- SNIFF="1" # Should we run code sniffer on your code?
- IMAGE_ICC="0" # Should we run icc profile sniffer on your images?
- EPV="0" # Should we run EPV (Extension Pre Validator) on your code?
- PHPBB_BRANCH="develop-ascraeus"
branches:
only:
- master
- develop
- /^develop-.*$/
before_install:
- sudo mkdir travis
- git clone "https://github.com/nickvergessen/phpbb-ext-acme-demo.git"
- sudo cp phpbb-ext-acme-demo/phpunit.xml.dist ./
- sudo cp phpbb-ext-acme-demo/travis/prepare-phpbb.sh travis
- sudo rm -rf phpbb-ext-acme-demo
install:
- composer install --dev --no-interaction --prefer-source
- travis/prepare-phpbb.sh $EXTNAME $PHPBB_BRANCH
- cd ../../phpBB3
- travis/prepare-extension.sh $EXTNAME $PHPBB_BRANCH
- travis/setup-phpbb.sh $DB $TRAVIS_PHP_VERSION
before_script:
- travis/setup-database.sh $DB $TRAVIS_PHP_VERSION
script:
- sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME $NOTESTS; fi"
- sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION $NOTESTS; fi"
- sh -c "if [ '$NOTESTS' != '1' ]; then phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php; fi"
- sh -c "if [ '$EPV' != '0' ] && [ '$NOTESTS' = '1' ]; then phpBB/ext/$EXTNAME/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi"

View File

@@ -1,21 +1,23 @@
# mChat Extension phpBB Extension - mChat
=====================
[![Build Status](https://travis-ci.org/dmzx/mChat-Extension.svg?branch=master)](https://travis-ci.org/dmzx/mChat-Extension) [![Build Status](https://travis-ci.org/kasimi/mChat.svg?branch=master)](https://travis-ci.org/kasimi/mChat)
## Install ## Install
1. Download the latest release. 1. Download the [latest release](https://github.com/kasimi/mChat/releases).
2. Unzip the downloaded release, and change the name of the folder to `mchat`. 2. Unzip the downloaded release, and change the name of the folder to `mchat`.
3. In the `ext` directory of your phpBB board, create a new directory named `dmzx` (if it does not already exist). 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). 4. Copy the `mchat` folder to `/ext/dmzx/`. If done correctly, the folder structure should look like this: `your forum root)/ext/dmzx/mchat/composer.json`.
5. Navigate in the ACP to `Customise -> Manage extensions`. 5. Navigate in the ACP to `Customise -> Manage extensions`.
6. Look for `mChat Extension` under the Disabled Extensions list, and click its `Enable` link. 6. Look for `mChat` under the `Disabled Extensions` list, and click its `Enable` link.
## Uninstall ## Uninstall
1. Navigate in the ACP to `Customise -> Extension Management -> Extensions`. 1. Navigate in the ACP to `Customise -> Extension Management -> Extensions`.
2. Look for `mChat Extension` under the Enabled Extensions list, and click its `Disable` link. 2. Look for `mChat` 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. 3. To permanently uninstall, click `Delete Data` and then delete the `/ext/dmzx/mchat` folder.
## License ## License
[GNU General Public License v2](http://opensource.org/licenses/GPL-2.0) [GNU General Public License v2](http://opensource.org/licenses/GPL-2.0)

View File

@@ -4,7 +4,7 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
@@ -15,21 +15,21 @@ class acp_mchat_info
{ {
function module() function module()
{ {
return array( return [
'filename' => '\dmzx\mchat\acp\acp_mchat_module', 'filename' => '\dmzx\mchat\acp\acp_mchat_module',
'title' => 'ACP_CAT_MCHAT', 'title' => 'ACP_CAT_MCHAT',
'modes' => array( 'modes' => [
'globalsettings' => array( 'globalsettings' => [
'title' => 'ACP_MCHAT_GLOBALSETTINGS', 'title' => 'ACP_MCHAT_GLOBALSETTINGS',
'auth' => 'ext_dmzx/mchat && acl_a_mchat', 'auth' => 'ext_dmzx/mchat && acl_a_mchat',
'cat' => array('ACP_CAT_MCHAT'), 'cat' => ['ACP_CAT_MCHAT'],
), ],
'globalusersettings' => array( 'globalusersettings' => [
'title' => 'ACP_MCHAT_GLOBALUSERSETTINGS', 'title' => 'ACP_MCHAT_GLOBALUSERSETTINGS',
'auth' => 'ext_dmzx/mchat && acl_a_mchat', 'auth' => 'ext_dmzx/mchat && acl_a_mchat',
'cat' => array('ACP_CAT_MCHAT'), 'cat' => ['ACP_CAT_MCHAT'],
), ],
), ],
); ];
} }
} }

View File

@@ -4,7 +4,7 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
@@ -13,14 +13,17 @@ namespace dmzx\mchat\acp;
class acp_mchat_module class acp_mchat_module
{ {
public $tpl_name;
public $page_title;
public $u_action; public $u_action;
public function main($id, $mode) public function main($id, $mode)
{ {
global $phpbb_container, $user; global $phpbb_container;
// Add the ACP lang file // Add the ACP lang file
$user->add_lang_ext('dmzx/mchat', array('mchat_acp', 'mchat_ucp')); $language = $phpbb_container->get('language');
$language->add_lang(['mchat_acp', 'mchat_ucp'], 'dmzx/mchat');
// Set template // Set template
$this->tpl_name = 'acp_mchat_' . strtolower($mode); $this->tpl_name = 'acp_mchat_' . strtolower($mode);

View File

@@ -1,200 +1,315 @@
<!-- INCLUDE overall_header.html --> {% INCLUDE 'overall_header.html' %}
<h1>{L_MCHAT_TITLE}</h1> <style>
dd label span {
white-space: normal;
}
</style>
{L_MCHAT_VERSION}{L_COLON} <em>{MCHAT_VERSION}</em> <h1>{{ lang('MCHAT_TITLE') }}</h1>
<!-- IF MCHAT_ERROR --> {{ lang('MCHAT_VERSION') ~ lang('COLON') }} <em>{{ MCHAT_VERSION }}</em> | <span>{{ lang('MCHAT_REPARSER_STATUS') ~ lang('COLON') }} <span{{ S_REPARSER_ACTIVE ? ' class="errorbox"' }}>{{ lang(S_REPARSER_ACTIVE ? 'MCHAT_REPARSER_ACTIVE' : 'MCHAT_REPARSER_FINISHED') }}</span></span> <a href="https://www.phpbb.com/customise/db/extension/mchat_extension/faq/3311" title="{{ lang('MCHAT_REPARSER_STATUS') }}"><i class="icon fa-question-circle-o fa-fw" aria-hidden="true"></i></a>
{% if MCHAT_ERROR %}
<div class="errorbox"> <div class="errorbox">
<h3>{L_WARNING}</h3> <h3>{{ lang('WARNING') }}</h3>
<p>{MCHAT_ERROR}</p> <p>{{ MCHAT_ERROR }}</p>
</div> </div>
<!-- ENDIF --> {% endif %}
<form id="acp_mchat" method="post" action="{U_ACTION}"> <form id="acp_mchat" method="post" action="{{ U_ACTION }}">
<!-- IF MCHAT_PURGE and MCHAT_FOUNDER --> <fieldset>
<fieldset> <legend>{{ lang('MCHAT_SETTINGS_INDEX') }}</legend>
<legend>{L_CONFIRM}</legend>
<span>{L_MCHAT_PURGE_CONFIRM}{L_COLON}</span> {% EVENT dmzx_mchat_acp_index_height_before %}
<p class="submit-buttons">
<input class="button1" type="submit" name="mchat_purge_confirm" value="{L_YES}" />&nbsp; <dl>
<input class="button2" type="submit" value="{L_NO}" /> <dt><label for="mchat_index_height">{{ lang('MCHAT_INDEX_HEIGHT') ~ lang('COLON') }}</label><br>
{S_FORM_TOKEN} <span>{{ lang('MCHAT_INDEX_HEIGHT_EXPLAIN') }}</span></dt>
</p> <dd><input type="text" name="mchat_index_height" id="mchat_index_height" size="10" maxlength="4" value="{{ MCHAT_INDEX_HEIGHT }}">&nbsp;<span>{{ lang('PIXEL') }}</span></dd>
</fieldset> </dl>
<!-- ELSE --> <dl>
<fieldset> <dt><label for="mchat_message_num_index">{{ lang('MCHAT_MESSAGE_NUM_INDEX') ~ lang('COLON') }}</label><br>
<legend>{L_MCHAT_SETTINGS_INDEX}</legend> <span>{{ lang('MCHAT_MESSAGE_NUM_INDEX_EXPLAIN') }}</span></dt>
<dl> <dd><input type="text" name="mchat_message_num_index" id="mchat_message_num_index" size="10" maxlength="4" value="{{ MCHAT_MESSAGE_NUM_INDEX }}">&nbsp;<span>{{ lang('MCHAT_ACP_MESSAGES') }}</span></dd>
<dt><label for="mchat_index_height">{L_MCHAT_INDEX_HEIGHT}{L_COLON}</label><br /> </dl>
<span>{L_MCHAT_INDEX_HEIGHT_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_index_height" id="mchat_index_height" size="10" maxlength="4" value="{MCHAT_INDEX_HEIGHT}" /></dd> {% EVENT dmzx_mchat_acp_message_num_index_after %}
</dl>
<dl> </fieldset>
<dt><label for="mchat_message_num_index">{L_MCHAT_MESSAGE_NUM_INDEX}{L_COLON}</label><br />
<span>{L_MCHAT_MESSAGE_NUM_INDEX_EXPLAIN}</span></dt> {% EVENT acp_dmzx_mchat_globalsettings_index_after %}
<dd><input type="text" name="mchat_message_num_index" id="mchat_message_num_index" size="10" maxlength="4" value="{MCHAT_MESSAGE_NUM_INDEX}" /></dd>
</dl> <fieldset>
</fieldset> <legend>{{ lang('MCHAT_SETTINGS_CUSTOM') }}</legend>
<!-- EVENT acp_dmzx_mchat_globalsettings_index_after -->
<fieldset> {% EVENT dmzx_mchat_acp_custom_page_before %}
<legend>{L_MCHAT_SETTINGS_CUSTOM}</legend>
<dl> <dl>
<dt><label for="mchat_custom_page">{L_MCHAT_CUSTOM_PAGE}{L_COLON}</label><br /> <dt><label for="mchat_custom_page">{{ lang('MCHAT_CUSTOM_PAGE') ~ lang('COLON') }}</label></dt>
<span>{L_MCHAT_CUSTOM_PAGE_EXPLAIN}</span></dt> <dd><label><input type="radio" class="radio" name="mchat_custom_page" value="1"{% if MCHAT_CUSTOM_PAGE %} id="mchat_custom_page" checked="checked"{% endif %}> {{ lang('YES') }}</label>
<dd><label><input type="radio" class="radio" name="mchat_custom_page" value="1"<!-- IF MCHAT_CUSTOM_PAGE --> id="mchat_custom_page" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" class="radio" name="mchat_custom_page" value="0"{% if not MCHAT_CUSTOM_PAGE %} id="mchat_custom_page" checked="checked"{% endif %}> {{ lang('NO') }}</label></dd>
<label><input type="radio" class="radio" name="mchat_custom_page" value="0"<!-- IF not MCHAT_CUSTOM_PAGE --> id="mchat_custom_page" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl>
</dl> <dl>
<dl> <dt><label for="mchat_custom_height">{{ lang('MCHAT_CUSTOM_HEIGHT') ~ lang('COLON') }}</label><br>
<dt><label for="mchat_custom_height">{L_MCHAT_CUSTOM_HEIGHT}{L_COLON}</label><br /> <span>{{ lang('MCHAT_CUSTOM_HEIGHT_EXPLAIN') }}</span></dt>
<span>{L_MCHAT_CUSTOM_HEIGHT_EXPLAIN}</span></dt> <dd><input type="text" name="mchat_custom_height" id="mchat_custom_height" size="10" maxlength="4" value="{{ MCHAT_CUSTOM_HEIGHT }}">&nbsp;<span>{{ lang('PIXEL') }}</span></dd>
<dd><input type="text" name="mchat_custom_height" id="mchat_custom_height" size="10" maxlength="4" value="{MCHAT_CUSTOM_HEIGHT}" /></dd> </dl>
</dl> <dl>
<dl> <dt><label for="mchat_message_num_custom">{{ lang('MCHAT_MESSAGE_NUM_CUSTOM') ~ lang('COLON') }}</label><br>
<dt><label for="mchat_message_num_custom">{L_MCHAT_MESSAGE_NUM_CUSTOM}{L_COLON}</label><br /> <span>{{ lang('MCHAT_MESSAGE_NUM_CUSTOM_EXPLAIN') }}</span></dt>
<span>{L_MCHAT_MESSAGE_NUM_CUSTOM_EXPLAIN}</span></dt> <dd><input type="text" name="mchat_message_num_custom" id="mchat_message_num_custom" size="10" value="{{ MCHAT_MESSAGE_NUM_CUSTOM }}">&nbsp;<span>{{ lang('MCHAT_ACP_MESSAGES') }}</span></dd>
<dd><input type="text" name="mchat_message_num_custom" id="mchat_message_num_custom" size="10" value="{MCHAT_MESSAGE_NUM_CUSTOM}" /></dd> </dl>
</dl>
<dl> {% EVENT dmzx_mchat_acp_navbar_link_count_after %}
<dt><label for="mchat_navbar_link">{L_MCHAT_NAVBAR_LINK}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="mchat_navbar_link" value="1"<!-- IF MCHAT_NAVBAR_LINK --> id="mchat_navbar_link" checked="checked"<!-- ENDIF --> /> {L_YES}</label> </fieldset>
<label><input type="radio" class="radio" name="mchat_navbar_link" value="0"<!-- IF not MCHAT_NAVBAR_LINK --> id="mchat_navbar_link" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> <fieldset>
</dl> <legend>{{ lang('MCHAT_SETTINGS_ARCHIVE') }}</legend>
</fieldset>
<fieldset> {% EVENT dmzx_mchat_acp_message_num_archive_before %}
<legend>{L_MCHAT_SETTINGS_ARCHIVE}</legend>
<dl> <dl>
<dt><label for="mchat_message_num_archive">{L_MCHAT_MESSAGE_NUM_ARCHIVE}{L_COLON}</label><br /> <dt><label for="mchat_message_num_archive">{{ lang('MCHAT_MESSAGE_NUM_ARCHIVE') ~ lang('COLON') }}</label><br>
<span>{L_MCHAT_MESSAGE_NUM_ARCHIVE_EXPLAIN}</span></dt> <span>{{ lang('MCHAT_MESSAGE_NUM_ARCHIVE_EXPLAIN') }}</span></dt>
<dd><input type="text" name="mchat_message_num_archive" id="mchat_message_num_archive" size="10" value="{MCHAT_MESSAGE_NUM_ARCHIVE}" /></dd> <dd><input type="text" name="mchat_message_num_archive" id="mchat_message_num_archive" size="10" value="{{ MCHAT_MESSAGE_NUM_ARCHIVE }}">&nbsp;<span>{{ lang('MCHAT_ACP_MESSAGES') }}</span></dd>
</dl> </dl>
</fieldset>
<fieldset> {% EVENT dmzx_mchat_acp_message_num_archive_after %}
<legend>{L_MCHAT_SETTINGS_MESSAGES}</legend>
<dl> <dl>
<dt><label for="mchat_timeout">{L_MCHAT_USER_TIMEOUT}{L_COLON}</label><br /> <dt><label for="mchat_archive_sort">{{ lang('MCHAT_ARCHIVE_SORT') ~ lang('COLON') }}</label></dt>
<span>{L_MCHAT_TIMEOUT_EXPLAIN}</span></dt> <dd>
<dd><input type="text" name="mchat_timeout" id="mchat_timeout" size="10" maxlength="4" value="{MCHAT_TIMEOUT}" /></dd> <label><input type="radio" class="radio" name="mchat_archive_sort" value="0"{% if MCHAT_ARCHIVE_SORT == 0 %} id="mchat_archive_sort" checked="checked"{% endif %}> <span>{{ lang('MCHAT_ARCHIVE_SORT_TOP_BOTTOM') }}</span></label><br>
</dl> <label><input type="radio" class="radio" name="mchat_archive_sort" value="1"{% if MCHAT_ARCHIVE_SORT == 1 %} id="mchat_archive_sort" checked="checked"{% endif %}> <span>{{ lang('MCHAT_ARCHIVE_SORT_BOTTOM_TOP') }}</span></label><br>
<dl> <label><input type="radio" class="radio" name="mchat_archive_sort" value="2"{% if MCHAT_ARCHIVE_SORT == 2 %} id="mchat_archive_sort" checked="checked"{% endif %}> <span>{{ lang('MCHAT_ARCHIVE_SORT_USER') }}</span></label>
<dt><label for="mchat_refresh">{L_MCHAT_REFRESH}{L_COLON}</label><br /> </dd>
<span>{L_MCHAT_REFRESH_EXPLAIN}</span></dt> </dl>
<dd><input type="text" name="mchat_refresh" id="mchat_refresh" size="10" value="{MCHAT_REFRESH}" /></dd> </fieldset>
</dl> <fieldset>
<dl> <legend>{{ lang('MCHAT_SETTINGS_MESSAGES') }}</legend>
<dt><label for="mchat_edit_delete_limit">{L_MCHAT_EDIT_DELETE_LIMIT}{L_COLON}</label><br />
<span>{L_MCHAT_EDIT_DELETE_LIMIT_EXPLAIN}</span> {% EVENT dmzx_mchat_acp_timeout_before %}
<dd><input type="text" name="mchat_edit_delete_limit" id="mchat_edit_delete_limit" size="10" value="{MCHAT_EDIT_DELETE_LIMIT}" /></dd>
</dl> <dl>
<dl> <dt><label for="mchat_timeout">{{ lang('MCHAT_TIMEOUT') ~ lang('COLON') }}</label><br>
<dt><label for="mchat_live_updates">{L_MCHAT_LIVE_UPDATES}{L_COLON}</label><br /> <span>{{ lang('MCHAT_TIMEOUT_EXPLAIN') }}</span></dt>
<span>{L_MCHAT_LIVE_UPDATES_EXPLAIN}</span></dt> <dd><input type="text" name="mchat_timeout" id="mchat_timeout" size="10" maxlength="4" value="{{ MCHAT_TIMEOUT }}">&nbsp;<span>{{ lang('MCHAT_ACP_SECONDS') }}</span></dd>
<dd><label><input type="radio" class="radio" name="mchat_live_updates" value="1"<!-- IF MCHAT_LIVE_UPDATES --> id="mchat_live_updates" checked="checked"<!-- ENDIF --> /> {L_YES}</label> </dl>
<label><input type="radio" class="radio" name="mchat_live_updates" value="0"<!-- IF not MCHAT_LIVE_UPDATES --> id="mchat_live_updates" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> <dl>
</dl> <dt><label for="mchat_refresh">{{ lang('MCHAT_REFRESH') ~ lang('COLON') }}</label><br>
<dl> <span>{{ lang('MCHAT_REFRESH_EXPLAIN') }}</span></dt>
<dt><label for="mchat_flood_time">{L_MCHAT_FLOOD_TIME}{L_COLON}</label><br /> <dd><input type="text" name="mchat_refresh" id="mchat_refresh" size="10" value="{{ MCHAT_REFRESH }}">&nbsp;<span>{{ lang('MCHAT_ACP_SECONDS') }}</span></dd>
<span>{L_MCHAT_FLOOD_TIME_EXPLAIN}</span></dt> </dl>
<dd><input type="text" name="mchat_flood_time" id="mchat_flood_time" size="10" value="{MCHAT_FLOOD_TIME}" /></dd> <dl>
</dl> <dt><label for="mchat_edit_delete_limit">{{ lang('MCHAT_EDIT_DELETE_LIMIT') ~ lang('COLON') }}</label><br>
<dl> <span>{{ lang('MCHAT_EDIT_DELETE_LIMIT_EXPLAIN') }}</span></dt>
<dt><label for="mchat_max_message_lngth">{L_MCHAT_MAX_MESSAGE_LENGTH}{L_COLON}</label><br /> <dd><input type="text" name="mchat_edit_delete_limit" id="mchat_edit_delete_limit" size="10" value="{{ MCHAT_EDIT_DELETE_LIMIT }}">&nbsp;<span>{{ lang('MCHAT_ACP_SECONDS') }}</span></dd>
<span>{L_MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN}</span></dt> </dl>
<dd><input type="text" name="mchat_max_message_lngth" id="mchat_max_message_lngth" size="10" value="{MCHAT_MAX_MESSAGE_LNGTH}" /></dd> <dl>
</dl> <dt><label for="mchat_live_updates">{{ lang('MCHAT_LIVE_UPDATES') ~ lang('COLON') }}</label><br>
<dl> <span>{{ lang('MCHAT_LIVE_UPDATES_EXPLAIN') }}</span></dt>
<dt><label for="mchat_override_min_post_chars">{L_MCHAT_OVERRIDE_MIN_POST_CHARS}{L_COLON}</label><br /> <dd><label><input type="radio" class="radio" name="mchat_live_updates" value="1"{% if MCHAT_LIVE_UPDATES %} id="mchat_live_updates" checked="checked"{% endif %}> {{ lang('YES') }}</label>
<span>{L_MCHAT_OVERRIDE_MIN_POST_CHARS_EXPLAIN}</span></dt> <label><input type="radio" class="radio" name="mchat_live_updates" value="0"{% if not MCHAT_LIVE_UPDATES %} id="mchat_live_updates" checked="checked"{% endif %}> {{ lang('NO') }}</label></dd>
<dd><label><input type="radio" class="radio" name="mchat_override_min_post_chars" value="1"<!-- IF MCHAT_OVERRIDE_MIN_POST_CHARS --> id="mchat_override_min_post_chars" checked="checked"<!-- ENDIF --> /> {L_YES}</label> </dl>
<label><input type="radio" class="radio" name="mchat_override_min_post_chars" value="0"<!-- IF not MCHAT_OVERRIDE_MIN_POST_CHARS --> id="mchat_override_min_post_chars" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> <dl>
</dl> <dt><label for="mchat_flood_time">{{ lang('MCHAT_FLOOD_TIME') ~ lang('COLON') }}</label><br>
<dl> <span>{{ lang('MCHAT_FLOOD_TIME_EXPLAIN') }}</span></dt>
<dt><label for="mchat_override_smilie_limit">{L_MCHAT_OVERRIDE_SMILIE_LIMIT}{L_COLON}</label><br /> <dd><input type="text" name="mchat_flood_time" id="mchat_flood_time" size="10" value="{{ MCHAT_FLOOD_TIME }}">&nbsp;<span>{{ lang('MCHAT_ACP_SECONDS') }}</span></dd>
<span>{L_MCHAT_OVERRIDE_SMILIE_LIMIT_EXPLAIN}</span></dt> </dl>
<dd><label><input type="radio" class="radio" name="mchat_override_smilie_limit" value="1"<!-- IF MCHAT_OVERRIDE_SMILIE_LIMIT --> id="mchat_override_smilie_limit" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <dl>
<label><input type="radio" class="radio" name="mchat_override_smilie_limit" value="0"<!-- IF not MCHAT_OVERRIDE_SMILIE_LIMIT --> id="mchat_override_smilie_limit" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> <dt><label for="mchat_flood_messages">{{ lang('MCHAT_FLOOD_MESSAGES') ~ lang('COLON') }}</label><br>
</dl> <span>{{ lang('MCHAT_FLOOD_MESSAGES_EXPLAIN') }}</span></dt>
<dl> <dd><input type="text" name="mchat_flood_messages" id="mchat_flood_messages" size="10" value="{{ MCHAT_FLOOD_MESSAGES }}">&nbsp;<span>{{ lang('MCHAT_ACP_MESSAGES') }}</span></dd>
<dt><label for="mchat_bbcode_disallowed">{L_MCHAT_BBCODES_DISALLOWED}{L_COLON}</label><br /> </dl>
<span>{L_MCHAT_BBCODES_DISALLOWED_EXPLAIN}</span></dt> <dl>
<dd><textarea name="mchat_bbcode_disallowed" id="mchat_bbcode_disallowed" rows="3" cols="40">{MCHAT_BBCODE_DISALLOWED}</textarea></dd> <dt><label for="mchat_max_message_lngth">{{ lang('MCHAT_MAX_MESSAGE_LENGTH') ~ lang('COLON') }}</label><br>
</dl> <span>{{ lang('MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN') }}</span></dt>
<dl> <dd><input type="text" name="mchat_max_message_lngth" id="mchat_max_message_lngth" size="10" value="{{ MCHAT_MAX_MESSAGE_LNGTH }}">&nbsp;<span>{{ lang('MCHAT_ACP_CHARACTERS') }}</span></dd>
<dt><label for="mchat_rules">{L_MCHAT_RULES}{L_COLON}</label><br /> </dl>
<span>{L_MCHAT_RULES_EXPLAIN}</span></dt> <dl>
<dd><textarea name="mchat_rules" id="mchat_rules" rows="5" cols="40">{MCHAT_RULES}</textarea></dd> <dt><label for="mchat_max_input_height">{{ lang('MCHAT_MAX_INPUT_HEIGHT') ~ lang('COLON') }}</label><br>
</dl> <span>{{ lang('MCHAT_MAX_INPUT_HEIGHT_EXPLAIN') }}</span></dt>
<dl> <dd><input type="text" name="mchat_max_input_height" id="mchat_max_input_height" size="10" value="{{ MCHAT_MAX_INPUT_HEIGHT }}">&nbsp;<span>{{ lang('PIXEL') }}</span></dd>
<dt><label for="mchat_static_message">{L_MCHAT_STATIC_MESSAGE}{L_COLON}</label><br /> </dl>
<span>{L_MCHAT_STATIC_MESSAGE_EXPLAIN}</span></dt> <dl>
<dd><textarea name="mchat_static_message" id="mchat_static_message" rows="5" cols="40">{MCHAT_STATIC_MESSAGE}</textarea></dd> <dt><label for="mchat_override_min_post_chars">{{ lang('MCHAT_OVERRIDE_MIN_POST_CHARS') ~ lang('COLON') }}</label><br>
</dl> <span>{{ lang('MCHAT_OVERRIDE_MIN_POST_CHARS_EXPLAIN') }}</span></dt>
</fieldset> <dd><label><input type="radio" class="radio" name="mchat_override_min_post_chars" value="1"{% if MCHAT_OVERRIDE_MIN_POST_CHARS %} id="mchat_override_min_post_chars" checked="checked"{% endif %}> {{ lang('YES') }}</label>
<fieldset> <label><input type="radio" class="radio" name="mchat_override_min_post_chars" value="0"{% if not MCHAT_OVERRIDE_MIN_POST_CHARS %} id="mchat_override_min_post_chars" checked="checked"{% endif %}> {{ lang('NO') }}</label></dd>
<legend>{L_MCHAT_SETTINGS_POSTS}</legend> </dl>
<dl> <dl>
<dt><label for="mchat_posts_topic">{L_MCHAT_POSTS_TOPIC}{L_COLON}</label></dt> <dt><label for="mchat_override_smilie_limit">{{ lang('MCHAT_OVERRIDE_SMILIE_LIMIT') ~ lang('COLON') }}</label><br>
<dd> <span>{{ lang('MCHAT_OVERRIDE_SMILIE_LIMIT_EXPLAIN') }}</span></dt>
<label><input type="radio" name="mchat_posts_topic" value="1"<!-- IF MCHAT_POSTS_TOPIC --> id="mchat_posts_topic" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_TOPIC_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label> <dd><label><input type="radio" class="radio" name="mchat_override_smilie_limit" value="1"{% if MCHAT_OVERRIDE_SMILIE_LIMIT %} id="mchat_override_smilie_limit" checked="checked"{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" name="mchat_posts_topic" value="0"<!-- IF not MCHAT_POSTS_TOPIC --> id="mchat_posts_topic" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_TOPIC_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label> <label><input type="radio" class="radio" name="mchat_override_smilie_limit" value="0"{% if not MCHAT_OVERRIDE_SMILIE_LIMIT %} id="mchat_override_smilie_limit" checked="checked"{% endif %}> {{ lang('NO') }}</label></dd>
</dd> </dl>
</dl> <dl>
<dl> <dt><label for="mchat_bbcode_disallowed">{{ lang('MCHAT_BBCODES_DISALLOWED') ~ lang('COLON') }}</label><br>
<dt><label for="mchat_posts_reply">{L_MCHAT_POSTS_REPLY}{L_COLON}</label></dt> <span>{{ lang('MCHAT_BBCODES_DISALLOWED_EXPLAIN') }}</span></dt>
<dd> <dd><textarea name="mchat_bbcode_disallowed" id="mchat_bbcode_disallowed" rows="3" cols="40">{{ MCHAT_BBCODE_DISALLOWED }}</textarea></dd>
<label><input type="radio" name="mchat_posts_reply" value="1"<!-- IF MCHAT_POSTS_REPLY --> id="mchat_posts_reply" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_REPLY_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label> </dl>
<label><input type="radio" name="mchat_posts_reply" value="0"<!-- IF not MCHAT_POSTS_REPLY --> id="mchat_posts_reply" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_REPLY_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label> <dl>
</dd> <dt><label for="mchat_rules">{{ lang('MCHAT_RULES') ~ lang('COLON') }}</label><br>
</dl> <span>{{ lang('MCHAT_RULES_EXPLAIN') }}</span></dt>
<dl> <dd><textarea name="mchat_rules" id="mchat_rules" rows="5" cols="40">{{ MCHAT_RULES }}</textarea></dd>
<dt><label for="mchat_posts_edit">{L_MCHAT_POSTS_EDIT}{L_COLON}</label></dt> </dl>
<dd> <dl>
<label><input type="radio" name="mchat_posts_edit" value="1"<!-- IF MCHAT_POSTS_EDIT --> id="mchat_posts_edit" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_EDIT_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label> <dt><label for="mchat_static_message">{{ lang('MCHAT_STATIC_MESSAGE') ~ lang('COLON') }}</label><br>
<label><input type="radio" name="mchat_posts_edit" value="0"<!-- IF not MCHAT_POSTS_EDIT --> id="mchat_posts_edit" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_EDIT_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label> <span>{{ lang('MCHAT_STATIC_MESSAGE_EXPLAIN') }}</span></dt>
</dd> <dd><textarea name="mchat_static_message" id="mchat_static_message" rows="5" cols="40">{{ MCHAT_STATIC_MESSAGE }}</textarea></dd>
</dl> </dl>
<dl>
<dt><label for="mchat_posts_quote">{L_MCHAT_POSTS_QUOTE}{L_COLON}</label></dt> {% EVENT dmzx_mchat_acp_static_message_after %}
<dd>
<label><input type="radio" name="mchat_posts_quote" value="1"<!-- IF MCHAT_POSTS_QUOTE --> id="mchat_posts_quote" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_QUOTE_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label> </fieldset>
<label><input type="radio" name="mchat_posts_quote" value="0"<!-- IF not MCHAT_POSTS_QUOTE --> id="mchat_posts_quote" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_QUOTE_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label> <fieldset>
</dd> <legend>{{ lang('MCHAT_SETTINGS_POSTS') }}</legend>
</dl>
</fieldset> {% EVENT dmzx_mchat_acp_posts_topic_before %}
<fieldset>
<legend>{L_MCHAT_SETTINGS_STATS}</legend> <dl>
<dl> <dt><label for="mchat_posts_topic">{{ lang('MCHAT_POSTS_TOPIC') ~ lang('COLON') }}</label></dt>
<dt><label for="mchat_whois_refresh">{L_MCHAT_WHOIS_REFRESH}{L_COLON}</label><br /> <dd>
<span>{L_MCHAT_WHOIS_REFRESH_EXPLAIN}</span></dt> <label><input type="radio" name="mchat_posts_topic" value="1"{% if MCHAT_POSTS_TOPIC %} id="mchat_posts_topic" checked="checked"{% endif %}> {{ lang('YES') }}</label>
<dd><input type="text" name="mchat_whois_refresh" id="mchat_whois_refresh" size="10" value="{MCHAT_WHOIS_REFRESH}" /></dd> <label><input type="radio" name="mchat_posts_topic" value="0"{% if not MCHAT_POSTS_TOPIC %} id="mchat_posts_topic" checked="checked"{% endif %}> {{ lang('NO') }}</label>
</dl> </dd>
</fieldset> </dl>
<fieldset> <dl>
<legend>{L_MCHAT_SETTINGS_PRUNE}</legend> <dt><label for="mchat_posts_reply">{{ lang('MCHAT_POSTS_REPLY') ~ lang('COLON') }}</label></dt>
<dl> <dd>
<dt><label for="mchat_prune">{L_MCHAT_PRUNE}{L_COLON}</label><br /> <label><input type="radio" name="mchat_posts_reply" value="1"{% if MCHAT_POSTS_REPLY %} id="mchat_posts_reply" checked="checked"{% endif %}> {{ lang('YES') }}</label>
<span>{L_MCHAT_PRUNE_EXPLAIN}</span></dt> <label><input type="radio" name="mchat_posts_reply" value="0"{% if not MCHAT_POSTS_REPLY %} id="mchat_posts_reply" checked="checked"{% endif %}> {{ lang('NO') }}</label>
<dd><label><input type="radio" class="radio" name="mchat_prune" value="1"<!-- IF MCHAT_PRUNE --> id="mchat_prune" checked="checked"<!-- ENDIF --> /> {L_YES}</label> </dd>
<label><input type="radio" class="radio" name="mchat_prune" value="0"<!-- IF not MCHAT_PRUNE --> id="mchat_prune" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd> </dl>
</dl> <dl>
<dl> <dt><label for="mchat_posts_edit">{{ lang('MCHAT_POSTS_EDIT') ~ lang('COLON') }}</label></dt>
<dt><label for="mchat_prune_num">{L_MCHAT_PRUNE_NUM}{L_COLON}</label></dt> <dd>
<dd><input type="text" name="mchat_prune_num" size="10" id="mchat_prune_num" value="{MCHAT_PRUNE_NUM}" /></dd> <label><input type="radio" name="mchat_posts_edit" value="1"{% if MCHAT_POSTS_EDIT %} id="mchat_posts_edit" checked="checked"{% endif %}> {{ lang('YES') }}</label>
</dl> <label><input type="radio" name="mchat_posts_edit" value="0"{% if not MCHAT_POSTS_EDIT %} id="mchat_posts_edit" checked="checked"{% endif %}> {{ lang('NO') }}</label>
<!-- IF MCHAT_FOUNDER --> </dd>
<dl> </dl>
<dt><label for="mchat_purge">{L_MCHAT_PURGE}{L_COLON}</label></dt> <dl>
<dd><input class="button1" type="submit" id="mchat_purge" name="mchat_purge" value="{L_MCHAT_PURGE}" /></dd> <dt><label for="mchat_posts_quote">{{ lang('MCHAT_POSTS_QUOTE') ~ lang('COLON') }}</label></dt>
</dl> <dd>
<!-- ENDIF --> <label><input type="radio" name="mchat_posts_quote" value="1"{% if MCHAT_POSTS_QUOTE %} id="mchat_posts_quote" checked="checked"{% endif %}> {{ lang('YES') }}</label>
</fieldset> <label><input type="radio" name="mchat_posts_quote" value="0"{% if not MCHAT_POSTS_QUOTE %} id="mchat_posts_quote" checked="checked"{% endif %}> {{ lang('NO') }}</label>
<!-- EVENT acp_dmzx_mchat_globalsettings_after --> </dd>
</dl>
<dl>
<dt><label for="mchat_posts_login">{{ lang('MCHAT_POSTS_LOGIN') ~ lang('COLON') }}</label></dt>
<dd>
<label><input type="radio" name="mchat_posts_login" value="1"{% if MCHAT_POSTS_LOGIN %} id="mchat_posts_login" checked="checked"{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" name="mchat_posts_login" value="0"{% if not MCHAT_POSTS_LOGIN %} id="mchat_posts_login" checked="checked"{% endif %}> {{ lang('NO') }}</label>
</dd>
</dl>
<dl>
<dt><label for="mchat_posts_auth_check">{{ lang('MCHAT_POSTS_AUTH_CHECK') ~ lang('COLON') }}</label><br>
<span>{{ lang('MCHAT_POSTS_AUTH_CHECK_EXPLAIN') }}</span></dt>
<dd>
<label><input type="radio" name="mchat_posts_auth_check" value="1"{% if MCHAT_POSTS_AUTH_CHECK %} id="mchat_posts_auth_check" checked="checked"{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" name="mchat_posts_auth_check" value="0"{% if not MCHAT_POSTS_AUTH_CHECK %} id="mchat_posts_auth_check" checked="checked"{% endif %}> {{ lang('NO') }}</label>
</dd>
</dl>
{% EVENT dmzx_mchat_acp_posts_login_after %}
</fieldset>
<fieldset>
<legend>{{ lang('MCHAT_SETTINGS_STATS') }}</legend>
{% EVENT dmzx_mchat_acp_whois_refresh_before %}
<dl>
<dt><label for="mchat_whois_refresh">{{ lang('MCHAT_WHOIS_REFRESH') ~ lang('COLON') }}</label><br>
<span>{{ lang('MCHAT_WHOIS_REFRESH_EXPLAIN') }}</span></dt>
<dd><input type="text" name="mchat_whois_refresh" id="mchat_whois_refresh" size="10" value="{{ MCHAT_WHOIS_REFRESH }}">&nbsp;<span>{{ lang('MCHAT_ACP_SECONDS') }}</span></dd>
</dl>
<dl>
<dt><label for="mchat_navbar_link_count">{{ lang('MCHAT_NAVBAR_LINK_COUNT') ~ lang('COLON') }}</label></dt>
<dd><label><input type="radio" class="radio" name="mchat_navbar_link_count" value="1"{% if MCHAT_NAVBAR_LINK_COUNT %} id="mchat_navbar_link_count" checked="checked"{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" class="radio" name="mchat_navbar_link_count" value="0"{% if not MCHAT_NAVBAR_LINK_COUNT %} id="mchat_navbar_link_count" checked="checked"{% endif %}> {{ lang('NO') }}</label></dd>
</dl>
{% EVENT dmzx_mchat_acp_whois_refresh_after %}
</fieldset>
{% if MCHAT_FOUNDER %}
<fieldset>
<legend>{{ lang('MCHAT_SETTINGS_PRUNE') }}</legend>
{% EVENT dmzx_mchat_acp_prune_before %}
<dl>
<dt><label for="mchat_prune">{{ lang('MCHAT_PRUNE') ~ lang('COLON') }}</label></dt>
<dd><label><input type="radio" class="radio" name="mchat_prune" value="1"{% if MCHAT_PRUNE %} id="mchat_prune" checked="checked"{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" class="radio" name="mchat_prune" value="0"{% if not MCHAT_PRUNE %} id="mchat_prune" checked="checked"{% endif %}> {{ lang('NO') }}</label></dd>
</dl>
<dl>
<dt><label for="mchat_prune_gc">{{ lang('MCHAT_PRUNE_GC') ~ lang('COLON') }}</label><br>
<span>{{ lang('MCHAT_PRUNE_GC_EXPLAIN') }}</span></dt>
<dd><input type="text" name="mchat_prune_gc" id="mchat_prune_gc" size="10" value="{{ MCHAT_PRUNE_GC }}">&nbsp;<span>{{ lang('MCHAT_ACP_SECONDS') }}</span></dd>
</dl>
<dl>
<dt><label for="mchat_prune_num">{{ lang('MCHAT_PRUNE_NUM') ~ lang('COLON') }}</label><br>
<span>{{ lang('MCHAT_PRUNE_NUM_EXPLAIN') }}</span></dt>
<dd>
<input type="text" name="mchat_prune_num" size="10" id="mchat_prune_num" value="{{ MCHAT_PRUNE_NUM }}">
<select name="mchat_prune_mode" id="mchat_prune_mode" title="{{ lang('MCHAT_PRUNE_NUM') }}">
{{ S_MCHAT_PRUNE_MODE_OPTIONS }}
</select>
</dd>
</dl>
<dl>
<dt><label for="mchat_prune_now">{{ lang('MCHAT_PRUNE_NOW') ~ lang('COLON') }}</label></dt>
<dd>
<input class="button1" type="submit" id="mchat_prune_now" name="mchat_prune_now" value="{{ lang('MCHAT_PRUNE_NOW') }}">
<label>{{ lang('MCHAT_PRUNE_NOW_CONFIRM') ~ lang('COLON') }}</label>
<label><input type="radio" name="mchat_prune_now_confirm" value="1"> {{ lang('YES') }}</label>
<label><input type="radio" name="mchat_prune_now_confirm" value="0" id="mchat_prune_now_confirm" checked="checked"> {{ lang('NO') }}</label>
</dd>
</dl>
<dl>
<dt><label for="mchat_purge">{{ lang('MCHAT_PURGE') ~ lang('COLON') }}</label></dt>
<dd>
<input class="button1" type="submit" id="mchat_purge" name="mchat_purge" value="{{ lang('MCHAT_PURGE') }}">
<label>{{ lang('MCHAT_PURGE_CONFIRM') ~ lang('COLON') }}</label>
<label><input type="radio" name="mchat_purge_confirm" value="1"> {{ lang('YES') }}</label>
<label><input type="radio" name="mchat_purge_confirm" value="0" id="mchat_purge_confirm" checked="checked"> {{ lang('NO') }}</label>
</dd>
</dl>
{% EVENT dmzx_mchat_acp_purge_after %}
</fieldset>
<fieldset>
<legend>{{ lang('MCHAT_SETTINGS_LOG') }}</legend>
{% EVENT dmzx_mchat_acp_log_before %}
<dl>
<dt><label for="mchat_log_enabled">{{ lang('MCHAT_LOG_ENABLED') ~ lang('COLON') }}</label><br>
<span>{{ lang('MCHAT_LOG_ENABLED_EXPLAIN') }}</span></dt>
<dd><label><input type="radio" class="radio" name="mchat_log_enabled" value="1"{% if MCHAT_LOG_ENABLED %} id="mchat_log_enabled" checked="checked"{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" class="radio" name="mchat_log_enabled" value="0"{% if not MCHAT_LOG_ENABLED %} id="mchat_log_enabled" checked="checked"{% endif %}> {{ lang('NO') }}</label></dd>
</dl>
{% EVENT dmzx_mchat_acp_log_after %}
</fieldset>
{% endif %}
{% EVENT acp_dmzx_mchat_globalsettings_after %}
<fieldset>
<legend>{{ lang('ACP_SUBMIT_CHANGES') }}</legend>
<p class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{{ lang('SUBMIT') }}">&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{{ lang('RESET') }}">
{S_FORM_TOKEN}
</p> </p>
<!-- ENDIF --> {{ S_FORM_TOKEN }}
</fieldset>
</form> </form>
<!-- INCLUDE overall_footer.html --> {% INCLUDE 'overall_footer.html' %}

View File

@@ -1,28 +1,48 @@
<!-- INCLUDE overall_header.html --> {% INCLUDE 'overall_header.html' %}
<h1>{L_MCHAT_TITLE}</h1> <h1>{{ lang('MCHAT_TITLE') }}</h1>
{L_MCHAT_VERSION}{L_COLON} <em>{MCHAT_VERSION}</em> {{ lang('MCHAT_VERSION') ~ lang('COLON') }} <em>{{ MCHAT_VERSION }}</em>
<div class="successbox notice">{L_MCHAT_GLOBALUSERSETTINGS_EXPLAIN}</div> <div class="successbox notice">{{ lang('MCHAT_GLOBALUSERSETTINGS_EXPLAIN') }}</div>
<!-- IF MCHAT_ERROR --> {% if MCHAT_ERROR %}
<div class="errorbox"> <div class="errorbox">
<h3>{L_WARNING}</h3> <h3>{{ lang('WARNING') }}</h3>
<p>{MCHAT_ERROR}</p> <p>{{ MCHAT_ERROR }}</p>
</div> </div>
<!-- ENDIF --> {% endif %}
<form id="acp_mchat" method="post" action="{U_ACTION}"> <form id="acp_mchat" method="post" action="{{ U_ACTION }}">
<fieldset> <fieldset>
<legend>{L_MCHAT_ACP_GLOBALUSERSETTINGS_TITLE}</legend> <legend>{{ lang('ACP_MCHAT_GLOBALUSERSETTINGS') }}</legend>
<!-- INCLUDE acp_mchat_globalusersettings_content.html --> {% INCLUDE '@dmzx_mchat/acp_mchat_globalusersettings_content.html' %}
</fieldset> </fieldset>
<fieldset>
<legend>{{ lang('MCHAT_GLOBALUSERSETTINGS_OVERWRITE') }}</legend>
<dl>
<dt><label for="mchat_overwrite">{{ lang('MCHAT_GLOBALUSERSETTINGS_OVERWRITE') ~ lang('COLON') }}</label><br><span>{{ lang('MCHAT_GLOBALUSERSETTINGS_OVERWRITE_EXPLAIN') }}</span></dt>
<dd>
<label><input type="radio" name="mchat_overwrite" value="1"> {{ lang('YES') }}</label>
<label><input type="radio" name="mchat_overwrite" value="0" id="mchat_overwrite" checked="checked"> {{ lang('NO') }}</label>
</dd>
</dl>
<dl>
<dt><label for="mchat_overwrite_confirm">{{ lang('MCHAT_GLOBALUSERSETTINGS_OVERWRITE_CONFIRM') ~ lang('COLON') }}</label></dt>
<dd>
<label><input type="radio" name="mchat_overwrite_confirm" value="1"> {{ lang('YES') }}</label>
<label><input type="radio" name="mchat_overwrite_confirm" value="0" id="mchat_overwrite_confirm" checked="checked"> {{ lang('NO') }}</label>
</dd>
</dl>
</fieldset>
<fieldset>
<legend>{{ lang('ACP_SUBMIT_CHANGES') }}</legend>
<p class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{{ lang('SUBMIT') }}">&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{{ lang('RESET') }}">
{S_FORM_TOKEN}
</p> </p>
{{ S_FORM_TOKEN }}
</fieldset>
</form> </form>
<!-- INCLUDE overall_footer.html --> {% INCLUDE 'overall_footer.html' %}

View File

@@ -1,102 +1,108 @@
{% EVENT dmzx_mchat_acp_index_before %}
<dl> <dl>
<dt><label for="user_mchat_index">{L_MCHAT_INDEX}{L_COLON}</label></dt> <dt><label for="user_mchat_index">{{ lang('MCHAT_INDEX') ~ lang('COLON') }}</label></dt>
<dd> <dd>
<label><input type="radio" name="user_mchat_index" value="1"<!-- IF MCHAT_INDEX --> id="user_mchat_index" checked="checked"<!-- ENDIF --><!-- IF MCHAT_INDEX_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" name="user_mchat_index" value="1"{% if MCHAT_INDEX %} id="user_mchat_index" checked="checked"{% endif %}{% if MCHAT_INDEX_NOAUTH %} disabled{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" name="user_mchat_index" value="0"<!-- IF not MCHAT_INDEX --> id="user_mchat_index" checked="checked"<!-- ENDIF --><!-- IF MCHAT_INDEX_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label> <label><input type="radio" name="user_mchat_index" value="0"{% if not MCHAT_INDEX %} id="user_mchat_index" checked="checked"{% endif %}{% if MCHAT_INDEX_NOAUTH %} disabled{% endif %}> {{ lang('NO') }}</label>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="user_mchat_whois_index">{L_MCHAT_WHOIS_INDEX}{L_COLON}</label></dt> <dt><label for="user_mchat_whois_index">{{ lang('MCHAT_WHOIS_INDEX') ~ lang('COLON') }}</label></dt>
<dd> <dd>
<label><input type="radio" name="user_mchat_whois_index" value="1"<!-- IF MCHAT_WHOIS_INDEX --> id="user_mchat_whois_index" checked="checked"<!-- ENDIF --><!-- IF MCHAT_WHOIS_INDEX_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" name="user_mchat_whois_index" value="1"{% if MCHAT_WHOIS_INDEX %} id="user_mchat_whois_index" checked="checked"{% endif %}{% if MCHAT_WHOIS_INDEX_NOAUTH %} disabled{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" name="user_mchat_whois_index" value="0"<!-- IF not MCHAT_WHOIS_INDEX --> id="user_mchat_whois_index" checked="checked"<!-- ENDIF --><!-- IF MCHAT_WHOIS_INDEX_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label> <label><input type="radio" name="user_mchat_whois_index" value="0"{% if not MCHAT_WHOIS_INDEX %} id="user_mchat_whois_index" checked="checked"{% endif %}{% if MCHAT_WHOIS_INDEX_NOAUTH %} disabled{% endif %}> {{ lang('NO') }}</label>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="user_mchat_stats_index">{L_MCHAT_STATS_INDEX}{L_COLON}</label><br /><span>{L_MCHAT_STATS_INDEX_EXPLAIN}</span></dt> <dt><label for="user_mchat_stats_index">{{ lang('MCHAT_STATS_INDEX') ~ lang('COLON') }}</label><br><span>{{ lang('MCHAT_STATS_INDEX_EXPLAIN') }}</span></dt>
<dd> <dd>
<label><input type="radio" name="user_mchat_stats_index" value="1"<!-- IF MCHAT_STATS_INDEX --> id="user_mchat_stats_index" checked="checked"<!-- ENDIF --><!-- IF MCHAT_STATS_INDEX_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" name="user_mchat_stats_index" value="1"{% if MCHAT_STATS_INDEX %} id="user_mchat_stats_index" checked="checked"{% endif %}{% if MCHAT_STATS_INDEX_NOAUTH %} disabled{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" name="user_mchat_stats_index" value="0"<!-- IF not MCHAT_STATS_INDEX --> id="user_mchat_stats_index" checked="checked"<!-- ENDIF --><!-- IF MCHAT_STATS_INDEX_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label> <label><input type="radio" name="user_mchat_stats_index" value="0"{% if not MCHAT_STATS_INDEX %} id="user_mchat_stats_index" checked="checked"{% endif %}{% if MCHAT_STATS_INDEX_NOAUTH %} disabled{% endif %}> {{ lang('NO') }}</label>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="user_mchat_location">{L_MCHAT_LOCATION}{L_COLON}</label></dt> <dt><label for="user_mchat_location">{{ lang('MCHAT_LOCATION') ~ lang('COLON') }}</label></dt>
<dd> <dd>
<label><input type="radio" name="user_mchat_location" value="1"<!-- IF MCHAT_LOCATION --> id="user_mchat_location" checked="checked"<!-- ENDIF --><!-- IF MCHAT_LOCATION_NOAUTH --> disabled<!-- ENDIF --> /> {L_MCHAT_TOP}</label> <label><input type="radio" name="user_mchat_location" value="1"{% if MCHAT_LOCATION %} id="user_mchat_location" checked="checked"{% endif %}{% if MCHAT_LOCATION_NOAUTH %} disabled{% endif %}> {{ lang('MCHAT_TOP') }}</label>
<label><input type="radio" name="user_mchat_location" value="0"<!-- IF not MCHAT_LOCATION --> id="user_mchat_location" checked="checked"<!-- ENDIF --><!-- IF MCHAT_LOCATION_NOAUTH --> disabled<!-- ENDIF --> /> {L_MCHAT_BOTTOM}</label> <label><input type="radio" name="user_mchat_location" value="0"{% if not MCHAT_LOCATION %} id="user_mchat_location" checked="checked"{% endif %}{% if MCHAT_LOCATION_NOAUTH %} disabled{% endif %}> {{ lang('MCHAT_BOTTOM') }}</label>
</dd> </dd>
</dl> </dl>
<hr />
{% EVENT dmzx_mchat_acp_location_after %}
<hr>
{% EVENT dmzx_mchat_acp_message_top_before %}
<dl> <dl>
<dt><label for="user_mchat_message_top">{L_MCHAT_MESSAGE_TOP}{L_COLON}</label><br /><span>{L_MCHAT_MESSAGE_TOP_EXPLAIN}</span></dt> <dt><label for="user_mchat_message_top">{{ lang('MCHAT_MESSAGE_TOP') ~ lang('COLON') }}</label><br><span>{{ lang('MCHAT_MESSAGE_TOP_EXPLAIN') }}</span></dt>
<dd> <dd>
<label><input type="radio" name="user_mchat_message_top" value="1"<!-- IF MCHAT_MESSAGE_TOP --> id="user_mchat_message_top" checked="checked"<!-- ENDIF --><!-- IF MCHAT_MESSAGE_TOP_NOAUTH --> disabled<!-- ENDIF --> /> {L_MCHAT_TOP}</label> <label><input type="radio" name="user_mchat_message_top" value="1"{% if MCHAT_MESSAGE_TOP %} id="user_mchat_message_top" checked="checked"{% endif %}{% if MCHAT_MESSAGE_TOP_NOAUTH %} disabled{% endif %}> {{ lang('MCHAT_TOP') }}</label>
<label><input type="radio" name="user_mchat_message_top" value="0"<!-- IF not MCHAT_MESSAGE_TOP --> id="user_mchat_message_top" checked="checked"<!-- ENDIF --><!-- IF MCHAT_MESSAGE_TOP_NOAUTH --> disabled<!-- ENDIF --> /> {L_MCHAT_BOTTOM}</label> <label><input type="radio" name="user_mchat_message_top" value="0"{% if not MCHAT_MESSAGE_TOP %} id="user_mchat_message_top" checked="checked"{% endif %}{% if MCHAT_MESSAGE_TOP_NOAUTH %} disabled{% endif %}> {{ lang('MCHAT_BOTTOM') }}</label>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="user_mchat_capital_letter">{L_MCHAT_CAPITAL_LETTER}{L_COLON}</label></dt> <dt><label for="user_mchat_capital_letter">{{ lang('MCHAT_CAPITAL_LETTER') ~ lang('COLON') }}</label></dt>
<dd> <dd>
<label><input type="radio" name="user_mchat_capital_letter" value="1"<!-- IF MCHAT_CAPITAL_LETTER --> id="user_mchat_capital_letter" checked="checked"<!-- ENDIF --><!-- IF MCHAT_CAPITAL_LETTER_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" name="user_mchat_capital_letter" value="1"{% if MCHAT_CAPITAL_LETTER %} id="user_mchat_capital_letter" checked="checked"{% endif %}{% if MCHAT_CAPITAL_LETTER_NOAUTH %} disabled{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" name="user_mchat_capital_letter" value="0"<!-- IF not MCHAT_CAPITAL_LETTER --> id="user_mchat_capital_letter" checked="checked"<!-- ENDIF --><!-- IF MCHAT_CAPITAL_LETTER_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label> <label><input type="radio" name="user_mchat_capital_letter" value="0"{% if not MCHAT_CAPITAL_LETTER %} id="user_mchat_capital_letter" checked="checked"{% endif %}{% if MCHAT_CAPITAL_LETTER_NOAUTH %} disabled{% endif %}> {{ lang('NO') }}</label>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="user_mchat_sound">{L_MCHAT_SOUND}{L_COLON}</label></dt> <dt><label for="user_mchat_sound">{{ lang('MCHAT_SOUND') ~ lang('COLON') }}</label></dt>
<dd> <dd>
<label><input type="radio" name="user_mchat_sound" value="1"<!-- IF MCHAT_SOUND --> id="user_mchat_sound" checked="checked"<!-- ENDIF --><!-- IF MCHAT_SOUND_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" name="user_mchat_sound" value="1"{% if MCHAT_SOUND %} id="user_mchat_sound" checked="checked"{% endif %}{% if MCHAT_SOUND_NOAUTH %} disabled{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" name="user_mchat_sound" value="0"<!-- IF not MCHAT_SOUND --> id="user_mchat_sound" checked="checked"<!-- ENDIF --><!-- IF MCHAT_SOUND_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label> <label><input type="radio" name="user_mchat_sound" value="0"{% if not MCHAT_SOUND %} id="user_mchat_sound" checked="checked"{% endif %}{% if MCHAT_SOUND_NOAUTH %} disabled{% endif %}> {{ lang('NO') }}</label>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="user_mchat_avatars">{L_MCHAT_AVATARS}{L_COLON}</label></dt> <dt><label for="user_mchat_avatars">{{ lang('MCHAT_AVATARS') ~ lang('COLON') }}</label></dt>
<dd> <dd>
<label><input type="radio" name="user_mchat_avatars" value="1"<!-- IF MCHAT_AVATARS --> id="user_mchat_avatars" checked="checked"<!-- ENDIF --><!-- IF MCHAT_AVATARS_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" name="user_mchat_avatars" value="1"{% if MCHAT_AVATARS %} id="user_mchat_avatars" checked="checked"{% endif %}{% if MCHAT_AVATARS_NOAUTH %} disabled{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" name="user_mchat_avatars" value="0"<!-- IF not MCHAT_AVATARS --> id="user_mchat_avatars" checked="checked"<!-- ENDIF --><!-- IF MCHAT_AVATARS_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label> <label><input type="radio" name="user_mchat_avatars" value="0"{% if not MCHAT_AVATARS %} id="user_mchat_avatars" checked="checked"{% endif %}{% if MCHAT_AVATARS_NOAUTH %} disabled{% endif %}> {{ lang('NO') }}</label>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="user_mchat_input_area">{L_MCHAT_CHAT_AREA}{L_COLON}</label></dt> <dt><label for="user_mchat_character_count">{{ lang('MCHAT_DISPLAY_CHARACTER_COUNT') ~ lang('COLON') }}</label></dt>
<dd> <dd>
<label><input type="radio" name="user_mchat_input_area" value="1"<!-- IF MCHAT_INPUT_AREA --> id="user_mchat_input_area" checked="checked"<!-- ENDIF --><!-- IF MCHAT_INPUT_AREA_NOAUTH --> disabled<!-- ENDIF --> /> {L_MCHAT_INPUT_AREA}</label> <label><input type="radio" name="user_mchat_character_count" value="1"{% if MCHAT_CHARACTER_COUNT %} id="user_mchat_character_count" checked="checked"{% endif %}{% if MCHAT_CHARACTER_COUNT_NOAUTH %} disabled{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" name="user_mchat_input_area" value="0"<!-- IF not MCHAT_INPUT_AREA --> id="user_mchat_input_area" checked="checked"<!-- ENDIF --><!-- IF MCHAT_INPUT_AREA_NOAUTH --> disabled<!-- ENDIF --> /> {L_MCHAT_TEXT_AREA}</label> <label><input type="radio" name="user_mchat_character_count" value="0"{% if not MCHAT_CHARACTER_COUNT %} id="user_mchat_character_count" checked="checked"{% endif %}{% if MCHAT_CHARACTER_COUNT_NOAUTH %} disabled{% endif %}> {{ lang('NO') }}</label>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="user_mchat_character_count">{L_MCHAT_CHARACTER_COUNT}{L_COLON}</label></dt> <dt><label for="user_mchat_dateoptions">{{ lang('MCHAT_DATE_FORMAT') ~ lang('COLON') }}</label><br><span>{{ lang('MCHAT_DATE_FORMAT_EXPLAIN') }}</span></dt>
<dd> <dd>
<label><input type="radio" name="user_mchat_character_count" value="1"<!-- IF MCHAT_CHARACTER_COUNT --> id="user_mchat_character_count" checked="checked"<!-- ENDIF --><!-- IF MCHAT_CHARACTER_COUNT_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label> <select name="user_mchat_dateoptions" id="user_mchat_dateoptions" onchange="phpbb.toggleDisplay('user_mchat_custom_date', this.value == 'custom' ? 1 : -1); document.getElementById('user_mchat_date').value = this.value == 'custom' ? '{{ MCHAT_DEFAULT_DATEFORMAT | escape('js') }}' : this.value;"{% if MCHAT_DATE_NOAUTH %} disabled{% endif %}>
<label><input type="radio" name="user_mchat_character_count" value="0"<!-- IF not MCHAT_CHARACTER_COUNT --> id="user_mchat_character_count" checked="checked"<!-- ENDIF --><!-- IF MCHAT_CHARACTER_COUNT_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label> {{ S_MCHAT_DATEFORMAT_OPTIONS }}
</dd>
</dl>
<dl>
<dt><label for="user_mchat_pause_on_input">{L_MCHAT_PAUSE_ON_INPUT}{L_COLON}</label><br /><span>{L_MCHAT_PAUSE_ON_INPUT_EXPLAIN}</span></dt>
<dd>
<label><input type="radio" name="user_mchat_pause_on_input" value="1"<!-- IF MCHAT_PAUSE_ON_INPUT --> id="user_mchat_pause_on_input" checked="checked"<!-- ENDIF --><!-- IF MCHAT_PAUSE_ON_INPUT_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="user_mchat_pause_on_input" value="0"<!-- IF not MCHAT_PAUSE_ON_INPUT --> id="user_mchat_pause_on_input" checked="checked"<!-- ENDIF --><!-- IF MCHAT_PAUSE_ON_INPUT_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
<dt><label for="user_mchat_dateoptions">{L_MCHAT_DATE_FORMAT}{L_COLON}</label><br /><span>{L_MCHAT_DATE_FORMAT_EXPLAIN}</span></dt>
<dd>
<select name="user_mchat_dateoptions" id="user_mchat_dateoptions" onchange="phpbb.toggleDisplay('user_mchat_custom_date', this.value == 'custom' ? 1 : -1); document.getElementById('user_mchat_date').value = this.value == 'custom' ? '{A_MCHAT_DEFAULT_DATEFORMAT}' : this.value;"<!-- IF MCHAT_DATE_NOAUTH --> disabled<!-- ENDIF -->>
{S_MCHAT_DATEFORMAT_OPTIONS}
</select> </select>
</dd> </dd>
<dd><div id="user_mchat_custom_date"<!-- IF not S_MCHAT_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="user_mchat_date" id="user_mchat_date" value="{MCHAT_DATE}"<!-- IF MCHAT_DATE_NOAUTH --> disabled<!-- ENDIF --> /></div></dd>
</dl>
<dl>
<dt><label for="user_mchat_relative_time">{L_MCHAT_RELATIVE_TIME}{L_COLON}</label><br /><span>{L_MCHAT_RELATIVE_TIME_EXPLAIN}</span></dt>
<dd> <dd>
<label><input type="radio" name="user_mchat_relative_time" value="1"<!-- IF MCHAT_RELATIVE_TIME --> id="user_mchat_relative_time" checked="checked"<!-- ENDIF --><!-- IF MCHAT_RELATIVE_TIME_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label> <div id="user_mchat_custom_date"{% if not S_MCHAT_CUSTOM_DATEFORMAT %} style="display:none;"{% endif %}>
<label><input type="radio" name="user_mchat_relative_time" value="0"<!-- IF not MCHAT_RELATIVE_TIME --> id="user_mchat_relative_time" checked="checked"<!-- ENDIF --><!-- IF MCHAT_RELATIVE_TIME_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label> <input type="text" name="user_mchat_date" id="user_mchat_date" value="{{ MCHAT_DATE }}"{% if MCHAT_DATE_NOAUTH %} disabled{% endif %}>
</div>
</dd> </dd>
</dl> </dl>
<hr />
<dl> <dl>
<dt><label for="user_mchat_posts"><!-- IF MCHAT_POSTS_ENABLED_LANG -->{MCHAT_POSTS_ENABLED_LANG}<!-- ELSE -->{L_MCHAT_POSTS}<!-- ENDIF -->{L_COLON}</label></dt> <dt><label for="user_mchat_relative_time">{{ lang('MCHAT_RELATIVE_TIME') ~ lang('COLON') }}</label><br><span>{{ lang('MCHAT_RELATIVE_TIME_EXPLAIN') }}</span></dt>
<dd> <dd>
<label><input type="radio" name="user_mchat_posts" value="1"<!-- IF MCHAT_POSTS --> id="user_mchat_posts" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label> <label><input type="radio" name="user_mchat_relative_time" value="1"{% if MCHAT_RELATIVE_TIME %} id="user_mchat_relative_time" checked="checked"{% endif %}{% if MCHAT_RELATIVE_TIME_NOAUTH %} disabled{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" name="user_mchat_posts" value="0"<!-- IF not MCHAT_POSTS --> id="user_mchat_posts" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label> <label><input type="radio" name="user_mchat_relative_time" value="0"{% if not MCHAT_RELATIVE_TIME %} id="user_mchat_relative_time" checked="checked"{% endif %}{% if MCHAT_RELATIVE_TIME_NOAUTH %} disabled{% endif %}> {{ lang('NO') }}</label>
</dd> </dd>
</dl> </dl>
{% EVENT dmzx_mchat_acp_relative_time_after %}
<hr>
{% EVENT dmzx_mchat_acp_posts_before %}
<dl>
<dt><label for="user_mchat_posts">{% if MCHAT_POSTS_ENABLED_LANG %}{{ MCHAT_POSTS_ENABLED_LANG }}{% else %}{{ lang('MCHAT_POSTS') }}{% endif %}{{ lang('COLON') }}</label></dt>
<dd>
<label><input type="radio" name="user_mchat_posts" value="1"{% if MCHAT_POSTS %} id="user_mchat_posts" checked="checked"{% endif %}{% if MCHAT_POSTS_NOAUTH %} disabled{% endif %}> {{ lang('YES') }}</label>
<label><input type="radio" name="user_mchat_posts" value="0"{% if not MCHAT_POSTS %} id="user_mchat_posts" checked="checked"{% endif %}{% if MCHAT_POSTS_NOAUTH %} disabled{% endif %}> {{ lang('NO') }}</label>
</dd>
</dl>
{% EVENT dmzx_mchat_acp_posts_after %}

View File

@@ -1,5 +1,5 @@
<fieldset> <fieldset>
<p class="successbox notice">{L_MCHAT_ACP_USER_PREFS_EXPLAIN}</p> <p class="successbox notice">{{ lang('MCHAT_ACP_USER_PREFS_EXPLAIN') }}</p>
<legend>{L_MCHAT_PREFERENCES}</legend> <legend>{{ lang('MCHAT_PREFERENCES') }}</legend>
<!-- INCLUDE acp_mchat_globalusersettings_content.html --> {% INCLUDE '@dmzx_mchat/acp_mchat_globalusersettings_content.html' %}
</fieldset> </fieldset>

View File

@@ -1,45 +1,47 @@
{ {
"name": "dmzx/mchat", "name": "dmzx/mchat",
"type": "phpbb-extension", "type": "phpbb-extension",
"description": "mChat Extension", "description": "mChat",
"homepage": "http://www.dmzx-web.net", "homepage": "https://www.phpbb.com/customise/db/extension/mchat_extension/",
"version": "2.0.0-RC3", "version": "2.1.4",
"time": "2016-03-24", "time": "2020-08-08",
"keywords": ["phpbb", "extension", "mchat"], "keywords": ["phpbb", "extension", "mchat"],
"license": "GPL-2.0", "license": "GPL-2.0-only",
"authors": [ "authors": [
{
"name": "kasimi",
"homepage": "https://kasimi.net",
"email": "mail@kasimi.net",
"role": "Lead Developer"
},
{ {
"name": "dmzx", "name": "dmzx",
"homepage": "http://www.dmzx-web.net", "homepage": "http://www.dmzx-web.net",
"email": "info@dmzx-web.net", "email": "info@dmzx-web.net",
"role": "Extension Developer" "role": "Former Developer"
},
{
"name": "kasimi",
"homepage": "https://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=1330603",
"role": "Extension Co-Developer"
}, },
{ {
"name": "RMcGirr83", "name": "RMcGirr83",
"homepage": "http://rmcgirr83.org", "homepage": "http://rmcgirr83.org",
"role": "Author" "role": "Original MOD author"
} }
], ],
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.4.7",
"composer/installers": "~1.0"
}, },
"require-dev": { "require-dev": {
"phpbb/epv": "dev-master" "phpbb/epv": "dev-master"
}, },
"extra": { "extra": {
"display-name": "mChat Extension", "display-name": "mChat",
"soft-require": { "soft-require": {
"phpbb/phpbb": ">=3.1.7-PL1,<3.3.0@dev" "phpbb/phpbb": ">=3.2.0"
}, },
"version-check": { "version-check": {
"host": "www.dmzx-web.net", "host": "www.phpbb.com",
"directory": "/versions", "directory": "/customise/db/extension/mchat_extension",
"filename": "mchat_version.json" "filename": "version_check"
} }
} }
} }

View File

@@ -1,174 +0,0 @@
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'

View File

@@ -1,16 +1,37 @@
dmzx_mchat_controller: dmzx_mchat_page_custom_controller:
path: /mchat path: '/mchat'
methods: [GET] methods: ['GET']
defaults: { _controller: dmzx.mchat.main.controller:page, page: custom } defaults: { _controller: 'dmzx.mchat.core:page_custom' }
dmzx_mchat_page_controller: dmzx_mchat_page_archive_controller:
path: /mchat/{page} path: '/mchat/archive'
methods: [GET] methods: ['GET']
defaults: { _controller: dmzx.mchat.main.controller:page } defaults: { _controller: 'dmzx.mchat.core:page_archive' }
requirements: dmzx_mchat_page_rules_controller:
page: 'archive|rules|whois' path: '/mchat/rules'
dmzx_mchat_action_controller: methods: ['GET']
path: /mchat/action-{action} defaults: { _controller: 'dmzx.mchat.core:page_rules' }
methods: [POST] dmzx_mchat_page_whois_controller:
defaults: { _controller: dmzx.mchat.main.controller:action } path: '/mchat/whois/{ip}'
requirements: methods: ['GET']
action: 'add|edit|del|refresh|whois' defaults: { _controller: 'dmzx.mchat.core:page_whois' }
dmzx_mchat_action_add_controller:
path: '/mchat/action/add'
methods: ['POST']
defaults: { _controller: 'dmzx.mchat.core:action_add' }
dmzx_mchat_action_edit_controller:
path: '/mchat/action/edit'
methods: ['POST']
defaults: { _controller: 'dmzx.mchat.core:action_edit' }
dmzx_mchat_action_del_controller:
path: '/mchat/action/del'
methods: ['POST']
defaults: { _controller: 'dmzx.mchat.core:action_del' }
dmzx_mchat_action_refresh_controller:
path: '/mchat/action/refresh'
methods: ['POST']
defaults: { _controller: 'dmzx.mchat.core:action_refresh' }
dmzx_mchat_action_whois_controller:
path: '/mchat/action/whois'
methods: ['POST']
defaults: { _controller: 'dmzx.mchat.core:action_whois' }

View File

@@ -1,93 +1,159 @@
imports: imports:
- { resource: tables.yml } - { resource: 'tables.yml' }
- { resource: config_2_0_0.yml }
services: services:
dmzx.mchat.acp.controller: dmzx.mchat.acp.controller:
class: dmzx\mchat\controller\acp_controller class: 'dmzx\mchat\controller\acp_controller'
arguments: arguments:
- '@dmzx.mchat.functions'
- '@template' - '@template'
- '@log' - '@log'
- '@user' - '@user'
- '@language'
- '@dbal.conn' - '@dbal.conn'
- '@cache' - '@config_text'
- '@cache.driver'
- '@request' - '@request'
- '@dispatcher'
- '@dmzx.mchat.settings' - '@dmzx.mchat.settings'
- '%dmzx.mchat.table.mchat%'
- '%dmzx.mchat.table.mchat_deleted_messages%'
- '%core.root_path%'
- '%core.php_ext%'
dmzx.mchat.ucp.controller: dmzx.mchat.ucp.controller:
class: dmzx\mchat\controller\ucp_controller class: 'dmzx\mchat\controller\ucp_controller'
arguments: arguments:
- '@template' - '@template'
- '@user' - '@user'
- '@language'
- '@auth' - '@auth'
- '@dbal.conn' - '@dbal.conn'
- '@request' - '@request'
- '@dmzx.mchat.settings' - '@dmzx.mchat.settings'
- '%core.root_path%' - '@dispatcher'
- '%core.php_ext%'
dmzx.mchat.main.controller: dmzx.mchat.notifications:
class: dmzx\mchat\controller\main_controller class: 'dmzx\mchat\core\notifications'
arguments: arguments:
- '@dmzx.mchat.settings'
- '@user' - '@user'
- '@dmzx.mchat.core' - '@language'
- '@request' - '@auth'
- '@dbal.conn'
- '@dispatcher'
- '@text_formatter.parser'
dmzx.mchat.log:
class: 'dmzx\mchat\core\log'
arguments:
- '@dmzx.mchat.settings'
- '@user'
- '@dbal.conn'
- '@cache.driver'
- '@dispatcher'
dmzx.mchat.core: dmzx.mchat.core:
class: dmzx\mchat\core\mchat class: 'dmzx\mchat\core\mchat'
arguments: arguments:
- '@dmzx.mchat.functions' - '@dmzx.mchat.functions'
- '@dmzx.mchat.notifications'
- '@dmzx.mchat.settings' - '@dmzx.mchat.settings'
- '@dmzx.mchat.log'
- '@controller.helper' - '@controller.helper'
- '@template' - '@template'
- '@user' - '@user'
- '@language'
- '@auth' - '@auth'
- '@pagination' - '@pagination'
- '@request' - '@request'
- '@dispatcher' - '@dispatcher'
- '@ext.manager' - '@ext.manager'
- '%core.root_path%' - '@text_formatter.parser'
- '%core.php_ext%' - '@?phpbb.collapsiblecategories.operator'
- '@?rmcgirr83.authorizedforurls.listener'
dmzx.mchat.functions: dmzx.mchat.functions:
class: dmzx\mchat\core\functions class: 'dmzx\mchat\core\functions'
arguments: arguments:
- '@dmzx.mchat.settings' - '@dmzx.mchat.settings'
- '@dmzx.mchat.notifications'
- '@dmzx.mchat.log'
- '@user' - '@user'
- '@language'
- '@auth' - '@auth'
- '@log' - '@log'
- '@dbal.conn' - '@dbal.conn'
- '@cache.driver' - '@cache.driver'
- '@dispatcher'
- '@group_helper'
dmzx.mchat.settings:
class: 'dmzx\mchat\core\settings'
arguments:
- '@user'
- '@language'
- '@config'
- '@config_text'
- '@auth'
- '@dispatcher'
- '%core.root_path%' - '%core.root_path%'
- '%core.php_ext%' - '%core.php_ext%'
- '%dmzx.mchat.table.mchat%' - '%dmzx.mchat.table.mchat%'
- '%dmzx.mchat.table.mchat_deleted_messages%' - '%dmzx.mchat.table.mchat_log%'
- '%dmzx.mchat.table.mchat_sessions%' - '%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: dmzx.mchat.acp.listener:
class: dmzx\mchat\event\acp_listener class: 'dmzx\mchat\event\acp_listener'
arguments: arguments:
- '@template' - '@template'
- '@request' - '@request'
- '@user' - '@language'
- '@dmzx.mchat.settings' - '@dmzx.mchat.settings'
- '%core.root_path%' - '@dmzx.mchat.functions'
- '%core.php_ext%'
tags: tags:
- { name: event.listener } - { name: 'event.listener' }
dmzx.mchat.main.listener: dmzx.mchat.main.listener:
class: dmzx\mchat\event\main_listener class: 'dmzx\mchat\event\main_listener'
arguments: arguments:
- '@dmzx.mchat.core' - '@dmzx.mchat.core'
- '@dmzx.mchat.notifications'
- '@controller.helper' - '@controller.helper'
- '@user' - '@user'
- '@language'
- '@request'
- '%core.php_ext%' - '%core.php_ext%'
tags: tags:
- { name: event.listener } - { name: 'event.listener' }
dmzx.mchat.cron.task.mchat_prune:
class: 'dmzx\mchat\cron\mchat_prune'
arguments:
- '@dmzx.mchat.functions'
- '@dmzx.mchat.settings'
calls:
- ['set_name', ['cron.task.mchat_prune']]
tags:
- { name: 'cron.task' }
dmzx.mchat.text_reparser.mchat_messages:
class: 'dmzx\mchat\textreparser\plugins\mchat_messages'
arguments:
- '@dbal.conn'
- '%dmzx.mchat.table.mchat%'
calls:
- ['set_name', ['dmzx.mchat.text_reparser.mchat_messages']]
tags:
- { name: 'text_reparser.plugin' }
dmzx.mchat.text_reparser.reparser:
class: 'phpbb\cron\task\text_reparser\reparser'
arguments:
- '@config'
- '@config_text'
- '@text_reparser.lock'
- '@text_reparser.manager'
- '@text_reparser_collection'
calls:
- ['set_name', ['dmzx.mchat.text_reparser.reparser']]
- ['set_reparser', ['dmzx.mchat.text_reparser.mchat_messages']]
tags:
- { name: 'cron.task' }

View File

@@ -1,4 +1,4 @@
parameters: parameters:
dmzx.mchat.table.mchat: %core.table_prefix%mchat dmzx.mchat.table.mchat: '%core.table_prefix%mchat'
dmzx.mchat.table.mchat_deleted_messages: %core.table_prefix%mchat_deleted_messages dmzx.mchat.table.mchat_log: '%core.table_prefix%mchat_log'
dmzx.mchat.table.mchat_sessions: %core.table_prefix%mchat_sessions dmzx.mchat.table.mchat_sessions: '%core.table_prefix%mchat_sessions'

View File

@@ -4,76 +4,100 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace dmzx\mchat\controller; namespace dmzx\mchat\controller;
use dmzx\mchat\core\functions;
use dmzx\mchat\core\settings;
use phpbb\cache\driver\driver_interface as cache_interface;
use phpbb\config\db_text as config_text;
use phpbb\db\driver\driver_interface as db_interface;
use phpbb\event\dispatcher_interface;
use phpbb\language\language;
use phpbb\log\log_interface;
use phpbb\request\request_interface;
use phpbb\template\template;
use phpbb\user;
class acp_controller class acp_controller
{ {
/** @var \phpbb\template\template */ /** @var functions */
protected $mchat_functions;
/** @var template */
protected $template; protected $template;
/** @var \phpbb\log\log_interface */ /** @var log_interface */
protected $log; protected $log;
/** @var \phpbb\user */ /** @var user */
protected $user; protected $user;
/** @var \phpbb\db\driver\driver_interface */ /** @var language */
protected $lang;
/** @var db_interface */
protected $db; protected $db;
/** @var \phpbb\cache\service */ /** @var config_text */
protected $config_text;
/** @var cache_interface */
protected $cache; protected $cache;
/** @var \phpbb\request\request */ /** @var request_interface */
protected $request; protected $request;
/** @var \dmzx\mchat\core\settings */ /** @var dispatcher_interface */
protected $dispatcher;
/** @var settings */
protected $settings; protected $settings;
/** @var string */
protected $mchat_table;
/** @var string */
protected $mchat_deleted_messages_table;
/** @var string */
protected $root_path;
/** @var string */
protected $php_ext;
/** /**
* Constructor * Constructor
* *
* @param \phpbb\template\template $template * @param functions $mchat_functions
* @param \phpbb\log\log_interface $log * @param template $template
* @param \phpbb\user $user * @param log_interface $log
* @param \phpbb\db\driver\driver_interface $db * @param user $user
* @param \phpbb\cache\service $cache * @param language $lang
* @param \phpbb\request\request $request * @param db_interface $db
* @param \dmzx\mchat\core\settings $settings * @param config_text $config_text
* @param string $mchat_table * @param cache_interface $cache
* @param string $mchat_deleted_messages_table * @param request_interface $request
* @param string $root_path * @param dispatcher_interface $dispatcher
* @param string $php_ext * @param settings $settings
*/ */
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) public function __construct(
functions $mchat_functions,
template $template,
log_interface $log,
user $user,
language $lang,
db_interface $db,
config_text $config_text,
cache_interface $cache,
request_interface $request,
dispatcher_interface $dispatcher,
settings $settings
)
{ {
$this->template = $template; $this->mchat_functions = $mchat_functions;
$this->log = $log; $this->template = $template;
$this->user = $user; $this->log = $log;
$this->db = $db; $this->user = $user;
$this->cache = $cache; $this->lang = $lang;
$this->request = $request; $this->db = $db;
$this->settings = $settings; $this->config_text = $config_text;
$this->mchat_table = $mchat_table; $this->cache = $cache;
$this->mchat_deleted_messages_table = $mchat_deleted_messages_table; $this->request = $request;
$this->root_path = $root_path; $this->dispatcher = $dispatcher;
$this->php_ext = $php_ext; $this->settings = $settings;
} }
/** /**
@@ -85,28 +109,17 @@ class acp_controller
{ {
add_form_key('acp_mchat'); add_form_key('acp_mchat');
$error = array(); $error = [];
if ($this->request->is_set_post('mchat_purge')) $is_founder = $this->user->data['user_type'] == USER_FOUNDER;
$settings = array_merge($this->settings->global_settings(), $this->settings->global_text_settings());
if ($this->request->is_set_post('submit'))
{ {
$this->template->assign_var('MCHAT_PURGE', true); $mchat_new_config = [];
} $validation = [];
else if ($this->request->is_set_post('mchat_purge_confirm')) foreach ($settings as $config_name => $config_data)
{
if (check_form_key('acp_mchat') && $this->user->data['user_type'] == USER_FOUNDER)
{
$this->db->sql_query('TRUNCATE TABLE ' . $this->mchat_table);
$this->db->sql_query('TRUNCATE TABLE ' . $this->mchat_deleted_messages_table);
$this->cache->destroy('sql', $this->mchat_deleted_messages_table);
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_MCHAT_TABLE_PURGED', false, array($this->user->data['username']));
trigger_error($this->user->lang('MCHAT_PURGED') . adm_back_link($u_action));
}
}
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); $default = $this->settings->cfg($config_name);
settype($default, gettype($config_data['default'])); settype($default, gettype($config_data['default']));
@@ -117,11 +130,27 @@ class acp_controller
} }
} }
if (!function_exists('validate_data')) // Enable Emojis and rich text in Rules and Static Message
$mchat_new_config['mchat_rules'] = utf8_encode_ncr($mchat_new_config['mchat_rules']);
$mchat_new_config['mchat_static_message'] = utf8_encode_ncr($mchat_new_config['mchat_static_message']);
// Remove leading & trailing | characters to not break allowed BBCodes
$mchat_new_config['mchat_bbcode_disallowed'] = trim($mchat_new_config['mchat_bbcode_disallowed'], '|');
if (!$is_founder)
{ {
include($this->root_path . 'includes/functions_user.' . $this->php_ext); // Don't allow changing pruning settings for non founders
unset($mchat_new_config['mchat_prune']);
unset($mchat_new_config['mchat_prune_gc']);
unset($mchat_new_config['mchat_prune_mode']);
unset($mchat_new_config['mchat_prune_num']);
// Don't allow changing log settings for non founders
unset($mchat_new_config['mchat_log_enabled']);
} }
$this->settings->include_functions('user', 'validate_data');
$error = array_merge($error, validate_data($mchat_new_config, $validation)); $error = array_merge($error, validate_data($mchat_new_config, $validation));
if (!check_form_key('acp_mchat')) if (!check_form_key('acp_mchat'))
@@ -129,6 +158,20 @@ class acp_controller
$error[] = 'FORM_INVALID'; $error[] = 'FORM_INVALID';
} }
/**
* Event to modify ACP global settings data before they are updated
*
* @event dmzx.mchat.acp_globalsettings_update_data
* @var array mchat_new_config Array containing the ACP settings data that is about to be sent to the database
* @var array error Array with error lang keys
* @since 2.0.0-RC7
*/
$vars = [
'mchat_new_config',
'error',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.acp_globalsettings_update_data', compact($vars)));
if (!$error) if (!$error)
{ {
// Set the options the user configured // Set the options the user configured
@@ -138,28 +181,72 @@ class acp_controller
} }
// Add an entry into the log table // 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'])); $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_MCHAT_CONFIG_UPDATE', false, [$this->user->data['username']]);
trigger_error($this->user->lang('MCHAT_CONFIG_SAVED') . adm_back_link($u_action)); trigger_error($this->lang->lang('MCHAT_CONFIG_SAVED') . adm_back_link($u_action));
} }
// Replace "error" strings with their real, localised form // Replace "error" strings with their real, localised form
$error = array_map(array($this->user, 'lang'), $error); $error = array_map([$this->lang, 'lang'], $error);
} }
foreach (array_keys($this->settings->global) as $key) if (!$error)
{ {
$this->template->assign_var(strtoupper($key), $this->settings->cfg($key)); if ($is_founder && $this->request->is_set_post('mchat_purge') && $this->request->variable('mchat_purge_confirm', false) && check_form_key('acp_mchat'))
{
/**
* Event that is triggered right before all mChat messages are
* deleted when using the Delete all messages button in the ACP
*
* @event dmzx.mchat.purge_before
* @since 2.1.0-RC1
*/
$this->dispatcher->dispatch('dmzx.mchat.purge_before');
$this->db->sql_query('DELETE FROM ' . $this->settings->get_table_mchat());
$this->db->sql_query('DELETE FROM ' . $this->settings->get_table_mchat_log());
$this->cache->destroy('sql', $this->settings->get_table_mchat_log());
$this->mchat_functions->phpbb_log('LOG_MCHAT_TABLE_PURGED');
trigger_error($this->lang->lang('MCHAT_PURGED') . adm_back_link($u_action));
}
else if ($is_founder && $this->request->is_set_post('mchat_prune_now') && $this->request->variable('mchat_prune_now_confirm', false) && check_form_key('acp_mchat'))
{
$num_pruned_messages = count($this->mchat_functions->mchat_prune());
trigger_error($this->lang->lang('MCHAT_PRUNED', $num_pruned_messages) . adm_back_link($u_action));
}
} }
$this->template->assign_vars(array( $template_data = [
'MCHAT_ERROR' => $error ? implode('<br />', $error) : '', 'MCHAT_ERROR' => implode('<br>', $error),
'MCHAT_VERSION' => $this->settings->cfg('mchat_version'), 'MCHAT_VERSION' => $this->settings->cfg('mchat_version'),
'MCHAT_FOUNDER' => $this->user->data['user_type'] == USER_FOUNDER, 'MCHAT_FOUNDER' => $is_founder,
'L_MCHAT_BBCODES_DISALLOWED_EXPLAIN' => $this->user->lang('MCHAT_BBCODES_DISALLOWED_EXPLAIN', '<a href="' . append_sid("{$this->root_path}adm/index.$this->php_ext", 'i=bbcodes', true, $this->user->session_id) . '">', '</a>'), 'S_MCHAT_PRUNE_MODE_OPTIONS' => $this->get_prune_mode_options($this->settings->cfg('mchat_prune_mode')),
'L_MCHAT_TIMEOUT_EXPLAIN' => $this->user->lang('MCHAT_USER_TIMEOUT_EXPLAIN','<a href="' . append_sid("{$this->root_path}adm/index.$this->php_ext", 'i=board&amp;mode=load', true, $this->user->session_id) . '">', '</a>', $this->settings->cfg('session_length')), 'L_MCHAT_BBCODES_DISALLOWED_EXPLAIN' => $this->lang->lang('MCHAT_BBCODES_DISALLOWED_EXPLAIN', '<a href="' . append_sid($this->settings->url('adm/index'), ['i' => 'bbcodes']) . '">', '</a>'),
'L_MCHAT_TIMEOUT_EXPLAIN' => $this->lang->lang('MCHAT_TIMEOUT_EXPLAIN','<a href="' . append_sid($this->settings->url('adm/index'), ['i' => 'board', 'mode' => 'load']) . '">', '</a>', $this->settings->cfg('session_length')),
'S_REPARSER_ACTIVE' => $this->is_reparser_active('dmzx.mchat.text_reparser.mchat_messages'),
'U_ACTION' => $u_action, 'U_ACTION' => $u_action,
)); ];
foreach (array_keys($settings) as $key)
{
$template_data[strtoupper($key)] = $this->settings->cfg($key);
}
/**
* Event to modify ACP global settings template data
*
* @event dmzx.mchat.acp_globalsettings_modify_template_data
* @var array template_data Array containing the template data for the ACP settings
* @var array error Array with error lang keys
* @since 2.0.0-RC7
*/
$vars = [
'template_data',
'error',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.acp_globalsettings_modify_template_data', compact($vars)));
$this->template->assign_vars($template_data);
} }
/** /**
@@ -169,15 +256,13 @@ class acp_controller
{ {
add_form_key('acp_mchat'); add_form_key('acp_mchat');
$this->user->add_lang_ext('dmzx/mchat', 'mchat_ucp'); $error = [];
$error = array();
if ($this->request->is_set_post('submit')) if ($this->request->is_set_post('submit'))
{ {
$mchat_new_config = array(); $mchat_new_config = [];
$validation = array(); $validation = [];
foreach ($this->settings->ucp as $config_name => $config_data) foreach ($this->settings->ucp_settings() as $config_name => $config_data)
{ {
$default = $this->settings->cfg($config_name, true); $default = $this->settings->cfg($config_name, true);
settype($default, gettype($config_data['default'])); settype($default, gettype($config_data['default']));
@@ -189,10 +274,7 @@ class acp_controller
} }
} }
if (!function_exists('validate_data')) $this->settings->include_functions('user', 'validate_data');
{
include($this->root_path . 'includes/functions_user.' . $this->php_ext);
}
$error = array_merge($error, validate_data($mchat_new_config, $validation)); $error = array_merge($error, validate_data($mchat_new_config, $validation));
@@ -201,8 +283,40 @@ class acp_controller
$error[] = 'FORM_INVALID'; $error[] = 'FORM_INVALID';
} }
$mchat_new_user_config = [];
if ($this->request->variable('mchat_overwrite', 0) && $this->request->variable('mchat_overwrite_confirm', 0))
{
foreach ($mchat_new_config as $config_name => $config_value)
{
$mchat_new_user_config['user_' . $config_name] = $config_value;
}
}
/**
* Event to modify ACP global user settings data before they are updated
*
* @event dmzx.mchat.acp_globalusersettings_update_data
* @var array mchat_new_config Array containing the ACP global user settings data that is about to be sent to the database
* @var array mchat_new_user_config Array containing the user settings data when overwriting all user settings
* @var array error Array with error lang keys
* @since 2.0.0-RC7
*/
$vars = [
'mchat_new_config',
'mchat_new_user_config',
'error',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.acp_globalusersettings_update_data', compact($vars)));
if (!$error) if (!$error)
{ {
if ($mchat_new_user_config)
{
$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $mchat_new_user_config);
$this->db->sql_query($sql);
}
// Set the options the user configured // Set the options the user configured
foreach ($mchat_new_config as $config_name => $config_value) foreach ($mchat_new_config as $config_name => $config_value)
{ {
@@ -210,32 +324,91 @@ class acp_controller
} }
// Add an entry into the log table // 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'])); $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_MCHAT_CONFIG_UPDATE', false, [$this->user->data['username']]);
trigger_error($this->user->lang('MCHAT_CONFIG_SAVED') . adm_back_link($u_action)); trigger_error($this->lang->lang('MCHAT_CONFIG_SAVED') . adm_back_link($u_action));
} }
// Replace "error" strings with their real, localised form // Replace "error" strings with their real, localised form
$error = array_map(array($this->user, 'lang'), $error); $error = array_map([$this->lang, 'lang'], $error);
} }
foreach (array_keys($this->settings->ucp) as $key) // Force global date format for $selected_date value, not user-specific
$selected_date = $this->settings->cfg('mchat_date', true);
$template_data = $this->settings->get_date_template_data($selected_date);
foreach (array_keys($this->settings->ucp_settings()) as $key)
{ {
$this->template->assign_var(strtoupper($key), $this->settings->cfg($key, true)); $template_data[strtoupper($key)] = $this->settings->cfg($key, true);
} }
// Force global date format for $selected value, not user-specific $template_data = array_merge($template_data, [
$selected = $this->settings->cfg('mchat_date', true); 'MCHAT_POSTS_ENABLED_LANG' => $this->settings->get_enabled_post_notifications_lang(),
$date_template_data = $this->settings->get_date_template_data($selected); 'MCHAT_ERROR' => implode('<br>', $error),
$this->template->assign_vars($date_template_data); 'MCHAT_VERSION' => $this->settings->cfg('mchat_version'),
'U_ACTION' => $u_action,
]);
$notifications_template_data = $this->settings->get_enabled_post_notifications_lang(); /**
$this->template->assign_var('MCHAT_POSTS_ENABLED_LANG', $notifications_template_data); * Event to modify ACP global user settings template data
*
* @event dmzx.mchat.acp_globalusersettings_modify_template_data
* @var array template_data Array containing the template data for the ACP user settings
* @var array error Array with error lang keys
* @since 2.0.0-RC7
*/
$vars = [
'template_data',
'error',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.acp_globalusersettings_modify_template_data', compact($vars)));
$this->template->assign_vars(array( $this->template->assign_vars($template_data);
'MCHAT_ERROR' => $error ? implode('<br />', $error) : '', }
'MCHAT_VERSION' => $this->settings->cfg('mchat_version'),
'U_ACTION' => $u_action, /**
)); * @param int $selected
* @return string
*/
protected function get_prune_mode_options($selected)
{
if (empty($this->settings->prune_modes[$selected]))
{
$selected = 0;
}
$prune_mode_options = '';
foreach ($this->settings->prune_modes as $i => $prune_mode)
{
$prune_mode_options .= '<option value="' . $i . '"' . (($i == $selected) ? ' selected="selected"' : '') . '>';
$prune_mode_options .= $this->lang->lang('MCHAT_ACP_' . strtoupper($prune_mode));
$prune_mode_options .= '</option>';
}
return $prune_mode_options;
}
/**
* @param string $reparser_name
* @return bool
*/
protected function is_reparser_active($reparser_name)
{
$reparser_resume = $this->config_text->get('reparser_resume');
if (empty($reparser_resume))
{
return false;
}
$reparser_resume = @unserialize($reparser_resume);
if (!isset($reparser_resume[$reparser_name]['range-min']) || !isset($reparser_resume[$reparser_name]['range-max']))
{
return false;
}
return $reparser_resume[$reparser_name]['range-max'] >= $reparser_resume[$reparser_name]['range-min'];
} }
} }

View File

@@ -1,77 +0,0 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\controller;
use \Symfony\Component\HttpFoundation\JsonResponse;
class main_controller
{
/** @var \phpbb\user */
protected $user;
/** @var \dmzx\mchat\core\mchat */
protected $mchat;
/** @var \phpbb\request\request */
protected $request;
/**
* Constructor
*
* @param \phpbb\user $user
* @param \dmzx\mchat\core\mchat $mchat
* @param \phpbb\request\request $request
*/
public function __construct(\phpbb\user $user, \dmzx\mchat\core\mchat $mchat, \phpbb\request\request $request)
{
$this->user = $user;
$this->mchat = $mchat;
$this->request = $request;
}
/**
* Controller for mChat
*
* @param string $page The page to render, one of custom|archive|rules|whois
* @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
*/
public function page($page)
{
$this->user->add_lang_ext('dmzx/mchat', 'mchat');
return call_user_func(array($this->mchat, 'page_' . $page));
}
/**
* 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
*/
public function action($action)
{
if (!$this->request->is_ajax())
{
throw new \phpbb\exception\http_exception(403, 'NO_AUTH_OPERATION');
}
// Fix avatars & smilies
if (!defined('PHPBB_USE_BOARD_URL_PATH'))
{
define('PHPBB_USE_BOARD_URL_PATH', true);
}
$this->user->add_lang_ext('dmzx/mchat', 'mchat');
$data = call_user_func(array($this->mchat, 'action_' . $action));
return new JsonResponse($data);
}
}

View File

@@ -4,61 +4,79 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace dmzx\mchat\controller; namespace dmzx\mchat\controller;
use dmzx\mchat\core\settings;
use phpbb\auth\auth;
use phpbb\db\driver\driver_interface as db_interface;
use phpbb\event\dispatcher_interface;
use phpbb\language\language;
use phpbb\request\request_interface;
use phpbb\template\template;
use phpbb\user;
class ucp_controller class ucp_controller
{ {
/** @var \phpbb\template\template */ /** @var template */
protected $template; protected $template;
/** @var \phpbb\user */ /** @var user */
protected $user; protected $user;
/** @var \phpbb\auth\auth */ /** @var language */
protected $lang;
/** @var auth */
protected $auth; protected $auth;
/** @var \phpbb\db\driver\driver_interface */ /** @var db_interface */
protected $db; protected $db;
/** @var \phpbb\request\request */ /** @var request_interface */
protected $request; protected $request;
/** @var \dmzx\mchat\core\settings */ /** @var settings */
protected $settings; protected $mchat_settings;
/** @var string */ /** @var dispatcher_interface */
protected $root_path; protected $dispatcher;
/** @var string */
protected $php_ext;
/** /**
* Constructor * Constructor
* *
* @param \phpbb\template\template $template * @param template $template
* @param \phpbb\user $user * @param user $user
* @param \phpbb\auth\auth $auth * @param language $lang
* @param \phpbb\db\driver\driver_interface $db * @param auth $auth
* @param \phpbb\request\request $request * @param db_interface $db
* @param \dmzx\mchat\core\settings $settings * @param request_interface $request
* @param string $root_path * @param settings $mchat_settings
* @param string $php_ext * @param dispatcher_interface $dispatcher
*/ */
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) public function __construct(
template $template,
user $user,
language $lang,
auth $auth,
db_interface $db,
request_interface $request,
settings $mchat_settings,
dispatcher_interface $dispatcher
)
{ {
$this->template = $template; $this->template = $template;
$this->user = $user; $this->user = $user;
$this->auth = $auth; $this->lang = $lang;
$this->db = $db; $this->auth = $auth;
$this->request = $request; $this->db = $db;
$this->settings = $settings; $this->request = $request;
$this->root_path = $root_path; $this->mchat_settings = $mchat_settings;
$this->php_ext = $php_ext; $this->dispatcher = $dispatcher;
} }
/** /**
@@ -70,13 +88,13 @@ class ucp_controller
{ {
add_form_key('ucp_mchat'); add_form_key('ucp_mchat');
$error = array(); $error = [];
if ($this->request->is_set_post('submit')) if ($this->request->is_set_post('submit'))
{ {
$mchat_new_config = array(); $mchat_new_config = [];
$validation = array(); $validation = [];
foreach ($this->settings->ucp as $config_name => $config_data) foreach ($this->mchat_settings->ucp_settings() as $config_name => $config_data)
{ {
if ($this->auth->acl_get('u_' . $config_name)) if ($this->auth->acl_get('u_' . $config_name))
{ {
@@ -91,10 +109,7 @@ class ucp_controller
} }
} }
if (!function_exists('validate_data')) $this->mchat_settings->include_functions('user', 'validate_data');
{
include($this->root_path . 'includes/functions_user.' . $this->php_ext);
}
$error = array_merge($error, validate_data($mchat_new_config, $validation)); $error = array_merge($error, validate_data($mchat_new_config, $validation));
@@ -103,6 +118,20 @@ class ucp_controller
$error[] = 'FORM_INVALID'; $error[] = 'FORM_INVALID';
} }
/**
* Event to modify UCP settings data before they are updated
*
* @event dmzx.mchat.ucp_update_data
* @var array mchat_new_config Array containing the user settings data that are about to be sent to the database
* @var array error Array with error lang keys
* @since 2.0.0-RC7
*/
$vars = [
'mchat_new_config',
'error',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.ucp_update_data', compact($vars)));
if (!$error) if (!$error)
{ {
$sql = 'UPDATE ' . USERS_TABLE . ' $sql = 'UPDATE ' . USERS_TABLE . '
@@ -111,25 +140,26 @@ class ucp_controller
$this->db->sql_query($sql); $this->db->sql_query($sql);
meta_refresh(3, $u_action); meta_refresh(3, $u_action);
$message = $this->user->lang('PROFILE_UPDATED') . '<br /><br />' . $this->user->lang('RETURN_UCP', '<a href="' . $u_action . '">', '</a>'); $message = $this->lang->lang('PROFILE_UPDATED') . '<br><br>' . $this->lang->lang('RETURN_UCP', '<a href="' . $u_action . '">', '</a>');
trigger_error($message); trigger_error($message);
} }
// Replace "error" strings with their real, localised form // Replace "error" strings with their real, localised form
$error = array_map(array($this->user, 'lang'), $error); $error = array_map([$this->lang, 'lang'], $error);
} }
$selected_date = $this->mchat_settings->cfg('mchat_date');
$template_data = $this->mchat_settings->get_date_template_data($selected_date);
$auth_count = 0; $auth_count = 0;
foreach (array_keys($this->settings->ucp) as $config_name) foreach (array_keys($this->mchat_settings->ucp_settings()) as $config_name)
{ {
$upper = strtoupper($config_name); $upper = strtoupper($config_name);
$auth = $this->auth->acl_get('u_' . $config_name); $auth = $this->auth->acl_get('u_' . $config_name);
$this->template->assign_vars(array( $template_data[$upper] = $this->mchat_settings->cfg($config_name);
$upper => $this->settings->cfg($config_name), $template_data[$upper . '_AUTH'] = $auth;
$upper . '_AUTH' => $auth,
));
if ($auth) if ($auth)
{ {
@@ -137,17 +167,30 @@ class ucp_controller
} }
} }
$selected = $this->settings->cfg('mchat_date'); $template_data = array_merge($template_data, [
$date_template_data = $this->settings->get_date_template_data($selected); 'MCHAT_ALLOW_USE' => $this->auth->acl_get('u_mchat_use'),
$this->template->assign_vars($date_template_data); 'MCHAT_POSTS_ENABLED_LANG' => $this->mchat_settings->get_enabled_post_notifications_lang(),
'ERROR' => sizeof($error) ? implode('<br>', $error) : '',
'MCHAT_AUTH_COUNT' => $auth_count,
'S_UCP_ACTION' => $u_action,
]);
$notifications_template_data = $this->settings->get_enabled_post_notifications_lang(); /**
$this->template->assign_var('MCHAT_POSTS_ENABLED_LANG', $notifications_template_data); * Event to modify UCP settings template data
*
* @event dmzx.mchat.ucp_modify_template_data
* @var array template_data Array containing the template data for the UCP settings
* @var int auth_count Number of settings the user is authorized do see & adjust
* @var array error Array with error lang keys
* @since 2.0.0-RC7
*/
$vars = [
'template_data',
'auth_count',
'error',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.ucp_modify_template_data', compact($vars)));
$this->template->assign_vars(array( $this->template->assign_vars($template_data);
'ERROR' => sizeof($error) ? implode('<br />', $error) : '',
'MCHAT_AUTH_COUNT' => $auth_count,
'S_UCP_ACTION' => $u_action,
));
} }
} }

File diff suppressed because it is too large Load Diff

238
core/log.php Normal file
View File

@@ -0,0 +1,238 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2018 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\core;
use phpbb\cache\driver\driver_interface as cache_interface;
use phpbb\event\dispatcher_interface;
use phpbb\user;
use phpbb\db\driver\driver_interface as db_interface;
class log
{
/** @var settings */
protected $mchat_settings;
/** @var user */
protected $user;
/** @var db_interface */
protected $db;
/** @var cache_interface */
protected $cache;
/** @var dispatcher_interface */
protected $dispatcher;
/** @var array */
protected $log_types;
/**
* Constructor
*
* @param settings $mchat_settings
* @param user $user
* @param db_interface $db
* @param cache_interface $cache
* @param dispatcher_interface $dispatcher
*/
public function __construct(
settings $mchat_settings,
user $user,
db_interface $db,
cache_interface $cache,
dispatcher_interface $dispatcher
)
{
$this->mchat_settings = $mchat_settings;
$this->user = $user;
$this->db = $db;
$this->cache = $cache;
$this->dispatcher = $dispatcher;
}
/**
* Returns an array with all registered log types
*
* @return array
*/
public function get_types()
{
if (!$this->log_types)
{
// Default log types
$log_types = [
1 => 'edit',
2 => 'del',
];
/**
* Event that allows adding log types
*
* @event dmzx.mchat.log_types_init
* @var array log_types Array containing log types
* @since 2.1.0-RC1
*/
$vars = [
'log_types',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.log_types_init', compact($vars)));
$this->log_types = $log_types;
}
return $this->log_types;
}
/**
* Returns the log type ID for the given string type
*
* @param string $type
* @return int
*/
public function get_type_id($type)
{
return (int) array_search($type, $this->get_types());
}
/**
* @param string $log_type The log type, one of edit|del or a custom type
* @param int $message_id The ID of the message to which this log entry belongs
* @return int The ID of the newly added log row, or 0 if no log row was added
*/
public function add_log($log_type, $message_id)
{
$log_row = [
'log_type' => $this->get_type_id($log_type),
'user_id' => (int) $this->user->data['user_id'],
'message_id' => (int) $message_id,
'log_ip' => $this->user->ip,
'log_time' => time(),
];
$insert_log = true;
/**
* Event that allows adding log types
*
* @event dmzx.mchat.log_add_before
* @var string log_type The log type, one of edit|del or a custom type
* @var int message_id ID of the message to which this log entry belongs
* @var array log_row Array that is about to be added to the mchat_log table
* @var bool insert_log Whether or not to add the log_row
* @since 2.1.2
*/
$vars = [
'log_type',
'message_id',
'log_row',
'insert_log',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.log_add_before', compact($vars)));
if (!$insert_log)
{
return 0;
}
$sql = 'INSERT INTO ' . $this->mchat_settings->get_table_mchat_log() . ' ' . $this->db->sql_build_array('INSERT', $log_row);
$this->db->sql_query($sql);
$log_id = (int) $this->db->sql_nextid();
$this->cache->destroy('sql', $this->mchat_settings->get_table_mchat_log());
return $log_id;
}
/**
* Fetches log entries from the database and sorts them
*
* @param int $log_id The ID of the latest log entry that the user has
* @return array
*/
public function get_logs($log_id)
{
$sql_array = [
'SELECT' => 'ml.*',
'FROM' => [$this->mchat_settings->get_table_mchat_log() => 'ml'],
'WHERE' => 'ml.log_id > ' . (int) $log_id,
];
$sql = $this->db->sql_build_query('SELECT', $sql_array);
$result = $this->db->sql_query($sql, 3600);
$rows = $this->db->sql_fetchrowset($result);
$this->db->sql_freeresult($result);
$log_rows = array_merge(array_fill_keys($this->get_types(), []), [
'latest' => (int) $log_id,
]);
$log_types = $this->get_types();
$edit_delete_limit = $this->mchat_settings->cfg('mchat_edit_delete_limit');
$time_limit = $edit_delete_limit ? time() - $edit_delete_limit : 0;
foreach ($rows as $log_row)
{
$log_rows['latest'] = max($log_rows['latest'], (int) $log_row['log_id']);
$log_type = $log_row['log_type'];
if (isset($log_types[$log_type]))
{
if ($log_row['user_id'] != $this->user->data['user_id'] && $log_row['log_time'] > $time_limit)
{
$log_type_name = $log_types[$log_type];
$log_rows[$log_type_name][] = (int) $log_row['message_id'];
}
}
/**
* Event that allows processing log messages
*
* @event dmzx.mchat.action_refresh_process_log_row
* @var array log_row The log data (read only)
* @since 2.0.0-RC6
* @changed 2.1.2 Removed response
*/
$vars = [
'log_row',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.action_refresh_process_log_row', compact($vars)));
unset($log_row);
}
return $log_rows;
}
/**
* Fetches the highest log ID
*
* @return int
*/
public function get_latest_id()
{
$sql_array = [
'SELECT' => 'ml.log_id',
'FROM' => [$this->mchat_settings->get_table_mchat_log() => 'ml'],
'ORDER_BY' => 'log_id DESC',
];
$sql = $this->db->sql_build_query('SELECT', $sql_array);
$result = $this->db->sql_query_limit($sql, 1);
$max_log_id = (int) $this->db->sql_fetchfield('log_id');
$this->db->sql_freeresult($result);
return $max_log_id;
}
}

File diff suppressed because it is too large Load Diff

453
core/notifications.php Normal file
View File

@@ -0,0 +1,453 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2018 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\core;
use phpbb\auth\auth;
use phpbb\event\dispatcher_interface;
use phpbb\language\language;
use phpbb\textformatter\parser_interface;
use phpbb\user;
use phpbb\db\driver\driver_interface as db_interface;
class notifications
{
/**
* Value of the phpbb_mchat.post_id field for login notification
* messages if the user session is visible at the time of login
*/
const LOGIN_VISIBLE = 1;
/**
* Value of the phpbb_mchat.post_id field for login notification
* messages if the user session is hidden at the time of login
*/
const LOGIN_HIDDEN = 2;
/**
* A notification of a new topic, quote, edit or reply
*/
const POST = 3;
/** @var settings */
protected $mchat_settings;
/** @var user */
protected $user;
/** @var language */
protected $lang;
/** @var auth */
protected $auth;
/** @var db_interface */
protected $db;
/** @var dispatcher_interface */
protected $dispatcher;
/** @var parser_interface */
protected $textformatter_parser;
/**
* Constructor
*
* @param settings $mchat_settings
* @param user $user
* @param language $lang
* @param auth $auth
* @param db_interface $db
* @param dispatcher_interface $dispatcher
* @param parser_interface $textformatter_parser
*/
public function __construct(
settings $mchat_settings,
user $user,
language $lang,
auth $auth,
db_interface $db,
dispatcher_interface $dispatcher,
parser_interface $textformatter_parser
)
{
$this->mchat_settings = $mchat_settings;
$this->user = $user;
$this->lang = $lang;
$this->auth = $auth;
$this->db = $db;
$this->dispatcher = $dispatcher;
$this->textformatter_parser = $textformatter_parser;
}
/**
* Checks whether or not the given message row is a notification
*
* @param array $row The message row
* @return int the notification type, or 0 if the $row is not a notification
*/
public function is_notification($row)
{
// If post_id is 0 it's not a notification
if (isset($row['post_id']) && $row['post_id'])
{
// If forum_id is 0 it's a login notification
if (isset($row['forum_id']) && !$row['forum_id'])
{
// post_id is either LOGIN_VISIBLE or LOGIN_HIDDEN
return $row['post_id'];
}
return self::POST;
}
return 0;
}
/**
* Checks the post rows for notifications and converts their language keys
*
* @param array $rows The rows to modify
* @return array
*/
public function process($rows)
{
// All language keys of valid notifications. We need to check for them here because
// notifications in < 2.0.0-RC6 are plain text and don't need to be processed.
$notification_lang = [
'MCHAT_NEW_POST',
'MCHAT_NEW_QUOTE',
'MCHAT_NEW_EDIT',
'MCHAT_NEW_REPLY',
'MCHAT_NEW_LOGIN',
];
/**
* Event that allows to modify rows and language keys before checking for notifications
*
* @event dmzx.mchat.process_notifications_before
* @var array rows Message rows about to be checked for notifications
* @var array notification_lang Unprocessed language keys of valid/known notifications
* @since 2.1.4-RC1
*/
$vars = [
'rows',
'notification_lang',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.process_notifications_before', compact($vars)));
$notification_langs = array_merge(
// Raw notification messages in phpBB < 3.2
array_combine($notification_lang, $notification_lang),
// XML notification messages in phpBB >= 3.2
array_combine(array_map([$this->textformatter_parser, 'parse'], $notification_lang), $notification_lang)
);
$notifications = [];
$post_ids = [];
foreach ($rows as $i => $row)
{
$type = $this->is_notification($row);
if ($type && isset($notification_langs[$row['message']]))
{
$notifications[$i] = $type;
if ($type == self::POST)
{
$post_ids[$i] = $row['post_id'];
}
}
}
$notification_post_data = $this->mchat_get_post_data($post_ids);
foreach ($notifications as $i => $type)
{
$lang_key = $notification_langs[$rows[$i]['message']];
$post_data = $type == self::POST ? $notification_post_data[$post_ids[$i]] : null;
$rows[$i] = $this->process_notification($rows[$i], $type, $lang_key, $post_data);
}
/**
* Event that allows to modify rows after processing their notifications
*
* @event dmzx.mchat.process_notifications_after
* @var array rows Message rows about to be checked for notifications
* @var array notification_lang Unprocessed language keys of valid/known notifications
* @var array notification_langs Processed language keys of valid/known notifications
* @var array notification_post_data Post data of notifications found in the rows array
* @since 2.1.4-RC1
*/
$vars = [
'rows',
'notification_lang',
'notification_langs',
'notification_post_data',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.process_notifications_after', compact($vars)));
return $rows;
}
/**
* Fetches post subjects and their forum names. If a post_id can't be found the value for the post_id is set to null.
*
* @param array $post_ids
* @return array
*/
protected function mchat_get_post_data($post_ids)
{
if (!$post_ids)
{
return [];
}
$sql_array = [
'SELECT' => 'p.post_id, p.post_subject, f.forum_id, f.forum_name',
'FROM' => [POSTS_TABLE => 'p', FORUMS_TABLE => 'f'],
'WHERE' => 'p.forum_id = f.forum_id AND ' . $this->db->sql_in_set('p.post_id', $post_ids),
];
$sql = $this->db->sql_build_query('SELECT', $sql_array);
$result = $this->db->sql_query($sql);
$rows = $this->db->sql_fetchrowset($result);
$this->db->sql_freeresult($result);
$existing_post_ids = array_column($rows, 'post_id');
$existing_posts = array_combine($existing_post_ids, $rows);
// Map IDs of missing posts to null
$missing_posts = array_fill_keys(array_diff($post_ids, $existing_post_ids), null);
return $existing_posts + $missing_posts;
}
/**
* Converts the message field of the post row so that it can be passed to generate_text_for_display()
*
* @param array $row
* @param int $type
* @param string $lang_key
* @param array $post_data
* @return array
*/
protected function process_notification($row, $type, $lang_key, $post_data = null)
{
$lang_args = [];
$replacements = [];
$post_subject_placeholder = '%POST_SUBJECT%';
$forum_name_placeholder = '%FORUM_NAME%';
if ($type == self::POST)
{
if ($post_data)
{
$viewtopic_url = append_sid($this->mchat_settings->url('viewtopic', true), [
'p' => $row['post_id'],
'#' => 'p' . $row['post_id'],
]);
// We prefer $post_data because it was fetched from the forums table just now.
// $row might contain outdated data if a post was moved to a new forum.
$forum_id = isset($post_data['forum_id']) ? $post_data['forum_id'] : $row['forum_id'];
$viewforum_url = append_sid($this->mchat_settings->url('viewforum', true), [
'f' => $forum_id,
]);
$lang_args[] = '[url=' . $viewtopic_url . ']' . $post_subject_placeholder . '[/url]';
$lang_args[] = '[url=' . $viewforum_url . ']' . $forum_name_placeholder . '[/url]';
$replacements = [
$post_subject_placeholder => $post_data['post_subject'],
$forum_name_placeholder => $post_data['forum_name'],
];
}
else
{
$lang_key .= '_DELETED';
}
}
else if ($type == self::LOGIN_HIDDEN)
{
$row['username'] = '<em>' . $row['username'] . '</em>';
}
$row['message'] = $this->lang->lang_array($lang_key, $lang_args);
// Quick'n'dirty check if BBCodes are in the message
if (strpos($row['message'], '[') !== false)
{
generate_text_for_storage($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options'], true, true, true, true, true, true, true, 'mchat');
}
$row['message'] = strtr($row['message'], $replacements);
return $row;
}
/**
* Inserts a message with posting information into the database
*
* @param string $mode One of post|quote|edit|reply
* @param int $forum_id
* @param int $post_id
*/
public function insert_post($mode, $forum_id, $post_id)
{
$this->insert($mode, $forum_id, $post_id);
}
/**
* Inserts a message with login information into the database
*
* @param bool $is_hidden
*/
public function insert_login($is_hidden)
{
$this->insert('login', 0, $is_hidden ? self::LOGIN_HIDDEN : self::LOGIN_VISIBLE);
}
/**
* Inserts a message with posting or login information into the database
*
* @param string $mode One of post|quote|edit|reply|login
* @param int $forum_id
* @param int $post_id Can be 0 if mode is login.
*/
protected function insert($mode, $forum_id, $post_id)
{
$mode_config = [
'post' => 'mchat_posts_topic',
'quote' => 'mchat_posts_quote',
'edit' => 'mchat_posts_edit',
'reply' => 'mchat_posts_reply',
'login' => 'mchat_posts_login',
];
$is_mode_enabled = !empty($mode_config[$mode]) && $this->mchat_settings->cfg($mode_config[$mode]) && (!$this->mchat_settings->cfg('mchat_posts_auth_check') || $this->can_use_mchat());
$sql_array = [
'forum_id' => (int) $forum_id,
'post_id' => (int) $post_id,
'user_id' => (int) $this->user->data['user_id'],
'user_ip' => $this->user->ip,
'message' => $this->textformatter_parser->parse('MCHAT_NEW_' . strtoupper($mode)),
'message_time' => time(),
];
/**
* Event that allows to modify data of a posting or login notification before it is inserted in the database
*
* @event dmzx.mchat.insert_posting_before
* @var string mode The posting mode, one of post|quote|edit|reply|login
* @var int forum_id The ID of the forum where the post was made, or 0 if mode is login.
* @var int post_id The ID of the post that was made. If mode is login this value is
* one of the constants LOGIN_HIDDEN|LOGIN_VISIBLE
* @var array is_mode_enabled Whether or not the posting should be added to the database.
* @var array sql_array An array containing the data that is about to be inserted into the messages table.
* @since 2.0.0-RC6
* @changed 2.1.0-RC1 Removed is_hidden_login
*/
$vars = [
'mode',
'forum_id',
'post_id',
'is_mode_enabled',
'sql_array',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.insert_posting_before', compact($vars)));
if ($is_mode_enabled)
{
$sql = 'INSERT INTO ' . $this->mchat_settings->get_table_mchat() . ' ' . $this->db->sql_build_array('INSERT', $sql_array);
$this->db->sql_query($sql);
}
}
/**
* The user might have just logged in successfully in which case the permissions haven't been updated yet.
* Let's do that here so that notifications are recorded correctly.
*
* @return bool
*/
protected function can_use_mchat()
{
if ($this->auth->acl_get('u_mchat_use'))
{
return true;
}
$auth = new auth();
$auth->acl($this->user->data);
return $auth->acl_get('u_mchat_use');
}
/**
* Generates an SQL WHERE condition to include or exlude notifacation
* messages based on the current user's settings and permissions
*
* @param string $mode One of user|exclude. user mode uses the current user's settings to decide which notifications
* to exclude. exclude mode always excludes all notifications.
* @return string
*/
public function get_sql_where($mode = 'user')
{
// Exclude all post notifications
if ($mode == 'exclude' || !$this->mchat_settings->cfg('mchat_posts'))
{
return 'm.post_id = 0';
}
// If the current user doesn't have permission to see hidden users, exclude their login posts
if (!$this->auth->acl_get('u_viewonline'))
{
return implode(' OR ', [
'm.post_id <> ' . self::LOGIN_HIDDEN, // Exclude all notifications that were created by hidden users ...
'm.user_id = ' . (int) $this->user->data['user_id'], // ... but include all login notifications of the current user
'm.forum_id <> 0', // ... and include all post notifications
]);
}
return '';
}
/**
* Delete post notification messages, for example when disapproving posts
*
* @param array $post_ids
*/
public function delete_post_notifications($post_ids)
{
if ($post_ids)
{
$sql = 'DELETE FROM ' . $this->mchat_settings->get_table_mchat() . '
WHERE forum_id <> 0 AND ' . $this->db->sql_in_set('post_id', $post_ids);
$this->db->sql_query($sql);
}
}
/**
* Change the user to which a post notification belongs
*
* @param int $post_id
* @param int $user_id
*/
public function update_post_notification_user($post_id, $user_id)
{
$sql = 'UPDATE ' . $this->mchat_settings->get_table_mchat() . '
SET user_id = ' . (int) $user_id . '
WHERE forum_id <> 0 AND post_id = ' . (int) $post_id;
$this->db->sql_query($sql);
}
}

View File

@@ -4,71 +4,333 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace dmzx\mchat\core; namespace dmzx\mchat\core;
use phpbb\auth\auth;
use phpbb\config\config;
use phpbb\config\db_text;
use phpbb\event\dispatcher_interface;
use phpbb\exception\runtime_exception;
use phpbb\language\language;
use phpbb\user;
class settings class settings
{ {
const VALIDATE_TYPE = 0; /** @var user */
const VALIDATE_IS_OPTIONAL = 1;
const VALIDATE_MIN_VALUE = 2;
const VALIDATE_MAX_VALUE = 3;
/** @var \phpbb\user */
protected $user; protected $user;
/** @var \phpbb\config\config */ /** @var language */
protected $lang;
/** @var config */
protected $config; protected $config;
/** @var \phpbb\auth\auth */ /** @var db_text */
protected $config_text;
/** @var auth */
protected $auth; protected $auth;
/** @var array */ /** @var dispatcher_interface */
public $global; protected $dispatcher;
/** @var array */ /** @var string */
public $ucp; protected $root_path;
/** @var bool */ /** @var string */
public $is_phpbb31; protected $php_ext;
/** @var bool */ /** @var string */
public $is_phpbb32; protected $mchat_table;
/** @var string */
protected $mchat_log_table;
/** @var string */
protected $mchat_sessions_table;
/** @var string */
protected $board_url;
/**
* Keys for global settings that only the administrator is allowed to modify.
* The values are stored in the phpbb_config table.
*
* @var array
*/
protected $global_settings;
/**
* Keys for global text settings that only the administrator is allowed to modify.
* The values are stored in the phpbb_config_text table.
*
* @var array
*/
protected $global_text_settings;
/**
* Values for global text settings.
*
* @var array
*/
protected $global_text_values;
/**
* Keys for user-specific settings for which the administrator can set default
* values as well as adjust permissions to allow users to customize them.
* The values are stored in the phpbb_users table as well as the phpbb_config table.
* If a user has permission to customize a setting, the value in the phpbb_users
* table is used, otherwise the value in the phpbb_config table is used.
*
* @var array
*/
protected $ucp_settings;
/**
* Prune modes listed in the ACP. For values other than messages the key is the
* amount of hours that is later multiplied with the value that is set in the ACP.
*
* @var array
*/
public $prune_modes = [
0 => 'messages',
1 => 'hours',
24 => 'days',
168 => 'weeks',
];
/**
* Possible values of the global setting mchat_archive_sort
*/
const ARCHIVE_SORT_TOP_BOTTOM = 0;
const ARCHIVE_SORT_BOTTOM_TOP = 1;
const ARCHIVE_SORT_USER = 2;
/** /**
* Constructor * Constructor
* *
* @param \phpbb\user $user * @param user $user
* @param \phpbb\config\config $config * @param language $lang
* @param \phpbb\auth\auth $auth * @param config $config
* @param array $global * @param db_text $config_text
* @param array $ucp * @param auth $auth
* @param dispatcher_interface $dispatcher
* @param string $root_path
* @param string $php_ext
* @param string $mchat_table
* @param string $mchat_log_table
* @param string $mchat_sessions_table
*/ */
public function __construct(\phpbb\user $user, \phpbb\config\config $config, \phpbb\auth\auth $auth, $global, $ucp) public function __construct(
user $user,
language $lang,
config $config,
db_text $config_text,
auth $auth,
dispatcher_interface $dispatcher,
$root_path,
$php_ext,
$mchat_table,
$mchat_log_table,
$mchat_sessions_table
)
{ {
$this->user = $user; $this->user = $user;
$this->config = $config; $this->lang = $lang;
$this->auth = $auth; $this->config = $config;
$this->global = $global; $this->config_text = $config_text;
$this->ucp = $ucp; $this->auth = $auth;
$this->dispatcher = $dispatcher;
$this->is_phpbb31 = phpbb_version_compare($config['version'], '3.1.0@dev', '>=') && phpbb_version_compare($config['version'], '3.2.0@dev', '<'); $this->root_path = $root_path;
$this->is_phpbb32 = phpbb_version_compare($config['version'], '3.2.0@dev', '>=') && phpbb_version_compare($config['version'], '3.3.0@dev', '<'); $this->php_ext = $php_ext;
$this->mchat_table = $mchat_table;
$this->inject_core_config_values(); $this->mchat_log_table = $mchat_log_table;
$this->mchat_sessions_table = $mchat_sessions_table;
} }
/** /**
* Writes phpBB config values into the mChat config for validating input data * @return array
*/ */
protected function inject_core_config_values() public function initialize_global_settings()
{ {
// Limit mChat session timeout to phpBB session length $global_settings = [
$this->global['mchat_timeout']['validation'][self::VALIDATE_MAX_VALUE] = (int) $this->cfg('session_length'); 'mchat_archive_sort' => ['default' => self::ARCHIVE_SORT_BOTTOM_TOP],
'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, 3600]],
'mchat_flood_messages' => ['default' => 0, 'validation' => ['num', false, 0, 100]],
'mchat_index_height' => ['default' => 250, 'validation' => ['num', false, 50, 1000]],
'mchat_live_updates' => ['default' => 1],
'mchat_log_enabled' => ['default' => 1],
'mchat_max_input_height' => ['default' => 150, 'validation' => ['num', false, 0, 1000]],
'mchat_max_message_lngth' => ['default' => 500],
'mchat_message_num_archive' => ['default' => 25, 'validation' => ['num', false, 10, 100]],
'mchat_message_num_custom' => ['default' => 10],
'mchat_message_num_index' => ['default' => 10],
'mchat_navbar_link_count' => ['default' => 1],
'mchat_override_min_post_chars' => ['default' => 0],
'mchat_override_smilie_limit' => ['default' => 0],
'mchat_posts_auth_check' => ['default' => 0],
'mchat_posts_edit' => ['default' => 0],
'mchat_posts_quote' => ['default' => 0],
'mchat_posts_reply' => ['default' => 0],
'mchat_posts_topic' => ['default' => 0],
'mchat_posts_login' => ['default' => 0],
'mchat_prune' => ['default' => 0],
'mchat_prune_gc' => ['default' => strtotime('1 day', 0)],
'mchat_prune_mode' => ['default' => 0],
'mchat_prune_num' => ['default' => 0],
'mchat_refresh' => ['default' => 10, 'validation' => ['num', false, 2, 3600]],
'mchat_timeout' => ['default' => 0, 'validation' => ['num', false, 0, (int) $this->cfg('session_length')]],
'mchat_whois_refresh' => ['default' => 60, 'validation' => ['num', false, 10, 300]],
];
/**
* Event to modify global settings data
*
* @event dmzx.mchat.global_settings_modify
* @var array global_settings Array containing global settings data
* @since 2.0.0-RC7
*/
$vars = [
'global_settings',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.global_settings_modify', compact($vars)));
return $global_settings;
}
/**
* @return array
*/
public function initialize_global_text_settings()
{
$global_text_settings = [
'mchat_rules' => ['default' => ''],
'mchat_static_message' => ['default' => ''],
];
/**
* Event to modify global text settings data
*
* @event dmzx.mchat.global_text_settings_modify
* @var array global_text_settings Array containing global text settings data
* @since 2.0.2
*/
$vars = [
'global_text_settings',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.global_text_settings_modify', compact($vars)));
return $global_text_settings;
}
/**
* @return array
*/
public function initialize_ucp_settings()
{
$ucp_settings = [
'mchat_avatars' => ['default' => 1],
'mchat_capital_letter' => ['default' => 1],
'mchat_character_count' => ['default' => 1],
'mchat_date' => ['default' => 'D M d, Y g:i a', 'validation' => ['string', false, 0, 64]],
'mchat_index' => ['default' => 1],
'mchat_location' => ['default' => 1],
'mchat_message_top' => ['default' => 1],
'mchat_posts' => ['default' => 1],
'mchat_relative_time' => ['default' => 1],
'mchat_sound' => ['default' => 1],
'mchat_stats_index' => ['default' => 0],
'mchat_whois_index' => ['default' => 1],
];
/**
* Event to modify UCP settings data
*
* @event dmzx.mchat.ucp_settings_modify
* @var array ucp_settings Array containing UCP settings data
* @since 2.0.0-RC7
*/
$vars = [
'ucp_settings',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.ucp_settings_modify', compact($vars)));
return $ucp_settings;
}
/**
* @return array
*/
public function global_settings()
{
if (empty($this->global_settings))
{
$this->global_settings = $this->initialize_global_settings();
}
return $this->global_settings;
}
/**
* @return array
*/
public function global_text_settings()
{
if (empty($this->global_text_settings))
{
$this->global_text_settings = $this->initialize_global_text_settings();
}
return $this->global_text_settings;
}
/**
* @return array
*/
public function global_text_values()
{
if (empty($this->global_text_values))
{
$global_text_values = $this->config_text->get_array(array_keys($this->global_text_settings()));
/**
* Event to modify global text values
*
* @event dmzx.mchat.global_text_values_modify
* @var array global_text_values Array containing global text values
* @since 2.0.2
*/
$vars = [
'global_text_values',
];
extract($this->dispatcher->trigger_event('dmzx.mchat.global_text_values_modify', compact($vars)));
$this->global_text_values = $global_text_values;
}
return $this->global_text_values;
}
/**
* @return array
*/
public function ucp_settings()
{
if (empty($this->ucp_settings))
{
$this->ucp_settings = $this->initialize_ucp_settings();
}
return $this->ucp_settings;
} }
/** /**
@@ -84,27 +346,91 @@ class settings
/** /**
* @param string $config * @param string $config
* @param array $user_data * @param array $user_data
* @param \phpbb\auth\auth $auth * @param auth $auth
* @param bool $force_global * @param bool $force_global
* @return string * @return string
*/ */
public function cfg_user($config, $user_data, $auth, $force_global = false) public function cfg_user($config, $user_data, $auth, $force_global = false)
{ {
if (!$force_global && isset($this->ucp[$config]) && $auth->acl_get('u_' . $config)) if (!$force_global)
{ {
return $user_data['user_' . $config]; $ucp_settings = $this->ucp_settings();
if (isset($ucp_settings[$config]) && $auth->acl_get('u_' . $config))
{
return $user_data['user_' . $config];
}
} }
return $this->config[$config]; if (isset($this->config[$config]))
{
return $this->config[$config];
}
$global_text_settings = $this->global_text_settings();
if (isset($global_text_settings[$config]))
{
$global_text_values = $this->global_text_values();
return $global_text_values[$config];
}
throw new runtime_exception();
} }
/** /**
* @param $config * @param string $config
* @param $value * @param mixed $value
* @param bool $volatile
*/ */
public function set_cfg($config, $value) public function set_cfg($config, $value, $volatile = false)
{ {
$this->config->set($config, $value); $global_text_settings = $this->global_text_settings();
if (isset($global_text_settings[$config]))
{
$this->global_text_values[$config] = $value;
if (!$volatile)
{
$this->config_text->set($config, $value);
}
return;
}
if ($volatile)
{
$this->config[$config] = $value;
}
else
{
$this->config->set($config, $value);
}
}
/**
* @return string
*/
public function get_table_mchat()
{
return $this->mchat_table;
}
/**
* @return string
*/
public function get_table_mchat_log()
{
return $this->mchat_log_table;
}
/**
* @return string
*/
public function get_table_mchat_sessions()
{
return $this->mchat_sessions_table;
} }
/** /**
@@ -114,29 +440,32 @@ class settings
public function get_date_template_data($selected) public function get_date_template_data($selected)
{ {
$dateformat_options = ''; $dateformat_options = '';
$dateformats = $this->lang->lang_raw('dateformats');
foreach ($this->user->lang['dateformats'] as $format => $null) foreach (array_keys($dateformats) as $format)
{ {
$dateformat_options .= '<option value="' . $format . '"' . (($format == $selected) ? ' selected="selected"' : '') . '>'; $dateformat_options .= '<option value="' . $format . '"' . (($format == $selected) ? ' selected="selected"' : '') . '>';
$dateformat_options .= $this->user->format_date(time(), $format, false) . ((strpos($format, '|') !== false) ? $this->user->lang('VARIANT_DATE_SEPARATOR') . $this->user->format_date(time(), $format, true) : ''); $dateformat_options .= $this->user->format_date(time(), $format, false) . ((strpos($format, '|') !== false) ? $this->lang->lang('VARIANT_DATE_SEPARATOR') . $this->user->format_date(time(), $format, true) : '');
$dateformat_options .= '</option>'; $dateformat_options .= '</option>';
} }
$s_custom = false; $s_custom = false;
$dateformat_options .= '<option value="custom"'; $dateformat_options .= '<option value="custom"';
if (!isset($this->user->lang['dateformats'][$selected])) if (!isset($dateformats[$selected]))
{ {
$dateformat_options .= ' selected="selected"'; $dateformat_options .= ' selected="selected"';
$s_custom = true; $s_custom = true;
} }
$dateformat_options .= '>' . $this->user->lang('MCHAT_CUSTOM_DATEFORMAT') . '</option>'; $dateformat_options .= '>' . $this->lang->lang('MCHAT_CUSTOM_DATEFORMAT') . '</option>';
return array( $ucp_settings = $this->ucp_settings();
return [
'S_MCHAT_DATEFORMAT_OPTIONS' => $dateformat_options, 'S_MCHAT_DATEFORMAT_OPTIONS' => $dateformat_options,
'A_MCHAT_DEFAULT_DATEFORMAT' => addslashes($this->ucp['mchat_date']['default']), 'MCHAT_DEFAULT_DATEFORMAT' => $ucp_settings['mchat_date']['default'],
'S_MCHAT_CUSTOM_DATEFORMAT' => $s_custom, 'S_MCHAT_CUSTOM_DATEFORMAT' => $s_custom,
); ];
} }
/** /**
@@ -144,16 +473,72 @@ class settings
*/ */
public function get_enabled_post_notifications_lang() public function get_enabled_post_notifications_lang()
{ {
$enabled_notifications_lang = array(); $enabled_notifications_lang = [];
foreach (array('topic', 'reply', 'quote', 'edit') as $notification) foreach (['topic', 'reply', 'quote', 'edit', 'login'] as $notification)
{ {
if ($this->cfg('mchat_posts_' . $notification)) if ($this->cfg('mchat_posts_' . $notification))
{ {
$enabled_notifications_lang[] = $this->user->lang('MCHAT_POSTS_' . strtoupper($notification)); $enabled_notifications_lang[] = $this->lang->lang('MCHAT_POSTS_' . strtoupper($notification));
} }
} }
return implode($this->user->lang('COMMA_SEPARATOR'), $enabled_notifications_lang); return implode($this->lang->lang('COMMA_SEPARATOR'), $enabled_notifications_lang);
}
/**
* @return string
*/
public function get_current_page()
{
$page = $this->user->page['page_name'];
// Remove app.php if URL rewriting is enabled in the ACP
if ($this->config['enable_mod_rewrite'])
{
$app_php = 'app.' . $this->php_ext . '/';
if (($app_position = strpos($page, $app_php)) !== false)
{
$page = substr($page, $app_position + strlen($app_php));
}
}
return generate_board_url() . '/' . $page;
}
/**
* @param string $path
* @param bool $absolute_url
* @param bool $append_ext
* @return string
*/
public function url($path, $absolute_url = false, $append_ext = true)
{
if ($absolute_url && !$this->board_url)
{
$this->board_url = generate_board_url() . '/';
}
$url = ($absolute_url ? $this->board_url : $this->root_path) . $path;
if ($append_ext)
{
$url .= '.' . $this->php_ext;
}
return $url;
}
/**
* @param string $file
* @param string $function
*/
public function include_functions($file, $function)
{
if (!function_exists($function))
{
include($this->root_path . 'includes/functions_' . $file . '.' . $this->php_ext);
}
} }
} }

72
cron/mchat_prune.php Normal file
View File

@@ -0,0 +1,72 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\cron;
use dmzx\mchat\core\functions;
use dmzx\mchat\core\settings;
use phpbb\cron\task\base;
class mchat_prune extends base
{
/** @var functions */
protected $mchat_functions;
/** @var settings */
protected $mchat_settings;
/**
* Constructor
*
* @param functions $mchat_functions
* @param settings $mchat_settings
*/
public function __construct(
functions $mchat_functions,
settings $mchat_settings
)
{
$this->mchat_functions = $mchat_functions;
$this->mchat_settings = $mchat_settings;
}
/**
* Runs this cron task.
*/
public function run()
{
$this->mchat_functions->mchat_prune();
$this->mchat_settings->set_cfg('mchat_prune_last_gc', time());
}
/**
* Returns whether this cron task can run, given current board configuration.
*
* If warnings are set to never expire, this cron task will not run.
*
* @return bool
*/
public function is_runnable()
{
return $this->mchat_settings->cfg('mchat_prune');
}
/**
* Returns whether this cron task should run now, because enough time
* has passed since it was last run (24 hours).
*
* @return bool
*/
public function should_run()
{
return $this->mchat_settings->cfg('mchat_prune_last_gc') < time() - $this->mchat_settings->cfg('mchat_prune_gc');
}
}

View File

@@ -4,80 +4,97 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace dmzx\mchat\event; namespace dmzx\mchat\event;
use dmzx\mchat\core\functions;
use dmzx\mchat\core\settings;
use phpbb\auth\auth;
use phpbb\event\data;
use phpbb\language\language;
use phpbb\request\request_interface;
use phpbb\template\template;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class acp_listener implements EventSubscriberInterface class acp_listener implements EventSubscriberInterface
{ {
/** @var \phpbb\template\template */ /** @var template */
protected $template; protected $template;
/** @var \phpbb\request\request */ /** @var request_interface */
protected $request; protected $request;
/** @var \phpbb\user */ /** @var language */
protected $user; protected $lang;
/** @var \dmzx\mchat\core\settings */ /** @var settings */
protected $settings; protected $mchat_settings;
/** @var string */ /** @var functions */
protected $root_path; protected $mchat_functions;
/** @var string */
protected $php_ext;
/** /**
* Constructor * Constructor
* *
* @param \phpbb\template\template $template * @param template $template
* @param \phpbb\request\request $request * @param request_interface $request
* @param \phpbb\user $user * @param language $lang
* @param \dmzx\mchat\core\settings $settings * @param settings $mchat_settings
* @param string $root_path * @param functions $mchat_functions
* @param string $php_ext
*/ */
public function __construct(\phpbb\template\template $template, \phpbb\request\request $request, \phpbb\user $user, \dmzx\mchat\core\settings $settings, $root_path, $php_ext) public function __construct(
template $template,
request_interface $request,
language $lang,
settings $mchat_settings,
functions $mchat_functions
)
{ {
$this->template = $template; $this->template = $template;
$this->request = $request; $this->request = $request;
$this->user = $user; $this->lang = $lang;
$this->settings = $settings; $this->mchat_settings = $mchat_settings;
$this->root_path = $root_path; $this->mchat_functions = $mchat_functions;
$this->php_ext = $php_ext;
} }
/** /**
* @return array * @return array
*/ */
static public function getSubscribedEvents() public static function getSubscribedEvents()
{ {
return array( return [
'core.permissions' => 'permissions', 'core.permissions' => 'permissions',
'core.acp_users_prefs_modify_sql' => 'acp_users_prefs_modify_sql', 'core.acp_users_prefs_modify_sql' => 'acp_users_prefs_modify_sql',
'core.acp_users_prefs_modify_template_data' => 'acp_users_prefs_modify_template_data', 'core.acp_users_prefs_modify_template_data' => 'acp_users_prefs_modify_template_data',
); 'core.acp_users_overview_before' => 'acp_users_overview_before',
'core.delete_user_after' => 'delete_user_after',
];
} }
/** /**
* @param object $event The event object * @param data $event
*/ */
public function permissions($event) public function permissions(data $event)
{ {
$mchat_permissions = array(); $ucp_configs = [];
$permission_categories = array( foreach (array_keys($this->mchat_settings->ucp_settings()) as $config_name)
'mchat' => array( {
$ucp_configs[] = 'u_' . $config_name;
}
$permission_categories = [
'mchat' => [
'u_mchat_use', 'u_mchat_use',
'u_mchat_view', 'u_mchat_view',
'u_mchat_edit', 'u_mchat_edit',
'u_mchat_delete', 'u_mchat_delete',
'u_mchat_moderator_edit',
'u_mchat_moderator_delete',
'u_mchat_ip', 'u_mchat_ip',
'u_mchat_pm', 'u_mchat_pm',
'u_mchat_like', 'u_mchat_like',
@@ -88,44 +105,46 @@ class acp_listener implements EventSubscriberInterface
'u_mchat_smilies', 'u_mchat_smilies',
'u_mchat_urls', 'u_mchat_urls',
'a_mchat', 'a_mchat',
), ],
'mchat_user_config' => array_map(function($key) { return 'u_' . $key; }, array_keys($this->settings->ucp)), 'mchat_user_config' => $ucp_configs,
); ];
$mchat_permissions = [];
foreach ($permission_categories as $cat => $permissions) foreach ($permission_categories as $cat => $permissions)
{ {
foreach ($permissions as $permission) foreach ($permissions as $permission)
{ {
$mchat_permissions[$permission] = array( $mchat_permissions[$permission] = [
'lang' => 'ACL_' . strtoupper($permission), 'lang' => 'ACL_' . strtoupper($permission),
'cat' => $cat, 'cat' => $cat,
); ];
} }
} }
$event['permissions'] = array_merge($event['permissions'], $mchat_permissions); $event['permissions'] = array_merge($event['permissions'], $mchat_permissions);
$event['categories'] = array_merge($event['categories'], array( $event['categories'] = array_merge($event['categories'], [
'mchat' => 'ACP_CAT_MCHAT', 'mchat' => 'ACP_CAT_MCHAT',
'mchat_user_config' => 'ACP_CAT_MCHAT_USER_CONFIG' 'mchat_user_config' => 'ACP_CAT_MCHAT_USER_CONFIG',
)); ]);
} }
/** /**
* @param object $event The event object * @param data $event
*/ */
public function acp_users_prefs_modify_sql($event) public function acp_users_prefs_modify_sql(data $event)
{ {
$sql_ary = array(); $sql_ary = [];
$validation = array(); $validation = [];
$user_id = $event['user_row']['user_id']; $user_id = $event['user_row']['user_id'];
$auth = new \phpbb\auth\auth(); $auth = new auth();
$userdata = $auth->obtain_user_data($user_id); $userdata = $auth->obtain_user_data($user_id);
$auth->acl($userdata); $auth->acl($userdata);
foreach ($this->settings->ucp as $config_name => $config_data) foreach ($this->mchat_settings->ucp_settings() as $config_name => $config_data)
{ {
if ($auth->acl_get('u_' . $config_name)) if ($auth->acl_get('u_' . $config_name))
{ {
@@ -140,42 +159,63 @@ class acp_listener implements EventSubscriberInterface
} }
} }
if (!function_exists('validate_data')) $this->mchat_settings->include_functions('user', 'validate_data');
{
include($this->root_path . 'includes/functions_user.' . $this->php_ext);
}
$event['error'] = array_merge($event['error'], validate_data($sql_ary, $validation)); $event['error'] = array_merge($event['error'], validate_data($sql_ary, $validation));
$event['sql_ary'] = array_merge($event['sql_ary'], $sql_ary); $event['sql_ary'] = array_merge($event['sql_ary'], $sql_ary);
} }
/** /**
* @param object $event The event object * @param data $event
*/ */
public function acp_users_prefs_modify_template_data($event) public function acp_users_prefs_modify_template_data(data $event)
{ {
$this->user->add_lang_ext('dmzx/mchat', 'mchat_ucp'); $this->lang->add_lang(['mchat_acp', 'mchat_ucp'], 'dmzx/mchat');
$user_id = $event['user_row']['user_id']; $user_id = (int) $event['user_row']['user_id'];
$auth = new \phpbb\auth\auth(); $auth = new auth();
$userdata = $auth->obtain_user_data($user_id); $userdata = $auth->obtain_user_data($user_id);
$auth->acl($userdata); $auth->acl($userdata);
$selected = $this->settings->cfg_user('mchat_date', $event['user_row'], $auth); $selected = $this->mchat_settings->cfg_user('mchat_date', $event['user_row'], $auth);
$date_template_data = $this->settings->get_date_template_data($selected); $date_template_data = $this->mchat_settings->get_date_template_data($selected);
$this->template->assign_vars($date_template_data); $this->template->assign_vars($date_template_data);
$notifications_template_data = $this->settings->get_enabled_post_notifications_lang(); $notifications_template_data = $this->mchat_settings->get_enabled_post_notifications_lang();
$this->template->assign_var('MCHAT_POSTS_ENABLED_LANG', $notifications_template_data); $this->template->assign_var('MCHAT_POSTS_ENABLED_LANG', $notifications_template_data);
foreach (array_keys($this->settings->ucp) as $config_name) foreach (array_keys($this->mchat_settings->ucp_settings()) as $config_name)
{ {
$upper = strtoupper($config_name); $upper = strtoupper($config_name);
$this->template->assign_vars(array( $this->template->assign_vars([
$upper => $this->settings->cfg_user($config_name, $event['user_row'], $auth), $upper => $this->mchat_settings->cfg_user($config_name, $event['user_row'], $auth),
$upper . '_NOAUTH' => !$auth->acl_get('u_' . $config_name, $user_id), $upper . '_NOAUTH' => !$auth->acl_get('u_' . $config_name, $user_id),
)); ]);
}
}
/**
*
*/
public function acp_users_overview_before()
{
$this->lang->add_lang('mchat_acp', 'dmzx/mchat');
$this->template->assign_vars([
'L_RETAIN_POSTS' => $this->lang->lang('MCHAT_RETAIN_MESSAGES', $this->lang->lang('RETAIN_POSTS')),
'L_DELETE_POSTS' => $this->lang->lang('MCHAT_DELETE_MESSAGES', $this->lang->lang('DELETE_POSTS')),
]);
}
/**
* @param data $event
*/
public function delete_user_after(data $event)
{
if ($event['mode'] == 'remove')
{
$this->mchat_functions->mchat_prune($event['user_ids']);
} }
} }
} }

View File

@@ -4,123 +4,217 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace dmzx\mchat\event; namespace dmzx\mchat\event;
use dmzx\mchat\core\mchat;
use dmzx\mchat\core\notifications;
use phpbb\controller\helper;
use phpbb\event\data;
use phpbb\language\language;
use phpbb\request\request_interface;
use phpbb\user;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class main_listener implements EventSubscriberInterface class main_listener implements EventSubscriberInterface
{ {
/** @var \dmzx\mchat\core\mchat */ /** @var mchat */
protected $mchat; protected $mchat;
/** @var \phpbb\controller\helper */ /** @var notifications */
protected $mchat_notifications;
/** @var helper */
protected $helper; protected $helper;
/** @var \phpbb\user */ /** @var user */
protected $user; protected $user;
/** @var language */
protected $lang;
/** @var request_interface */
protected $request;
/** @var string */ /** @var string */
protected $php_ext; protected $php_ext;
/** /**
* Constructor * Constructor
* *
* @param \dmzx\mchat\core\mchat $mchat * @param mchat $mchat
* @param \phpbb\controller\helper $helper * @param notifications $mchat_notifications
* @param \phpbb\user $user * @param helper $helper
* @param string $php_ext * @param user $user
* @param language $lang
* @param request_interface $request
* @param string $php_ext
*/ */
public function __construct(\dmzx\mchat\core\mchat $mchat, \phpbb\controller\helper $helper, \phpbb\user $user, $php_ext) public function __construct(
mchat $mchat,
notifications $mchat_notifications,
helper $helper,
user $user,
language $lang,
request_interface $request,
$php_ext
)
{ {
$this->mchat = $mchat; $this->mchat = $mchat;
$this->helper = $helper; $this->mchat_notifications = $mchat_notifications;
$this->user = $user; $this->helper = $helper;
$this->php_ext = $php_ext; $this->user = $user;
$this->lang = $lang;
$this->request = $request;
$this->php_ext = $php_ext;
} }
/** /**
* @return array * @return array
*/ */
static public function getSubscribedEvents() public static function getSubscribedEvents()
{ {
return array( return [
'core.viewonline_overwrite_location' => 'add_page_viewonline', 'core.viewonline_overwrite_location' => 'add_page_viewonline',
'core.user_setup' => 'load_language_on_setup', 'core.user_setup' => 'load_language_on_setup',
'core.page_header' => 'add_page_header_link', 'core.page_header' => 'add_page_header_link',
'core.index_modify_page_title' => 'display_mchat_on_index', 'core.index_modify_page_title' => 'display_mchat_on_index',
'core.posting_modify_submit_post_after' => 'posting_modify_submit_post_after', 'core.submit_post_end' => 'insert_posting',
'core.display_custom_bbcodes_modify_sql' => 'display_custom_bbcodes_modify_sql', 'core.delete_posts_after' => 'delete_posts_after',
); 'core.display_custom_bbcodes_modify_sql' => [['remove_disallowed_bbcodes'], ['pm_compose_add_quote']],
'core.generate_smilies_after' => 'generate_smilies_after',
'core.user_add_modify_data' => 'user_registration_set_default_values',
'core.mcp_change_poster_after' => 'mcp_change_poster_after',
'core.login_box_redirect' => 'user_login_success',
'core.session_gc_after' => 'session_gc',
];
} }
/** /**
* @param object $event The event object * @param data $event
*/ */
public function add_page_viewonline($event) public function add_page_viewonline(data $event)
{ {
if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/mchat') === 0) if (strrpos($event['row']['session_page'], 'app.' . $this->php_ext . '/mchat') === 0)
{ {
$event['location'] = $this->user->lang('MCHAT_TITLE'); $event['location'] = $this->lang->lang('MCHAT_TITLE');
$event['location_url'] = $this->helper->route('dmzx_mchat_controller'); $event['location_url'] = $this->helper->route('dmzx_mchat_page_custom_controller');
} }
} }
/** /**
* @param object $event The event object * @param data $event
*/ */
public function load_language_on_setup($event) public function load_language_on_setup(data $event)
{ {
$lang_set_ext = $event['lang_set_ext']; $lang_set_ext = $event['lang_set_ext'];
$lang_set_ext[] = array( $lang_set_ext[] = [
'ext_name' => 'dmzx/mchat', 'ext_name' => 'dmzx/mchat',
'lang_set' => 'common', 'lang_set' => 'common',
); ];
$event['lang_set_ext'] = $lang_set_ext; $event['lang_set_ext'] = $lang_set_ext;
} }
/** /**
* Create a URL to the mchat controller file for the header linklist * Create a URL to the mchat controller file for the header linklist
*
* @param object $event The event object
*/ */
public function add_page_header_link($event) public function add_page_header_link()
{ {
$this->mchat->render_page_header_link(); $this->mchat->render_page_header_link();
} }
/** /**
* Check if mchat should be displayed on index. * Check if mchat should be displayed on index.
*
* @param object $event The event object
*/ */
public function display_mchat_on_index($event) public function display_mchat_on_index()
{ {
$this->mchat->page_index(); $this->mchat->page_index();
} }
/** /**
* @param object $event The event object * @param data $event
*/ */
public function posting_modify_submit_post_after($event) public function insert_posting(data $event)
{ {
$this->mchat->insert_posting($event['mode'], array( $this->mchat_notifications->insert_post($event['mode'], $event['data']['forum_id'], $event['data']['post_id']);
'forum_id' => $event['forum_id'],
'forum_name' => $event['post_data']['forum_name'],
'post_id' => $event['data']['post_id'],
'post_subject' => $event['post_data']['post_subject'],
));
} }
/** /**
* @param object $event The event object * @param data $event
*/ */
public function display_custom_bbcodes_modify_sql($event) public function delete_posts_after(data $event)
{
$this->mchat_notifications->delete_post_notifications($event['post_ids']);
}
/**
* @param data $event
*/
public function remove_disallowed_bbcodes(data $event)
{ {
$event['sql_ary'] = $this->mchat->remove_disallowed_bbcodes($event['sql_ary']); $event['sql_ary'] = $this->mchat->remove_disallowed_bbcodes($event['sql_ary']);
$this->mchat->set_custom_bbcodes_generated(true);
}
/**
*
*/
public function generate_smilies_after()
{
$this->mchat->set_smilies_generated(true);
}
/**
* @param data $event
*/
public function user_registration_set_default_values(data $event)
{
$event['sql_ary'] = $this->mchat->set_user_default_values($event['sql_ary']);
}
/**
* @param data $event
*/
public function mcp_change_poster_after(data $event)
{
$this->mchat_notifications->update_post_notification_user($event['post_info']['post_id'], $event['userdata']['user_id']);
}
/**
* @param data $event
*/
public function user_login_success(data $event)
{
if (!$event['admin'])
{
$is_hidden = $this->request->is_set_post('viewonline') || !$this->user->data['user_allow_viewonline'];
$this->mchat_notifications->insert_login($is_hidden);
}
}
/**
*
*/
public function pm_compose_add_quote()
{
$mchat_message_id = $this->request->variable('mchat_pm_quote_message', 0);
if ($mchat_message_id)
{
$this->mchat->quote_message_text($mchat_message_id);
}
}
/**
*
*/
public function session_gc()
{
$this->mchat->session_gc();
} }
} }

69
ext.php
View File

@@ -4,17 +4,21 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace dmzx\mchat; namespace dmzx\mchat;
class ext extends \phpbb\extension\base use phpbb\extension\base;
class ext extends base
{ {
/** /**
* Requires phpBB 3.1.7-PL1 due to usage of \phpbb\session:update_session_infos() * Requires phpBB 3.1.7-PL1 due to usage of \phpbb\session:update_session_infos()
* Requires phpBB 3.1.8-RC1 due to HTTPS in version check
* Requires phpBB 3.2.0 due to EoL of phpBB 3.1
* *
* @return bool * @return bool
* @access public * @access public
@@ -22,6 +26,65 @@ class ext extends \phpbb\extension\base
public function is_enableable() public function is_enableable()
{ {
$config = $this->container->get('config'); $config = $this->container->get('config');
return phpbb_version_compare($config['version'], '3.1.7-PL1', '>=');
// Here we check if any modules from the mChat MOD for phpBB 3.0.x are still in the database.
// This is_enableable() method is called multiple times during the installation but we only
// need to do the following check once. Checking for the absence of the mchat_version value
// in the config guarantees that we're in the very first step of the installation process.
// Any later call of this method doesn't need to check this again and in fact will wrongly
// detect the extension's modules as being remnants.
if (empty($config['mchat_version']))
{
$table_prefix = $this->container->getParameter('core.table_prefix');
$module_ids = $this->get_old_module_ids($table_prefix);
if ($module_ids)
{
$lang = $this->container->get('language');
$lang->add_lang('mchat_acp', 'dmzx/mchat');
$php_ext = $this->container->getParameter('core.php_ext');
$error_msg = $lang->lang('MCHAT_30X_REMNANTS', $table_prefix, implode($lang->lang('COMMA_SEPARATOR'), $module_ids)) . adm_back_link(append_sid('index.' . $php_ext, ['i' => 'acp_extensions', 'mode' => 'main']));
trigger_error($error_msg, E_USER_WARNING);
}
}
return phpbb_version_compare(PHPBB_VERSION, '3.2.0', '>=') && phpbb_version_compare(PHP_VERSION, '5.4.7', '>=');
}
/**
* This method checks whether the phpbb_modules table contains remnants of the 3.0 MOD.
* It returns an array of the modules' IDs, or an empty array if no old modules are found.
*
* @param string $table_prefix
* @return array
*/
protected function get_old_module_ids($table_prefix)
{
$db = $this->container->get('dbal.conn');
$mchat_30x_module_langnames = [
'ACP_CAT_MCHAT',
'ACP_MCHAT_CONFIG',
'ACP_USER_MCHAT',
'UCP_CAT_MCHAT',
'UCP_MCHAT_CONFIG',
];
$sql = 'SELECT module_id
FROM ' . $table_prefix . 'modules
WHERE ' . $db->sql_in_set('module_langname', $mchat_30x_module_langnames);
$result = $db->sql_query($sql);
$rows = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$module_ids = [];
foreach ($rows as $row)
{
$module_ids[] = $row['module_id'];
}
return $module_ids;
} }
} }

82
language/de/common.php Normal file
View File

@@ -0,0 +1,82 @@
<?php
/**
*
* @package phpBB Extension - mChat [German]
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (empty($lang) || !is_array($lang))
{
$lang = [];
}
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters for use
// » “ ” …
$lang = array_merge($lang, [
'MCHAT_TITLE' => 'Tippliga Würzburg Shoutbox',
'MCHAT_TITLE_COUNT' => [
0 => 'Shoutbox',
1 => 'Shoutbox [<strong>%1$d</strong>]',
],
'MCHAT_NAVBAR_CUSTOM_PAGE' => 'Shoutbox Seite',
'MCHAT_NAVBAR_ARCHIVE' => 'Archiv',
'MCHAT_NAVBAR_RULES' => 'Regeln',
// Who is chatting
'MCHAT_WHO_IS_CHATTING' => 'Wer chattet',
'MCHAT_ONLINE_USERS_TOTAL' => [
0 => 'Niemand ist im Chat',
1 => '<strong>%1$d</strong> Benutzer chattet',
2 => '<strong>%1$d</strong> Benutzer chatten',
],
'MCHAT_ONLINE_EXPLAIN' => 'basierend auf den aktiven Besuchern der letzten %1$s',
'MCHAT_HOURS' => [
1 => '%1$d Stunde',
2 => '%1$d Stunden',
],
'MCHAT_MINUTES' => [
1 => '%1$d Minute',
2 => '%1$d Minuten',
],
'MCHAT_SECONDS' => [
1 => '%1$d Sekunde',
2 => '%1$d Sekunden',
],
// Custom translations for administrators
'MCHAT_RULES_MESSAGE' => '',
'MCHAT_STATIC_MESSAGE' => '',
// 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' => 'erstellte einen neuen Beitrag: %1$s in %2$s',
'MCHAT_NEW_POST_DELETED' => 'erstellte einen neuen Beitrag, der gelöscht wurde',
'MCHAT_NEW_REPLY' => 'erstellte eine neue Antwort: %1$s in %2$s',
'MCHAT_NEW_REPLY_DELETED' => 'erstellte eine Antwort, die gelöscht wurde',
'MCHAT_NEW_QUOTE' => 'antwortete mit einem Zitat: %1$s in %2$s',
'MCHAT_NEW_QUOTE_DELETED' => 'erstellte eine Zitatantwort, die gelöscht wurde',
'MCHAT_NEW_EDIT' => 'bearbeitete einen Beitrag: %1$s in %2$s',
'MCHAT_NEW_EDIT_DELETED' => 'bearbeitete einen Beitrag, der gelöscht wurde',
'MCHAT_NEW_LOGIN' => 'hat sich angemeldet',
]);

View File

@@ -0,0 +1,50 @@
<?php
/**
*
* @package phpBB Extension - mChat [German]
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (empty($lang) || !is_array($lang))
{
$lang = [];
}
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters for use
// » “ ” …
$lang = array_merge($lang, [
// Module titles
'ACP_CAT_MCHAT' => 'mChat',
'ACP_CAT_MCHAT_USER_CONFIG' => 'mChat im UCP',
'ACP_MCHAT_GLOBALSETTINGS' => 'Globale Einstellungen',
'ACP_MCHAT_GLOBALUSERSETTINGS' => 'Globale Benutzereinstellungen',
// Log entries (%1$s is replaced with the user name who triggered the event)
'LOG_MCHAT_CONFIG_UPDATE' => '<strong>mChat-Konfiguration geändert</strong><br>» %1$s',
'LOG_MCHAT_TABLE_PRUNED' => '<strong>mChat-Nachrichten beschnitten: %2$d</strong>',
'LOG_MCHAT_TABLE_PURGED' => '<strong>mChat-Nachrichten bereinigt</strong><br>» %1$s',
'LOG_DELETED_MCHAT' => '<strong>mChat-Nachricht gelöscht</strong><br>» %1$s',
'LOG_EDITED_MCHAT' => '<strong>mChat-Nachricht bearbeitet</strong><br>» %1$s',
]);

View File

@@ -0,0 +1,39 @@
<?php
/**
*
* @package phpBB Extension - mChat [German]
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (empty($lang) || !is_array($lang))
{
$lang = [];
}
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters for use
// » “ ” …
$lang = array_merge($lang, [
'UCP_MCHAT_CONFIG' => 'Shoutbox',
]);

88
language/de/mchat.php Normal file
View File

@@ -0,0 +1,88 @@
<?php
/**
*
* @package phpBB Extension - mChat [German]
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (empty($lang) || !is_array($lang))
{
$lang = [];
}
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters for use
// » “ ” …
$lang = array_merge($lang, [
'MCHAT_ADD' => 'Senden',
'MCHAT_ARCHIVE' => 'Archiv',
'MCHAT_ARCHIVE_PAGE' => 'mChat Archiv',
'MCHAT_CUSTOM_PAGE' => 'mChat',
'MCHAT_BBCODES' => 'BBCodes',
'MCHAT_CUSTOM_BBCODES' => 'Eigene BBCodes',
'MCHAT_DELCONFIRM' => 'Bist du sicher, dass du diese Nachricht löschen willst?',
'MCHAT_EDIT' => 'Bearbeiten',
'MCHAT_EDITINFO' => 'Bearbeite die Nachricht unten.',
'MCHAT_NEW_CHAT' => 'Neue Chatnachricht!',
'MCHAT_SEND_PM' => 'Sende private Nachricht',
'MCHAT_LIKE' => 'Diese Nachricht gefällt mir',
'MCHAT_LIKES' => 'gefällt diese Nachricht',
'MCHAT_FLOOD' => 'Du kannst keine Nachricht so schnell nach deiner letzten Nachricht senden.',
'MCHAT_FOE' => 'Diese Nachricht wurde von <strong>%1$s</strong> erstellt, welcher sich derzeit auf deiner Ignorierliste befindet.',
'MCHAT_RULES' => 'Regeln',
'MCHAT_WHOIS_USER' => 'IP whois für %1$s',
'MCHAT_MESS_LONG' => 'Deine Nachricht ist zu lang. Bitte beschränke sie auf %1$d Zeichen.',
'MCHAT_NO_CUSTOM_PAGE' => 'Die separate Seite für mChat ist derzeit nicht aktiviert.',
'MCHAT_NO_RULES' => 'Die Seite mit den mChat-Regeln ist derzeit nicht aktiviert.',
'MCHAT_NOACCESS_ARCHIVE' => 'Du hast keine Berechtigung das Archiv anzusehen.',
'MCHAT_NOJAVASCRIPT' => 'Bitte aktiviere JavaScript, um mChat zu benutzen.',
'MCHAT_NOMESSAGE' => 'Keine Nachrichten',
'MCHAT_NOMESSAGEINPUT' => 'Du hast keine Nachricht eingegeben',
'MCHAT_MESSAGE_DELETED' => 'Diese Nachricht wurde gelöscht.',
'MCHAT_OK' => 'OK',
'MCHAT_PAUSE' => 'Pausiert',
'MCHAT_PERMISSIONS' => 'Ändere die Benutzerrechte',
'MCHAT_REFRESHING' => 'Aktualisiere…',
'MCHAT_RESPOND' => 'Antworte dem Benutzer',
'MCHAT_SMILES' => 'Smilies',
'MCHAT_TOTALMESSAGES' => 'Nachrichten gesamt: <strong>%1$d</strong>',
'MCHAT_USESOUND' => 'Ton abspielen',
'MCHAT_SOUND_ON' => 'Ton ist an',
'MCHAT_SOUND_OFF' => 'Ton ist aus',
'MCHAT_ENTER' => 'Use Strg/Cmd + Enter für die alternative Aktion',
'MCHAT_ENTER_SUBMIT' => 'Enter schickt die Nachricht',
'MCHAT_ENTER_LINEBREAK' => 'Enter fügt eine neue Zeile hinzu',
'MCHAT_COLLAPSE_TITLE' => 'Sichtbarkeit von mChat umschalten',
'MCHAT_WHO_IS_REFRESH_EXPLAIN' => 'Aktualisiert alle <strong>%1$d</strong> Sekunden',
'MCHAT_MINUTES_AGO' => [
0 => 'gerade eben',
1 => 'vor %1$d Minute',
2 => 'vor %1$d Minuten',
],
// These messages are formatted with JavaScript, hence {} and no %d
'MCHAT_CHARACTER_COUNT' => '<strong>{current}</strong> Zeichen',
'MCHAT_CHARACTER_COUNT_LIMIT' => '<strong>{current}</strong> verbraucht von {max} Zeichen',
'MCHAT_MENTION' => ' @{username} ',
]);

163
language/de/mchat_acp.php Normal file
View File

@@ -0,0 +1,163 @@
<?php
/**
*
* @package phpBB Extension - mChat [German]
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (empty($lang) || !is_array($lang))
{
$lang = [];
}
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters for use
// » “ ” …
$lang = array_merge($lang, [
// ACP Configuration sections
'MCHAT_SETTINGS_INDEX' => 'Einstellungen Index',
'MCHAT_SETTINGS_CUSTOM' => 'Einstellungen separate Seite',
'MCHAT_SETTINGS_ARCHIVE' => 'Einstellungen Archivseite',
'MCHAT_SETTINGS_POSTS' => 'Einstellungen neuer Beitrag',
'MCHAT_SETTINGS_MESSAGES' => 'Einstellungen Nachricht',
'MCHAT_SETTINGS_PRUNE' => 'Einstellungen für Löschen (nur für Gründer einstellbar)',
'MCHAT_SETTINGS_LOG' => 'Log settings (adjustable for founders only)',
'MCHAT_SETTINGS_STATS' => 'Einstellungen für <em>Wer chattet</em>',
'MCHAT_GLOBALUSERSETTINGS_EXPLAIN' => 'Einstellungen, für welche ein Benutzer <strong>KEINE</strong> Berechtigung zur Anpassung hat, werden angewendet wie unten eingestellt.<br>Neue Benutzerkonten werden die unten konfigurierten Starteinstellungen haben.<br><br>Gehe zum <em>mChat im UCP</em>-Tab im Bereich Benutzerberechtigungen, um die Befugnisse zu einzustellen.<br>Gehe zum Formular <em>Voreinstellungen</em> im Bereich <em>Benutzer verwalten</em> um den Status der Einstellung eines jeden Benutzers zu sehen.',
'MCHAT_GLOBALUSERSETTINGS_OVERWRITE' => 'Überschreibe Einstellungen für alle Benutzer',
'MCHAT_GLOBALUSERSETTINGS_OVERWRITE_EXPLAIN' => 'Setzt die Einstellungen für <em>alle</em> Benutzerkonten wie oben definiert.',
'MCHAT_GLOBALUSERSETTINGS_OVERWRITE_CONFIRM' => 'Bestätige überschreiben der mChat-Einstellungen für alle Benutzer',
'MCHAT_ACP_USER_PREFS_EXPLAIN' => 'Unten sind alle mChat-Voreinstellungen der ausgewählten Benutzer aufgelistet. Einstellungen, für deren Anpassung die ausgewählten Benutzer keine Berechtigung haben, sind deaktiviert. Diese Einstellungen können geändert werden in der mChat Konfiguration <em>Globale Benutzereinstellungen</em>.',
// ACP settings
'MCHAT_ACP_CHARACTERS' => 'Zeichen',
'MCHAT_ACP_MESSAGES' => 'Nachrichten',
'MCHAT_ACP_SECONDS' => 'Sekunden',
'MCHAT_ACP_HOURS' => 'Stunden',
'MCHAT_ACP_DAYS' => 'Tage',
'MCHAT_ACP_WEEKS' => 'Wochen',
'MCHAT_ACP_GLOBALSETTINGS_TITLE' => 'mChat Globale Einstellungen',
'MCHAT_ACP_GLOBALUSERSETTINGS_TITLE' => 'mChat Globale Benutzereinstellungen',
'MCHAT_VERSION' => 'Version',
'MCHAT_RULES' => 'Regeln',
'MCHAT_RULES_EXPLAIN' => 'Gib deine Forenregeln hier ein. HTML-Code ist erlaubt. Lass das Feld leer, und die Anzeige zu deaktivieren.<br>Diese Nachricht kann übersetzt werden: bearbeite dafür die Sprachvariable MCHAT_RULES_MESSAGE in /ext/dmzx/mchat/language/XX/common.php.',
'MCHAT_CONFIG_SAVED' => 'mChat-Konfiguration wurde aktualisiert',
'MCHAT_AVATARS' => 'Avatare anzeigen',
'MCHAT_AVATARS_EXPLAIN' => 'Wenn JA eingestellt ist, werden verkleinerte Benutzeravatare angezeigt',
'MCHAT_INDEX' => 'mChat auf dem Forenindex anzeigen',
'MCHAT_INDEX_HEIGHT' => 'Seitenhöhe im Index',
'MCHAT_INDEX_HEIGHT_EXPLAIN' => 'Die Höhe der Chat Box in Pixeln auf der Indexseite des Forums.<br><em>Die Einstellung ist begrenzt von 50 bis 1000 Pixel.</em>',
'MCHAT_TOP_OF_FORUM' => 'Oben',
'MCHAT_BOTTOM_OF_FORUM' => 'Unten',
'MCHAT_REFRESH' => 'Aktualisierungsintervall',
'MCHAT_REFRESH_EXPLAIN' => 'Die Anzahl Sekunden, bis sich der mChat automatisch aktualisiert. <br><em>Die Einstellung ist begrenzt von 5 bis 60 Sekunden. Standard ist 10.</em>',
'MCHAT_LIVE_UPDATES' => 'Live-Aktualiserung von bearbeiteten und gelöschten Nachrichten',
'MCHAT_LIVE_UPDATES_EXPLAIN' => 'Wenn ein Benutzer Nachrichten bearbeitet oder löscht, werden die Änderungen für alle live angezeigt, ohne dass sie die Seite aktualisieren müssen. Deaktiviere das, falls du Leistungsprobleme bekommst.',
'MCHAT_PRUNE' => 'Aktiviere automatisches Leeren',
'MCHAT_PRUNE_GC' => 'Intervall für Nachrichten-Löschaufgabe',
'MCHAT_PRUNE_GC_EXPLAIN' => 'Die Zeit in Sekunden, die vergehen muss, ehe die nächste Löschung von Nachrichten ausgelöst wird. Hinweis: diese Einstellung steuert, <em>wann</em> Nachrichten geprüft werden, ob sie gelöscht werden können. Sie steuert <em>nicht</em>, <em>welche</em> Nachrichten gelöscht werden. <em>Standard ist 86400 = 24 Stunden.</em>',
'MCHAT_PRUNE_NUM' => 'Anzahl verbleibender Nachrichten nach dem Leeren',
'MCHAT_PRUNE_NUM_EXPLAIN' => 'Verwende die Einstellung „Nachrichten“, um eine festgelegte Anzahl von Nachrichten zu behalten. Verwende „Stunden“, „Tage“ oder „Wochen“, und alle Nachrichten, die älter sind als die festgelegte Zeitperiode werden gelöscht.',
'MCHAT_PRUNE_NOW' => 'Jetzt die Nachrichten löschen',
'MCHAT_PRUNE_NOW_CONFIRM' => 'Löschen der Nachrichten bestätigen',
'MCHAT_PRUNED' => '%1$d mChat Nachrichten wurden gelöscht.',
'MCHAT_NAVBAR_LINK_COUNT' => 'Zeige die Anzahl der aktiven Chatsitzungen im Navbar-Link an',
'MCHAT_MESSAGE_NUM_CUSTOM' => 'Anfängliche Anzahl von Nachrichten, die in der eigenen Chatseite angezeigt werden',
'MCHAT_MESSAGE_NUM_CUSTOM_EXPLAIN' => '<em>Du bist eingeschränkt auf Einstellungen zwischen 5 und 50. Standard ist 10.</em>',
'MCHAT_MESSAGE_NUM_INDEX' => 'Anfängliche Anzahl von Nachrichten, die auf der Indexseite angezeigt werden sollen',
'MCHAT_MESSAGE_NUM_INDEX_EXPLAIN' => '<em>Du bist eingeschränkt auf Einstellungen zwischen 5 und 50. Standard ist 10.</em>',
'MCHAT_MESSAGE_NUM_ARCHIVE' => 'Nachrichtenanzahl zur Anzeige auf der Archivseite',
'MCHAT_MESSAGE_NUM_ARCHIVE_EXPLAIN' => 'Die maximale Anzahl an Nachrichten, die je Seite auf der Archivseite angezeigt werden sollen.<br><em>Du bist beschränkt auf Einstellungen zwischen 10 und 100. Standard ist 25.</em>',
'MCHAT_ARCHIVE_SORT' => 'Nachrichten sortieren',
'MCHAT_ARCHIVE_SORT_TOP_BOTTOM' => 'Sortiere Nachrichten immer von der ältesten zur neuesten',
'MCHAT_ARCHIVE_SORT_BOTTOM_TOP' => 'Sortiere Nachrichten immer von der neuesten zur ältesten',
'MCHAT_ARCHIVE_SORT_USER' => 'Nachrichtensortierung hängt ab von der Einstellung des Benutzers zu <em>Lokalisierung neuer Nachrichten</em>',
'MCHAT_FLOOD_TIME' => 'Überflutungszeit',
'MCHAT_FLOOD_TIME_EXPLAIN' => 'Sekunden, die ein Benutzer warten muss, bevor er eine weitere Nachricht im Chat schreibt.<br><em>Du bist zwischen 0 und 3600 Sekunden (1 Stunde) limitiert. Default ist 0. 0 zum deaktivieren.</em>',
'MCHAT_FLOOD_MESSAGES' => 'Nachrichtenflut',
'MCHAT_FLOOD_MESSAGES_EXPLAIN' => 'Die Zeit in Sekunden, die ein Benutzer warten muß, bis er eine neue Nachricht im mChat absenden kann.<br><em>Begrenzt auf 0 bis 60 Sekunden. Standard ist 0. Stelle 0 ein, um die Funktion zu deaktivieren</em>',
'MCHAT_EDIT_DELETE_LIMIT' => 'Zeitbegrenzung für bearbeiten und löschen von Nachrichten',
'MCHAT_EDIT_DELETE_LIMIT_EXPLAIN' => 'Nachrichten, die älter sind als die hier angegebene Anzahl Sekunden können nicht mehr durch den Verfasser bearbeitet oder gelöscht werden.<br>Benutzer mit <em>Berechtigung zum bearbeiten/löschen sowie mit Moderatorberechtigung sind ausgenommen</em> von dieser Begrenzung.<br>Um unbegrenzte Bearbeitung und Löschen zu erlauben, setze auf 0.',
'MCHAT_MAX_MESSAGE_LENGTH' => 'Maximale Nachrichtenlänge',
'MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN' => 'Die maximal erlaubte Anzahl von Zeichen pro Nachricht.<br><em>Empfohlen sind 100 bis 500, stelle 0 ein, um die Funktion zu deaktivieren</em>.',
'MCHAT_MAX_INPUT_HEIGHT' => 'Maximale Eingabefeld Höhe',
'MCHAT_MAX_INPUT_HEIGHT_EXPLAIN' => 'Das Eingabefeld wird nicht über diese Anzahl von Pixeln hinaus erweitert.<br><em>Du bist zwischen 0 und 1000 limitiert. Default ist 150. Stelle 0 ein, um multi-line Nachrichten zu verbieten.</em>',
'MCHAT_CUSTOM_PAGE' => 'Separate Seite aktivieren',
'MCHAT_CUSTOM_HEIGHT' => 'Höhe der separaten Seite',
'MCHAT_CUSTOM_HEIGHT_EXPLAIN' => 'Die Höhe der Chat-Box in Pixeln auf der eigenen mChat Seite.<br><em>Die Einstellung ist begrenzt von 50 bis 1000 Pixel</em>.',
'MCHAT_BBCODES_DISALLOWED' => 'Nicht erlaubte BBCodes',
'MCHAT_BBCODES_DISALLOWED_EXPLAIN' => 'Hier kann man BBCodes eintragen, die <strong>nicht</strong> in einer Nachricht verwendet werden dürfen.<br>Trenne BBCodes mit einem senkrechten Strich (pipe), zum Beispiel: <br>b|i|u|code|list|list=|flash|quote und/oder einem %1$scustom bbcode tag name%2$s',
'MCHAT_STATIC_MESSAGE' => 'Permanente Nachricht',
'MCHAT_STATIC_MESSAGE_EXPLAIN' => 'Hier kannst du eine permanente Nachricht für die Benutzer des mChats eingeben. HTML-Code ist erlaubt.Wenn das Feld leer bleibt wird keine Nachricht angezeigt.<br>Diese Nachricht kann auch übersetzt werden: bearbeite dafür die Sprachvariable MCHAT_STATIC_MESSAGE in /ext/dmzx/mchat/language/XX/common.php.',
'MCHAT_TIMEOUT' => 'Ablauf der Benutzersitzung',
'MCHAT_TIMEOUT_EXPLAIN' => 'Stelle einen Wert für die Zeit in Sekunden ein, nach der die Sitzung für einen Benutzer im mChat endet. <br>Setze hier 0 für kein Timeout. Achtung - für einen Benutzer, der im mChat liest, endet dann die Sitzung nie! <br><em>Diese Einstellung ist eingeschränkt durch die Einstellungen in deiner %1$sForenkonfiguration für Sitzungen%2$s, welche derzeit auf %3$d Sekunden eingestellt ist.</em>',
'MCHAT_OVERRIDE_SMILIE_LIMIT' => 'Smilielimit überschreiben?',
'MCHAT_OVERRIDE_SMILIE_LIMIT_EXPLAIN' => 'Setze auf Ja um die Smiliebegrenzung des Forums für Chatnachrichten zu überschreiben',
'MCHAT_OVERRIDE_MIN_POST_CHARS' => 'Minimale Anzahl von Zeichen überschreiben?',
'MCHAT_OVERRIDE_MIN_POST_CHARS_EXPLAIN' => 'Setze auf Ja um die Forumseinstellung für die minimale Anzahl von Zeichen für Chatnachrichten zu überschreiben',
'MCHAT_LOG_ENABLED' => 'Füge den Admin Log Einträge hinzu',
'MCHAT_LOG_ENABLED_EXPLAIN' => 'Das betrifft Nachrichten editieren, löschen, kürzen und aufräumen.',
'MCHAT_POSTS_AUTH_CHECK' => 'Erfordert Benutzerberechtigung',
'MCHAT_POSTS_AUTH_CHECK_EXPLAIN' => 'Wenn dies auf Ja gesetzt wird, werden Benutzer, die keine Berechtigung für die Benutzung von mChat haben, auch keine Beitrags- oder Loginbenachrichtigungen auslösen.',
'MCHAT_WHOIS_REFRESH' => '„Wer chattet“ Aktualisierungsintervall',
'MCHAT_WHOIS_REFRESH_EXPLAIN' => 'Anzahl der Sekunden, ehe „Wer chattet“ aktualisiert.<br><em>Du bist beschränkt auf Einstellungen von 10 bis 300 Sekunden. Standard ist 60.</em>',
'MCHAT_SOUND' => 'Töne abspielen bei neuen, bearbeiteten und gelöschten Nachrichten',
'MCHAT_PURGE' => 'Lösche jetzt alle Nachrichten',
'MCHAT_PURGE_CONFIRM' => 'Bestätige die Löschung aller Nachrichten',
'MCHAT_PURGED' => 'Alle mChat Nachrichten wurden erfolgreich gelöscht',
'MCHAT_REPARSER_STATUS' => 'Nachricht reparser status',
'MCHAT_REPARSER_ACTIVE' => 'aktiv',
'MCHAT_REPARSER_FINISHED' => 'beendet',
// '%1$s' enthält 'Beiträge behalten' bzw. 'Beiträge löschen'
'MCHAT_RETAIN_MESSAGES' => '%1$s und behalte mChat-Nachrichten',
'MCHAT_DELETE_MESSAGES' => '%1$s und lösche mChat-Nachrichten',
// Error reporting
'TOO_LONG_MCHAT_BBCODE_DISALLOWED' => 'Der Wert für nicht erlaubte BBCodes ist zu lang.',
'TOO_SMALL_MCHAT_CUSTOM_HEIGHT' => 'Der Wert für die benutzerdefinierte Höhe ist zu klein.',
'TOO_LARGE_MCHAT_CUSTOM_HEIGHT' => 'Der Wert für die benutzerdefinierte Höhe ist zu groß.',
'TOO_LONG_MCHAT_DATE' => 'Das eingegebene Datumsformat ist zu lang.',
'TOO_SHORT_MCHAT_DATE' => 'Das eingegebene Datumsformat ist zu kurz.',
'TOO_LARGE_MCHAT_FLOOD_TIME' => 'Der Wert für die Flood-Zeit ist zu groß.',
'TOO_LARGE_MCHAT_FLOOD_MESSAGES' => 'Der Wert für die Nachrichtenflug ist zu groß.',
'TOO_SMALL_MCHAT_INDEX_HEIGHT' => 'Der Wert für die Höhe im Index ist zu klein.',
'TOO_LARGE_MCHAT_INDEX_HEIGHT' => 'Der Wert für die Höhe im Index ist zu groß.',
'TOO_LARGE_MCHAT_MAX_INPUT_HEIGHT' => 'Der Wert für die Höhe im Eingabefeldhöhe ist zu groß.',
'TOO_SMALL_MCHAT_MESSAGE_NUM_ARCHIVE' => 'The number of message to display on the archive is too small.',
'TOO_LARGE_MCHAT_MESSAGE_NUM_ARCHIVE' => 'Die Anzahl der Nachrichten für die Anzeige auf der Archivseite ist zu groß.',
'TOO_SMALL_MCHAT_REFRESH' => 'Der Wert für die Aktualisierung ist zu klein.',
'TOO_LARGE_MCHAT_REFRESH' => 'Der Wert für die Aktualisierung ist zu groß.',
'TOO_SMALL_MCHAT_TIMEOUT' => 'Der Timeout-Wert für Benutzer ist zu klein.',
'TOO_LARGE_MCHAT_TIMEOUT' => 'Der Timeout-Wert für Benutzer ist zu groß.',
'TOO_SMALL_MCHAT_WHOIS_REFRESH' => 'Der Wert für <em>Wer chattet</em> ist zu klein.',
'TOO_LARGE_MCHAT_WHOIS_REFRESH' => 'Der Wert für <em>Wer chattet</em> ist zu groß.',
'MCHAT_30X_REMNANTS' => 'Die Installation wurde abgebrochen. <br>Es befinden sich übriggebliebene Module des mChat MOD für phpBB 3.0.x in der Datenbank. Die mChat Extension funktioniert nicht korrekt, wenn diese Module vorhanden sind.<br>Du musst unbedingt den mChat MOD vollständig deinstallieren, damit es möglich ist, die mChat Extension zu installieren. Besonders die Module mit den folgenden IDs müssen gelöscht werden aus der %1$smodules Tabelle: %2$s',
]);

67
language/de/mchat_ucp.php Normal file
View File

@@ -0,0 +1,67 @@
<?php
/**
*
* @package phpBB Extension - mChat [German]
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (empty($lang) || !is_array($lang))
{
$lang = [];
}
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters for use
// » “ ” …
$lang = array_merge($lang, [
'MCHAT_PREFERENCES' => 'Shoutbox Einstellungen',
'MCHAT_NO_SETTINGS' => 'Du bist nicht berechtigt irgendwelche Einstellungen anzupassen.',
'MCHAT_INDEX' => 'Auf dem Forenindex anzeigen',
'MCHAT_SOUND' => 'Ton einschalten',
'MCHAT_WHOIS_INDEX' => 'Zeige <em>Wer chattet</em> unter dem Chat an',
'MCHAT_STATS_INDEX' => 'Zeige <em>Wer chattet</em> im Statistikbereich an',
'MCHAT_STATS_INDEX_EXPLAIN' => 'Zeige wer chattet unter dem <em>Wer ist online</em>-Bereich auf dem Forenindex.',
'MCHAT_AVATARS' => 'Zeige Avatare im Chat',
'MCHAT_CAPITAL_LETTER' => 'Erster Buchstabe als Grossbuchstabe in deinen Nachrichten',
'MCHAT_POSTS' => 'Zeige neue Beiträge an (derzeit alle deaktiviert, können im ACP in den Allgemeinen Einstellungen von Shoutbox aktiviert werden)',
'MCHAT_DISPLAY_CHARACTER_COUNT' => 'Zeige die Anzahl der Zeichen beim Schreiben einer Nachricht an',
'MCHAT_RELATIVE_TIME' => 'Zeige die relative Zeit für neue Nachrichten an',
'MCHAT_RELATIVE_TIME_EXPLAIN' => 'Zeigt „gerade eben“, „vor einer Minute“ und so weiter für jede Nachricht an. Setze auf <em>Nein</em>, um immer das volle Datum zu sehen.',
'MCHAT_MESSAGE_TOP' => 'Lokalisierung neuer Nachrichten',
'MCHAT_MESSAGE_TOP_EXPLAIN' => 'Neue Nachrichten werden oben oder unten im Chat erscheinen.',
'MCHAT_LOCATION' => 'Lokalisierung auf der Forenübersicht',
'MCHAT_BOTTOM' => 'Unten',
'MCHAT_TOP' => 'Oben',
'MCHAT_POSTS_TOPIC' => 'Zeige neue Themen an',
'MCHAT_POSTS_REPLY' => 'Zeige neue Antworten an',
'MCHAT_POSTS_EDIT' => 'Zeige bearbeitete Beiträge an',
'MCHAT_POSTS_QUOTE' => 'Zeige Zitatbeiträge an',
'MCHAT_POSTS_LOGIN' => 'Zeige Benutzeranmeldungen an',
'MCHAT_DATE_FORMAT' => 'Datumsformat',
'MCHAT_DATE_FORMAT_EXPLAIN' => 'Die verwendete Syntax ist identisch zur PHP <a href="http://www.php.net/date">date()</a> Funktion.',
'MCHAT_CUSTOM_DATEFORMAT' => 'Eigenes…',
]);

View File

@@ -0,0 +1,68 @@
<?php
/**
*
* @package phpBB Extension - mChat [German]
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (empty($lang) || !is_array($lang))
{
$lang = [];
}
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters for use
// » “ ” …
$lang = array_merge($lang, [
'ACL_U_MCHAT_USE' => 'Kann mChat benutzen',
'ACL_U_MCHAT_VIEW' => 'Kann mChat sehen',
'ACL_U_MCHAT_EDIT' => 'Kann eigene mChat-Nachrichten bearbeiten',
'ACL_U_MCHAT_DELETE' => 'Kann eigene mChat-Nachrichten löschen',
'ACL_U_MCHAT_MODERATOR_EDIT' => 'Kann jedermanns Nachrichten bearbeiten',
'ACL_U_MCHAT_MODERATOR_DELETE' => 'Kann jedermanns Nachrichten löschen',
'ACL_U_MCHAT_IP' => 'Kann IP-Adressen sehen',
'ACL_U_MCHAT_PM' => 'Kann Private Nachrichten benutzen',
'ACL_U_MCHAT_LIKE' => 'Kann Nachrichten liken',
'ACL_U_MCHAT_QUOTE' => 'Kann Nachrichten zitieren',
'ACL_U_MCHAT_FLOOD_IGNORE' => 'Kann Flood-Intervall ignorieren',
'ACL_U_MCHAT_ARCHIVE' => 'Kann das Archiv sehen',
'ACL_U_MCHAT_BBCODE' => 'Kann BBCodes benutzen',
'ACL_U_MCHAT_SMILIES' => 'Kann Smilies benutzen',
'ACL_U_MCHAT_URLS' => 'Kann automatisch geparste URLs senden',
'ACL_U_MCHAT_AVATARS' => 'Kann anpassen <em>Avatare anzeigen</em>',
'ACL_U_MCHAT_CAPITAL_LETTER' => 'Kann anpassen <em>Erster Buchstabe groß</em>',
'ACL_U_MCHAT_CHARACTER_COUNT' => 'Kann anpassen <em>Zeige Zeichenanzahl an</em>',
'ACL_U_MCHAT_DATE' => 'Kann anpassen <em>Datumsformat</em>',
'ACL_U_MCHAT_INDEX' => 'Kann anpassen <em>Display on index</em>',
'ACL_U_MCHAT_LOCATION' => 'Kann anpassen <em>Lokalisierung von mChat auf der Indexseite</em>',
'ACL_U_MCHAT_MESSAGE_TOP' => 'Kann anpassen <em>Lokalisierung neuer mChat-Nachrichten</em>',
'ACL_U_MCHAT_POSTS' => 'Kann anpassen <em>Neue Beiträge anzeigen</em>',
'ACL_U_MCHAT_RELATIVE_TIME' => 'Kann anpassen <em>Relative Zeit anzeigen</em>',
'ACL_U_MCHAT_SOUND' => 'Kann anpassen <em>Töne abspielen</em>',
'ACL_U_MCHAT_WHOIS_INDEX' => 'Kann anpassen <em>„Wer chattet“-Anzeige unter dem Chat</em>',
'ACL_U_MCHAT_STATS_INDEX' => 'Kann anpassen <em>„Wer chattet“-Anzeige im Statistikbereich</em>',
'ACL_A_MCHAT' => 'Kann mChat-Einstellungen verwalten',
]);

View File

@@ -4,7 +4,7 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
if (empty($lang) || !is_array($lang)) if (empty($lang) || !is_array($lang))
{ {
$lang = array(); $lang = [];
} }
// DEVELOPERS PLEASE NOTE // DEVELOPERS PLEASE NOTE
@@ -34,33 +34,49 @@ if (empty($lang) || !is_array($lang))
// Some characters for use // Some characters for use
// » “ ” … // » “ ” …
$lang = array_merge($lang, array( $lang = array_merge($lang, [
'MCHAT_TITLE' => 'mChat', 'MCHAT_TITLE' => 'mChat',
'MCHAT_TITLE_COUNT' => [
0 => 'mChat',
1 => 'mChat [<strong>%1$d</strong>]',
],
'MCHAT_NAVBAR_CUSTOM_PAGE' => 'mChat page',
'MCHAT_NAVBAR_ARCHIVE' => 'Archive',
'MCHAT_NAVBAR_RULES' => 'Rules',
// Who is chatting // Who is chatting
'MCHAT_WHO_IS_CHATTING' => 'Who is chatting', 'MCHAT_WHO_IS_CHATTING' => 'Who is chatting',
'MCHAT_ONLINE_USERS_TOTAL' => array( 'MCHAT_ONLINE_USERS_TOTAL' => [
0 => 'No one is chatting', 0 => 'No one is chatting',
1 => 'There is <strong>%1$d</strong> user chatting', 1 => '<strong>%1$d</strong> user is chatting',
2 => 'There are <strong>%1$d</strong> users chatting', 2 => '<strong>%1$d</strong> users are chatting',
), ],
'MCHAT_ONLINE_EXPLAIN' => 'based on users active over the past %1$s', 'MCHAT_ONLINE_EXPLAIN' => 'based on users active over the past %1$s',
'MCHAT_HOURS' => array( 'MCHAT_HOURS' => [
1 => '%1$d hour', 1 => '%1$d hour',
2 => '%1$d hours', 2 => '%1$d hours',
), ],
'MCHAT_MINUTES' => array( 'MCHAT_MINUTES' => [
1 => '%1$d minute', 1 => '%1$d minute',
2 => '%1$d minutes', 2 => '%1$d minutes',
), ],
'MCHAT_SECONDS' => array( 'MCHAT_SECONDS' => [
1 => '%1$d second', 1 => '%1$d second',
2 => '%1$d seconds', 2 => '%1$d seconds',
), ],
// Custom translations for administrators
'MCHAT_RULES_MESSAGE' => '',
'MCHAT_STATIC_MESSAGE' => '',
// 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) // 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_POST' => 'posted a new topic: %1$s in %2$s',
'MCHAT_NEW_POST_DELETED' => 'posted a new topic that was deleted',
'MCHAT_NEW_REPLY' => 'posted a reply: %1$s in %2$s', 'MCHAT_NEW_REPLY' => 'posted a reply: %1$s in %2$s',
'MCHAT_NEW_REPLY_DELETED' => 'posted a reply that was deleted',
'MCHAT_NEW_QUOTE' => 'replied with a quote: %1$s in %2$s', 'MCHAT_NEW_QUOTE' => 'replied with a quote: %1$s in %2$s',
'MCHAT_NEW_QUOTE_DELETED' => 'posted a reply that was deleted',
'MCHAT_NEW_EDIT' => 'edited a post: %1$s in %2$s', 'MCHAT_NEW_EDIT' => 'edited a post: %1$s in %2$s',
)); 'MCHAT_NEW_EDIT_DELETED' => 'edited a post that was deleted',
'MCHAT_NEW_LOGIN' => 'just logged in',
]);

View File

@@ -4,7 +4,7 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
if (empty($lang) || !is_array($lang)) if (empty($lang) || !is_array($lang))
{ {
$lang = array(); $lang = [];
} }
// DEVELOPERS PLEASE NOTE // DEVELOPERS PLEASE NOTE
@@ -34,19 +34,17 @@ if (empty($lang) || !is_array($lang))
// Some characters for use // Some characters for use
// » “ ” … // » “ ” …
$lang = array_merge($lang, array( $lang = array_merge($lang, [
// Module titles // Module titles
'ACP_CAT_MCHAT' => 'mChat', 'ACP_CAT_MCHAT' => 'mChat',
'ACP_CAT_MCHAT_USER_CONFIG' => 'mChat in UCP', 'ACP_CAT_MCHAT_USER_CONFIG' => 'mChat in UCP',
'ACP_MCHAT_GLOBALSETTINGS' => 'Global settings', 'ACP_MCHAT_GLOBALSETTINGS' => 'Global settings',
'ACP_MCHAT_GLOBALUSERSETTINGS' => 'Global user 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 <em>Global user settings</em> mChat configuration section.',
// Log entries (%1$s is replaced with the user name who triggered the event) // Log entries (%1$s is replaced with the user name who triggered the event)
'LOG_MCHAT_CONFIG_UPDATE' => '<strong>mChat configuration updated</strong><br />» %1$s', 'LOG_MCHAT_CONFIG_UPDATE' => '<strong>mChat configuration updated</strong><br>» %1$s',
'LOG_MCHAT_TABLE_PRUNED' => '<strong>mChat messages pruned</strong><br />» %1$s', 'LOG_MCHAT_TABLE_PRUNED' => '<strong>mChat messages pruned: %2$d</strong>',
'LOG_MCHAT_TABLE_PURGED' => '<strong>mChat messages purged</strong><br />» %1$s', 'LOG_MCHAT_TABLE_PURGED' => '<strong>mChat messages purged</strong><br>» %1$s',
'LOG_DELETED_MCHAT' => '<strong>mChat message deleted</strong><br />» %1$s', 'LOG_DELETED_MCHAT' => '<strong>mChat message deleted</strong><br>» %1$s',
'LOG_EDITED_MCHAT' => '<strong>mChat message edited</strong><br />» %1$s', 'LOG_EDITED_MCHAT' => '<strong>mChat message edited</strong><br>» %1$s',
)); ]);

View File

@@ -4,7 +4,7 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
if (empty($lang) || !is_array($lang)) if (empty($lang) || !is_array($lang))
{ {
$lang = array(); $lang = [];
} }
// DEVELOPERS PLEASE NOTE // DEVELOPERS PLEASE NOTE
@@ -34,6 +34,6 @@ if (empty($lang) || !is_array($lang))
// Some characters for use // Some characters for use
// » “ ” … // » “ ” …
$lang = array_merge($lang, array( $lang = array_merge($lang, [
'UCP_MCHAT_CONFIG' => 'mChat', 'UCP_MCHAT_CONFIG' => 'mChat',
)); ]);

View File

@@ -4,7 +4,7 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
if (empty($lang) || !is_array($lang)) if (empty($lang) || !is_array($lang))
{ {
$lang = array(); $lang = [];
} }
// DEVELOPERS PLEASE NOTE // DEVELOPERS PLEASE NOTE
@@ -34,57 +34,55 @@ if (empty($lang) || !is_array($lang))
// Some characters for use // Some characters for use
// » “ ” … // » “ ” …
$lang = array_merge($lang, array( $lang = array_merge($lang, [
'MCHAT_ADD' => 'Send', 'MCHAT_ADD' => 'Send',
'MCHAT_ARCHIVE' => 'Archive', 'MCHAT_ARCHIVE' => 'Archive',
'MCHAT_ARCHIVE_PAGE' => 'mChat Archive', 'MCHAT_ARCHIVE_PAGE' => 'mChat Archive',
'MCHAT_CUSTOM_PAGE' => 'mChat',
'MCHAT_BBCODES' => 'BBCodes', 'MCHAT_BBCODES' => 'BBCodes',
'MCHAT_CUSTOM_BBCODES' => 'Custom BBCodes', 'MCHAT_CUSTOM_BBCODES' => 'Custom BBCodes',
'MCHAT_DELCONFIRM' => 'Do you confirm removal?', 'MCHAT_DELCONFIRM' => 'Are you sure you want to delete this message?',
'MCHAT_EDIT' => 'Edit', 'MCHAT_EDIT' => 'Edit',
'MCHAT_EDITINFO' => 'Edit the message and click OK', 'MCHAT_EDITINFO' => 'Edit the message below.',
'MCHAT_NEW_CHAT' => 'New chat message!', 'MCHAT_NEW_CHAT' => 'New chat message!',
'MCHAT_SEND_PM' => 'Send private message', 'MCHAT_SEND_PM' => 'Send private message',
'MCHAT_LIKE' => 'Like this post', 'MCHAT_LIKE' => 'Like this message',
'MCHAT_LIKES' => 'likes this post', 'MCHAT_LIKES' => 'likes this message',
'MCHAT_FLOOD' => 'You can not post another message so soon after your last', 'MCHAT_FLOOD' => 'You can not post another message so soon after your last.',
'MCHAT_FOE' => 'This message was made by <strong>%1$s</strong> who is currently on your ignore list.', 'MCHAT_FOE' => 'This message was made by <strong>%1$s</strong> who is currently on your ignore list.',
'MCHAT_RULES' => 'Rules', 'MCHAT_RULES' => 'Rules',
'MCHAT_WHOIS_USER' => 'IP whois for %1$s', 'MCHAT_WHOIS_USER' => 'IP whois for %1$s',
'MCHAT_MESS_LONG' => 'Your message is too long. Please limit it to %1$d characters', 'MCHAT_MESS_LONG' => 'Your message is too long. Please limit it to %1$d characters.',
'MCHAT_NO_CUSTOM_PAGE' => 'The mChat custom page is not activated at this time!', 'MCHAT_NO_CUSTOM_PAGE' => 'The mChat page is not activated at this time.',
'MCHAT_NO_RULES' => 'The mChat rules page is not activated at this time!', 'MCHAT_NO_RULES' => 'The mChat rules page is not activated at this time.',
'MCHAT_NOACCESS' => 'You dont have permission to post in the chat', 'MCHAT_NOACCESS_ARCHIVE' => 'You dont have permission to view the archive.',
'MCHAT_NOACCESS_ARCHIVE' => 'You dont have permission to view the archive', 'MCHAT_NOJAVASCRIPT' => 'Please enable JavaScript to use mChat.',
'MCHAT_NOJAVASCRIPT' => 'Your browser does not support JavaScript or JavaScript is disabled',
'MCHAT_NOMESSAGE' => 'No messages', 'MCHAT_NOMESSAGE' => 'No messages',
'MCHAT_NOMESSAGEINPUT' => 'You have not entered a message', 'MCHAT_NOMESSAGEINPUT' => 'You have not entered a message',
'MCHAT_MESSAGE_DELETED' => 'This message has been deleted.',
'MCHAT_OK' => 'OK', 'MCHAT_OK' => 'OK',
'MCHAT_PAUSE' => 'Paused', 'MCHAT_PAUSE' => 'Paused',
'MCHAT_PERMISSIONS' => 'Change users permissions', 'MCHAT_PERMISSIONS' => 'Change users permissions',
'MCHAT_REFRESHING' => 'Refreshing…', 'MCHAT_REFRESHING' => 'Refreshing…',
'MCHAT_REFRESH_NO' => 'Update is off',
'MCHAT_REFRESH_YES' => 'Updates every <strong>%1$d</strong> seconds',
'MCHAT_RESPOND' => 'Respond to user', '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_SMILES' => 'Smilies', 'MCHAT_SMILES' => 'Smilies',
'MCHAT_TOTALMESSAGES' => 'Total messages: <strong>%1$d</strong>', 'MCHAT_TOTALMESSAGES' => 'Total messages: <strong>%1$d</strong>',
'MCHAT_USESOUND' => 'Play sound', 'MCHAT_USESOUND' => 'Play sound',
'MCHAT_SOUND_ON' => 'Sound is on',
'MCHAT_SOUND_OFF' => 'Sound is off',
'MCHAT_ENTER' => 'Use Ctrl/Cmd + Enter for the alternative action',
'MCHAT_ENTER_SUBMIT' => 'Enter sends the message',
'MCHAT_ENTER_LINEBREAK' => 'Enter adds a new line',
'MCHAT_COLLAPSE_TITLE' => 'Toggle visibility of mChat',
'MCHAT_WHO_IS_REFRESH_EXPLAIN' => 'Refreshes every <strong>%1$d</strong> seconds', 'MCHAT_WHO_IS_REFRESH_EXPLAIN' => 'Refreshes every <strong>%1$d</strong> seconds',
'MCHAT_MINUTES_AGO' => array( 'MCHAT_MINUTES_AGO' => [
0 => 'just now', 0 => 'just now',
1 => '%1$d minute ago', 1 => '%1$d minute ago',
2 => '%1$d minutes ago', 2 => '%1$d minutes ago',
), ],
// These messages are formatted with JavaScript, hence {} and no $d // These messages are formatted with JavaScript, hence {} and no %d
'MCHAT_CHARACTER_COUNT' => '<strong>{current}</strong> characters', 'MCHAT_CHARACTER_COUNT' => '<strong>{current}</strong> characters',
'MCHAT_CHARACTER_COUNT_LIMIT' => '<strong>{current}</strong> out of {max} characters', 'MCHAT_CHARACTER_COUNT_LIMIT' => '<strong>{current}</strong> out of {max} characters',
'MCHAT_SESSION_ENDS_JS' => 'Chat session ends in {timeleft}', 'MCHAT_MENTION' => ' @{username} ',
]);
// Custom translations for administrators
'MCHAT_RULES_MESSAGE' => '',
'MCHAT_STATIC_MESSAGE' => '',
));

View File

@@ -4,7 +4,7 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
if (empty($lang) || !is_array($lang)) if (empty($lang) || !is_array($lang))
{ {
$lang = array(); $lang = [];
} }
// DEVELOPERS PLEASE NOTE // DEVELOPERS PLEASE NOTE
@@ -34,97 +34,130 @@ if (empty($lang) || !is_array($lang))
// Some characters for use // Some characters for use
// » “ ” … // » “ ” …
$lang = array_merge($lang, array( $lang = array_merge($lang, [
// ACP Configuration sections // ACP Configuration sections
'MCHAT_SETTINGS_INDEX' => 'Index page settings', 'MCHAT_SETTINGS_INDEX' => 'Index page settings',
'MCHAT_SETTINGS_CUSTOM' => 'Custom page settings', 'MCHAT_SETTINGS_CUSTOM' => 'mChat page settings',
'MCHAT_SETTINGS_ARCHIVE' => 'Archive page settings', 'MCHAT_SETTINGS_ARCHIVE' => 'Archive page settings',
'MCHAT_SETTINGS_POSTS' => 'New posts settings', 'MCHAT_SETTINGS_POSTS' => 'New posts settings',
'MCHAT_SETTINGS_MESSAGES' => 'Message settings', 'MCHAT_SETTINGS_MESSAGES' => 'Message settings',
'MCHAT_SETTINGS_PRUNE' => 'Pruning settings', 'MCHAT_SETTINGS_PRUNE' => 'Pruning settings (adjustable for founders only)',
'MCHAT_SETTINGS_STATS' => 'Who is chatting settings', 'MCHAT_SETTINGS_LOG' => 'Log settings (adjustable for founders only)',
'MCHAT_SETTINGS_STATS' => 'Who is chatting settings',
'MCHAT_GLOBALUSERSETTINGS_EXPLAIN' => 'Settings for which a user does <strong>not</strong> have permission to customise are applied as configured below.<br />Go to the <em>mChat UCP</em> tab of the user permissions section to adjust customisation permissions.<br />Go to the <em>Preferences</em> form in the <em>user management</em> section to see the status of each users settings.', 'MCHAT_GLOBALUSERSETTINGS_EXPLAIN' => 'Settings for which a user does <strong>not</strong> have permission to customise are applied as configured below.<br>New user accounts will have initial settings as configured below.<br><br>Go to the <em>mChat in UCP</em> tab of the user permissions section to adjust customisation permissions.<br>Go to the <em>Preferences</em> form in the <em>user management</em> section to adjust individual user settings.',
'MCHAT_GLOBALUSERSETTINGS_OVERWRITE' => 'Overwrite settings for all users',
'MCHAT_GLOBALUSERSETTINGS_OVERWRITE_EXPLAIN' => 'Applies the settings as defined above to <em>all</em> user accounts.',
'MCHAT_GLOBALUSERSETTINGS_OVERWRITE_CONFIRM' => 'Confirm overwriting mChat settings for all users',
'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 <em>Global user settings</em> mChat configuration section.',
// ACP settings // ACP settings
'MCHAT_ACP_GLOBALSETTINGS_TITLE' => 'mChat Global settings', 'MCHAT_ACP_CHARACTERS' => 'characters',
'MCHAT_ACP_GLOBALUSERSETTINGS_TITLE' => 'mChat Global user settings', 'MCHAT_ACP_MESSAGES' => 'messages',
'MCHAT_VERSION' => 'Version', 'MCHAT_ACP_SECONDS' => 'seconds',
'MCHAT_RULES' => 'Rules', 'MCHAT_ACP_HOURS' => 'hours',
'MCHAT_RULES_EXPLAIN' => 'Enter the rules of the forum here. HTML code is allowed. <em>You are limited to 255 characters.</em><br />This message can be translated: edit the MCHAT_RULES_MESSAGE language key in /ext/dmzx/mchat/language/XX/mchat.php.', 'MCHAT_ACP_DAYS' => 'days',
'MCHAT_CONFIG_SAVED' => 'mChat configuration has been updated', 'MCHAT_ACP_WEEKS' => 'weeks',
'MCHAT_AVATARS' => 'Display avatars', 'MCHAT_ACP_GLOBALSETTINGS_TITLE' => 'mChat Global settings',
'MCHAT_AVATARS_EXPLAIN' => 'If set to yes, resized user avatars will be displayed', 'MCHAT_ACP_GLOBALUSERSETTINGS_TITLE' => 'mChat Global user settings',
'MCHAT_INDEX' => 'Display mChat on the index page', 'MCHAT_VERSION' => 'Version',
'MCHAT_INDEX_HEIGHT' => 'Index page height', 'MCHAT_RULES' => 'Rules',
'MCHAT_INDEX_HEIGHT_EXPLAIN' => 'The height of the chat box in pixels on the index page.<br /><em>You are limited from 50 to 1000. Default is 250.</em>', 'MCHAT_RULES_EXPLAIN' => 'Enter the rules here. HTML code is allowed. Set to empty to disable the display.<br>This message can be translated: edit the MCHAT_RULES_MESSAGE language key in /ext/dmzx/mchat/language/XX/mchat.php.',
'MCHAT_TOP_OF_FORUM' => 'Top', 'MCHAT_CONFIG_SAVED' => 'mChat configuration has been updated.',
'MCHAT_BOTTOM_OF_FORUM' => 'Bottom', 'MCHAT_AVATARS' => 'Display avatars',
'MCHAT_REFRESH' => 'Refresh interval', 'MCHAT_AVATARS_EXPLAIN' => 'If set to yes, resized user avatars will be displayed.',
'MCHAT_REFRESH_EXPLAIN' => 'Number of seconds before the chat refreshes.<br /><em>You are limited from 5 to 60 seconds. Default is 10.</em>', 'MCHAT_INDEX' => 'Display mChat on the index page',
'MCHAT_LIVE_UPDATES' => 'Live updates of edited and deleted messages', 'MCHAT_INDEX_HEIGHT' => 'Index page height',
'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_INDEX_HEIGHT_EXPLAIN' => '<em>You are limited from 50 to 1000. Default is 250.</em>',
'MCHAT_PRUNE' => 'Enable message pruning', 'MCHAT_TOP_OF_FORUM' => 'Top',
'MCHAT_PRUNE_EXPLAIN' => 'Only occurs if a user views the custom or archive pages.', 'MCHAT_BOTTOM_OF_FORUM' => 'Bottom',
'MCHAT_PRUNE_NUM' => 'Number of messages to retain when pruning', 'MCHAT_REFRESH' => 'Refresh interval',
'MCHAT_NAVBAR_LINK' => 'Display link to the custom page in the navbar', 'MCHAT_REFRESH_EXPLAIN' => 'Number of seconds between refreshing messages.<br><em>You are limited from 2 to 3600 seconds. Default is 10.</em>',
'MCHAT_MESSAGE_NUM_CUSTOM' => 'Initial number of messages to display on the custom page', 'MCHAT_LIVE_UPDATES' => 'Live updates of edited and deleted messages',
'MCHAT_MESSAGE_NUM_CUSTOM_EXPLAIN' => '<em>You are limited from 5 to 50. Default is 10.</em>', '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_MESSAGE_NUM_INDEX' => 'Initial number of messages to display on the index page', 'MCHAT_PRUNE' => 'Enable message pruning',
'MCHAT_MESSAGE_NUM_INDEX_EXPLAIN' => '<em>You are limited from 5 to 50. Default is 10.</em>', 'MCHAT_PRUNE_GC' => 'Message prune task interval',
'MCHAT_MESSAGE_NUM_ARCHIVE' => 'Number of messages to display on the archive page', 'MCHAT_PRUNE_GC_EXPLAIN' => 'The time that needs to pass before the next message pruning is triggered. Note: this setting controls <em>when</em> messages are checked if they can be deleted. It does <em>not</em> control <em>which</em> messages are deleted. <em>Default is 86400 seconds = 24 hours.</em>',
'MCHAT_MESSAGE_NUM_ARCHIVE_EXPLAIN' => 'The maximum number of messages to show per page on the archive page.<br /><em>You are limited from 10 to 100. Default is 25.</em>', 'MCHAT_PRUNE_NUM' => 'Messages to retain when pruning',
'MCHAT_FLOOD_TIME' => 'Flood time', 'MCHAT_PRUNE_NUM_EXPLAIN' => 'When using messages a fixed number of messages will be kept. When using hours, days or weeks all messages older than the specified time period at the time of pruning will be deleted.',
'MCHAT_FLOOD_TIME_EXPLAIN' => 'The number of seconds a user must wait before posting another message in the chat.<br /><em>You are limited from 5 to 60 seconds. Default is 0. Set to 0 to disable.</em>', 'MCHAT_PRUNE_NOW' => 'Prune messages now',
'MCHAT_EDIT_DELETE_LIMIT' => 'Time limit for editing and deleting messages', 'MCHAT_PRUNE_NOW_CONFIRM' => 'Confirm pruning messages',
'MCHAT_EDIT_DELETE_LIMIT_EXPLAIN' => 'Messages older than the specified number of seconds cannot be edited or deleted by the author any more.<br />Users who have <em>edit/delete permission as well as moderator permission are exempt</em> from this time limit.<br />Set to 0 to allow unlimited editing and deleting.', 'MCHAT_PRUNED' => '%1$d mChat messages have been pruned',
'MCHAT_MAX_MESSAGE_LENGTH' => 'Maximum message length', 'MCHAT_NAVBAR_LINK_COUNT' => 'Display number of active chat sessions in the navbar',
'MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN' => 'Maximum number of characters allowed per message posted.<br /><em>You are limited from 0 to 1000. Default is 500. Set to 0 to disable.</em>', 'MCHAT_MESSAGE_NUM_CUSTOM' => 'Initial number of messages to display on the mChat page',
'MCHAT_CUSTOM_PAGE' => 'Enable custom Page', 'MCHAT_MESSAGE_NUM_CUSTOM_EXPLAIN' => '<em>Default is 10.</em>',
'MCHAT_CUSTOM_PAGE_EXPLAIN' => 'Allow the use of the custom page', 'MCHAT_MESSAGE_NUM_INDEX' => 'Initial number of messages to display on the index page',
'MCHAT_CUSTOM_HEIGHT' => 'Custom page height', 'MCHAT_MESSAGE_NUM_INDEX_EXPLAIN' => '<em>Default is 10.</em>',
'MCHAT_CUSTOM_HEIGHT_EXPLAIN' => 'The height of the chat box in pixels on the custom page.<br /><em>You are limited from 50 to 1000. Default is 350.</em>', 'MCHAT_MESSAGE_NUM_ARCHIVE' => 'Number of messages to display on the archive page',
'MCHAT_BBCODES_DISALLOWED' => 'Disallowed bbcodes', 'MCHAT_MESSAGE_NUM_ARCHIVE_EXPLAIN' => '<em>You are limited from 10 to 100. Default is 25.</em>',
'MCHAT_BBCODES_DISALLOWED_EXPLAIN' => 'Here you can input the bbcodes that are <strong>not</strong> to be used in a message.<br />Separate bbcodes with a vertical bar, for example: <br />b|i|u|code|list|list=|flash|quote and/or a %1$scustom bbcode tag name%2$s', 'MCHAT_ARCHIVE_SORT' => 'Message sorting',
'MCHAT_STATIC_MESSAGE' => 'Static message', 'MCHAT_ARCHIVE_SORT_TOP_BOTTOM' => 'Always sort messages oldest to newest',
'MCHAT_STATIC_MESSAGE_EXPLAIN' => 'Here you can define a static message to display to users of the chat. HTML code is allowed.<br />Set to empty to disable the display. <em>You are limited to 255 characters.</em><br />This message can be translated: edit the MCHAT_STATIC_MESSAGE language key in /ext/dmzx/mchat/language/XX/mchat.php.', 'MCHAT_ARCHIVE_SORT_BOTTOM_TOP' => 'Always sort messages newest to oldest',
'MCHAT_USER_TIMEOUT' => 'User session timeout', 'MCHAT_ARCHIVE_SORT_USER' => 'Sort messages depending on the users <em>Location of new messages</em> preference',
'MCHAT_USER_TIMEOUT_EXPLAIN' => 'Set the amount of time in seconds until a user session in the chat ends.<br />Set to 0 for no timeout. Careful, the session of a user reading mChat will never expire!<br /><em>You are limited to the %1$sforum config setting for sessions%2$s which is currently set to %3$d seconds</em>', 'MCHAT_FLOOD_TIME' => 'Flood time',
'MCHAT_OVERRIDE_SMILIE_LIMIT' => 'Override smilie limit', 'MCHAT_FLOOD_TIME_EXPLAIN' => 'The number of seconds a user must wait before posting another message in the chat.<br><em>You are limited from 0 to 3600 seconds (1 hour). Default is 0. Set to 0 to disable.</em>',
'MCHAT_OVERRIDE_SMILIE_LIMIT_EXPLAIN' => 'Set to yes to override the forums smilie limit setting for chat messages', 'MCHAT_FLOOD_MESSAGES' => 'Flood messages',
'MCHAT_OVERRIDE_MIN_POST_CHARS' => 'Override minimum characters limit', 'MCHAT_FLOOD_MESSAGES_EXPLAIN' => 'The number of messages a user can send consecutively before another user is required to post in the chat.<br><em>You are limited from 0 to 100 messages. Default is 0. Set to 0 to disable.</em>',
'MCHAT_OVERRIDE_MIN_POST_CHARS_EXPLAIN' => 'Set to yes to override the forums minimum characters setting for chat messages', '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.<br>Users who have <em>edit/delete permission as well as moderator permission are exempt</em> from this time limit.<br>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.<br><em>Default is 500. Set to 0 to disable.</em>',
'MCHAT_MAX_INPUT_HEIGHT' => 'Maximum input field height',
'MCHAT_MAX_INPUT_HEIGHT_EXPLAIN' => 'The input field will not expand beyond this number of pixels.<br><em>You are limited from 0 to 1000. Default is 150. Set to 0 to not allow multi-line messages.</em>',
'MCHAT_CUSTOM_PAGE' => 'Enable mChat page',
'MCHAT_CUSTOM_HEIGHT' => 'mChat page height',
'MCHAT_CUSTOM_HEIGHT_EXPLAIN' => '<em>You are limited from 50 to 1000. Default is 350.</em>',
'MCHAT_BBCODES_DISALLOWED' => 'Disallowed BBCodes',
'MCHAT_BBCODES_DISALLOWED_EXPLAIN' => 'Here you can input the BBCodes that are <strong>not</strong> to be used in a message.<br>Separate BBCodes with a vertical bar, for example:<br>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. HTML code is allowed. Set to empty to disable the display.<br>This message can be translated: edit the MCHAT_STATIC_MESSAGE language key in /ext/dmzx/mchat/language/XX/mchat.php.',
'MCHAT_TIMEOUT' => 'Session timeout',
'MCHAT_TIMEOUT_EXPLAIN' => 'Set the number of seconds until a session in the chat ends.<br>Set to 0 for no timeout. Careful, the session of a user reading mChat will never expire!<br><em>You are limited to the %1$sforum config setting for sessions%2$s which is currently set to %3$d seconds.</em>',
'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_LOG_ENABLED' => 'Add entries to the admin log',
'MCHAT_LOG_ENABLED_EXPLAIN' => 'This affects message editing, deleting, pruning and purging.',
'MCHAT_WHOIS_REFRESH' => 'Who is chatting refresh interval', 'MCHAT_POSTS_AUTH_CHECK' => 'Require user permission',
'MCHAT_WHOIS_REFRESH_EXPLAIN' => 'Number of seconds before who is chatting refreshes.<br /><em>You are limited from 10 to 300 seconds. Default is 60.</em>', 'MCHAT_POSTS_AUTH_CHECK_EXPLAIN' => 'If set to yes, users who can not use mChat will not generate any post/login notification messages.',
'MCHAT_SOUND' => 'Play sounds for new, edited and deleted messages',
'MCHAT_PURGE' => 'Delete all messages now', 'MCHAT_WHOIS_REFRESH' => 'Who is chatting refresh interval',
'MCHAT_PURGE_CONFIRM' => 'Confirm deleting all messages', 'MCHAT_WHOIS_REFRESH_EXPLAIN' => 'Number of seconds before who is chatting refreshes.<br><em>You are limited from 10 to 300 seconds. Default is 60.</em>',
'MCHAT_PURGED' => 'All mChat messages have been successfully deleted', '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.',
'MCHAT_REPARSER_STATUS' => 'Message reparser status',
'MCHAT_REPARSER_ACTIVE' => 'active',
'MCHAT_REPARSER_FINISHED' => 'finished',
// '%1$s' contains 'Retain posts' and 'Delete posts' respectively
'MCHAT_RETAIN_MESSAGES' => '%1$s and retain mChat messages',
'MCHAT_DELETE_MESSAGES' => '%1$s and delete mChat messages',
// Error reporting // Error reporting
'TOO_LONG_MCHAT_BBCODE_DISALLOWED' => 'The disallowed bbcodes value is too long.', '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_SMALL_MCHAT_CUSTOM_HEIGHT' => 'The mChat page height value is too small.',
'TOO_LARGE_MCHAT_CUSTOM_HEIGHT' => 'The custom height value is too large.', 'TOO_LARGE_MCHAT_CUSTOM_HEIGHT' => 'The mChat page height value is too large.',
'TOO_LONG_MCHAT_DATE' => 'The date format you entered is too long.', 'TOO_LONG_MCHAT_DATE' => 'The date format you entered is too long.',
'TOO_SHORT_MCHAT_DATE' => 'The date format you entered is too short.', 'TOO_SHORT_MCHAT_DATE' => 'The date format you entered is too short.',
'TOO_SMALL_MCHAT_FLOOD_TIME' => 'The flood time value is too small.', 'TOO_LARGE_MCHAT_FLOOD_TIME' => 'The flood time value is too large.',
'TOO_LARGE_MCHAT_FLOOD_TIME' => 'The flood time value is too large.', 'TOO_LARGE_MCHAT_FLOOD_MESSAGES' => 'The flood messages value is too large.',
'TOO_SMALL_MCHAT_INDEX_HEIGHT' => 'The index height value is too small.', 'TOO_SMALL_MCHAT_INDEX_HEIGHT' => 'The index height value is too small.',
'TOO_LARGE_MCHAT_INDEX_HEIGHT' => 'The index height value is too large.', '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_INPUT_HEIGHT' => 'The max input height value is too large.',
'TOO_LARGE_MCHAT_MAX_MESSAGE_LNGTH' => 'The max message length value is too large.', 'TOO_SMALL_MCHAT_MESSAGE_NUM_ARCHIVE' => 'The number of messages to display on the archive page is too small.',
'TOO_SMALL_MCHAT_MESSAGE_NUM_CUSTOM' => 'The number of message to display on the custom page is too small.', 'TOO_LARGE_MCHAT_MESSAGE_NUM_ARCHIVE' => 'The number of messages to display on the archive page is too large.',
'TOO_LARGE_MCHAT_MESSAGE_NUM_CUSTOM' => 'The number of message to display on the custom page is too large.', 'TOO_SMALL_MCHAT_REFRESH' => 'The refresh value is too small.',
'TOO_SMALL_MCHAT_MESSAGE_NUM_INDEX' => 'The number of messages to display on the index page is too small.', 'TOO_LARGE_MCHAT_REFRESH' => 'The refresh value is too large.',
'TOO_LARGE_MCHAT_MESSAGE_NUM_INDEX' => 'The number of messages to display on the index page is too large.', 'TOO_SMALL_MCHAT_TIMEOUT' => 'The user timeout value is too small.',
'TOO_SMALL_MCHAT_MESSAGE_NUM_ARCHIVE' => 'The number of message to display on the archive page is too small.', 'TOO_LARGE_MCHAT_TIMEOUT' => 'The user timeout value is too large.',
'TOO_LARGE_MCHAT_MESSAGE_NUM_ARCHIVE' => 'The number of message to display on the archive page is too large.', 'TOO_SMALL_MCHAT_WHOIS_REFRESH' => 'The whois refresh value is too small.',
'TOO_SMALL_MCHAT_REFRESH' => 'The refresh value is too small.', 'TOO_LARGE_MCHAT_WHOIS_REFRESH' => 'The whois refresh value is too large.',
'TOO_LARGE_MCHAT_REFRESH' => 'The refresh value is too large.',
'TOO_LONG_MCHAT_STATIC_MESSAGE' => 'The static message value is too long.', 'MCHAT_30X_REMNANTS' => 'The installation has been aborted.<br>There are remnant modules from the mChat MOD for phpBB 3.0.x in the database. The mChat extension does not work correctly with these modules present.<br>You need to entirely uninstall the mChat MOD before being able to install the mChat extension. Specifically, the modules with the following IDs need to be deleted from the %1$smodules table: %2$s',
'TOO_SMALL_MCHAT_TIMEOUT' => 'The user timeout value is too small.', ]);
'TOO_LARGE_MCHAT_TIMEOUT' => 'The user timeout value is too large.',
'TOO_SMALL_MCHAT_WHOIS_REFRESH' => 'The whois refresh value is too small.',
'TOO_LARGE_MCHAT_WHOIS_REFRESH' => 'The whois refresh value is too large.',
));

View File

@@ -4,7 +4,7 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
if (empty($lang) || !is_array($lang)) if (empty($lang) || !is_array($lang))
{ {
$lang = array(); $lang = [];
} }
// DEVELOPERS PLEASE NOTE // DEVELOPERS PLEASE NOTE
@@ -34,7 +34,7 @@ if (empty($lang) || !is_array($lang))
// Some characters for use // Some characters for use
// » “ ” … // » “ ” …
$lang = array_merge($lang, array( $lang = array_merge($lang, [
'MCHAT_PREFERENCES' => 'mChat preferences', 'MCHAT_PREFERENCES' => 'mChat preferences',
'MCHAT_NO_SETTINGS' => 'You are not authorised to customise any settings.', 'MCHAT_NO_SETTINGS' => 'You are not authorised to customise any settings.',
@@ -45,15 +45,10 @@ $lang = array_merge($lang, array(
'MCHAT_STATS_INDEX_EXPLAIN' => 'Displays who is chatting below the <em>Who is online</em> section on the index page.', 'MCHAT_STATS_INDEX_EXPLAIN' => 'Displays who is chatting below the <em>Who is online</em> section on the index page.',
'MCHAT_AVATARS' => 'Display avatars', 'MCHAT_AVATARS' => 'Display avatars',
'MCHAT_CAPITAL_LETTER' => 'Capital first letter in your messages', 'MCHAT_CAPITAL_LETTER' => 'Capital first letter in your messages',
'MCHAT_CHAT_AREA' => 'Input type',
'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_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_DISPLAY_CHARACTER_COUNT' => 'Display number of characters when typing a message',
'MCHAT_RELATIVE_TIME' => 'Display relative time for new messages', '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 <em>No</em> to always display the full date.', 'MCHAT_RELATIVE_TIME_EXPLAIN' => 'Displays just now, 1 minute ago and so on for each message. Set to <em>No</em> 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' => 'Location of new chat messages',
'MCHAT_MESSAGE_TOP_EXPLAIN' => 'New messages will appear at the top or at the bottom in the chat.', '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_LOCATION' => 'Location on the index page',
@@ -64,8 +59,9 @@ $lang = array_merge($lang, array(
'MCHAT_POSTS_REPLY' => 'Display new replies', 'MCHAT_POSTS_REPLY' => 'Display new replies',
'MCHAT_POSTS_EDIT' => 'Display edited posts', 'MCHAT_POSTS_EDIT' => 'Display edited posts',
'MCHAT_POSTS_QUOTE' => 'Display quoted posts', 'MCHAT_POSTS_QUOTE' => 'Display quoted posts',
'MCHAT_POSTS_LOGIN' => 'Display user logins',
'MCHAT_DATE_FORMAT' => 'Date format', 'MCHAT_DATE_FORMAT' => 'Date format',
'MCHAT_DATE_FORMAT_EXPLAIN' => 'The syntax used is identical to the PHP <a href="http://www.php.net/date">date()</a> function.', 'MCHAT_DATE_FORMAT_EXPLAIN' => 'The syntax used is identical to the PHP <a href="http://www.php.net/date">date()</a> function.',
'MCHAT_CUSTOM_DATEFORMAT' => 'Custom…', 'MCHAT_CUSTOM_DATEFORMAT' => 'Custom…',
)); ]);

View File

@@ -4,7 +4,7 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
@@ -16,7 +16,7 @@ if (!defined('IN_PHPBB'))
if (empty($lang) || !is_array($lang)) if (empty($lang) || !is_array($lang))
{ {
$lang = array(); $lang = [];
} }
// DEVELOPERS PLEASE NOTE // DEVELOPERS PLEASE NOTE
@@ -34,35 +34,35 @@ if (empty($lang) || !is_array($lang))
// Some characters for use // Some characters for use
// » “ ” … // » “ ” …
$lang = array_merge($lang, array( $lang = array_merge($lang, [
'ACL_U_MCHAT_USE' => 'Can use mChat', 'ACL_U_MCHAT_USE' => 'Can use mChat',
'ACL_U_MCHAT_VIEW' => 'Can view mChat', 'ACL_U_MCHAT_VIEW' => 'Can view mChat',
'ACL_U_MCHAT_EDIT' => 'Can edit messages', 'ACL_U_MCHAT_EDIT' => 'Can edit own messages',
'ACL_U_MCHAT_DELETE' => 'Can delete messages', 'ACL_U_MCHAT_DELETE' => 'Can delete own messages',
'ACL_U_MCHAT_MODERATOR_EDIT' => 'Can edit anyones messages',
'ACL_U_MCHAT_MODERATOR_DELETE' => 'Can delete anyones messages',
'ACL_U_MCHAT_IP' => 'Can view IP addresses', 'ACL_U_MCHAT_IP' => 'Can view IP addresses',
'ACL_U_MCHAT_PM' => 'Can use private message', 'ACL_U_MCHAT_PM' => 'Can use private message',
'ACL_U_MCHAT_LIKE' => 'Can like messages', 'ACL_U_MCHAT_LIKE' => 'Can see like icon (requires BBCode permission)',
'ACL_U_MCHAT_QUOTE' => 'Can quote messages', 'ACL_U_MCHAT_QUOTE' => 'Can see quote icon (requires BBCode permission)',
'ACL_U_MCHAT_FLOOD_IGNORE' => 'Can ignore flood limit', 'ACL_U_MCHAT_FLOOD_IGNORE' => 'Can ignore flood limits',
'ACL_U_MCHAT_ARCHIVE' => 'Can view the archive', '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_SMILIES' => 'Can use smilies',
'ACL_U_MCHAT_URLS' => 'Can post URLs', 'ACL_U_MCHAT_URLS' => 'Can post automatically parsed URLs',
'ACL_U_MCHAT_AVATARS' => 'Can customise <em>Display avatars</em>', 'ACL_U_MCHAT_AVATARS' => 'Can customise <em>Display avatars</em>',
'ACL_U_MCHAT_CAPITAL_LETTER' => 'Can customise <em>Capital first letter</em>', 'ACL_U_MCHAT_CAPITAL_LETTER' => 'Can customise <em>Capital first letter</em>',
'ACL_U_MCHAT_CHARACTER_COUNT' => 'Can customise <em>Display number of characters</em>', 'ACL_U_MCHAT_CHARACTER_COUNT' => 'Can customise <em>Display number of characters</em>',
'ACL_U_MCHAT_DATE' => 'Can customise <em>Date format</em>', 'ACL_U_MCHAT_DATE' => 'Can customise <em>Date format</em>',
'ACL_U_MCHAT_INDEX' => 'Can customise <em>Display on index</em>', 'ACL_U_MCHAT_INDEX' => 'Can customise <em>Display on index</em>',
'ACL_U_MCHAT_INPUT_AREA' => 'Can customise <em>Input type</em>',
'ACL_U_MCHAT_LOCATION' => 'Can customise <em>Location of mChat on the index page</em>', 'ACL_U_MCHAT_LOCATION' => 'Can customise <em>Location of mChat on the index page</em>',
'ACL_U_MCHAT_MESSAGE_TOP' => 'Can customise <em>Location of new chat messages</em>', 'ACL_U_MCHAT_MESSAGE_TOP' => 'Can customise <em>Location of new chat messages</em>',
'ACL_U_MCHAT_PAUSE_ON_INPUT' => 'Can customise <em>Pause on input</em>', 'ACL_U_MCHAT_POSTS' => 'Can customise <em>Display new posts</em>',
'ACL_U_MCHAT_POSTS' => 'Can customise <em>Display new post</em>',
'ACL_U_MCHAT_RELATIVE_TIME' => 'Can customise <em>Display relative time</em>', 'ACL_U_MCHAT_RELATIVE_TIME' => 'Can customise <em>Display relative time</em>',
'ACL_U_MCHAT_SOUND' => 'Can customise <em>Play sounds</em>', 'ACL_U_MCHAT_SOUND' => 'Can customise <em>Play sounds</em>',
'ACL_U_MCHAT_WHOIS_INDEX' => 'Can customise <em>Display who is chatting below the chat</em>', 'ACL_U_MCHAT_WHOIS_INDEX' => 'Can customise <em>Display who is chatting below the chat</em>',
'ACL_U_MCHAT_STATS_INDEX' => 'Can customise <em>Display who is chatting in the stats section</em>', 'ACL_U_MCHAT_STATS_INDEX' => 'Can customise <em>Display who is chatting in the stats section</em>',
'ACL_A_MCHAT' => 'Can manage mChat settings', 'ACL_A_MCHAT' => 'Can manage mChat settings',
)); ]);

View File

@@ -0,0 +1,31 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use phpbb\db\migration\migration;
class mchat_2_0_0 extends migration
{
static public function depends_on()
{
return array(
'\dmzx\mchat\migrations\mchat_2_0_0_rc7',
);
}
public function update_data()
{
return array(
array('config.update', array('mchat_version', '2.0.0')),
);
}
}

View File

@@ -4,65 +4,70 @@
* *
* @package phpBB Extension - mChat * @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net * @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi * @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
* *
*/ */
namespace dmzx\mchat\migrations; namespace dmzx\mchat\migrations;
class mchat_2_0_0_rc3 extends \phpbb\db\migration\migration use phpbb\db\migration\migration;
class mchat_2_0_0_rc3 extends migration
{ {
/** @const string */
const MCHAT_VERSION = '2.0.0-RC3';
/** @var array */
protected $mchat_config = null;
static public function depends_on() static public function depends_on()
{ {
return array('\phpbb\db\migration\data\v31x\v317pl1'); 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() public function update_data()
{ {
$config = $this->get_config(); return array(
$update_data = array(); array('config.add', array('mchat_version', '2.0.0-RC3')),
// Add configs // Add global configs
foreach (array('dmzx.mchat.config_global', 'dmzx.mchat.config_ucp') as $section) array('config.add', array('mchat_bbcode_disallowed', '')),
{ array('config.add', array('mchat_custom_height', 350)),
foreach ($config[$section] as $key => $value) array('config.add', array('mchat_custom_page', 1)),
{ array('config.add', array('mchat_edit_delete_limit', 0)),
$update_data[] = array('config.add', array($key, $value['default'])); 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_max_message_lngth', 500)),
array('config.add', array('mchat_message_num_archive', 25)),
array('config.add', array('mchat_message_num_custom', 10)),
array('config.add', array('mchat_message_num_index', 10)),
array('config.add', array('mchat_navbar_link', 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_posts_edit', 0)),
array('config.add', array('mchat_posts_quote', 0)),
array('config.add', array('mchat_posts_reply', 0)),
array('config.add', array('mchat_posts_topic', 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_timeout', 0)),
array('config.add', array('mchat_whois', 1)),
array('config.add', array('mchat_whois_refresh', 60)),
// Add user permissions for customizing config values // Add global user configs
foreach ($config['dmzx.mchat.config_ucp'] as $key => $value) array('config.add', array('mchat_avatars', 1)),
{ array('config.add', array('mchat_capital_letter', 1)),
$update_data[] = array('permission.add', array('u_' . $key, true)); array('config.add', array('mchat_character_count', 1)),
} array('config.add', array('mchat_date', 'D M d, Y g:i a')),
array('config.add', array('mchat_index', 1)),
return array_merge($update_data, array( array('config.add', array('mchat_input_area', 1)),
array('config.add', array('mchat_version', self::MCHAT_VERSION)), array('config.add', array('mchat_location', 1)),
array('config.add', array('mchat_message_top', 1)),
array('config.add', array('mchat_pause_on_input', 0)),
array('config.add', array('mchat_posts', 1)),
array('config.add', array('mchat_relative_time', 1)),
array('config.add', array('mchat_sound', 1)),
array('config.add', array('mchat_stats_index', 0)),
array('config.add', array('mchat_whois_index', 1)),
// Add user permissions // Add user permissions
array('permission.add', array('u_mchat_use', true)), array('permission.add', array('u_mchat_use', true)),
@@ -79,6 +84,22 @@ class mchat_2_0_0_rc3 extends \phpbb\db\migration\migration
array('permission.add', array('u_mchat_smilies', true)), array('permission.add', array('u_mchat_smilies', true)),
array('permission.add', array('u_mchat_urls', true)), array('permission.add', array('u_mchat_urls', true)),
// Add user permissions for customizing config values
array('permission.add', array('u_mchat_avatars', true)),
array('permission.add', array('u_mchat_capital_letter', true)),
array('permission.add', array('u_mchat_character_count', true)),
array('permission.add', array('u_mchat_date', true)),
array('permission.add', array('u_mchat_index', true)),
array('permission.add', array('u_mchat_input_area', true)),
array('permission.add', array('u_mchat_location', true)),
array('permission.add', array('u_mchat_message_top', true)),
array('permission.add', array('u_mchat_pause_on_input', true)),
array('permission.add', array('u_mchat_posts', true)),
array('permission.add', array('u_mchat_relative_time', true)),
array('permission.add', array('u_mchat_sound', true)),
array('permission.add', array('u_mchat_stats_index', true)),
array('permission.add', array('u_mchat_whois_index', true)),
// Add admin permissions // Add admin permissions
array('permission.add', array('a_mchat', true)), array('permission.add', array('a_mchat', true)),
@@ -114,45 +135,48 @@ class mchat_2_0_0_rc3 extends \phpbb\db\migration\migration
array('module.add', array( array('module.add', array(
'acp', 'acp',
'ACP_CAT_DOT_MODS', 'ACP_CAT_DOT_MODS',
'ACP_CAT_MCHAT' 'ACP_CAT_MCHAT',
)), )),
// Add ACP preferences module // Add ACP preferences module
array('module.add', array( array('module.add', array(
'acp', 'acp',
'ACP_CAT_MCHAT', 'ACP_CAT_MCHAT',
array('module_basename' => '\dmzx\mchat\acp\acp_mchat_module'), array(
'module_basename' => '\dmzx\mchat\acp\acp_mchat_module',
'modes' => array(
'globalsettings',
'globalusersettings',
),
),
)), )),
// Add UCP category // Add UCP category
array('module.add', array( array('module.add', array(
'ucp', 'ucp',
0, 0,
'UCP_MCHAT_CONFIG' 'UCP_MCHAT_CONFIG',
)), )),
// Add UCP preferences module // Add UCP preferences module
array('module.add', array( array('module.add', array(
'ucp', 'ucp',
'UCP_MCHAT_CONFIG', 'UCP_MCHAT_CONFIG',
array('module_basename' => '\dmzx\mchat\ucp\ucp_mchat_module'), array(
'module_basename' => '\dmzx\mchat\ucp\ucp_mchat_module',
'modes' => array(
'configuration',
),
),
)), )),
)); );
} }
public function update_schema() 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( return array(
'add_tables' => array( 'add_tables' => array(
$this->table_prefix . 'mchat' => array( $this->table_prefix . 'mchat' => array(
'COLUMNS' => array( 'COLUMNS' => array(
'message_id' => array('UINT', null, 'auto_increment'), 'message_id' => array('UINT', null, 'auto_increment'),
'user_id' => array('UINT', 0), 'user_id' => array('UINT', 0),
@@ -171,7 +195,7 @@ class mchat_2_0_0_rc3 extends \phpbb\db\migration\migration
$this->table_prefix . 'mchat_deleted_messages' => array( $this->table_prefix . 'mchat_deleted_messages' => array(
'COLUMNS' => array( 'COLUMNS' => array(
'message_id' => array('UINT', null), 'message_id' => array('UINT', 0),
), ),
'PRIMARY_KEY' => 'message_id', 'PRIMARY_KEY' => 'message_id',
), ),
@@ -186,31 +210,53 @@ class mchat_2_0_0_rc3 extends \phpbb\db\migration\migration
), ),
), ),
'add_columns' => array( 'add_columns' => array(
$this->table_prefix . 'users' => $user_columns, $this->table_prefix . 'users' => array(
'user_mchat_avatars' => array('BOOL', 1),
'user_mchat_capital_letter' => array('BOOL', 1),
'user_mchat_character_count' => array('BOOL', 1),
'user_mchat_date' => array('VCHAR:64', 'D M d, Y g:i a'),
'user_mchat_index' => array('BOOL', 1),
'user_mchat_input_area' => array('BOOL', 1),
'user_mchat_location' => array('BOOL', 1),
'user_mchat_message_top' => array('BOOL', 1),
'user_mchat_pause_on_input' => array('BOOL', 0),
'user_mchat_posts' => array('BOOL', 1),
'user_mchat_relative_time' => array('BOOL', 1),
'user_mchat_sound' => array('BOOL', 1),
'user_mchat_stats_index' => array('BOOL', 0),
'user_mchat_whois_index' => array('BOOL', 1),
),
), ),
); );
} }
public function revert_schema() 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( return array(
'drop_tables' => array( 'drop_tables' => array(
$this->table_prefix . 'mchat', $this->table_prefix . 'mchat',
$this->table_prefix . 'mchat_deleted_messages', $this->table_prefix . 'mchat_deleted_messages',
$this->table_prefix . 'mchat_sessions', $this->table_prefix . 'mchat_sessions',
), ),
'drop_columns' => array( 'drop_columns' => array(
$this->table_prefix . 'users' => $user_columns, $this->table_prefix . 'users' => array(
'user_mchat_avatars',
'user_mchat_capital_letter',
'user_mchat_character_count',
'user_mchat_date',
'user_mchat_index',
'user_mchat_input_area',
'user_mchat_location',
'user_mchat_message_top',
'user_mchat_pause_on_input',
'user_mchat_posts',
'user_mchat_relative_time',
'user_mchat_sound',
'user_mchat_stats_index',
'user_mchat_whois_index',
),
), ),
); );
} }

View File

@@ -0,0 +1,31 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use phpbb\db\migration\migration;
class mchat_2_0_0_rc4 extends migration
{
static public function depends_on()
{
return array(
'\dmzx\mchat\migrations\mchat_2_0_0_rc3',
);
}
public function update_data()
{
return array(
array('config.update', array('mchat_version', '2.0.0-RC4')),
);
}
}

View File

@@ -0,0 +1,31 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use phpbb\db\migration\migration;
class mchat_2_0_0_rc5 extends migration
{
static public function depends_on()
{
return array(
'\dmzx\mchat\migrations\mchat_2_0_0_rc4',
);
}
public function update_data()
{
return array(
array('config.update', array('mchat_version', '2.0.0-RC5')),
);
}
}

View File

@@ -0,0 +1,79 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use phpbb\db\migration\migration;
class mchat_2_0_0_rc6 extends migration
{
static public function depends_on()
{
return array(
'\dmzx\mchat\migrations\mchat_2_0_0_rc5',
);
}
public function update_data()
{
return array(
array('config.update', array('mchat_version', '2.0.0-RC6')),
array('config.add', array('mchat_navbar_link_count', 1)),
array('config.add', array('mchat_posts_login', 0)),
array('config.add', array('mchat_prune_gc', strtotime('1 day', 0))),
array('config.add', array('mchat_prune_last_gc', 0, true)), // true => value is dynamic, do not cache
array('config.remove', array('mchat_whois')),
array('permission.add', array('u_mchat_moderator_edit', true)),
array('permission.add', array('u_mchat_moderator_delete', true)),
);
}
public function update_schema()
{
return array(
'add_tables' => array(
$this->table_prefix . 'mchat_log' => array(
'COLUMNS' => array(
'log_id' => array('UINT', null, 'auto_increment'),
'log_type' => array('TINT:4', 0),
'user_id' => array('UINT', 0),
'message_id' => array('UINT', 0),
'log_ip' => array('VCHAR:40', ''),
'log_time' => array('INT:11', 0),
),
'PRIMARY_KEY' => 'log_id',
),
),
'drop_tables' => array(
$this->table_prefix . 'mchat_deleted_messages',
),
'drop_columns' => array(
$this->table_prefix . 'mchat' => array(
'edit_time',
),
),
);
}
public function revert_schema()
{
return array(
'drop_tables' => array(
$this->table_prefix . 'mchat_log',
),
);
}
}

View File

@@ -0,0 +1,67 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2016 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use phpbb\db\migration\migration;
class mchat_2_0_0_rc7 extends migration
{
static public function depends_on()
{
return array(
'\dmzx\mchat\migrations\mchat_2_0_0_rc6',
);
}
public function update_data()
{
return array(
array('config.update', array('mchat_version', '2.0.0-RC7')),
array('config.add', array('mchat_prune_mode', 0)),
array('custom', array(array($this, 'fix_pruning_time_span'))),
);
}
/**
* In 2.0.0-RC6 it was possible to specify a time span like '45 minutes' or '4 days' to
* keep the messages from that time span when pruning messages. Since 2.0.0-RC7 it is
* only possible to specify the number of hours, days or weeks. If such a time span is
* defined in the mchat_prune_num config value it is converted here to the number of
* hours, rounded up to the next full hour.
*/
public function fix_pruning_time_span()
{
$prune_num = $this->config['mchat_prune_num'];
if (false === filter_var($prune_num, FILTER_VALIDATE_INT))
{
$time_span = strtotime($prune_num, 0);
if ($time_span !== false)
{
// A time span is specified. Convert it to number of hours.
$hours = ceil($time_span / 60 / 60);
$sql = 'UPDATE ' . CONFIG_TABLE . '
SET config_value = ' . (int) $hours . "
WHERE config_name = 'mchat_prune_num'";
$this->sql_query($sql);
// Set to 'hours' mode
$sql = 'UPDATE ' . CONFIG_TABLE . "
SET config_value = 1
WHERE config_name = 'mchat_prune_mode'";
$this->sql_query($sql);
}
}
}
}

View File

@@ -0,0 +1,32 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2017 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use dmzx\mchat\core\settings;
use phpbb\db\migration\migration;
class mchat_2_0_1 extends migration
{
static public function depends_on()
{
return array(
'\dmzx\mchat\migrations\mchat_2_0_0',
);
}
public function update_data()
{
return array(
array('config.update', array('mchat_version', '2.0.1')),
array('config.add', array('mchat_archive_sort', settings::ARCHIVE_SORT_BOTTOM_TOP)),
);
}
}

View File

@@ -0,0 +1,39 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2017 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use phpbb\db\migration\migration;
class mchat_2_0_2 extends migration
{
static public function depends_on()
{
return array(
'\dmzx\mchat\migrations\mchat_2_0_1',
);
}
public function update_data()
{
return array(
array('config.update', array('mchat_version', '2.0.2')),
array('config.add', array('mchat_posts_auth_check', 0)),
// Move rules and static message from config to config_text table
array('config_text.add', array('mchat_rules', $this->config['mchat_rules'])),
array('config_text.add', array('mchat_static_message', $this->config['mchat_static_message'])),
array('config.remove', array('mchat_rules')),
array('config.remove', array('mchat_static_message')),
);
}
}

View File

@@ -0,0 +1,30 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2018 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use phpbb\db\migration\migration;
class mchat_2_0_3 extends migration
{
static public function depends_on()
{
return array(
'\dmzx\mchat\migrations\mchat_2_0_2',
);
}
public function update_data()
{
return array(
array('config.update', array('mchat_version', '2.0.3')),
);
}
}

View File

@@ -0,0 +1,30 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2018 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use phpbb\db\migration\migration;
class mchat_2_1_0 extends migration
{
public static function depends_on()
{
return [
'\dmzx\mchat\migrations\mchat_2_1_0_rc1',
];
}
public function update_data()
{
return [
['config.update', ['mchat_version', '2.1.0']],
];
}
}

View File

@@ -0,0 +1,66 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2018 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use phpbb\db\migration\migration;
class mchat_2_1_0_rc1 extends migration
{
public static function depends_on()
{
return [
'\dmzx\mchat\migrations\mchat_2_0_3',
];
}
public function update_data()
{
return [
['config.update', ['mchat_version', '2.1.0-RC1']],
['config.remove', ['mchat_navbar_link']],
['config.add', ['mchat_max_input_height', 150]],
['config.add', ['mchat_log_enabled', 1]],
// Message reparser
['config.add', ['dmzx.mchat.text_reparser.mchat_messages_cron_interval', 10]],
['config.add', ['dmzx.mchat.text_reparser.mchat_messages_last_cron', 0]],
// Remove pause on input
['config.remove', ['mchat_pause_on_input']],
['permission.remove', ['u_mchat_pause_on_input', true]],
];
}
public function update_schema()
{
return [
'drop_columns' => [
$this->table_prefix . 'users' => [
'user_mchat_pause_on_input',
],
],
];
}
public function revert_schema()
{
return [
'add_columns' => [
$this->table_prefix . 'users' => [
'user_mchat_pause_on_input' => ['BOOL', 0],
],
],
];
}
}

View File

@@ -0,0 +1,55 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2018 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use phpbb\db\migration\migration;
class mchat_2_1_1 extends migration
{
public static function depends_on()
{
return [
'\dmzx\mchat\migrations\mchat_2_1_0',
];
}
public function update_data()
{
return [
['config.update', ['mchat_version', '2.1.1']],
['config.remove', ['mchat_input_area']],
['permission.remove', ['u_mchat_input_area', true]],
];
}
public function update_schema()
{
return [
'drop_columns' => [
$this->table_prefix . 'users' => [
'user_mchat_input_area',
],
],
];
}
public function revert_schema()
{
return [
'add_columns' => [
$this->table_prefix . 'users' => [
'user_mchat_input_area' => ['BOOL', 1],
],
],
];
}
}

View File

@@ -0,0 +1,30 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2018 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use phpbb\db\migration\migration;
class mchat_2_1_2 extends migration
{
public static function depends_on()
{
return [
'\dmzx\mchat\migrations\mchat_2_1_1',
];
}
public function update_data()
{
return [
['config.update', ['mchat_version', '2.1.2']],
];
}
}

View File

@@ -0,0 +1,31 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2019 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use phpbb\db\migration\migration;
class mchat_2_1_3 extends migration
{
public static function depends_on()
{
return [
'\dmzx\mchat\migrations\mchat_2_1_2',
];
}
public function update_data()
{
return [
['config.update', ['mchat_version', '2.1.3']],
['config.add', ['mchat_flood_messages', 0]],
];
}
}

View File

@@ -0,0 +1,30 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2020 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use phpbb\db\migration\migration;
class mchat_2_1_4 extends migration
{
public static function depends_on()
{
return [
'\dmzx\mchat\migrations\mchat_2_1_4_rc2',
];
}
public function update_data()
{
return [
['config.update', ['mchat_version', '2.1.4']],
];
}
}

View File

@@ -0,0 +1,30 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2020 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use phpbb\db\migration\migration;
class mchat_2_1_4_rc1 extends migration
{
public static function depends_on()
{
return [
'\dmzx\mchat\migrations\mchat_2_1_3',
];
}
public function update_data()
{
return [
['config.update', ['mchat_version', '2.1.4-RC1']],
];
}
}

View File

@@ -0,0 +1,30 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2020 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
use phpbb\db\migration\migration;
class mchat_2_1_4_rc2 extends migration
{
public static function depends_on()
{
return [
'\dmzx\mchat\migrations\mchat_2_1_4_rc1',
];
}
public function update_data()
{
return [
['config.update', ['mchat_version', '2.1.4-RC2']],
];
}
}

6
sounds/README.txt Normal file
View File

@@ -0,0 +1,6 @@
Credits
add.mp3 UI Buttons and Whooshes Pack 1 by Narfstuff http://www.narfstuff.co.uk/
edit.mp3 Scribble by TiesWijnen https://www.freesound.org/people/TiesWijnen/sounds/341738/
del.mp3 Paper Throw http://www.soundjay.com/
error.mp3 GUI Sound Effects by Lokif http://opengameart.org/content/gui-sound-effects

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
{% INCLUDECSS '@dmzx_mchat/mchat_absolution.css' %}

View File

@@ -0,0 +1,18 @@
/**
*
* mChat CSS for Absolution
*
* @package phpBB Extension - mChat
* @copyright (c) 2018 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
.mchat-nav-link-title {
color: #082c51;
font-weight: bold;
}
.mchat-nav-link-title i {
color: #EE8B0A;
}

View File

@@ -0,0 +1,5 @@
{% INCLUDECSS '@dmzx_mchat/mchat_allanstyle.css' %}
<script>
document.querySelector('#mchat-body').classList.add('topiclist');
document.querySelector('#mchat-body').classList.add('forums');
</script>

View File

@@ -0,0 +1,17 @@
/**
*
* mChat CSS for AllanStyle SUBSILVER
*
* @package phpBB Extension - mChat
* @copyright (c) 2018 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
@media only screen and (min-width: 700px), only screen and (min-device-width: 700px) {
.mchat-wrapper .list-inner {
margin-left: 5px;
}
}

View File

@@ -0,0 +1 @@
{% INCLUDECSS '@dmzx_mchat/mchat_cleansilver.css' %}

View File

@@ -0,0 +1,26 @@
/**
*
* mChat CSS for CleanSilver
*
* @package phpBB Extension - mChat
* @copyright (c) 2017 MannixMD
* @copyright (c) 2018 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
.mchat-panel-buttons .icon.fa.fa-smile-o {
padding: 3px;
}
.mchat-wrapper li.header dd {
width: 95px;
}
.mchat-wrapper li.header dd.lastpost {
width: 250px;
}
.mchat-button-is-down {
border-style: none;
}

View File

@@ -0,0 +1 @@
{% INCLUDECSS '@dmzx_mchat/mchat_hexagonreborn.css' %}

View File

@@ -0,0 +1,26 @@
/**
*
* mChat CSS for Hexagon Reborn
*
* @package phpBB Extension - mChat
* @copyright (c) 2017 MannixMD
* @copyright (c) 2018 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
.mchat-button-down {
line-height: 1.6;
}
.mchat-button-down .icon {
padding: 2px;
}
.mchat-button-is-down {
border-style: none;
}
.mchat-input-control button:hover .icon {
color: #de7300;
}

View File

@@ -0,0 +1 @@
{% INCLUDECSS '@dmzx_mchat/mchat_myinvision.css' %}

View File

@@ -0,0 +1,20 @@
/**
*
* mChat CSS for MyInvision
*
* @package phpBB Extension - mChat
* @copyright (c) 2017 MannixMD
* @copyright (c) 2018 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
.mchat-status {
padding-bottom: 10px;
}
#mchat-panel {
border-bottom: 1px solid #ccc;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
}

View File

@@ -0,0 +1 @@
{% INCLUDECSS '@dmzx_mchat/mchat_projectdurango.css' %}

View File

@@ -0,0 +1,78 @@
/**
*
* mChat CSS for Project Durango
*
* @package phpBB Extension - mChat
* @copyright (c) 2017 MannixMD
* @copyright (c) 2018 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
.mchat-panel-buttons .button {
border-color: #3a3a3a;
background: #3a3a3a;
}
.mchat-panel-buttons .button:hover {
background: #5dc21e;
border-color: #5dc21e;
}
.mchat-panel-button .button .icon {
color: #000;
}
.mchat-panel-buttons .icon {
color: #5dc21e;
}
.mchat-input-control button:hover .icon {
color: #5dc21e;
}
ul#mchat-messages {
background: #c2c2c2;
}
.mchat-messages-top .row {
border-bottom-color: #107c10;
border-bottom-width: 4px;
border-top-width: 0;
}
.mchat-text {
color: #3a3a3a;
}
ul.mchat-buttons .icon {
color: #107c10;
}
.mchat-wrapper .mchat-buttons li {
opacity: .5;
}
#mchat-main {
border-top: 4px solid #107c10;
}
#mchat-messages li.row:hover {
background: #c2c2c2;
}
.mchat-message-header {
color: #3a3a3a;
}
.mchat-button-add .icon {
color: #107c10;
}
#mchat-confirm textarea {
color: #f1f1f1;
}
#mchat-panel {
background-color: #6b6b6b;
}

View File

@@ -0,0 +1 @@
{% INCLUDECSS '@dmzx_mchat/mchat_se_gamer.css' %}

View File

@@ -0,0 +1,16 @@
/**
*
* mChat CSS for SE Gamer
*
* @package phpBB Extension - mChat
* @copyright (c) 2018 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
.mchat-nav-link-title,
.mchat-nav-link-title:hover,
.mchat-nav-link,
.mchat-nav-link:hover {
color: #FFFFFF;
}

View File

@@ -0,0 +1,6 @@
/*!
autosize 4.0.2
license: MIT
http://www.jacklmoore.com/autosize
*/
!function(e,t){if("function"==typeof define&&define.amd)define(["module","exports"],t);else if("undefined"!=typeof exports)t(module,exports);else{var n={exports:{}};t(n,n.exports),e.autosize=n.exports}}(this,function(e,t){"use strict";var n,o,p="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return-1<n.indexOf(e)},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);-1<t&&(n.splice(t,1),o.splice(t,1))}}),c=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){c=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function r(r){if(r&&r.nodeName&&"TEXTAREA"===r.nodeName&&!p.has(r)){var e,n=null,o=null,i=null,d=function(){r.clientWidth!==o&&a()},l=function(t){window.removeEventListener("resize",d,!1),r.removeEventListener("input",a,!1),r.removeEventListener("keyup",a,!1),r.removeEventListener("autosize:destroy",l,!1),r.removeEventListener("autosize:update",a,!1),Object.keys(t).forEach(function(e){r.style[e]=t[e]}),p.delete(r)}.bind(r,{height:r.style.height,resize:r.style.resize,overflowY:r.style.overflowY,overflowX:r.style.overflowX,wordWrap:r.style.wordWrap});r.addEventListener("autosize:destroy",l,!1),"onpropertychange"in r&&"oninput"in r&&r.addEventListener("keyup",a,!1),window.addEventListener("resize",d,!1),r.addEventListener("input",a,!1),r.addEventListener("autosize:update",a,!1),r.style.overflowX="hidden",r.style.wordWrap="break-word",p.set(r,{destroy:l,update:a}),"vertical"===(e=window.getComputedStyle(r,null)).resize?r.style.resize="none":"both"===e.resize&&(r.style.resize="horizontal"),n="content-box"===e.boxSizing?-(parseFloat(e.paddingTop)+parseFloat(e.paddingBottom)):parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth),isNaN(n)&&(n=0),a()}function s(e){var t=r.style.width;r.style.width="0px",r.offsetWidth,r.style.width=t,r.style.overflowY=e}function u(){if(0!==r.scrollHeight){var e=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(r),t=document.documentElement&&document.documentElement.scrollTop;r.style.height="",r.style.height=r.scrollHeight+n+"px",o=r.clientWidth,e.forEach(function(e){e.node.scrollTop=e.scrollTop}),t&&(document.documentElement.scrollTop=t)}}function a(){u();var e=Math.round(parseFloat(r.style.height)),t=window.getComputedStyle(r,null),n="content-box"===t.boxSizing?Math.round(parseFloat(t.height)):r.offsetHeight;if(n<e?"hidden"===t.overflowY&&(s("scroll"),u(),n="content-box"===t.boxSizing?Math.round(parseFloat(window.getComputedStyle(r,null).height)):r.offsetHeight):"hidden"!==t.overflowY&&(s("hidden"),u(),n="content-box"===t.boxSizing?Math.round(parseFloat(window.getComputedStyle(r,null).height)):r.offsetHeight),i!==n){i=n;var o=c("autosize:resized");try{r.dispatchEvent(o)}catch(e){}}}}function i(e){var t=p.get(e);t&&t.destroy()}function d(e){var t=p.get(e);t&&t.update()}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((l=function(e){return e}).destroy=function(e){return e},l.update=function(e){return e}):((l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return r(e)}),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],d),e}),t.default=l,e.exports=t.default});

View File

@@ -1,47 +0,0 @@
/*
jQuery autoGrowInput v1.0.3
Copyright (c) 2014 Simon Steinberger / Pixabay
Based on stackoverflow.com/questions/931207 (James Padolsey)
GitHub: https://github.com/Pixabay/jQuery-autoGrowInput
License: http://www.opensource.org/licenses/mit-license.php
*/
(function($){
var event = 'oninput' in document.createElement('input') ? 'input' : 'keydown';
$.fn.autoGrowInput = function(options){
var o = $.extend({ maxWidth: 500, minWidth: 20, comfortZone: 0 }, options);
this.each(function(){
var input = $(this),
val = ' ',
comfortZone = (options && 'comfortZone' in options) ? o.comfortZone : parseInt(input.css('fontSize')),
span = $('<span/>').css({
position: 'absolute',
top: -9999,
left: -9999,
width: 'auto',
fontSize: input.css('fontSize'),
fontFamily: input.css('fontFamily'),
fontWeight: input.css('fontWeight'),
letterSpacing: input.css('letterSpacing'),
textTransform: input.css('textTransform'),
whiteSpace: 'nowrap',
ariaHidden: true
}).appendTo('body'),
check = function(e){
if (val === (val = input.val()) && e.type !== 'autogrow') return;
if (!val) val = input.attr('placeholder') || '';
span.html(val.replace(/&/g, '&amp;').replace(/\s/g, '&nbsp;').replace(/</g, '&lt;').replace(/>/g, '&gt;'));
var newWidth = span.width() + comfortZone, mw = typeof(o.maxWidth) == "function" ? o.maxWidth() : o.maxWidth;
if (newWidth > mw) newWidth = mw;
else if (newWidth < o.minWidth) newWidth = o.minWidth;
if (newWidth != input.width()) input.width(newWidth);
};
input.on(event+'.autogrow autogrow', check);
// init on page load
check();
});
return this;
}
}(jQuery));

View File

@@ -1,2 +0,0 @@
/*! js-cookie v2.0.4 | MIT */
!function(a){if("function"==typeof define&&define.amd)define(a);else if("object"==typeof exports)module.exports=a();else{var b=window.Cookies,c=window.Cookies=a();c.noConflict=function(){return window.Cookies=b,c}}}(function(){function a(){for(var a=0,b={};a<arguments.length;a++){var c=arguments[a];for(var d in c)b[d]=c[d]}return b}function b(c){function d(b,e,f){var g;if(arguments.length>1){if(f=a({path:"/"},d.defaults,f),"number"==typeof f.expires){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}try{g=JSON.stringify(e),/^[\{\[]/.test(g)&&(e=g)}catch(i){}return e=encodeURIComponent(String(e)),e=e.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),b=encodeURIComponent(String(b)),b=b.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),b=b.replace(/[\(\)]/g,escape),document.cookie=[b,"=",e,f.expires&&"; expires="+f.expires.toUTCString(),f.path&&"; path="+f.path,f.domain&&"; domain="+f.domain,f.secure?"; secure":""].join("")}b||(g={});for(var j=document.cookie?document.cookie.split("; "):[],k=/(%[0-9A-Z]{2})+/g,l=0;l<j.length;l++){var m=j[l].split("="),n=m[0].replace(k,decodeURIComponent),o=m.slice(1).join("=");'"'===o.charAt(0)&&(o=o.slice(1,-1));try{if(o=c&&c(o,n)||o.replace(k,decodeURIComponent),this.json)try{o=JSON.parse(o)}catch(i){}if(b===n){g=o;break}b||(g[n]=o)}catch(i){}}return g}return d.get=d.set=d,d.getJSON=function(){return d.apply({json:!0},[].slice.call(arguments))},d.defaults={},d.remove=function(b,c){d(b,"",a(c,{expires:-1}))},d.withConverter=b,d}return b()});

View File

@@ -0,0 +1,53 @@
/**
*
* mchat.collapse.js - Collapse mChat container for styles by Arty
*
* @package phpBB Extension - mChat
* @copyright (c) 2017 kasimi - https://kasimi.net
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
jQuery(function($) {
"use strict";
// Most code below copied from elegance/template/forum_fn.js for phpBB 3.2.2
var $this = $('.mchat-wrapper li.header').first(),
forum = $this.closest('.topiclist').next(),
id = 'mchat',
toggled = false,
toggle;
// Add toggle code
$this.append('<a class="forum-toggle" href="#"></a>');
toggle = $this.find('.forum-toggle');
toggle.click(function(event) {
event.preventDefault();
$(mChat).trigger('mchat_collapse_toggle_before', [{collapsed: !toggle}]);
if (toggled) {
forum.stop(true, true).slideDown(200, function() {
$(mChat).trigger('mchat_collapse_toggle_after', [{collapsed: toggle}]);
});
toggled = false;
toggle.removeClass('toggled');
phpbb.deleteCookie('toggled-' + id, styleConfig.cookieConfig);
return;
}
forum.stop(true, true).slideUp(200, function() {
$(mChat).trigger('mchat_collapse_toggle_after', [{collapsed: toggle}]);
});
toggled = true;
toggle.addClass('toggled');
phpbb.setCookie('toggled-' + id, '1', styleConfig.cookieConfig);
});
// Check default state
if (phpbb.getCookie('toggled-' + id, styleConfig.cookieConfig) === '1') {
forum.stop(true, true).slideUp(0);
toggled = true;
toggle.addClass('toggled');
}
});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,61 @@
{% if MCHAT_PAGE == 'archive' or not (MCHAT_ALLOW_USE and S_BBCODE_ALLOWED) %}
{% INCLUDEJS T_ASSETS_PATH ~ '/javascript/editor.js' %}
{% endif %}
{% if MCHAT_MAX_INPUT_HEIGHT %}
{% INCLUDEJS '@dmzx_mchat/javascript/autosize.min.js' %}
{% endif %}
{% INCLUDEJS '@dmzx_mchat/javascript/jquery.titlealert.min.js' %}
{% INCLUDEJS '@dmzx_mchat/javascript/mchat.js' %}
<script>
var form_name = 'postform';
var text_name = 'message';
var mChat = {
// General settings
actionUrls : {
{% for mchaturl in loops.mchaturl %}
{{ mchaturl.ACTION }}: '{{ mchaturl.URL }}'{{ not loop.last ? ',' }}
{% endfor %}
},
page : '{{ MCHAT_PAGE | escape('js') }}',
currentUrl : '{{ MCHAT_CURRENT_URL | escape('js') }}',
cookie : '{{ COOKIE_NAME | escape('js') }}',
playSound : {{ MCHAT_SOUND ? 'true' : 'false' }},
messageTop : {{ MCHAT_MESSAGE_TOP ? 'true' : 'false' }},
allowBBCodes : {{ S_BBCODE_ALLOWED ? 'true' : 'false' }},
relativeTime : {{ MCHAT_RELATIVE_TIME ? 'true' : 'false' }},
showCharCount : {{ MCHAT_CHARACTER_COUNT ? 'true' : 'false' }},
jumpTo : {{ MCHAT_JUMP_TO }},
// Limits & timeouts
refreshTime : {{ MCHAT_REFRESH_JS }},
whoisRefresh : {{ MCHAT_WHOIS_REFRESH }},
timeout : {{ MCHAT_TIMEOUT }},
mssgLngth : {{ MCHAT_MAX_MESSAGE_LENGTH }},
maxInputHeight : {{ MCHAT_MAX_INPUT_HEIGHT }},
editDeleteLimit : {{ MCHAT_EDIT_DELETE_LIMIT }},
logId : {{ MCHAT_LOG_ID }},
latestMessageId : {{ MCHAT_LATEST_MESSAGE_ID | default(0) }},
removeBBCodes : '{{ MCHAT_DISALLOWED_BBCODES | escape('js') }}',
// Language
lang: {
minutesAgo : {
{% if MCHAT_RELATIVE_TIME %}
{% for minute in 0..MCHAT_MINUTES_AGO_LIMIT-1 %}
{{ minute }}: '{{ lang('MCHAT_MINUTES_AGO', minute) | escape('js') }}'{{ not loop.last ? ',' }}
{% endfor %}
{% endif %}
},
err : '{{ lang('ERROR') | escape('js') }}',
parserErr : '{{ lang('AJAX_ERROR_TEXT_PARSERERROR') | escape('js') }}',
newMessageAlert : '{{ lang('MCHAT_NEW_CHAT') | escape('js') }}',
editInfo : '{{ lang('MCHAT_EDITINFO') | escape('js') }}',
delConfirm : '{{ lang('MCHAT_DELCONFIRM') | escape('js') }}',
mention : '{{ lang('MCHAT_MENTION') | escape('js') }}',
charCount : '{{ lang(MCHAT_MAX_MESSAGE_LENGTH ? 'MCHAT_CHARACTER_COUNT_LIMIT' : 'MCHAT_CHARACTER_COUNT') | escape('js') }}',
mssgLngthLong : '{{ lang('MCHAT_MESS_LONG', MCHAT_MAX_MESSAGE_LENGTH) | escape('js') }}',
likes : '{{ lang('MCHAT_LIKES') | escape('js') }}'
}
};
</script>

View File

@@ -0,0 +1,2 @@
{% INCLUDECSS '@dmzx_mchat/mchat.arty.css' %}
{% INCLUDEJS '@dmzx_mchat/javascript/mchat.collapse.arty.js' %}

View File

@@ -1,2 +0,0 @@
<!-- INCLUDECSS @dmzx_mchat/mchat.css -->
<!-- INCLUDECSS @dmzx_mchat/mchat_custom.css -->

View File

@@ -1 +0,0 @@
<li class="tab mchat" data-select-match="mchat" data-responsive-class="tab small-icon icon-mchat"><a class="nav-link" href="{U_MCHAT}" title="{L_MCHAT_TITLE}" role="menuitem">{L_MCHAT_TITLE}</a></li>

View File

@@ -1,77 +0,0 @@
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
.icon-mchat {
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;
}
.navbar .nav-tabs .mchat .nav-link {
position: relative;
text-indent: 999px;
width: 15px;
padding: 0 8px;
overflow: hidden;
}
.navbar .nav-tabs .mchat .nav-link:after {
content: '\f086';
font-family: 'FontAwesome';
position: absolute;
top: 50%;
margin-top: -7.5px;
width: 15px;
line-height: 15px;
height: 15px;
font-weight: normal;
font-style: normal;
text-indent: 0;
text-align: center;
font-size: 15px;
left:8px
}
.rtl .navbar .nav-tabs .mchat .nav-link {
padding-left: 12px;
padding-right: 30px;
}
.rtl .navbar .nav-tabs .mchat .nav-link:after {
left: auto;
right: 8px;
}
li.mchat-message:first-child {
border-top-width: 1px;
padding-top: 5px;
}
li.mchat-message:last-child {
border-bottom-width: 1px;
padding-bottom: 5px;
}

View File

@@ -0,0 +1 @@
{% INCLUDECSS '@dmzx_mchat/mchat.arty.css' %}

View File

@@ -1,2 +0,0 @@
<!-- INCLUDECSS @dmzx_mchat/mchat.css -->
<!-- INCLUDECSS @dmzx_mchat/mchat_custom.css -->

View File

@@ -1 +0,0 @@
<li class="tab mchat" data-select-match="mchat" data-responsive-class="tab small-icon icon-mchat"><a class="nav-link" href="{U_MCHAT}" title="{L_MCHAT_TITLE}" role="menuitem">{L_MCHAT_TITLE}</a></li>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -1,71 +0,0 @@
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
.icon-mchat {
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;
}
.navbar .nav-tabs .mchat .nav-link {
position: relative;
text-indent: 999px;
width: 15px;
padding: 0 8px;
overflow: hidden;
}
.navbar .nav-tabs .mchat .nav-link:after {
content: '\f086';
font-family: 'FontAwesome';
position: absolute;
top: 50%;
margin-top: -7.5px;
width: 15px;
line-height: 15px;
height: 15px;
font-weight: normal;
font-style: normal;
text-indent: 0;
text-align: center;
font-size: 15px;
left:8px
}
.rtl .navbar .nav-tabs .mchat .nav-link {
padding-left: 12px;
padding-right: 30px;
}
.rtl .navbar .nav-tabs .mchat .nav-link:after {
left: auto;
right: 8px;
}
.mchat-button:before {
background-image: url("./images/message_icons.png");
}

View File

@@ -0,0 +1,2 @@
{% INCLUDECSS '@dmzx_mchat/mchat.arty.css' %}
{% INCLUDEJS '@dmzx_mchat/javascript/mchat.collapse.arty.js' %}

View File

@@ -0,0 +1,2 @@
{% INCLUDECSS '@dmzx_mchat/mchat.arty.css' %}
{% INCLUDEJS '@dmzx_mchat/javascript/mchat.collapse.arty.js' %}

View File

@@ -1,2 +0,0 @@
<!-- INCLUDECSS @dmzx_mchat/mchat.css -->
<!-- INCLUDECSS @dmzx_mchat/mchat_custom.css -->

View File

@@ -1 +0,0 @@
<li class="tab mchat" data-select-match="mchat" data-responsive-class="tab small-icon icon-mchat"><a class="nav-link" href="{U_MCHAT}" title="{L_MCHAT_TITLE}" role="menuitem">{L_MCHAT_TITLE}</a></li>

View File

@@ -1,67 +0,0 @@
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
.icon-mchat {
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;
}
.navbar .nav-tabs .mchat .nav-link {
position: relative;
text-indent: 999px;
width: 15px;
padding: 0 8px;
overflow: hidden;
}
.navbar .nav-tabs .mchat .nav-link:after {
content: '\f086';
font-family: 'FontAwesome';
position: absolute;
top: 50%;
margin-top: -7.5px;
width: 15px;
line-height: 15px;
height: 15px;
font-weight: normal;
font-style: normal;
text-indent: 0;
text-align: center;
font-size: 15px;
left:8px
}
.rtl .navbar .nav-tabs .mchat .nav-link {
padding-left: 12px;
padding-right: 30px;
}
.rtl .navbar .nav-tabs .mchat .nav-link:after {
left: auto;
right: 8px;
}

View File

@@ -0,0 +1,2 @@
{% INCLUDECSS '@dmzx_mchat/mchat.arty.css' %}
{% INCLUDEJS '@dmzx_mchat/javascript/mchat.collapse.arty.js' %}

View File

@@ -1,2 +0,0 @@
<!-- INCLUDECSS @dmzx_mchat/mchat.css -->
<!-- INCLUDECSS @dmzx_mchat/mchat_custom.css -->

View File

@@ -1 +0,0 @@
<li class="tab mchat" data-select-match="mchat" data-responsive-class="tab small-icon icon-mchat"><a class="nav-link" href="{U_MCHAT}" title="{L_MCHAT_TITLE}" role="menuitem">{L_MCHAT_TITLE}</a></li>

View File

@@ -1,67 +0,0 @@
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
.icon-mchat {
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;
}
.navbar .nav-tabs .mchat .nav-link {
position: relative;
text-indent: 999px;
width: 15px;
padding: 0 8px;
overflow: hidden;
}
.navbar .nav-tabs .mchat .nav-link:after {
content: '\f086';
font-family: 'FontAwesome';
position: absolute;
top: 50%;
margin-top: -7.5px;
width: 15px;
line-height: 15px;
height: 15px;
font-weight: normal;
font-style: normal;
text-indent: 0;
text-align: center;
font-size: 15px;
left:8px
}
.rtl .navbar .nav-tabs .mchat .nav-link {
padding-left: 12px;
padding-right: 30px;
}
.rtl .navbar .nav-tabs .mchat .nav-link:after {
left: auto;
right: 8px;
}

View File

@@ -1,2 +0,0 @@
<!-- INCLUDECSS @dmzx_mchat/mchat.css -->
<!-- INCLUDECSS @dmzx_mchat/mchat_custom.css -->

Some files were not shown because too many files have changed in this diff Show More