Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
159d1d25b8 | ||
|
|
233dc89a8a | ||
|
|
aac8ce6f58 | ||
|
|
13a8dc2162 | ||
|
|
46380fea08 | ||
|
|
b9a1b38d8c | ||
|
|
172b9734f1 | ||
|
|
78a25e8ab3 | ||
|
|
2c6f1a8990 | ||
|
|
19b96ea4ba | ||
|
|
b89c3bec93 | ||
|
|
3d34f58884 | ||
|
|
b5f716e448 | ||
|
|
0d71f9f3f7 | ||
|
|
1404928202 | ||
|
|
ca5bcaa947 | ||
|
|
91dfd6d9fc | ||
|
|
463e7b37a9 |
67
.travis.yml
67
.travis.yml
@@ -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"
|
|
||||||
16
README.md
16
README.md
@@ -1,21 +1,23 @@
|
|||||||
# mChat Extension
|
phpBB Extension - mChat
|
||||||
|
=====================
|
||||||
|
|
||||||
[](https://travis-ci.org/dmzx/mChat-Extension)
|
[](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)
|
||||||
|
|||||||
@@ -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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -12,189 +12,259 @@
|
|||||||
<!-- 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>{L_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}" />
|
<dl>
|
||||||
<input class="button2" type="submit" value="{L_NO}" />
|
<dt><label for="mchat_index_height">{L_MCHAT_INDEX_HEIGHT}{L_COLON}</label><br />
|
||||||
{S_FORM_TOKEN}
|
<span>{L_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}" /> <span>{L_PIXEL}</span></dd>
|
||||||
</fieldset>
|
</dl>
|
||||||
<!-- ELSE -->
|
<dl>
|
||||||
<fieldset>
|
<dt><label for="mchat_message_num_index">{L_MCHAT_MESSAGE_NUM_INDEX}{L_COLON}</label><br />
|
||||||
<legend>{L_MCHAT_SETTINGS_INDEX}</legend>
|
<span>{L_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}" /> <span>{L_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>{L_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">{L_MCHAT_CUSTOM_PAGE}{L_COLON}</label><br />
|
||||||
<span>{L_MCHAT_CUSTOM_PAGE_EXPLAIN}</span></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 --> /> {L_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 --> /> {L_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">{L_MCHAT_CUSTOM_HEIGHT}{L_COLON}</label><br />
|
<dt><label for="mchat_custom_height">{L_MCHAT_CUSTOM_HEIGHT}{L_COLON}</label><br />
|
||||||
<span>{L_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}" /></dd>
|
<dd><input type="text" name="mchat_custom_height" id="mchat_custom_height" size="10" maxlength="4" value="{MCHAT_CUSTOM_HEIGHT}" /> <span>{L_PIXEL}</span></dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label for="mchat_message_num_custom">{L_MCHAT_MESSAGE_NUM_CUSTOM}{L_COLON}</label><br />
|
<dt><label for="mchat_message_num_custom">{L_MCHAT_MESSAGE_NUM_CUSTOM}{L_COLON}</label><br />
|
||||||
<span>{L_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}" /></dd>
|
<dd><input type="text" name="mchat_message_num_custom" id="mchat_message_num_custom" size="10" value="{MCHAT_MESSAGE_NUM_CUSTOM}" /> <span>{L_MCHAT_ACP_MESSAGES}</span></dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label for="mchat_navbar_link">{L_MCHAT_NAVBAR_LINK}{L_COLON}</label></dt>
|
<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>
|
<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>
|
||||||
<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>
|
<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>
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
<dl>
|
||||||
<fieldset>
|
<dt><label for="mchat_navbar_link_count">{L_MCHAT_NAVBAR_LINK_COUNT}{L_COLON}</label></dt>
|
||||||
<legend>{L_MCHAT_SETTINGS_ARCHIVE}</legend>
|
<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 --> /> {L_YES}</label>
|
||||||
<dl>
|
<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 --> /> {L_NO}</label></dd>
|
||||||
<dt><label for="mchat_message_num_archive">{L_MCHAT_MESSAGE_NUM_ARCHIVE}{L_COLON}</label><br />
|
</dl>
|
||||||
<span>{L_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>
|
<!-- EVENT dmzx_mchat_acp_navbar_link_count_after -->
|
||||||
</dl>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>{L_MCHAT_SETTINGS_MESSAGES}</legend>
|
<legend>{L_MCHAT_SETTINGS_ARCHIVE}</legend>
|
||||||
<dl>
|
|
||||||
<dt><label for="mchat_timeout">{L_MCHAT_USER_TIMEOUT}{L_COLON}</label><br />
|
<!-- EVENT dmzx_mchat_acp_message_num_archive_before -->
|
||||||
<span>{L_MCHAT_TIMEOUT_EXPLAIN}</span></dt>
|
|
||||||
<dd><input type="text" name="mchat_timeout" id="mchat_timeout" size="10" maxlength="4" value="{MCHAT_TIMEOUT}" /></dd>
|
<dl>
|
||||||
</dl>
|
<dt><label for="mchat_message_num_archive">{L_MCHAT_MESSAGE_NUM_ARCHIVE}{L_COLON}</label><br />
|
||||||
<dl>
|
<span>{L_MCHAT_MESSAGE_NUM_ARCHIVE_EXPLAIN}</span></dt>
|
||||||
<dt><label for="mchat_refresh">{L_MCHAT_REFRESH}{L_COLON}</label><br />
|
<dd><input type="text" name="mchat_message_num_archive" id="mchat_message_num_archive" size="10" value="{MCHAT_MESSAGE_NUM_ARCHIVE}" /> <span>{L_MCHAT_ACP_MESSAGES}</span></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>
|
|
||||||
</dl>
|
<!-- EVENT dmzx_mchat_acp_message_num_archive_after -->
|
||||||
<dl>
|
|
||||||
<dt><label for="mchat_edit_delete_limit">{L_MCHAT_EDIT_DELETE_LIMIT}{L_COLON}</label><br />
|
</fieldset>
|
||||||
<span>{L_MCHAT_EDIT_DELETE_LIMIT_EXPLAIN}</span>
|
<fieldset>
|
||||||
<dd><input type="text" name="mchat_edit_delete_limit" id="mchat_edit_delete_limit" size="10" value="{MCHAT_EDIT_DELETE_LIMIT}" /></dd>
|
<legend>{L_MCHAT_SETTINGS_MESSAGES}</legend>
|
||||||
</dl>
|
|
||||||
<dl>
|
<!-- EVENT dmzx_mchat_acp_timeout_before -->
|
||||||
<dt><label for="mchat_live_updates">{L_MCHAT_LIVE_UPDATES}{L_COLON}</label><br />
|
|
||||||
<span>{L_MCHAT_LIVE_UPDATES_EXPLAIN}</span></dt>
|
<dl>
|
||||||
<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>
|
<dt><label for="mchat_timeout">{L_MCHAT_TIMEOUT}{L_COLON}</label><br />
|
||||||
<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>
|
<span>{L_MCHAT_TIMEOUT_EXPLAIN}</span></dt>
|
||||||
</dl>
|
<dd><input type="text" name="mchat_timeout" id="mchat_timeout" size="10" maxlength="4" value="{MCHAT_TIMEOUT}" /> <span>{L_MCHAT_ACP_SECONDS}</span></dd>
|
||||||
<dl>
|
</dl>
|
||||||
<dt><label for="mchat_flood_time">{L_MCHAT_FLOOD_TIME}{L_COLON}</label><br />
|
<dl>
|
||||||
<span>{L_MCHAT_FLOOD_TIME_EXPLAIN}</span></dt>
|
<dt><label for="mchat_refresh">{L_MCHAT_REFRESH}{L_COLON}</label><br />
|
||||||
<dd><input type="text" name="mchat_flood_time" id="mchat_flood_time" size="10" value="{MCHAT_FLOOD_TIME}" /></dd>
|
<span>{L_MCHAT_REFRESH_EXPLAIN}</span></dt>
|
||||||
</dl>
|
<dd><input type="text" name="mchat_refresh" id="mchat_refresh" size="10" value="{MCHAT_REFRESH}" /> <span>{L_MCHAT_ACP_SECONDS}</dd>
|
||||||
<dl>
|
</dl>
|
||||||
<dt><label for="mchat_max_message_lngth">{L_MCHAT_MAX_MESSAGE_LENGTH}{L_COLON}</label><br />
|
<dl>
|
||||||
<span>{L_MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN}</span></dt>
|
<dt><label for="mchat_edit_delete_limit">{L_MCHAT_EDIT_DELETE_LIMIT}{L_COLON}</label><br />
|
||||||
<dd><input type="text" name="mchat_max_message_lngth" id="mchat_max_message_lngth" size="10" value="{MCHAT_MAX_MESSAGE_LNGTH}" /></dd>
|
<span>{L_MCHAT_EDIT_DELETE_LIMIT_EXPLAIN}</span>
|
||||||
</dl>
|
<dd><input type="text" name="mchat_edit_delete_limit" id="mchat_edit_delete_limit" size="10" value="{MCHAT_EDIT_DELETE_LIMIT}" /> <span>{L_MCHAT_ACP_SECONDS}</dd>
|
||||||
<dl>
|
</dl>
|
||||||
<dt><label for="mchat_override_min_post_chars">{L_MCHAT_OVERRIDE_MIN_POST_CHARS}{L_COLON}</label><br />
|
<dl>
|
||||||
<span>{L_MCHAT_OVERRIDE_MIN_POST_CHARS_EXPLAIN}</span></dt>
|
<dt><label for="mchat_live_updates">{L_MCHAT_LIVE_UPDATES}{L_COLON}</label><br />
|
||||||
<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>
|
<span>{L_MCHAT_LIVE_UPDATES_EXPLAIN}</span></dt>
|
||||||
<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>
|
<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_override_smilie_limit">{L_MCHAT_OVERRIDE_SMILIE_LIMIT}{L_COLON}</label><br />
|
<dl>
|
||||||
<span>{L_MCHAT_OVERRIDE_SMILIE_LIMIT_EXPLAIN}</span></dt>
|
<dt><label for="mchat_flood_time">{L_MCHAT_FLOOD_TIME}{L_COLON}</label><br />
|
||||||
<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>
|
<span>{L_MCHAT_FLOOD_TIME_EXPLAIN}</span></dt>
|
||||||
<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>
|
<dd><input type="text" name="mchat_flood_time" id="mchat_flood_time" size="10" value="{MCHAT_FLOOD_TIME}" /> <span>{L_MCHAT_ACP_SECONDS}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label for="mchat_bbcode_disallowed">{L_MCHAT_BBCODES_DISALLOWED}{L_COLON}</label><br />
|
<dt><label for="mchat_max_message_lngth">{L_MCHAT_MAX_MESSAGE_LENGTH}{L_COLON}</label><br />
|
||||||
<span>{L_MCHAT_BBCODES_DISALLOWED_EXPLAIN}</span></dt>
|
<span>{L_MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN}</span></dt>
|
||||||
<dd><textarea name="mchat_bbcode_disallowed" id="mchat_bbcode_disallowed" rows="3" cols="40">{MCHAT_BBCODE_DISALLOWED}</textarea></dd>
|
<dd><input type="text" name="mchat_max_message_lngth" id="mchat_max_message_lngth" size="10" value="{MCHAT_MAX_MESSAGE_LNGTH}" /> <span>{L_MCHAT_ACP_CHARACTERS}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label for="mchat_rules">{L_MCHAT_RULES}{L_COLON}</label><br />
|
<dt><label for="mchat_override_min_post_chars">{L_MCHAT_OVERRIDE_MIN_POST_CHARS}{L_COLON}</label><br />
|
||||||
<span>{L_MCHAT_RULES_EXPLAIN}</span></dt>
|
<span>{L_MCHAT_OVERRIDE_MIN_POST_CHARS_EXPLAIN}</span></dt>
|
||||||
<dd><textarea name="mchat_rules" id="mchat_rules" rows="5" cols="40">{MCHAT_RULES}</textarea></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_static_message">{L_MCHAT_STATIC_MESSAGE}{L_COLON}</label><br />
|
<dl>
|
||||||
|
<dt><label for="mchat_override_smilie_limit">{L_MCHAT_OVERRIDE_SMILIE_LIMIT}{L_COLON}</label><br />
|
||||||
|
<span>{L_MCHAT_OVERRIDE_SMILIE_LIMIT_EXPLAIN}</span></dt>
|
||||||
|
<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>
|
||||||
|
<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>
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt><label for="mchat_bbcode_disallowed">{L_MCHAT_BBCODES_DISALLOWED}{L_COLON}</label><br />
|
||||||
|
<span>{L_MCHAT_BBCODES_DISALLOWED_EXPLAIN}</span></dt>
|
||||||
|
<dd><textarea name="mchat_bbcode_disallowed" id="mchat_bbcode_disallowed" rows="3" cols="40">{MCHAT_BBCODE_DISALLOWED}</textarea></dd>
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt><label for="mchat_rules">{L_MCHAT_RULES}{L_COLON}</label><br />
|
||||||
|
<span>{L_MCHAT_RULES_EXPLAIN}</span></dt>
|
||||||
|
<dd><textarea name="mchat_rules" id="mchat_rules" rows="5" cols="40">{MCHAT_RULES}</textarea></dd>
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt><label for="mchat_static_message">{L_MCHAT_STATIC_MESSAGE}{L_COLON}</label><br />
|
||||||
<span>{L_MCHAT_STATIC_MESSAGE_EXPLAIN}</span></dt>
|
<span>{L_MCHAT_STATIC_MESSAGE_EXPLAIN}</span></dt>
|
||||||
<dd><textarea name="mchat_static_message" id="mchat_static_message" rows="5" cols="40">{MCHAT_STATIC_MESSAGE}</textarea></dd>
|
<dd><textarea name="mchat_static_message" id="mchat_static_message" rows="5" cols="40">{MCHAT_STATIC_MESSAGE}</textarea></dd>
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
|
||||||
<fieldset>
|
<!-- EVENT dmzx_mchat_acp_static_message_after -->
|
||||||
<legend>{L_MCHAT_SETTINGS_POSTS}</legend>
|
|
||||||
<dl>
|
</fieldset>
|
||||||
<dt><label for="mchat_posts_topic">{L_MCHAT_POSTS_TOPIC}{L_COLON}</label></dt>
|
<fieldset>
|
||||||
<dd>
|
<legend>{L_MCHAT_SETTINGS_POSTS}</legend>
|
||||||
<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>
|
|
||||||
<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>
|
<!-- EVENT dmzx_mchat_acp_posts_topic_before -->
|
||||||
</dd>
|
|
||||||
</dl>
|
<dl>
|
||||||
<dl>
|
<dt><label for="mchat_posts_topic">{L_MCHAT_POSTS_TOPIC}{L_COLON}</label></dt>
|
||||||
<dt><label for="mchat_posts_reply">{L_MCHAT_POSTS_REPLY}{L_COLON}</label></dt>
|
<dd>
|
||||||
<dd>
|
<label><input type="radio" name="mchat_posts_topic" value="1"<!-- IF MCHAT_POSTS_TOPIC --> id="mchat_posts_topic" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||||
<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>
|
<label><input type="radio" name="mchat_posts_topic" value="0"<!-- IF not MCHAT_POSTS_TOPIC --> id="mchat_posts_topic" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||||
<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>
|
</dd>
|
||||||
</dd>
|
</dl>
|
||||||
</dl>
|
<dl>
|
||||||
<dl>
|
<dt><label for="mchat_posts_reply">{L_MCHAT_POSTS_REPLY}{L_COLON}</label></dt>
|
||||||
<dt><label for="mchat_posts_edit">{L_MCHAT_POSTS_EDIT}{L_COLON}</label></dt>
|
<dd>
|
||||||
<dd>
|
<label><input type="radio" name="mchat_posts_reply" value="1"<!-- IF MCHAT_POSTS_REPLY --> id="mchat_posts_reply" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||||
<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>
|
<label><input type="radio" name="mchat_posts_reply" value="0"<!-- IF not MCHAT_POSTS_REPLY --> id="mchat_posts_reply" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||||
<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>
|
</dd>
|
||||||
</dd>
|
</dl>
|
||||||
</dl>
|
<dl>
|
||||||
<dl>
|
<dt><label for="mchat_posts_edit">{L_MCHAT_POSTS_EDIT}{L_COLON}</label></dt>
|
||||||
<dt><label for="mchat_posts_quote">{L_MCHAT_POSTS_QUOTE}{L_COLON}</label></dt>
|
<dd>
|
||||||
<dd>
|
<label><input type="radio" name="mchat_posts_edit" value="1"<!-- IF MCHAT_POSTS_EDIT --> id="mchat_posts_edit" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||||
<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>
|
<label><input type="radio" name="mchat_posts_edit" value="0"<!-- IF not MCHAT_POSTS_EDIT --> id="mchat_posts_edit" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||||
<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>
|
</dd>
|
||||||
</dd>
|
</dl>
|
||||||
</dl>
|
<dl>
|
||||||
</fieldset>
|
<dt><label for="mchat_posts_quote">{L_MCHAT_POSTS_QUOTE}{L_COLON}</label></dt>
|
||||||
<fieldset>
|
<dd>
|
||||||
<legend>{L_MCHAT_SETTINGS_STATS}</legend>
|
<label><input type="radio" name="mchat_posts_quote" value="1"<!-- IF MCHAT_POSTS_QUOTE --> id="mchat_posts_quote" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||||
<dl>
|
<label><input type="radio" name="mchat_posts_quote" value="0"<!-- IF not MCHAT_POSTS_QUOTE --> id="mchat_posts_quote" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||||
<dt><label for="mchat_whois_refresh">{L_MCHAT_WHOIS_REFRESH}{L_COLON}</label><br />
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt><label for="mchat_posts_login">{L_MCHAT_POSTS_LOGIN}{L_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 --> /> {L_YES}</label>
|
||||||
|
<label><input type="radio" name="mchat_posts_login" value="0"<!-- IF not MCHAT_POSTS_LOGIN --> id="mchat_posts_login" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_acp_posts_login_after -->
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
|
<fieldset>
|
||||||
|
<legend>{L_MCHAT_SETTINGS_STATS}</legend>
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_acp_whois_refresh_before -->
|
||||||
|
|
||||||
|
<dl>
|
||||||
|
<dt><label for="mchat_whois_refresh">{L_MCHAT_WHOIS_REFRESH}{L_COLON}</label><br />
|
||||||
<span>{L_MCHAT_WHOIS_REFRESH_EXPLAIN}</span></dt>
|
<span>{L_MCHAT_WHOIS_REFRESH_EXPLAIN}</span></dt>
|
||||||
<dd><input type="text" name="mchat_whois_refresh" id="mchat_whois_refresh" size="10" value="{MCHAT_WHOIS_REFRESH}" /></dd>
|
<dd><input type="text" name="mchat_whois_refresh" id="mchat_whois_refresh" size="10" value="{MCHAT_WHOIS_REFRESH}" /> <span>{L_MCHAT_ACP_SECONDS}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
|
||||||
<fieldset>
|
<!-- EVENT dmzx_mchat_acp_whois_refresh_after -->
|
||||||
<legend>{L_MCHAT_SETTINGS_PRUNE}</legend>
|
|
||||||
<dl>
|
</fieldset>
|
||||||
<dt><label for="mchat_prune">{L_MCHAT_PRUNE}{L_COLON}</label><br />
|
<!-- IF MCHAT_FOUNDER -->
|
||||||
<span>{L_MCHAT_PRUNE_EXPLAIN}</span></dt>
|
<fieldset>
|
||||||
<dd><label><input type="radio" class="radio" name="mchat_prune" value="1"<!-- IF MCHAT_PRUNE --> id="mchat_prune" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
<legend>{L_MCHAT_SETTINGS_PRUNE}</legend>
|
||||||
<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>
|
<!-- EVENT dmzx_mchat_acp_prune_before -->
|
||||||
<dl>
|
|
||||||
<dt><label for="mchat_prune_num">{L_MCHAT_PRUNE_NUM}{L_COLON}</label></dt>
|
<dl>
|
||||||
<dd><input type="text" name="mchat_prune_num" size="10" id="mchat_prune_num" value="{MCHAT_PRUNE_NUM}" /></dd>
|
<dt><label for="mchat_prune">{L_MCHAT_PRUNE}{L_COLON}</label></dt>
|
||||||
</dl>
|
<dd><label><input type="radio" class="radio" name="mchat_prune" value="1"<!-- IF MCHAT_PRUNE --> id="mchat_prune" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||||
<!-- IF MCHAT_FOUNDER -->
|
<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>
|
||||||
<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_prune_gc">{L_MCHAT_PRUNE_GC}{L_COLON}</label><br />
|
||||||
</dl>
|
<span>{L_MCHAT_PRUNE_GC_EXPLAIN}</span></dt>
|
||||||
<!-- ENDIF -->
|
<dd><input type="text" name="mchat_prune_gc" id="mchat_prune_gc" size="10" value="{MCHAT_PRUNE_GC}" /> <span>{L_MCHAT_ACP_SECONDS}</dd>
|
||||||
</fieldset>
|
</dl>
|
||||||
<!-- EVENT acp_dmzx_mchat_globalsettings_after -->
|
<dl>
|
||||||
<p class="submit-buttons">
|
<dt><label for="mchat_prune_num">{L_MCHAT_PRUNE_NUM}{L_COLON}</label><br />
|
||||||
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
|
<span>{L_MCHAT_PRUNE_NUM_EXPLAIN}</span></dt>
|
||||||
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
|
<dd>
|
||||||
{S_FORM_TOKEN}
|
<input type="text" name="mchat_prune_num" size="10" id="mchat_prune_num" value="{MCHAT_PRUNE_NUM}" />
|
||||||
</p>
|
<select name="mchat_prune_mode" id="mchat_prune_mode" title="{L_MCHAT_PRUNE_NUM}">
|
||||||
|
{S_MCHAT_PRUNE_MODE_OPTIONS}
|
||||||
|
</select>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt><label for="mchat_prune_now">{L_MCHAT_PRUNE_NOW}{L_COLON}</label></dt>
|
||||||
|
<dd>
|
||||||
|
<input class="button1" type="submit" id="mchat_prune_now" name="mchat_prune_now" value="{L_MCHAT_PRUNE_NOW}" />
|
||||||
|
<label>{L_MCHAT_PRUNE_NOW_CONFIRM}{L_COLON}</label>
|
||||||
|
<label><input type="radio" name="mchat_prune_now_confirm" value="1" /> {L_YES}</label>
|
||||||
|
<label><input type="radio" name="mchat_prune_now_confirm" value="0" id="mchat_prune_now_confirm" checked="checked" /> {L_NO}</label>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt><label for="mchat_purge">{L_MCHAT_PURGE}{L_COLON}</label></dt>
|
||||||
|
<dd>
|
||||||
|
<input class="button1" type="submit" id="mchat_purge" name="mchat_purge" value="{L_MCHAT_PURGE}" />
|
||||||
|
<label>{L_MCHAT_PURGE_CONFIRM}{L_COLON}</label>
|
||||||
|
<label><input type="radio" name="mchat_purge_confirm" value="1" /> {L_YES}</label>
|
||||||
|
<label><input type="radio" name="mchat_purge_confirm" value="0" id="mchat_purge_confirm" checked="checked" /> {L_NO}</label>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_acp_purge_after -->
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
<!-- EVENT acp_dmzx_mchat_globalsettings_after -->
|
||||||
|
|
||||||
|
<p class="submit-buttons">
|
||||||
|
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
|
||||||
|
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
|
||||||
|
{S_FORM_TOKEN}
|
||||||
|
</p>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!-- INCLUDE overall_footer.html -->
|
<!-- INCLUDE overall_footer.html -->
|
||||||
|
|||||||
@@ -15,12 +15,29 @@
|
|||||||
|
|
||||||
<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>{L_ACP_MCHAT_GLOBALUSERSETTINGS}</legend>
|
||||||
<!-- INCLUDE acp_mchat_globalusersettings_content.html -->
|
<!-- INCLUDE @dmzx_mchat/acp_mchat_globalusersettings_content.html -->
|
||||||
|
</fieldset>
|
||||||
|
<fieldset>
|
||||||
|
<legend>{L_MCHAT_GLOBALUSERSETTINGS_OVERWRITE}</legend>
|
||||||
|
<dl>
|
||||||
|
<dt><label for="mchat_overwrite">{L_MCHAT_GLOBALUSERSETTINGS_OVERWRITE}{L_COLON}</label><br /><span>{L_MCHAT_GLOBALUSERSETTINGS_OVERWRITE_EXPLAIN}</span></dt>
|
||||||
|
<dd>
|
||||||
|
<label><input type="radio" name="mchat_overwrite" value="1" /> {L_YES}</label>
|
||||||
|
<label><input type="radio" name="mchat_overwrite" value="0" id="mchat_overwrite" checked="checked" /> {L_NO}</label>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt><label for="mchat_overwrite_confirm">{L_MCHAT_GLOBALUSERSETTINGS_OVERWRITE_CONFIRM}{L_COLON}</label></dt>
|
||||||
|
<dd>
|
||||||
|
<label><input type="radio" name="mchat_overwrite_confirm" value="1" /> {L_YES}</label>
|
||||||
|
<label><input type="radio" name="mchat_overwrite_confirm" value="0" id="mchat_overwrite_confirm" checked="checked" /> {L_NO}</label>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<p class="submit-buttons">
|
<p class="submit-buttons">
|
||||||
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
|
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
|
||||||
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
|
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
|
||||||
{S_FORM_TOKEN}
|
{S_FORM_TOKEN}
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
<!-- 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">{L_MCHAT_INDEX}{L_COLON}</label></dt>
|
||||||
<dd>
|
<dd>
|
||||||
@@ -26,7 +28,13 @@
|
|||||||
<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 --> /> {L_MCHAT_BOTTOM}</label>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_acp_location_after -->
|
||||||
|
|
||||||
<hr />
|
<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">{L_MCHAT_MESSAGE_TOP}{L_COLON}</label><br /><span>{L_MCHAT_MESSAGE_TOP_EXPLAIN}</span></dt>
|
||||||
<dd>
|
<dd>
|
||||||
@@ -63,7 +71,7 @@
|
|||||||
</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_character_count">{L_MCHAT_DISPLAY_CHARACTER_COUNT}{L_COLON}</label></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>
|
<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>
|
||||||
<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>
|
<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>
|
||||||
@@ -92,7 +100,13 @@
|
|||||||
<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>
|
<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>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_acp_relative_time_after -->
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_acp_posts_before -->
|
||||||
|
|
||||||
<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_posts"><!-- IF MCHAT_POSTS_ENABLED_LANG -->{MCHAT_POSTS_ENABLED_LANG}<!-- ELSE -->{L_MCHAT_POSTS}<!-- ENDIF -->{L_COLON}</label></dt>
|
||||||
<dd>
|
<dd>
|
||||||
@@ -100,3 +114,5 @@
|
|||||||
<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_posts" value="0"<!-- IF not MCHAT_POSTS --> id="user_mchat_posts" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_acp_posts_after -->
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<fieldset>
|
<fieldset>
|
||||||
<p class="successbox notice">{L_MCHAT_ACP_USER_PREFS_EXPLAIN}</p>
|
<p class="successbox notice">{L_MCHAT_ACP_USER_PREFS_EXPLAIN}</p>
|
||||||
<legend>{L_MCHAT_PREFERENCES}</legend>
|
<legend>{L_MCHAT_PREFERENCES}</legend>
|
||||||
<!-- INCLUDE acp_mchat_globalusersettings_content.html -->
|
<!-- INCLUDE @dmzx_mchat/acp_mchat_globalusersettings_content.html -->
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|||||||
@@ -1,45 +1,48 @@
|
|||||||
{
|
{
|
||||||
"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://github.com/kasimi/mChat",
|
||||||
"version": "2.0.0-RC3",
|
"version": "2.0.0-RC7",
|
||||||
"time": "2016-03-24",
|
"time": "2016-10-16",
|
||||||
"keywords": ["phpbb", "extension", "mchat"],
|
"keywords": ["phpbb", "extension", "mchat"],
|
||||||
"license": "GPL-2.0",
|
"license": "GPL-2.0",
|
||||||
"authors": [
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "kasimi",
|
||||||
|
"homepage": "https://kasimi.net",
|
||||||
|
"email": "mail@kasimi.net",
|
||||||
|
"role": "Extension 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": "Extension 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.3.3",
|
||||||
|
"phpbb/phpbb": ">=3.1.8-RC1,<3.3.0@dev"
|
||||||
},
|
},
|
||||||
"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.1.8-RC1,<3.3.0@dev"
|
||||||
},
|
},
|
||||||
"version-check": {
|
"version-check": {
|
||||||
"host": "www.dmzx-web.net",
|
"host": "kasimi.github.io",
|
||||||
"directory": "/versions",
|
"directory": "/mChat",
|
||||||
"filename": "mchat_version.json"
|
"filename": "mchat_version.json",
|
||||||
|
"ssl": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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'
|
|
||||||
@@ -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 }
|
||||||
|
dmzx_mchat_page_whois_controller:
|
||||||
|
path: /mchat/whois/{ip}
|
||||||
|
methods: [GET]
|
||||||
|
defaults: { _controller: dmzx.mchat.core:page_whois }
|
||||||
|
|
||||||
|
dmzx_mchat_action_add_controller:
|
||||||
|
path: /mchat/action/add
|
||||||
methods: [POST]
|
methods: [POST]
|
||||||
defaults: { _controller: dmzx.mchat.main.controller:action }
|
defaults: { _controller: dmzx.mchat.core:action_add }
|
||||||
requirements:
|
dmzx_mchat_action_edit_controller:
|
||||||
action: 'add|edit|del|refresh|whois'
|
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 }
|
||||||
|
|||||||
@@ -1,20 +1,21 @@
|
|||||||
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'
|
||||||
- '@dbal.conn'
|
- '@dbal.conn'
|
||||||
- '@cache'
|
- '@cache.driver'
|
||||||
- '@request'
|
- '@request'
|
||||||
|
- '@dispatcher'
|
||||||
- '@dmzx.mchat.settings'
|
- '@dmzx.mchat.settings'
|
||||||
- '%dmzx.mchat.table.mchat%'
|
- '%dmzx.mchat.table.mchat%'
|
||||||
- '%dmzx.mchat.table.mchat_deleted_messages%'
|
- '%dmzx.mchat.table.mchat_log%'
|
||||||
- '%core.root_path%'
|
- '%core.root_path%'
|
||||||
- '%core.php_ext%'
|
- '%core.php_ext%'
|
||||||
dmzx.mchat.ucp.controller:
|
dmzx.mchat.ucp.controller:
|
||||||
@@ -26,14 +27,9 @@ services:
|
|||||||
- '@dbal.conn'
|
- '@dbal.conn'
|
||||||
- '@request'
|
- '@request'
|
||||||
- '@dmzx.mchat.settings'
|
- '@dmzx.mchat.settings'
|
||||||
|
- '@dispatcher'
|
||||||
- '%core.root_path%'
|
- '%core.root_path%'
|
||||||
- '%core.php_ext%'
|
- '%core.php_ext%'
|
||||||
dmzx.mchat.main.controller:
|
|
||||||
class: dmzx\mchat\controller\main_controller
|
|
||||||
arguments:
|
|
||||||
- '@user'
|
|
||||||
- '@dmzx.mchat.core'
|
|
||||||
- '@request'
|
|
||||||
dmzx.mchat.core:
|
dmzx.mchat.core:
|
||||||
class: dmzx\mchat\core\mchat
|
class: dmzx\mchat\core\mchat
|
||||||
arguments:
|
arguments:
|
||||||
@@ -49,6 +45,8 @@ services:
|
|||||||
- '@ext.manager'
|
- '@ext.manager'
|
||||||
- '%core.root_path%'
|
- '%core.root_path%'
|
||||||
- '%core.php_ext%'
|
- '%core.php_ext%'
|
||||||
|
- '@?text_formatter.s9e.parser'
|
||||||
|
- '@?phpbb.collapsiblecategories.operator'
|
||||||
dmzx.mchat.functions:
|
dmzx.mchat.functions:
|
||||||
class: dmzx\mchat\core\functions
|
class: dmzx\mchat\core\functions
|
||||||
arguments:
|
arguments:
|
||||||
@@ -58,10 +56,11 @@ services:
|
|||||||
- '@log'
|
- '@log'
|
||||||
- '@dbal.conn'
|
- '@dbal.conn'
|
||||||
- '@cache.driver'
|
- '@cache.driver'
|
||||||
|
- '@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:
|
dmzx.mchat.settings:
|
||||||
class: dmzx\mchat\core\settings
|
class: dmzx\mchat\core\settings
|
||||||
@@ -69,8 +68,7 @@ services:
|
|||||||
- '@user'
|
- '@user'
|
||||||
- '@config'
|
- '@config'
|
||||||
- '@auth'
|
- '@auth'
|
||||||
- '%dmzx.mchat.config_global%'
|
- '@dispatcher'
|
||||||
- '%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:
|
||||||
@@ -88,6 +86,16 @@ services:
|
|||||||
- '@dmzx.mchat.core'
|
- '@dmzx.mchat.core'
|
||||||
- '@controller.helper'
|
- '@controller.helper'
|
||||||
- '@user'
|
- '@user'
|
||||||
|
- '@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 }
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -4,41 +4,57 @@
|
|||||||
*
|
*
|
||||||
* @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\db\driver\driver_interface as db_interface;
|
||||||
|
use phpbb\event\dispatcher_interface;
|
||||||
|
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 $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 db_interface */
|
||||||
protected $db;
|
protected $db;
|
||||||
|
|
||||||
/** @var \phpbb\cache\service */
|
/** @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 */
|
/** @var string */
|
||||||
protected $mchat_table;
|
protected $mchat_table;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $mchat_deleted_messages_table;
|
protected $mchat_log_table;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $root_path;
|
protected $root_path;
|
||||||
@@ -49,31 +65,48 @@ class acp_controller
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param \phpbb\template\template $template
|
* @param functions $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 db_interface $db
|
||||||
* @param \phpbb\request\request $request
|
* @param cache_interface $cache
|
||||||
* @param \dmzx\mchat\core\settings $settings
|
* @param request_interface $request
|
||||||
* @param string $mchat_table
|
* @param dispatcher_interface $dispatcher
|
||||||
* @param string $mchat_deleted_messages_table
|
* @param settings $settings
|
||||||
* @param string $root_path
|
* @param string $mchat_table
|
||||||
* @param string $php_ext
|
* @param string $mchat_log_table
|
||||||
|
* @param string $root_path
|
||||||
|
* @param string $php_ext
|
||||||
*/
|
*/
|
||||||
public function __construct(\phpbb\template\template $template, \phpbb\log\log_interface $log, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, \phpbb\request\request $request, \dmzx\mchat\core\settings $settings, $mchat_table, $mchat_deleted_messages_table, $root_path, $php_ext)
|
public function __construct(
|
||||||
|
functions $functions,
|
||||||
|
template $template,
|
||||||
|
log_interface $log,
|
||||||
|
user $user,
|
||||||
|
db_interface $db,
|
||||||
|
cache_interface $cache,
|
||||||
|
request_interface $request,
|
||||||
|
dispatcher_interface $dispatcher,
|
||||||
|
settings $settings,
|
||||||
|
$mchat_table,
|
||||||
|
$mchat_log_table,
|
||||||
|
$root_path, $php_ext
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$this->template = $template;
|
$this->functions = $functions;
|
||||||
$this->log = $log;
|
$this->template = $template;
|
||||||
$this->user = $user;
|
$this->log = $log;
|
||||||
$this->db = $db;
|
$this->user = $user;
|
||||||
$this->cache = $cache;
|
$this->db = $db;
|
||||||
$this->request = $request;
|
$this->cache = $cache;
|
||||||
$this->settings = $settings;
|
$this->request = $request;
|
||||||
$this->mchat_table = $mchat_table;
|
$this->dispatcher = $dispatcher;
|
||||||
$this->mchat_deleted_messages_table = $mchat_deleted_messages_table;
|
$this->settings = $settings;
|
||||||
$this->root_path = $root_path;
|
$this->mchat_table = $mchat_table;
|
||||||
$this->php_ext = $php_ext;
|
$this->mchat_log_table = $mchat_log_table;
|
||||||
|
$this->root_path = $root_path;
|
||||||
|
$this->php_ext = $php_ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -87,26 +120,13 @@ class acp_controller
|
|||||||
|
|
||||||
$error = array();
|
$error = array();
|
||||||
|
|
||||||
if ($this->request->is_set_post('mchat_purge'))
|
$is_founder = $this->user->data['user_type'] == USER_FOUNDER;
|
||||||
{
|
|
||||||
$this->template->assign_var('MCHAT_PURGE', true);
|
if ($this->request->is_set_post('submit'))
|
||||||
}
|
|
||||||
else if ($this->request->is_set_post('mchat_purge_confirm'))
|
|
||||||
{
|
|
||||||
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();
|
$mchat_new_config = array();
|
||||||
$validation = array();
|
$validation = array();
|
||||||
foreach ($this->settings->global as $config_name => $config_data)
|
foreach ($this->settings->global_settings() 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,6 +137,15 @@ class acp_controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't allow changing pruning settings for non founders
|
||||||
|
if (!$is_founder)
|
||||||
|
{
|
||||||
|
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']);
|
||||||
|
}
|
||||||
|
|
||||||
if (!function_exists('validate_data'))
|
if (!function_exists('validate_data'))
|
||||||
{
|
{
|
||||||
include($this->root_path . 'includes/functions_user.' . $this->php_ext);
|
include($this->root_path . 'includes/functions_user.' . $this->php_ext);
|
||||||
@@ -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 = array(
|
||||||
|
'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
|
||||||
@@ -147,19 +190,53 @@ class acp_controller
|
|||||||
$error = array_map(array($this->user, 'lang'), $error);
|
$error = array_map(array($this->user, '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'))
|
||||||
|
{
|
||||||
|
$this->db->sql_query('TRUNCATE TABLE ' . $this->mchat_table);
|
||||||
|
$this->db->sql_query('TRUNCATE TABLE ' . $this->mchat_log_table);
|
||||||
|
$this->cache->destroy('sql', $this->mchat_log_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 ($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->functions->mchat_prune());
|
||||||
|
trigger_error($this->user->lang('MCHAT_PRUNED', $num_pruned_messages) . adm_back_link($u_action));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->template->assign_vars(array(
|
$template_data = array(
|
||||||
'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,
|
||||||
|
'S_MCHAT_PRUNE_MODE_OPTIONS' => $this->get_prune_mode_options($this->settings->cfg('mchat_prune_mode')),
|
||||||
'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>'),
|
'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>'),
|
||||||
'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&mode=load', true, $this->user->session_id) . '">', '</a>', $this->settings->cfg('session_length')),
|
'L_MCHAT_TIMEOUT_EXPLAIN' => $this->user->lang('MCHAT_TIMEOUT_EXPLAIN','<a href="' . append_sid("{$this->root_path}adm/index.$this->php_ext", 'i=board&mode=load', true, $this->user->session_id) . '">', '</a>', $this->settings->cfg('session_length')),
|
||||||
'U_ACTION' => $u_action,
|
'U_ACTION' => $u_action,
|
||||||
));
|
);
|
||||||
|
|
||||||
|
foreach (array_keys($this->settings->global_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 = array(
|
||||||
|
'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 +246,13 @@ class acp_controller
|
|||||||
{
|
{
|
||||||
add_form_key('acp_mchat');
|
add_form_key('acp_mchat');
|
||||||
|
|
||||||
$this->user->add_lang_ext('dmzx/mchat', 'mchat_ucp');
|
|
||||||
|
|
||||||
$error = array();
|
$error = array();
|
||||||
|
|
||||||
if ($this->request->is_set_post('submit'))
|
if ($this->request->is_set_post('submit'))
|
||||||
{
|
{
|
||||||
$mchat_new_config = array();
|
$mchat_new_config = array();
|
||||||
$validation = array();
|
$validation = array();
|
||||||
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']));
|
||||||
@@ -201,8 +276,40 @@ class acp_controller
|
|||||||
$error[] = 'FORM_INVALID';
|
$error[] = 'FORM_INVALID';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$mchat_new_user_config = array();
|
||||||
|
|
||||||
|
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 = array(
|
||||||
|
'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)
|
||||||
{
|
{
|
||||||
@@ -219,23 +326,59 @@ class acp_controller
|
|||||||
$error = array_map(array($this->user, 'lang'), $error);
|
$error = array_map(array($this->user, '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, array(
|
||||||
$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);
|
|
||||||
|
|
||||||
$this->template->assign_vars(array(
|
|
||||||
'MCHAT_ERROR' => $error ? implode('<br />', $error) : '',
|
|
||||||
'MCHAT_VERSION' => $this->settings->cfg('mchat_version'),
|
|
||||||
'U_ACTION' => $u_action,
|
|
||||||
));
|
));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 = array(
|
||||||
|
'template_data',
|
||||||
|
'error',
|
||||||
|
);
|
||||||
|
extract($this->dispatcher->trigger_event('dmzx.mchat.acp_globalusersettings_modify_template_data', compact($vars)));
|
||||||
|
|
||||||
|
$this->template->assign_vars($template_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $selected
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
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->user->lang('MCHAT_ACP_' . strtoupper($prune_mode));
|
||||||
|
$prune_mode_options .= '</option>';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $prune_mode_options;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,33 +4,44 @@
|
|||||||
*
|
*
|
||||||
* @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\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 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 $settings;
|
||||||
|
|
||||||
|
/** @var dispatcher_interface */
|
||||||
|
protected $dispatcher;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $root_path;
|
protected $root_path;
|
||||||
|
|
||||||
@@ -40,16 +51,27 @@ class ucp_controller
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param \phpbb\template\template $template
|
* @param template $template
|
||||||
* @param \phpbb\user $user
|
* @param user $user
|
||||||
* @param \phpbb\auth\auth $auth
|
* @param auth $auth
|
||||||
* @param \phpbb\db\driver\driver_interface $db
|
* @param db_interface $db
|
||||||
* @param \phpbb\request\request $request
|
* @param request_interface $request
|
||||||
* @param \dmzx\mchat\core\settings $settings
|
* @param settings $settings
|
||||||
* @param string $root_path
|
* @param dispatcher_interface $dispatcher
|
||||||
* @param string $php_ext
|
* @param string $root_path
|
||||||
|
* @param string $php_ext
|
||||||
*/
|
*/
|
||||||
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,
|
||||||
|
auth $auth,
|
||||||
|
db_interface $db,
|
||||||
|
request_interface $request,
|
||||||
|
settings $settings,
|
||||||
|
dispatcher_interface $dispatcher,
|
||||||
|
$root_path,
|
||||||
|
$php_ext
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$this->template = $template;
|
$this->template = $template;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
@@ -57,6 +79,7 @@ class ucp_controller
|
|||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->request = $request;
|
$this->request = $request;
|
||||||
$this->settings = $settings;
|
$this->settings = $settings;
|
||||||
|
$this->dispatcher = $dispatcher;
|
||||||
$this->root_path = $root_path;
|
$this->root_path = $root_path;
|
||||||
$this->php_ext = $php_ext;
|
$this->php_ext = $php_ext;
|
||||||
}
|
}
|
||||||
@@ -76,7 +99,7 @@ class ucp_controller
|
|||||||
{
|
{
|
||||||
$mchat_new_config = array();
|
$mchat_new_config = array();
|
||||||
$validation = array();
|
$validation = array();
|
||||||
foreach ($this->settings->ucp as $config_name => $config_data)
|
foreach ($this->settings->ucp_settings() as $config_name => $config_data)
|
||||||
{
|
{
|
||||||
if ($this->auth->acl_get('u_' . $config_name))
|
if ($this->auth->acl_get('u_' . $config_name))
|
||||||
{
|
{
|
||||||
@@ -103,6 +126,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 = array(
|
||||||
|
'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 . '
|
||||||
@@ -119,17 +156,18 @@ class ucp_controller
|
|||||||
$error = array_map(array($this->user, 'lang'), $error);
|
$error = array_map(array($this->user, 'lang'), $error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$selected_date = $this->settings->cfg('mchat_date');
|
||||||
|
$template_data = $this->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->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->settings->cfg($config_name);
|
||||||
$upper => $this->settings->cfg($config_name),
|
$template_data[$upper . '_AUTH'] = $auth;
|
||||||
$upper . '_AUTH' => $auth,
|
|
||||||
));
|
|
||||||
|
|
||||||
if ($auth)
|
if ($auth)
|
||||||
{
|
{
|
||||||
@@ -137,17 +175,29 @@ class ucp_controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$selected = $this->settings->cfg('mchat_date');
|
$template_data = array_merge($template_data, array(
|
||||||
$date_template_data = $this->settings->get_date_template_data($selected);
|
'MCHAT_POSTS_ENABLED_LANG' => $this->settings->get_enabled_post_notifications_lang(),
|
||||||
$this->template->assign_vars($date_template_data);
|
|
||||||
|
|
||||||
$notifications_template_data = $this->settings->get_enabled_post_notifications_lang();
|
|
||||||
$this->template->assign_var('MCHAT_POSTS_ENABLED_LANG', $notifications_template_data);
|
|
||||||
|
|
||||||
$this->template->assign_vars(array(
|
|
||||||
'ERROR' => sizeof($error) ? implode('<br />', $error) : '',
|
'ERROR' => sizeof($error) ? implode('<br />', $error) : '',
|
||||||
'MCHAT_AUTH_COUNT' => $auth_count,
|
'MCHAT_AUTH_COUNT' => $auth_count,
|
||||||
'S_UCP_ACTION' => $u_action,
|
'S_UCP_ACTION' => $u_action,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 = array(
|
||||||
|
'template_data',
|
||||||
|
'auth_count',
|
||||||
|
'error',
|
||||||
|
);
|
||||||
|
extract($this->dispatcher->trigger_event('dmzx.mchat.ucp_modify_template_data', compact($vars)));
|
||||||
|
|
||||||
|
$this->template->assign_vars($template_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,33 +4,43 @@
|
|||||||
*
|
*
|
||||||
* @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\cache\driver\driver_interface as cache_interface;
|
||||||
|
use phpbb\db\driver\driver_interface as db_interface;
|
||||||
|
use phpbb\event\dispatcher_interface;
|
||||||
|
use phpbb\log\log_interface;
|
||||||
|
use phpbb\user;
|
||||||
|
|
||||||
class functions
|
class functions
|
||||||
{
|
{
|
||||||
/** @var \dmzx\mchat\core\settings */
|
/** @var settings */
|
||||||
protected $settings;
|
protected $settings;
|
||||||
|
|
||||||
/** @var \phpbb\user */
|
/** @var user */
|
||||||
protected $user;
|
protected $user;
|
||||||
|
|
||||||
/** @var \phpbb\auth\auth */
|
/** @var auth */
|
||||||
protected $auth;
|
protected $auth;
|
||||||
|
|
||||||
/** @var \phpbb\log\log */
|
/** @var log_interface */
|
||||||
protected $log;
|
protected $log;
|
||||||
|
|
||||||
/** @var \phpbb\db\driver\driver_interface */
|
/** @var db_interface */
|
||||||
protected $db;
|
protected $db;
|
||||||
|
|
||||||
/** @var \phpbb\cache\driver\driver_interface */
|
/** @var cache_interface */
|
||||||
protected $cache;
|
protected $cache;
|
||||||
|
|
||||||
|
/** @var dispatcher_interface */
|
||||||
|
protected $dispatcher;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $root_path;
|
protected $root_path;
|
||||||
|
|
||||||
@@ -41,42 +51,72 @@ class functions
|
|||||||
protected $mchat_table;
|
protected $mchat_table;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $mchat_deleted_messages_table;
|
protected $mchat_log_table;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $mchat_sessions_table;
|
protected $mchat_sessions_table;
|
||||||
|
|
||||||
/** @var array */
|
/** @var array */
|
||||||
protected $foes = null;
|
public $log_types = array(
|
||||||
|
1 => 'edit',
|
||||||
|
2 => 'del',
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param \dmzx\mchat\core\settings $settings
|
* @param settings $settings
|
||||||
* @param \phpbb\user $user
|
* @param user $user
|
||||||
* @param \phpbb\auth\auth $auth
|
* @param auth $auth
|
||||||
* @param \phpbb\log\log_interface $log
|
* @param log_interface $log
|
||||||
* @param \phpbb\db\driver\driver_interface $db
|
* @param db_interface $db
|
||||||
* @param \phpbb\cache\driver\driver_interface $cache
|
* @param cache_interface $cache
|
||||||
* @param string $root_path
|
* @param dispatcher_interface $dispatcher
|
||||||
* @param string $php_ext
|
* @param string $root_path
|
||||||
* @param string $mchat_table
|
* @param string $php_ext
|
||||||
* @param string $mchat_deleted_messages_table
|
* @param string $mchat_table
|
||||||
* @param string $mchat_sessions_table
|
* @param string $mchat_log_table
|
||||||
|
* @param string $mchat_sessions_table
|
||||||
*/
|
*/
|
||||||
function __construct(\dmzx\mchat\core\settings $settings, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\log\log_interface $log, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, $root_path, $php_ext, $mchat_table, $mchat_deleted_messages_table, $mchat_sessions_table)
|
function __construct(
|
||||||
|
settings $settings,
|
||||||
|
user $user,
|
||||||
|
auth $auth,
|
||||||
|
log_interface $log,
|
||||||
|
db_interface $db,
|
||||||
|
cache_interface $cache,
|
||||||
|
dispatcher_interface $dispatcher,
|
||||||
|
$root_path,
|
||||||
|
$php_ext,
|
||||||
|
$mchat_table,
|
||||||
|
$mchat_log_table,
|
||||||
|
$mchat_sessions_table
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$this->settings = $settings;
|
$this->settings = $settings;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
$this->auth = $auth;
|
$this->auth = $auth;
|
||||||
$this->log = $log;
|
$this->log = $log;
|
||||||
$this->db = $db;
|
$this->db = $db;
|
||||||
$this->cache = $cache;
|
$this->cache = $cache;
|
||||||
$this->root_path = $root_path;
|
$this->dispatcher = $dispatcher;
|
||||||
$this->php_ext = $php_ext;
|
$this->root_path = $root_path;
|
||||||
$this->mchat_table = $mchat_table;
|
$this->php_ext = $php_ext;
|
||||||
$this->mchat_deleted_messages_table = $mchat_deleted_messages_table;
|
$this->mchat_table = $mchat_table;
|
||||||
$this->mchat_sessions_table = $mchat_sessions_table;
|
$this->mchat_log_table = $mchat_log_table;
|
||||||
|
$this->mchat_sessions_table = $mchat_sessions_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -115,7 +155,7 @@ class functions
|
|||||||
/**
|
/**
|
||||||
* Returns the total session time in seconds
|
* Returns the total session time in seconds
|
||||||
*
|
*
|
||||||
* @return string
|
* @return int
|
||||||
*/
|
*/
|
||||||
protected function mchat_session_time()
|
protected function mchat_session_time()
|
||||||
{
|
{
|
||||||
@@ -141,25 +181,52 @@ class functions
|
|||||||
*/
|
*/
|
||||||
public function mchat_active_users()
|
public function mchat_active_users()
|
||||||
{
|
{
|
||||||
$mchat_users = array();
|
|
||||||
|
|
||||||
$check_time = time() - $this->mchat_session_time();
|
$check_time = time() - $this->mchat_session_time();
|
||||||
|
|
||||||
$sql = 'SELECT m.user_id, u.username, u.user_type, u.user_allow_viewonline, u.user_colour
|
$sql_array = array(
|
||||||
FROM ' . $this->mchat_sessions_table . ' m
|
'SELECT' => 'u.user_id, u.username, u.user_colour, s.session_viewonline',
|
||||||
LEFT JOIN ' . USERS_TABLE . ' u ON m.user_id = u.user_id
|
'FROM' => array(
|
||||||
WHERE m.user_lastupdate >= ' . (int) $check_time . '
|
$this->mchat_sessions_table => 'ms'
|
||||||
ORDER BY u.username ASC';
|
),
|
||||||
|
'LEFT_JOIN' => array(
|
||||||
|
array(
|
||||||
|
'FROM' => array(SESSIONS_TABLE => 's'),
|
||||||
|
'ON' => 'ms.user_id = s.session_user_id',
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'FROM' => array(USERS_TABLE => 'u'),
|
||||||
|
'ON' => 'ms.user_id = u.user_id',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
'WHERE' => 'u.user_id <> ' . ANONYMOUS . ' AND s.session_viewonline IS NOT NULL AND ms.user_lastupdate > ' . (int) $check_time,
|
||||||
|
'ORDER_BY' => 'u.username ASC',
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event to modify the SQL query that fetches active mChat users
|
||||||
|
*
|
||||||
|
* @event dmzx.mchat.active_users_sql_before
|
||||||
|
* @var array sql_array Array with SQL query data to fetch the current active sessions
|
||||||
|
* @since 2.0.0-RC6
|
||||||
|
*/
|
||||||
|
$vars = array(
|
||||||
|
'sql_array',
|
||||||
|
);
|
||||||
|
extract($this->dispatcher->trigger_event('dmzx.mchat.active_users_sql_before', compact($vars)));
|
||||||
|
|
||||||
|
$sql = $this->db->sql_build_query('SELECT', $sql_array);
|
||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
$rows = $this->db->sql_fetchrowset($result);
|
$rows = $this->db->sql_fetchrowset($result);
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
|
$mchat_users = array();
|
||||||
$can_view_hidden = $this->auth->acl_get('u_viewonline');
|
$can_view_hidden = $this->auth->acl_get('u_viewonline');
|
||||||
|
|
||||||
foreach ($rows as $row)
|
foreach ($rows as $row)
|
||||||
{
|
{
|
||||||
if (!$row['user_allow_viewonline'])
|
if (!$row['session_viewonline'])
|
||||||
{
|
{
|
||||||
if (!$can_view_hidden)
|
if (!$can_view_hidden && $row['user_id'] !== $this->user->data['user_id'])
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -167,87 +234,144 @@ class functions
|
|||||||
$row['username'] = '<em>' . $row['username'] . '</em>';
|
$row['username'] = '<em>' . $row['username'] . '</em>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$mchat_users[] = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST'));
|
$mchat_users[$row['user_id']] = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
$active_users = array(
|
||||||
'online_userlist' => implode($this->user->lang('COMMA_SEPARATOR'), $mchat_users),
|
'online_userlist' => implode($this->user->lang('COMMA_SEPARATOR'), $mchat_users),
|
||||||
'mchat_users_count' => $this->user->lang('MCHAT_ONLINE_USERS_TOTAL', count($mchat_users)),
|
'users_count_title' => $this->user->lang('MCHAT_TITLE_COUNT', count($mchat_users)),
|
||||||
|
'users_total' => $this->user->lang('MCHAT_ONLINE_USERS_TOTAL', count($mchat_users)),
|
||||||
'refresh_message' => $this->mchat_format_seconds($this->mchat_session_time()),
|
'refresh_message' => $this->mchat_format_seconds($this->mchat_session_time()),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event to modify collected data about active mChat users
|
||||||
|
*
|
||||||
|
* @event dmzx.mchat.active_users_after
|
||||||
|
* @var array mchat_users Array containing all currently active mChat sessions, mapping from user ID to full username
|
||||||
|
* @var array active_users Array containing info about currently active mChat users
|
||||||
|
* @since 2.0.0-RC6
|
||||||
|
*/
|
||||||
|
$vars = array(
|
||||||
|
'mchat_users',
|
||||||
|
'active_users',
|
||||||
|
);
|
||||||
|
extract($this->dispatcher->trigger_event('dmzx.mchat.active_users_after', compact($vars)));
|
||||||
|
|
||||||
|
return $active_users;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inserts the current user into the mchat_sessions table
|
* Inserts the current user into the mchat_sessions table
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool Returns true if a new session was created, otherwise false
|
||||||
*/
|
*/
|
||||||
public function mchat_add_user_session()
|
public function mchat_add_user_session()
|
||||||
{
|
{
|
||||||
// Remove expired sessions from the database
|
if (!$this->user->data['is_registered'] || $this->user->data['user_id'] == ANONYMOUS || $this->user->data['is_bot'])
|
||||||
$check_time = time() - $this->mchat_session_time();
|
{
|
||||||
$sql = 'DELETE FROM ' . $this->mchat_sessions_table . '
|
return false;
|
||||||
WHERE user_lastupdate < ' . $check_time;
|
}
|
||||||
|
|
||||||
|
$sql = 'UPDATE ' . $this->mchat_sessions_table . '
|
||||||
|
SET user_lastupdate = ' . time() . '
|
||||||
|
WHERE user_id = ' . (int) $this->user->data['user_id'];
|
||||||
$this->db->sql_query($sql);
|
$this->db->sql_query($sql);
|
||||||
|
|
||||||
$is_new_session = false;
|
$is_new_session = $this->db->sql_affectedrows() < 1;
|
||||||
|
|
||||||
if ($this->user->data['user_type'] == USER_FOUNDER || $this->user->data['user_type'] == USER_NORMAL && $this->user->data['user_id'] != ANONYMOUS && !$this->user->data['is_bot'])
|
if ($is_new_session)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT *
|
$sql = 'INSERT INTO ' . $this->mchat_sessions_table . ' ' . $this->db->sql_build_array('INSERT', array(
|
||||||
FROM ' . $this->mchat_sessions_table . '
|
'user_id' => (int) $this->user->data['user_id'],
|
||||||
WHERE user_id = ' . (int) $this->user->data['user_id'];
|
'user_ip' => $this->user->data['user_ip'],
|
||||||
$result = $this->db->sql_query($sql);
|
'user_lastupdate' => time(),
|
||||||
$row = $this->db->sql_fetchrow($result);
|
));
|
||||||
$this->db->sql_freeresult($result);
|
|
||||||
|
|
||||||
if ($row)
|
|
||||||
{
|
|
||||||
$sql = 'UPDATE ' . $this->mchat_sessions_table . '
|
|
||||||
SET user_lastupdate = ' . time() . '
|
|
||||||
WHERE user_id = ' . (int) $this->user->data['user_id'];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$is_new_session = true;
|
|
||||||
$sql = 'INSERT INTO ' . $this->mchat_sessions_table . ' ' . $this->db->sql_build_array('INSERT', array(
|
|
||||||
'user_id' => $this->user->data['user_id'],
|
|
||||||
'user_ip' => $this->user->data['user_ip'],
|
|
||||||
'user_lastupdate' => time(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->db->sql_query($sql);
|
$this->db->sql_query($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $is_new_session;
|
return $is_new_session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove expired sessions from the database
|
||||||
|
*/
|
||||||
|
public function mchat_session_gc()
|
||||||
|
{
|
||||||
|
$check_time = time() - $this->mchat_session_time();
|
||||||
|
|
||||||
|
$sql = 'DELETE FROM ' . $this->mchat_sessions_table . '
|
||||||
|
WHERE user_lastupdate <= ' . (int) $check_time;
|
||||||
|
$this->db->sql_query($sql);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prune messages
|
* Prune messages
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function mchat_prune()
|
public function mchat_prune()
|
||||||
{
|
{
|
||||||
if ($this->settings->cfg('mchat_prune'))
|
$prune_num = (int) $this->settings->cfg('mchat_prune_num');
|
||||||
|
$prune_mode = (int) $this->settings->cfg('mchat_prune_mode');
|
||||||
|
|
||||||
|
if (empty($this->settings->prune_modes[$prune_mode]))
|
||||||
{
|
{
|
||||||
$mchat_total_messages = $this->mchat_total_message_count();
|
return array();
|
||||||
|
|
||||||
if ($mchat_total_messages > $this->settings->cfg('mchat_prune_num'))
|
|
||||||
{
|
|
||||||
$sql = 'SELECT message_id
|
|
||||||
FROM '. $this->mchat_table . '
|
|
||||||
ORDER BY message_id ASC';
|
|
||||||
$result = $this->db->sql_query_limit($sql, 1);
|
|
||||||
$first_id = (int) $this->db->sql_fetchfield('message_id');
|
|
||||||
$this->db->sql_freeresult($result);
|
|
||||||
|
|
||||||
// Compute new oldest message id
|
|
||||||
$delete_id = $mchat_total_messages - $this->settings->cfg('mchat_prune_num') + $first_id;
|
|
||||||
|
|
||||||
// Delete older messages
|
|
||||||
$this->mchat_action('prune', null, $delete_id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sql_array = array(
|
||||||
|
'SELECT' => 'message_id',
|
||||||
|
'FROM' => array($this->mchat_table => 'm'),
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($this->settings->prune_modes[$prune_mode] === 'messages')
|
||||||
|
{
|
||||||
|
// Skip fixed number of messages, delete all others
|
||||||
|
$sql_array['ORDER_BY'] = 'm.message_id DESC';
|
||||||
|
$offset = $prune_num;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Delete messages older than time period
|
||||||
|
$sql_array['WHERE'] = 'm.message_time < ' . (int) strtotime($prune_num * $prune_mode . ' hours ago');
|
||||||
|
$offset = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = $this->db->sql_build_query('SELECT', $sql_array);
|
||||||
|
$result = $this->db->sql_query_limit($sql, 0, $offset);
|
||||||
|
$rows = $this->db->sql_fetchrowset();
|
||||||
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
|
$prune_ids = array();
|
||||||
|
|
||||||
|
foreach ($rows as $row)
|
||||||
|
{
|
||||||
|
$prune_ids[] = (int) $row['message_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event to modify messages that are about to be pruned
|
||||||
|
*
|
||||||
|
* @event dmzx.mchat.prune_before
|
||||||
|
* @var array prune_ids Array of message IDs that are about to be pruned
|
||||||
|
* @since 2.0.0-RC6
|
||||||
|
*/
|
||||||
|
$vars = array(
|
||||||
|
'prune_ids',
|
||||||
|
);
|
||||||
|
extract($this->dispatcher->trigger_event('dmzx.mchat.prune_before', compact($vars)));
|
||||||
|
|
||||||
|
if ($prune_ids)
|
||||||
|
{
|
||||||
|
$this->db->sql_query('DELETE FROM ' . $this->mchat_table . ' WHERE ' . $this->db->sql_in_set('message_id', $prune_ids));
|
||||||
|
$this->db->sql_query('DELETE FROM ' . $this->mchat_log_table . ' WHERE ' . $this->db->sql_in_set('message_id', $prune_ids));
|
||||||
|
$this->cache->destroy('sql', $this->mchat_log_table);
|
||||||
|
|
||||||
|
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_MCHAT_TABLE_PRUNED', false, array($this->user->data['username'], count($prune_ids)));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $prune_ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -257,42 +381,108 @@ class functions
|
|||||||
*/
|
*/
|
||||||
public function mchat_total_message_count()
|
public function mchat_total_message_count()
|
||||||
{
|
{
|
||||||
return $this->db->get_row_count($this->mchat_table);
|
$sql_where_ary = $this->get_sql_where_for_notifcation_messages();
|
||||||
|
|
||||||
|
$sql_array = array(
|
||||||
|
'SELECT' => 'COUNT(*) AS rows_total',
|
||||||
|
'FROM' => array($this->mchat_table => 'm'),
|
||||||
|
'WHERE' => $sql_where_ary ? $this->db->sql_escape('(' . implode(') AND (', $sql_where_ary) . ')') : '',
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event to modifying the SQL query that fetches the total number of mChat messages
|
||||||
|
*
|
||||||
|
* @event dmzx.mchat.total_message_count_modify_sql
|
||||||
|
* @var array sql_array Array with SQL query data to fetch the total message count
|
||||||
|
* @since 2.0.0-RC6
|
||||||
|
*/
|
||||||
|
$vars = array(
|
||||||
|
'sql_array',
|
||||||
|
);
|
||||||
|
extract($this->dispatcher->trigger_event('dmzx.mchat.total_message_count_modify_sql', compact($vars)));
|
||||||
|
|
||||||
|
$sql = $this->db->sql_build_query('SELECT', $sql_array);
|
||||||
|
$result = $this->db->sql_query($sql);
|
||||||
|
$rows_total = $this->db->sql_fetchfield('rows_total');
|
||||||
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
|
return (int) $rows_total;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch messages from the database
|
* Fetch messages from the database
|
||||||
*
|
*
|
||||||
* @param $sql_where
|
* @param int|array $message_ids IDs of specific messages to fetch, e.g. for fetching edited messages
|
||||||
|
* @param int $last_id The ID of the latest message that the user has, for fetching new messages
|
||||||
* @param int $total
|
* @param int $total
|
||||||
* @param int $offset
|
* @param int $offset
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function mchat_get_messages($sql_where, $total = 0, $offset = 0)
|
public function mchat_get_messages($message_ids, $last_id = 0, $total = 0, $offset = 0)
|
||||||
{
|
{
|
||||||
// Exclude post notifications
|
$sql_where_message_id = array();
|
||||||
if (!$this->settings->cfg('mchat_posts'))
|
|
||||||
|
// Fetch new messages
|
||||||
|
if ($last_id)
|
||||||
{
|
{
|
||||||
if (!empty($sql_where))
|
$sql_where_message_id[] = 'm.message_id > ' . (int) $last_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fetch edited messages
|
||||||
|
if ($message_ids)
|
||||||
|
{
|
||||||
|
if (!is_array($message_ids))
|
||||||
{
|
{
|
||||||
$sql_where = '(' . $sql_where . ') AND ';
|
$message_ids = array($message_ids);
|
||||||
}
|
}
|
||||||
$sql_where .= 'm.forum_id = 0';
|
|
||||||
|
$sql_where_message_id[] = $this->db->sql_in_set('m.message_id', array_map('intval', $message_ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql_where_ary = $this->get_sql_where_for_notifcation_messages();
|
||||||
|
|
||||||
|
if ($sql_where_message_id)
|
||||||
|
{
|
||||||
|
$sql_where_ary[] = implode(' OR ', $sql_where_message_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql_array = array(
|
$sql_array = array(
|
||||||
'SELECT' => 'm.*, u.username, u.user_colour, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, u.user_allow_pm',
|
'SELECT' => 'm.*, u.username, u.user_colour, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, u.user_allow_pm, p.post_visibility',
|
||||||
'FROM' => array($this->mchat_table => 'm'),
|
'FROM' => array($this->mchat_table => 'm'),
|
||||||
'LEFT_JOIN' => array(
|
'LEFT_JOIN' => array(
|
||||||
array(
|
array(
|
||||||
'FROM' => array(USERS_TABLE => 'u'),
|
'FROM' => array(USERS_TABLE => 'u'),
|
||||||
'ON' => 'm.user_id = u.user_id',
|
'ON' => 'm.user_id = u.user_id',
|
||||||
)
|
),
|
||||||
|
array(
|
||||||
|
'FROM' => array(POSTS_TABLE => 'p'),
|
||||||
|
'ON' => 'm.post_id = p.post_id AND m.forum_id <> 0',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
'WHERE' => $sql_where,
|
'WHERE' => $sql_where_ary ? $this->db->sql_escape('(' . implode(') AND (', $sql_where_ary) . ')') : '',
|
||||||
'ORDER_BY' => 'm.message_id DESC',
|
'ORDER_BY' => 'm.message_id DESC',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event to modify the SQL query that fetches mChat messages
|
||||||
|
*
|
||||||
|
* @event dmzx.mchat.get_messages_modify_sql
|
||||||
|
* @var array message_ids IDs of specific messages to fetch, e.g. for fetching edited messages
|
||||||
|
* @var int last_id The ID of the latest message that the user has, for fetching new messages
|
||||||
|
* @var int total SQL limit
|
||||||
|
* @var int offset SQL offset
|
||||||
|
* @var array sql_array Array containing the SQL query data
|
||||||
|
* @since 2.0.0-RC6
|
||||||
|
*/
|
||||||
|
$vars = array(
|
||||||
|
'message_ids',
|
||||||
|
'last_id',
|
||||||
|
'total',
|
||||||
|
'offset',
|
||||||
|
'sql_array',
|
||||||
|
);
|
||||||
|
extract($this->dispatcher->trigger_event('dmzx.mchat.get_messages_modify_sql', compact($vars)));
|
||||||
|
|
||||||
$sql = $this->db->sql_build_query('SELECT', $sql_array);
|
$sql = $this->db->sql_build_query('SELECT', $sql_array);
|
||||||
$result = $this->db->sql_query_limit($sql, $total, $offset);
|
$result = $this->db->sql_query_limit($sql, $total, $offset);
|
||||||
$rows = $this->db->sql_fetchrowset($result);
|
$rows = $this->db->sql_fetchrowset($result);
|
||||||
@@ -310,6 +500,88 @@ class functions
|
|||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates SQL where conditions to include or exlude notifacation
|
||||||
|
* messages based on the current user's settings and permissions
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected function get_sql_where_for_notifcation_messages()
|
||||||
|
{
|
||||||
|
$sql_where_ary = array();
|
||||||
|
|
||||||
|
if ($this->settings->cfg('mchat_posts'))
|
||||||
|
{
|
||||||
|
// If the current user doesn't have permission to see hidden users, exclude their login posts
|
||||||
|
if (!$this->auth->acl_get('u_viewonline'))
|
||||||
|
{
|
||||||
|
$sql_where_ary[] = 'm.post_id <> ' . (int) self::LOGIN_HIDDEN . // Exclude all notifications that were created by hidden users ...
|
||||||
|
' OR m.user_id = ' . (int) $this->user->data['user_id'] . // ... but include all login notifications of the current user
|
||||||
|
' OR m.forum_id <> 0'; // ... and include all post notifications
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Exclude all post notifications
|
||||||
|
$sql_where_ary[] = 'm.post_id = 0';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $sql_where_ary;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 mchat_get_logs($log_id)
|
||||||
|
{
|
||||||
|
$sql_array = array(
|
||||||
|
'SELECT' => 'ml.*',
|
||||||
|
'FROM' => array($this->mchat_log_table => '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);
|
||||||
|
|
||||||
|
$logs = array(
|
||||||
|
'id' => $log_id,
|
||||||
|
);
|
||||||
|
|
||||||
|
foreach ($rows as $row)
|
||||||
|
{
|
||||||
|
$logs['id'] = max((int) $logs['id'], (int) $row['log_id']);
|
||||||
|
$logs[] = $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $logs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches the highest log ID
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function get_latest_log_id()
|
||||||
|
{
|
||||||
|
$sql_array = array(
|
||||||
|
'SELECT' => 'ml.log_id',
|
||||||
|
'FROM' => array($this->mchat_log_table => '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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the user legend markup
|
* Generates the user legend markup
|
||||||
*
|
*
|
||||||
@@ -319,23 +591,27 @@ class functions
|
|||||||
{
|
{
|
||||||
// Grab group details for legend display for who is online on the custom page
|
// Grab group details for legend display for who is online on the custom page
|
||||||
$order_legend = $this->settings->cfg('legend_sort_groupname') ? 'group_name' : 'group_legend';
|
$order_legend = $this->settings->cfg('legend_sort_groupname') ? 'group_name' : 'group_legend';
|
||||||
|
|
||||||
|
$sql_array = array(
|
||||||
|
'SELECT' => 'g.group_id, g.group_name, g.group_colour, g.group_type',
|
||||||
|
'FROM' => array(GROUPS_TABLE => 'g'),
|
||||||
|
'WHERE' => 'group_legend <> 0',
|
||||||
|
'ORDER_BY' => 'g.' . $order_legend . ' ASC',
|
||||||
|
);
|
||||||
|
|
||||||
if ($this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
|
if ($this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
|
||||||
{
|
{
|
||||||
$sql = 'SELECT group_id, group_name, group_colour, group_type
|
$sql_array['LEFT_JOIN'] = array(
|
||||||
FROM ' . GROUPS_TABLE . '
|
array(
|
||||||
WHERE group_legend <> 0
|
'FROM' => array(USER_GROUP_TABLE => 'ug'),
|
||||||
ORDER BY ' . $order_legend . ' ASC';
|
'ON' => 'g.group_id = ug.group_id AND ug.user_id = ' . (int) $this->user->data['user_id'] . ' AND ug.user_pending = 0',
|
||||||
}
|
),
|
||||||
else
|
);
|
||||||
{
|
|
||||||
$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
|
$sql_array['WHERE'] .= ' AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . (int) $this->user->data['user_id'] . ')';
|
||||||
FROM ' . GROUPS_TABLE . ' g
|
|
||||||
LEFT JOIN ' . USER_GROUP_TABLE . ' ug ON (g.group_id = ug.group_id AND ug.user_id = ' . $this->user->data['user_id'] . ' AND ug.user_pending = 0)
|
|
||||||
WHERE g.group_legend <> 0
|
|
||||||
AND (g.group_type <> ' . GROUP_HIDDEN . '
|
|
||||||
OR ug.user_id = ' . (int) $this->user->data['user_id'] . ')
|
|
||||||
ORDER BY g.' . $order_legend . ' ASC';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sql = $this->db->sql_build_query('SELECT', $sql_array);
|
||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
$rows = $this->db->sql_fetchrowset($result);
|
$rows = $this->db->sql_fetchrowset($result);
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
@@ -365,23 +641,65 @@ class functions
|
|||||||
*/
|
*/
|
||||||
public function mchat_foes()
|
public function mchat_foes()
|
||||||
{
|
{
|
||||||
if (is_null($this->foes))
|
$sql = 'SELECT zebra_id
|
||||||
{
|
FROM ' . ZEBRA_TABLE . '
|
||||||
$sql = 'SELECT *
|
WHERE foe = 1
|
||||||
FROM ' . ZEBRA_TABLE . '
|
AND user_id = ' . (int) $this->user->data['user_id'];
|
||||||
WHERE foe = 1 AND user_id = ' . (int) $this->user->data['user_id'];
|
$result = $this->db->sql_query($sql);
|
||||||
$result = $this->db->sql_query($sql);
|
$rows = $this->db->sql_fetchrowset($result);
|
||||||
$rows = $this->db->sql_fetchrowset($result);
|
$this->db->sql_freeresult($result);
|
||||||
$this->db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$this->foes = array();
|
$foes = array();
|
||||||
foreach ($rows as $row)
|
|
||||||
{
|
foreach ($rows as $row)
|
||||||
$this->foes[] = $row['zebra_id'];
|
{
|
||||||
}
|
$foes[] = $row['zebra_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->foes;
|
return $foes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches post subjects and their forum names
|
||||||
|
*
|
||||||
|
* @param array $post_ids
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function mchat_get_post_data($post_ids)
|
||||||
|
{
|
||||||
|
if (!$post_ids)
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = 'SELECT p.post_id, p.post_subject, 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);
|
||||||
|
|
||||||
|
$result = $this->db->sql_query($sql);
|
||||||
|
$rows = $this->db->sql_fetchrowset($result);
|
||||||
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
|
$post_subjects = array();
|
||||||
|
|
||||||
|
foreach ($rows as $row)
|
||||||
|
{
|
||||||
|
$post_subjects[$row['post_id']] = array(
|
||||||
|
'post_subject' => $row['post_subject'],
|
||||||
|
'forum_name' => $row['forum_name'],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle deleted posts
|
||||||
|
$non_existent_post_ids = array_diff($post_ids, array_keys($post_subjects));
|
||||||
|
|
||||||
|
foreach ($non_existent_post_ids as $post_id)
|
||||||
|
{
|
||||||
|
$post_subjects[$post_id] = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $post_subjects;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -405,43 +723,67 @@ class functions
|
|||||||
/**
|
/**
|
||||||
* Inserts a message with posting information into the database
|
* Inserts a message with posting information into the database
|
||||||
*
|
*
|
||||||
* @param string $mode One of post|quote|edit|reply
|
* @param string $mode One of post|quote|edit|reply|login
|
||||||
* @param $data The post data
|
* @param int $forum_id
|
||||||
|
* @param int $post_id
|
||||||
|
* @param bool $is_hidden_login
|
||||||
*/
|
*/
|
||||||
public function mchat_insert_posting($mode, $data)
|
public function mchat_insert_posting($mode, $forum_id, $post_id, $is_hidden_login)
|
||||||
{
|
{
|
||||||
$mode_config = array(
|
$mode_config = array(
|
||||||
'post' => 'mchat_posts_topic',
|
'post' => 'mchat_posts_topic',
|
||||||
'quote' => 'mchat_posts_quote',
|
'quote' => 'mchat_posts_quote',
|
||||||
'edit' => 'mchat_posts_edit',
|
'edit' => 'mchat_posts_edit',
|
||||||
'reply' => 'mchat_posts_reply',
|
'reply' => 'mchat_posts_reply',
|
||||||
|
'login' => 'mchat_posts_login',
|
||||||
);
|
);
|
||||||
|
|
||||||
if (empty($mode_config[$mode]) || !$this->settings->cfg($mode_config[$mode]))
|
$is_mode_enabled = !empty($mode_config[$mode]) && $this->settings->cfg($mode_config[$mode]);
|
||||||
|
|
||||||
|
// Special treatment for login notifications
|
||||||
|
if ($mode === 'login')
|
||||||
{
|
{
|
||||||
return;
|
$forum_id = 0;
|
||||||
|
$post_id = $is_hidden_login ? self::LOGIN_HIDDEN : self::LOGIN_VISIBLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$board_url = generate_board_url();
|
$sql_array = array(
|
||||||
$topic_url = '[url=' . $board_url . '/viewtopic.' . $this->php_ext . '?p=' . $data['post_id'] . '#p' . $data['post_id'] . ']' . $data['post_subject'] . '[/url]';
|
'forum_id' => (int) $forum_id,
|
||||||
$forum_url = '[url=' . $board_url . '/viewforum.' . $this->php_ext . '?f=' . $data['forum_id'] . ']' . $data['forum_name'] . '[/url]';
|
'post_id' => (int) $post_id,
|
||||||
$message = $this->user->lang('MCHAT_NEW_' . strtoupper($mode), $topic_url, $forum_url);
|
'user_id' => (int) $this->user->data['user_id'],
|
||||||
|
|
||||||
$uid = $bitfield = $options = ''; // will be modified by generate_text_for_storage
|
|
||||||
generate_text_for_storage($message, $uid, $bitfield, $options, true, false, false);
|
|
||||||
$sql_ary = array(
|
|
||||||
'forum_id' => $data['forum_id'],
|
|
||||||
'post_id' => $data['post_id'],
|
|
||||||
'user_id' => $this->user->data['user_id'],
|
|
||||||
'user_ip' => $this->user->data['session_ip'],
|
'user_ip' => $this->user->data['session_ip'],
|
||||||
'message' => utf8_normalize_nfc($message),
|
'message' => 'MCHAT_NEW_' . strtoupper($mode),
|
||||||
'bbcode_bitfield' => $bitfield,
|
|
||||||
'bbcode_uid' => $uid,
|
|
||||||
'bbcode_options' => $options,
|
|
||||||
'message_time' => time(),
|
'message_time' => time(),
|
||||||
);
|
);
|
||||||
$sql = 'INSERT INTO ' . $this->mchat_table . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
|
|
||||||
$this->db->sql_query($sql);
|
/**
|
||||||
|
* Event that allows to modify data of a posting 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 bool is_hidden_login Whether or not the user session is hidden. Only used if mode is login.
|
||||||
|
* @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
|
||||||
|
*/
|
||||||
|
$vars = array(
|
||||||
|
'mode',
|
||||||
|
'forum_id',
|
||||||
|
'post_id',
|
||||||
|
'is_hidden_login',
|
||||||
|
'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_table . ' ' . $this->db->sql_build_array('INSERT', $sql_array);
|
||||||
|
$this->db->sql_query($sql);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -475,7 +817,7 @@ class functions
|
|||||||
*/
|
*/
|
||||||
public function mchat_author_for_message($message_id)
|
public function mchat_author_for_message($message_id)
|
||||||
{
|
{
|
||||||
$sql = 'SELECT u.user_id, u.username, m.message_time
|
$sql = 'SELECT u.user_id, u.username, m.message_time, m.forum_id, m.post_id
|
||||||
FROM ' . $this->mchat_table . ' m
|
FROM ' . $this->mchat_table . ' m
|
||||||
LEFT JOIN ' . USERS_TABLE . ' u ON m.user_id = u.user_id
|
LEFT JOIN ' . USERS_TABLE . ' u ON m.user_id = u.user_id
|
||||||
WHERE m.message_id = ' . (int) $message_id;
|
WHERE m.message_id = ' . (int) $message_id;
|
||||||
@@ -486,92 +828,97 @@ class functions
|
|||||||
return $row;
|
return $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an array of message IDs that have been deleted from the message table
|
|
||||||
*
|
|
||||||
* @param $start_id
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function mchat_deleted_ids($start_id)
|
|
||||||
{
|
|
||||||
$sql = 'SELECT message_id
|
|
||||||
FROM ' . $this->mchat_deleted_messages_table . '
|
|
||||||
WHERE message_id >= ' . (int) $start_id . '
|
|
||||||
ORDER BY message_id DESC';
|
|
||||||
$result = $this->db->sql_query($sql, 3600);
|
|
||||||
$rows = $this->db->sql_fetchrowset();
|
|
||||||
$this->db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$missing_ids = array();
|
|
||||||
foreach ($rows as $row)
|
|
||||||
{
|
|
||||||
$missing_ids[] = (int) $row['message_id'];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $missing_ids;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs AJAX actions
|
* Performs AJAX actions
|
||||||
*
|
*
|
||||||
* @param string $action One of add|edit|del|prune
|
* @param string $action One of add|edit|del
|
||||||
* @param array $sql_ary
|
* @param array $sql_ary
|
||||||
* @param int $message_id
|
* @param int $message_id
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function mchat_action($action, $sql_ary = null, $message_id = 0)
|
public function mchat_action($action, $sql_ary = null, $message_id = 0)
|
||||||
{
|
{
|
||||||
|
$update_session_infos = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Event to modify the SQL query that adds, edits or deletes an mChat message
|
||||||
|
*
|
||||||
|
* @event dmzx.mchat.action_before
|
||||||
|
* @var string action The action that is being performed, one of add|edit|del
|
||||||
|
* @var bool sql_ary Array containing SQL data, or null if a message is deleted
|
||||||
|
* @var int message_id The ID of the message that is being edited or deleted, or 0 if a message is added
|
||||||
|
* @var bool update_session_infos Whether or not to update the user session
|
||||||
|
* @since 2.0.0-RC6
|
||||||
|
*/
|
||||||
|
$vars = array(
|
||||||
|
'action',
|
||||||
|
'sql_ary',
|
||||||
|
'message_id',
|
||||||
|
'update_session_infos',
|
||||||
|
);
|
||||||
|
extract($this->dispatcher->trigger_event('dmzx.mchat.action_before', compact($vars)));
|
||||||
|
|
||||||
$is_new_session = false;
|
$is_new_session = false;
|
||||||
|
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
// User adds a message
|
// User adds a message
|
||||||
case 'add':
|
case 'add':
|
||||||
$this->user->update_session_infos();
|
if ($update_session_infos)
|
||||||
|
{
|
||||||
|
$this->user->update_session_infos();
|
||||||
|
}
|
||||||
$is_new_session = $this->mchat_add_user_session();
|
$is_new_session = $this->mchat_add_user_session();
|
||||||
$this->db->sql_query('INSERT INTO ' . $this->mchat_table . ' ' . $this->db->sql_build_array('INSERT', $sql_ary));
|
$this->db->sql_query('INSERT INTO ' . $this->mchat_table . ' ' . $this->db->sql_build_array('INSERT', $sql_ary));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// User edits a message
|
// User edits a message
|
||||||
case 'edit':
|
case 'edit':
|
||||||
$this->user->update_session_infos();
|
if ($update_session_infos)
|
||||||
|
{
|
||||||
|
$this->user->update_session_infos();
|
||||||
|
}
|
||||||
$is_new_session = $this->mchat_add_user_session();
|
$is_new_session = $this->mchat_add_user_session();
|
||||||
$this->db->sql_query('UPDATE ' . $this->mchat_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE message_id = ' . (int) $message_id);
|
$this->db->sql_query('UPDATE ' . $this->mchat_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE message_id = ' . (int) $message_id);
|
||||||
|
$this->mchat_insert_log('edit', $message_id);
|
||||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EDITED_MCHAT', false, array($this->user->data['username']));
|
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EDITED_MCHAT', false, array($this->user->data['username']));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// User deletes a message
|
// User deletes a message
|
||||||
case 'del':
|
case 'del':
|
||||||
$this->user->update_session_infos();
|
if ($update_session_infos)
|
||||||
|
{
|
||||||
|
$this->user->update_session_infos();
|
||||||
|
}
|
||||||
$is_new_session = $this->mchat_add_user_session();
|
$is_new_session = $this->mchat_add_user_session();
|
||||||
$this->db->sql_query('DELETE FROM ' . $this->mchat_table . ' WHERE message_id = ' . (int) $message_id);
|
$this->db->sql_query('DELETE FROM ' . $this->mchat_table . ' WHERE message_id = ' . (int) $message_id);
|
||||||
$this->db->sql_query('INSERT INTO ' . $this->mchat_deleted_messages_table . ' ' . $this->db->sql_build_array('INSERT', array('message_id' => (int) $message_id)));
|
$this->mchat_insert_log('del', $message_id);
|
||||||
$this->cache->destroy('sql', $this->mchat_deleted_messages_table);
|
|
||||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DELETED_MCHAT', false, array($this->user->data['username']));
|
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DELETED_MCHAT', false, array($this->user->data['username']));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// User triggers messages to be pruned
|
|
||||||
case 'prune':
|
|
||||||
$sql = 'SELECT message_id
|
|
||||||
FROM ' . $this->mchat_table . '
|
|
||||||
WHERE message_id < ' . (int) $message_id . '
|
|
||||||
ORDER BY message_id DESC';
|
|
||||||
$result = $this->db->sql_query($sql);
|
|
||||||
$rows = $this->db->sql_fetchrowset();
|
|
||||||
$this->db->sql_freeresult($result);
|
|
||||||
|
|
||||||
$prune_ids = array();
|
|
||||||
foreach ($rows as $row)
|
|
||||||
{
|
|
||||||
$prune_ids[] = (int) $row['message_id'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->db->sql_query('DELETE FROM ' . $this->mchat_table . ' WHERE ' .$this->db->sql_in_set('message_id', $prune_ids));
|
|
||||||
$this->db->sql_multi_insert($this->mchat_deleted_messages_table, $rows);
|
|
||||||
$this->cache->destroy('sql', $this->mchat_deleted_messages_table);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $is_new_session;
|
return $is_new_session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $log_type The log type, one of edit|del
|
||||||
|
* @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
|
||||||
|
*/
|
||||||
|
public function mchat_insert_log($log_type, $message_id)
|
||||||
|
{
|
||||||
|
$this->db->sql_query('INSERT INTO ' . $this->mchat_log_table . ' ' . $this->db->sql_build_array('INSERT', array(
|
||||||
|
'log_type' => array_search($log_type, $this->log_types),
|
||||||
|
'user_id' => (int) $this->user->data['user_id'],
|
||||||
|
'message_id' => (int) $message_id,
|
||||||
|
'log_ip' => $this->user->ip,
|
||||||
|
'log_time' => time(),
|
||||||
|
)));
|
||||||
|
|
||||||
|
$log_id = (int) $this->db->sql_nextid();
|
||||||
|
|
||||||
|
$this->cache->destroy('sql', $this->mchat_log_table);
|
||||||
|
|
||||||
|
return $log_id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1114
core/mchat.php
1114
core/mchat.php
File diff suppressed because it is too large
Load Diff
@@ -4,34 +4,63 @@
|
|||||||
*
|
*
|
||||||
* @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\event\dispatcher_interface;
|
||||||
|
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 config */
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
/** @var \phpbb\auth\auth */
|
/** @var auth */
|
||||||
protected $auth;
|
protected $auth;
|
||||||
|
|
||||||
/** @var array */
|
/** @var dispatcher_interface */
|
||||||
public $global;
|
protected $dispatcher;
|
||||||
|
|
||||||
/** @var array */
|
/**
|
||||||
public $ucp;
|
* 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 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 = array(
|
||||||
|
0 => 'messages',
|
||||||
|
1 => 'hours',
|
||||||
|
24 => 'days',
|
||||||
|
168 => 'weeks',
|
||||||
|
);
|
||||||
|
|
||||||
/** @var bool */
|
/** @var bool */
|
||||||
public $is_phpbb31;
|
public $is_phpbb31;
|
||||||
@@ -42,33 +71,140 @@ class settings
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param \phpbb\user $user
|
* @param user $user
|
||||||
* @param \phpbb\config\config $config
|
* @param config $config
|
||||||
* @param \phpbb\auth\auth $auth
|
* @param auth $auth
|
||||||
* @param array $global
|
* @param dispatcher_interface $dispatcher
|
||||||
* @param array $ucp
|
|
||||||
*/
|
*/
|
||||||
public function __construct(\phpbb\user $user, \phpbb\config\config $config, \phpbb\auth\auth $auth, $global, $ucp)
|
public function __construct(
|
||||||
|
user $user,
|
||||||
|
config $config,
|
||||||
|
auth $auth,
|
||||||
|
dispatcher_interface $dispatcher
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->auth = $auth;
|
$this->auth = $auth;
|
||||||
$this->global = $global;
|
$this->dispatcher = $dispatcher;
|
||||||
$this->ucp = $ucp;
|
|
||||||
|
|
||||||
$this->is_phpbb31 = phpbb_version_compare($config['version'], '3.1.0@dev', '>=') && phpbb_version_compare($config['version'], '3.2.0@dev', '<');
|
$this->is_phpbb31 = phpbb_version_compare(PHPBB_VERSION, '3.1.0@dev', '>=') && phpbb_version_compare(PHPBB_VERSION, '3.2.0@dev', '<');
|
||||||
$this->is_phpbb32 = phpbb_version_compare($config['version'], '3.2.0@dev', '>=') && phpbb_version_compare($config['version'], '3.3.0@dev', '<');
|
$this->is_phpbb32 = phpbb_version_compare(PHPBB_VERSION, '3.2.0@dev', '>=') && phpbb_version_compare(PHPBB_VERSION, '3.3.0@dev', '<');
|
||||||
|
|
||||||
$this->inject_core_config_values();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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 = array(
|
||||||
$this->global['mchat_timeout']['validation'][self::VALIDATE_MAX_VALUE] = (int) $this->cfg('session_length');
|
'mchat_bbcode_disallowed' => array('default' => '', 'validation' => array('string', false, 0, 255)),
|
||||||
|
'mchat_custom_height' => array('default' => 350, 'validation' => array('num', false, 50, 1000)),
|
||||||
|
'mchat_custom_page' => array('default' => 1),
|
||||||
|
'mchat_edit_delete_limit' => array('default' => 0),
|
||||||
|
'mchat_flood_time' => array('default' => 0, 'validation' => array('num', false, 0, 60)),
|
||||||
|
'mchat_index_height' => array('default' => 250, 'validation' => array('num', false, 50, 1000)),
|
||||||
|
'mchat_live_updates' => array('default' => 1),
|
||||||
|
'mchat_max_message_lngth' => array('default' => 500, 'validation' => array('num', false, 0, 1000)),
|
||||||
|
'mchat_message_num_archive' => array('default' => 25, 'validation' => array('num', false, 10, 100)),
|
||||||
|
'mchat_message_num_custom' => array('default' => 10, 'validation' => array('num', false, 5, 50)),
|
||||||
|
'mchat_message_num_index' => array('default' => 10, 'validation' => array('num', false, 5, 50)),
|
||||||
|
'mchat_navbar_link' => array('default' => 1),
|
||||||
|
'mchat_navbar_link_count' => array('default' => 1),
|
||||||
|
'mchat_override_min_post_chars' => array('default' => 0),
|
||||||
|
'mchat_override_smilie_limit' => array('default' => 0),
|
||||||
|
'mchat_posts_edit' => array('default' => 0),
|
||||||
|
'mchat_posts_quote' => array('default' => 0),
|
||||||
|
'mchat_posts_reply' => array('default' => 0),
|
||||||
|
'mchat_posts_topic' => array('default' => 0),
|
||||||
|
'mchat_posts_login' => array('default' => 0),
|
||||||
|
'mchat_prune' => array('default' => 0),
|
||||||
|
'mchat_prune_gc' => array('default' => strtotime('1 day', 0)),
|
||||||
|
'mchat_prune_mode' => array('default' => 0),
|
||||||
|
'mchat_prune_num' => array('default' => 0),
|
||||||
|
'mchat_refresh' => array('default' => 10, 'validation' => array('num', false, 5, 60)),
|
||||||
|
'mchat_rules' => array('default' => '', 'validation' => array('string', false, 0, 255)),
|
||||||
|
'mchat_static_message' => array('default' => '', 'validation' => array('string', false, 0, 255)),
|
||||||
|
'mchat_timeout' => array('default' => 0, 'validation' => array('num', false, 0, (int) $this->cfg('session_length'))),
|
||||||
|
'mchat_whois_refresh' => array('default' => 60, 'validation' => array('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 = array(
|
||||||
|
'global_settings',
|
||||||
|
);
|
||||||
|
extract($this->dispatcher->trigger_event('dmzx.mchat.global_settings_modify', compact($vars)));
|
||||||
|
|
||||||
|
return $global_settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function initialize_ucp_settings()
|
||||||
|
{
|
||||||
|
$ucp_settings = array(
|
||||||
|
'mchat_avatars' => array('default' => 1),
|
||||||
|
'mchat_capital_letter' => array('default' => 1),
|
||||||
|
'mchat_character_count' => array('default' => 1),
|
||||||
|
'mchat_date' => array('default' => 'D M d, Y g:i a', 'validation' => array('string', false, 0, 64)),
|
||||||
|
'mchat_index' => array('default' => 1),
|
||||||
|
'mchat_input_area' => array('default' => 1),
|
||||||
|
'mchat_location' => array('default' => 1),
|
||||||
|
'mchat_message_top' => array('default' => 1),
|
||||||
|
'mchat_pause_on_input' => array('default' => 0),
|
||||||
|
'mchat_posts' => array('default' => 1),
|
||||||
|
'mchat_relative_time' => array('default' => 1),
|
||||||
|
'mchat_sound' => array('default' => 1),
|
||||||
|
'mchat_stats_index' => array('default' => 0),
|
||||||
|
'mchat_whois_index' => array('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 = array(
|
||||||
|
'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 ucp_settings()
|
||||||
|
{
|
||||||
|
if (empty($this->ucp_settings))
|
||||||
|
{
|
||||||
|
$this->ucp_settings = $this->initialize_ucp_settings();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->ucp_settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,13 +220,15 @@ 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))
|
$ucp_settings = $this->ucp_settings();
|
||||||
|
|
||||||
|
if (!$force_global && isset($ucp_settings[$config]) && $auth->acl_get('u_' . $config))
|
||||||
{
|
{
|
||||||
return $user_data['user_' . $config];
|
return $user_data['user_' . $config];
|
||||||
}
|
}
|
||||||
@@ -101,10 +239,18 @@ class settings
|
|||||||
/**
|
/**
|
||||||
* @param $config
|
* @param $config
|
||||||
* @param $value
|
* @param $value
|
||||||
|
* @param bool $volatile
|
||||||
*/
|
*/
|
||||||
public function set_cfg($config, $value)
|
public function set_cfg($config, $value, $volatile = false)
|
||||||
{
|
{
|
||||||
$this->config->set($config, $value);
|
if ($volatile)
|
||||||
|
{
|
||||||
|
$this->config[$config] = $value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->config->set($config, $value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -132,9 +278,11 @@ class settings
|
|||||||
}
|
}
|
||||||
$dateformat_options .= '>' . $this->user->lang('MCHAT_CUSTOM_DATEFORMAT') . '</option>';
|
$dateformat_options .= '>' . $this->user->lang('MCHAT_CUSTOM_DATEFORMAT') . '</option>';
|
||||||
|
|
||||||
|
$ucp_settings = $this->ucp_settings();
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'S_MCHAT_DATEFORMAT_OPTIONS' => $dateformat_options,
|
'S_MCHAT_DATEFORMAT_OPTIONS' => $dateformat_options,
|
||||||
'A_MCHAT_DEFAULT_DATEFORMAT' => addslashes($this->ucp['mchat_date']['default']),
|
'A_MCHAT_DEFAULT_DATEFORMAT' => addslashes($ucp_settings['mchat_date']['default']),
|
||||||
'S_MCHAT_CUSTOM_DATEFORMAT' => $s_custom,
|
'S_MCHAT_CUSTOM_DATEFORMAT' => $s_custom,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -146,7 +294,7 @@ class settings
|
|||||||
{
|
{
|
||||||
$enabled_notifications_lang = array();
|
$enabled_notifications_lang = array();
|
||||||
|
|
||||||
foreach (array('topic', 'reply', 'quote', 'edit') as $notification)
|
foreach (array('topic', 'reply', 'quote', 'edit', 'login') as $notification)
|
||||||
{
|
{
|
||||||
if ($this->cfg('mchat_posts_' . $notification))
|
if ($this->cfg('mchat_posts_' . $notification))
|
||||||
{
|
{
|
||||||
|
|||||||
74
cron/mchat_prune.php
Normal file
74
cron/mchat_prune.php
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?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 $functions;
|
||||||
|
|
||||||
|
/** @var settings */
|
||||||
|
protected $settings;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param functions $functions
|
||||||
|
* @param settings $settings
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
functions $functions,
|
||||||
|
settings $settings
|
||||||
|
)
|
||||||
|
{
|
||||||
|
$this->functions = $functions;
|
||||||
|
$this->settings = $settings;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs this cron task.
|
||||||
|
*
|
||||||
|
* @return null
|
||||||
|
*/
|
||||||
|
public function run()
|
||||||
|
{
|
||||||
|
$this->functions->mchat_prune();
|
||||||
|
$this->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->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->settings->cfg('mchat_prune_last_gc') < time() - $this->settings->cfg('mchat_prune_gc');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,27 +4,33 @@
|
|||||||
*
|
*
|
||||||
* @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\settings;
|
||||||
|
use phpbb\auth\auth;
|
||||||
|
use phpbb\request\request_interface;
|
||||||
|
use phpbb\template\template;
|
||||||
|
use phpbb\user;
|
||||||
|
use Symfony\Component\EventDispatcher\Event;
|
||||||
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 user */
|
||||||
protected $user;
|
protected $user;
|
||||||
|
|
||||||
/** @var \dmzx\mchat\core\settings */
|
/** @var settings */
|
||||||
protected $settings;
|
protected $settings;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
@@ -36,14 +42,21 @@ class acp_listener implements EventSubscriberInterface
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param \phpbb\template\template $template
|
* @param template $template
|
||||||
* @param \phpbb\request\request $request
|
* @param request_interface $request
|
||||||
* @param \phpbb\user $user
|
* @param user $user
|
||||||
* @param \dmzx\mchat\core\settings $settings
|
* @param settings $settings
|
||||||
* @param string $root_path
|
* @param string $root_path
|
||||||
* @param string $php_ext
|
* @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,
|
||||||
|
user $user,
|
||||||
|
settings $settings,
|
||||||
|
$root_path,
|
||||||
|
$php_ext
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$this->template = $template;
|
$this->template = $template;
|
||||||
$this->request = $request;
|
$this->request = $request;
|
||||||
@@ -66,11 +79,16 @@ class acp_listener implements EventSubscriberInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param object $event The event object
|
* @param Event $event
|
||||||
*/
|
*/
|
||||||
public function permissions($event)
|
public function permissions($event)
|
||||||
{
|
{
|
||||||
$mchat_permissions = array();
|
$ucp_configs = array();
|
||||||
|
|
||||||
|
foreach (array_keys($this->settings->ucp_settings()) as $config_name)
|
||||||
|
{
|
||||||
|
$ucp_configs[] = 'u_' . $config_name;
|
||||||
|
}
|
||||||
|
|
||||||
$permission_categories = array(
|
$permission_categories = array(
|
||||||
'mchat' => array(
|
'mchat' => array(
|
||||||
@@ -78,6 +96,8 @@ class acp_listener implements EventSubscriberInterface
|
|||||||
'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',
|
||||||
@@ -89,9 +109,11 @@ class acp_listener implements EventSubscriberInterface
|
|||||||
'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 = array();
|
||||||
|
|
||||||
foreach ($permission_categories as $cat => $permissions)
|
foreach ($permission_categories as $cat => $permissions)
|
||||||
{
|
{
|
||||||
foreach ($permissions as $permission)
|
foreach ($permissions as $permission)
|
||||||
@@ -107,12 +129,12 @@ class acp_listener implements EventSubscriberInterface
|
|||||||
|
|
||||||
$event['categories'] = array_merge($event['categories'], array(
|
$event['categories'] = array_merge($event['categories'], array(
|
||||||
'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 Event $event
|
||||||
*/
|
*/
|
||||||
public function acp_users_prefs_modify_sql($event)
|
public function acp_users_prefs_modify_sql($event)
|
||||||
{
|
{
|
||||||
@@ -121,11 +143,11 @@ class acp_listener implements EventSubscriberInterface
|
|||||||
|
|
||||||
$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->settings->ucp_settings() as $config_name => $config_data)
|
||||||
{
|
{
|
||||||
if ($auth->acl_get('u_' . $config_name))
|
if ($auth->acl_get('u_' . $config_name))
|
||||||
{
|
{
|
||||||
@@ -150,15 +172,15 @@ class acp_listener implements EventSubscriberInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param object $event The event object
|
* @param Event $event
|
||||||
*/
|
*/
|
||||||
public function acp_users_prefs_modify_template_data($event)
|
public function acp_users_prefs_modify_template_data($event)
|
||||||
{
|
{
|
||||||
$this->user->add_lang_ext('dmzx/mchat', 'mchat_ucp');
|
$this->user->add_lang_ext('dmzx/mchat', array('mchat_acp', 'mchat_ucp'));
|
||||||
|
|
||||||
$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);
|
||||||
|
|
||||||
@@ -169,7 +191,7 @@ class acp_listener implements EventSubscriberInterface
|
|||||||
$notifications_template_data = $this->settings->get_enabled_post_notifications_lang();
|
$notifications_template_data = $this->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->settings->ucp_settings()) as $config_name)
|
||||||
{
|
{
|
||||||
$upper = strtoupper($config_name);
|
$upper = strtoupper($config_name);
|
||||||
$this->template->assign_vars(array(
|
$this->template->assign_vars(array(
|
||||||
|
|||||||
@@ -4,43 +4,59 @@
|
|||||||
*
|
*
|
||||||
* @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 phpbb\controller\helper;
|
||||||
|
use phpbb\request\request_interface;
|
||||||
|
use phpbb\user;
|
||||||
|
use Symfony\Component\EventDispatcher\Event;
|
||||||
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 helper */
|
||||||
protected $helper;
|
protected $helper;
|
||||||
|
|
||||||
/** @var \phpbb\user */
|
/** @var user */
|
||||||
protected $user;
|
protected $user;
|
||||||
|
|
||||||
|
/** @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 helper $helper
|
||||||
* @param \phpbb\user $user
|
* @param user $user
|
||||||
* @param string $php_ext
|
* @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,
|
||||||
|
helper $helper,
|
||||||
|
user $user,
|
||||||
|
request_interface $request,
|
||||||
|
$php_ext
|
||||||
|
)
|
||||||
{
|
{
|
||||||
$this->mchat = $mchat;
|
$this->mchat = $mchat;
|
||||||
$this->helper = $helper;
|
$this->helper = $helper;
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
$this->php_ext = $php_ext;
|
$this->request = $request;
|
||||||
|
$this->php_ext = $php_ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -53,25 +69,28 @@ class main_listener implements EventSubscriberInterface
|
|||||||
'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.display_custom_bbcodes_modify_sql' => array(array('remove_disallowed_bbcodes'), array('pm_compose_add_quote')),
|
||||||
|
'core.user_add_modify_data' => 'user_registration_set_default_values',
|
||||||
|
'core.login_box_redirect' => 'user_login_success',
|
||||||
|
'core.session_gc_after' => 'session_gc',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param object $event The event object
|
* @param Event $event
|
||||||
*/
|
*/
|
||||||
public function add_page_viewonline($event)
|
public function add_page_viewonline($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->user->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 Event $event
|
||||||
*/
|
*/
|
||||||
public function load_language_on_setup($event)
|
public function load_language_on_setup($event)
|
||||||
{
|
{
|
||||||
@@ -86,7 +105,7 @@ class main_listener implements EventSubscriberInterface
|
|||||||
/**
|
/**
|
||||||
* 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
|
* @param Event $event
|
||||||
*/
|
*/
|
||||||
public function add_page_header_link($event)
|
public function add_page_header_link($event)
|
||||||
{
|
{
|
||||||
@@ -96,7 +115,7 @@ class main_listener implements EventSubscriberInterface
|
|||||||
/**
|
/**
|
||||||
* Check if mchat should be displayed on index.
|
* Check if mchat should be displayed on index.
|
||||||
*
|
*
|
||||||
* @param object $event The event object
|
* @param Event $event
|
||||||
*/
|
*/
|
||||||
public function display_mchat_on_index($event)
|
public function display_mchat_on_index($event)
|
||||||
{
|
{
|
||||||
@@ -104,23 +123,58 @@ class main_listener implements EventSubscriberInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param object $event The event object
|
* @param Event $event
|
||||||
*/
|
*/
|
||||||
public function posting_modify_submit_post_after($event)
|
public function insert_posting($event)
|
||||||
{
|
{
|
||||||
$this->mchat->insert_posting($event['mode'], array(
|
$this->mchat->insert_posting($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 Event $event
|
||||||
*/
|
*/
|
||||||
public function display_custom_bbcodes_modify_sql($event)
|
public function remove_disallowed_bbcodes($event)
|
||||||
{
|
{
|
||||||
$event['sql_ary'] = $this->mchat->remove_disallowed_bbcodes($event['sql_ary']);
|
$event['sql_ary'] = $this->mchat->remove_disallowed_bbcodes($event['sql_ary']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Event $event
|
||||||
|
*/
|
||||||
|
public function user_registration_set_default_values($event)
|
||||||
|
{
|
||||||
|
$event['sql_ary'] = $this->mchat->set_user_default_values($event['sql_ary']);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Event $event
|
||||||
|
*/
|
||||||
|
public function user_login_success($event)
|
||||||
|
{
|
||||||
|
if (!$event['admin'])
|
||||||
|
{
|
||||||
|
$this->mchat->insert_posting('login');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Event $event
|
||||||
|
*/
|
||||||
|
public function pm_compose_add_quote($event)
|
||||||
|
{
|
||||||
|
$mchat_message_id = $this->request->variable('mchat_pm_quote_message', 0);
|
||||||
|
|
||||||
|
if ($mchat_message_id)
|
||||||
|
{
|
||||||
|
$this->mchat->quote_message_text($mchat_message_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Event $event
|
||||||
|
*/
|
||||||
|
public function session_gc($event)
|
||||||
|
{
|
||||||
|
$this->mchat->session_gc();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
76
ext.php
76
ext.php
@@ -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,6 +15,7 @@ class ext extends \phpbb\extension\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
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
* @access public
|
* @access public
|
||||||
@@ -22,6 +23,77 @@ 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)
|
||||||
|
{
|
||||||
|
if (phpbb_version_compare(PHPBB_VERSION, '3.2.0-dev', '>='))
|
||||||
|
{
|
||||||
|
// For phpBB >= 3.2.x
|
||||||
|
$lang = $this->container->get('language');
|
||||||
|
$lang->add_lang('mchat_acp', 'dmzx/mchat');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// For phpBB 3.1.x
|
||||||
|
$user = $this->container->get('user');
|
||||||
|
$user->add_lang_ext('dmzx/mchat', 'mchat_acp');
|
||||||
|
$lang = $user;
|
||||||
|
}
|
||||||
|
|
||||||
|
$php_ext = $this->container->getParameter('core.php_ext');
|
||||||
|
$error_msg = $lang->lang('MCHAT_30X_REMNANTS', $table_prefix, implode(', ', $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.1.8-RC1', '>=');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* @var string $table_prefix
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected function get_old_module_ids($table_prefix)
|
||||||
|
{
|
||||||
|
$db = $this->container->get('dbal.conn');
|
||||||
|
|
||||||
|
$mchat_30x_module_langnames = array(
|
||||||
|
'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();
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
$module_ids = array();
|
||||||
|
|
||||||
|
foreach ($rows as $row)
|
||||||
|
{
|
||||||
|
$module_ids[] = $row['module_id'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $module_ids;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -36,13 +36,14 @@ if (empty($lang) || !is_array($lang))
|
|||||||
|
|
||||||
$lang = array_merge($lang, array(
|
$lang = array_merge($lang, array(
|
||||||
'MCHAT_TITLE' => 'mChat',
|
'MCHAT_TITLE' => 'mChat',
|
||||||
|
'MCHAT_TITLE_COUNT' => 'mChat [<strong>%1$d</strong>]',
|
||||||
|
|
||||||
// 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' => array(
|
||||||
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' => array(
|
||||||
@@ -60,7 +61,12 @@ $lang = array_merge($lang, array(
|
|||||||
|
|
||||||
// Post notification messages (%1$s is replaced with a link to the new/edited post, %2$s is replaced with a link to the forum)
|
// 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',
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -36,17 +36,15 @@ if (empty($lang) || !is_array($lang))
|
|||||||
|
|
||||||
$lang = array_merge($lang, array(
|
$lang = array_merge($lang, array(
|
||||||
// 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><br />» %1$s',
|
||||||
'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',
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -38,25 +38,25 @@ $lang = array_merge($lang, array(
|
|||||||
'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 custom 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 don’t have permission to post in the chat',
|
'MCHAT_NOACCESS_ARCHIVE' => 'You don’t have permission to view the archive.',
|
||||||
'MCHAT_NOACCESS_ARCHIVE' => 'You don’t 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_OK' => 'OK',
|
'MCHAT_OK' => 'OK',
|
||||||
@@ -66,12 +66,12 @@ $lang = array_merge($lang, array(
|
|||||||
'MCHAT_REFRESH_NO' => 'Update is off',
|
'MCHAT_REFRESH_NO' => 'Update is off',
|
||||||
'MCHAT_REFRESH_YES' => 'Updates every <strong>%1$d</strong> seconds',
|
'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_ENDS' => 'Chat session ends in %1$s',
|
||||||
'MCHAT_SESSION_OUT' => 'Chat session has expired',
|
'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_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' => array(
|
||||||
0 => 'just now',
|
0 => 'just now',
|
||||||
@@ -79,7 +79,7 @@ $lang = array_merge($lang, array(
|
|||||||
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_SESSION_ENDS_JS' => 'Chat session ends in {timeleft}',
|
||||||
|
|||||||
@@ -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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -36,95 +36,114 @@ if (empty($lang) || !is_array($lang))
|
|||||||
|
|
||||||
$lang = array_merge($lang, array(
|
$lang = array_merge($lang, array(
|
||||||
// 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' => 'Custom 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_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 user’s 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 see the status of each user’s 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 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_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' => '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_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 before the chat refreshes.<br /><em>You are limited from 5 to 60 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 in seconds 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 = 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' => 'Display link to the custom page 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_NAVBAR_LINK_COUNT' => 'Display number of active chat sessions in navbar link',
|
||||||
'MCHAT_CUSTOM_PAGE' => 'Enable custom Page',
|
'MCHAT_MESSAGE_NUM_CUSTOM' => 'Initial number of messages to display on the custom page',
|
||||||
'MCHAT_CUSTOM_PAGE_EXPLAIN' => 'Allow the use of the custom page',
|
'MCHAT_MESSAGE_NUM_CUSTOM_EXPLAIN' => '<em>You are limited from 5 to 50. Default is 10.</em>',
|
||||||
'MCHAT_CUSTOM_HEIGHT' => 'Custom page height',
|
'MCHAT_MESSAGE_NUM_INDEX' => 'Initial number of messages to display on the index page',
|
||||||
'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_INDEX_EXPLAIN' => '<em>You are limited from 5 to 50. Default is 10.</em>',
|
||||||
'MCHAT_BBCODES_DISALLOWED' => 'Disallowed bbcodes',
|
'MCHAT_MESSAGE_NUM_ARCHIVE' => 'Number of messages to display on the archive page',
|
||||||
'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_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_STATIC_MESSAGE' => 'Static message',
|
'MCHAT_FLOOD_TIME' => 'Flood time',
|
||||||
'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_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 60 seconds. Default is 0. Set to 0 to disable.</em>',
|
||||||
'MCHAT_USER_TIMEOUT' => 'User session timeout',
|
'MCHAT_EDIT_DELETE_LIMIT' => 'Time limit for editing and deleting messages',
|
||||||
'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_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_OVERRIDE_SMILIE_LIMIT' => 'Override smilie limit',
|
'MCHAT_MAX_MESSAGE_LENGTH' => 'Maximum message length',
|
||||||
'MCHAT_OVERRIDE_SMILIE_LIMIT_EXPLAIN' => 'Set to yes to override the forums smilie limit setting for chat messages',
|
'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_OVERRIDE_MIN_POST_CHARS' => 'Override minimum characters limit',
|
'MCHAT_CUSTOM_PAGE' => 'Enable custom Page',
|
||||||
'MCHAT_OVERRIDE_MIN_POST_CHARS_EXPLAIN' => 'Set to yes to override the forums minimum characters setting for chat messages',
|
'MCHAT_CUSTOM_PAGE_EXPLAIN' => 'Allow the use of the custom page',
|
||||||
|
'MCHAT_CUSTOM_HEIGHT' => 'Custom page height',
|
||||||
|
'MCHAT_CUSTOM_HEIGHT_EXPLAIN' => 'The height of the chat box in pixels on the custom page.<br /><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 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_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_WHOIS_REFRESH' => 'Who is chatting refresh interval',
|
'MCHAT_WHOIS_REFRESH' => 'Who is chatting refresh interval',
|
||||||
'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_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_SOUND' => 'Play sounds for new, edited and deleted messages',
|
'MCHAT_SOUND' => 'Play sounds for new, edited and deleted messages',
|
||||||
'MCHAT_PURGE' => 'Delete all messages now',
|
'MCHAT_PURGE' => 'Delete all messages now',
|
||||||
'MCHAT_PURGE_CONFIRM' => 'Confirm deleting all messages',
|
'MCHAT_PURGE_CONFIRM' => 'Confirm deleting all messages',
|
||||||
'MCHAT_PURGED' => 'All mChat messages have been successfully deleted',
|
'MCHAT_PURGED' => 'All mChat messages have been successfully deleted',
|
||||||
|
|
||||||
// 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 custom height value is too small.',
|
||||||
'TOO_LARGE_MCHAT_CUSTOM_HEIGHT' => 'The custom height value is too large.',
|
'TOO_LARGE_MCHAT_CUSTOM_HEIGHT' => 'The custom 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_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_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_SMALL_MCHAT_MAX_MESSAGE_LNGTH' => 'The max message length value is too small.',
|
||||||
'TOO_LARGE_MCHAT_MAX_MESSAGE_LNGTH' => 'The max message length value is too large.',
|
'TOO_LARGE_MCHAT_MAX_MESSAGE_LNGTH' => 'The max message length value is too large.',
|
||||||
'TOO_SMALL_MCHAT_MESSAGE_NUM_CUSTOM' => 'The number of message to display on the custom 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_CUSTOM' => 'The number of message to display on the custom 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_MESSAGE_NUM_INDEX' => 'The number of messages to display on the index page 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_MESSAGE_NUM_INDEX' => 'The number of messages to display on the index page 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_MESSAGE_NUM_ARCHIVE' => 'The number of message to display on the archive page 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_MESSAGE_NUM_ARCHIVE' => 'The number of message to display on the archive page 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_REFRESH' => 'The refresh value is too small.',
|
'TOO_SMALL_MCHAT_REFRESH' => 'The refresh value is too small.',
|
||||||
'TOO_LARGE_MCHAT_REFRESH' => 'The 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.',
|
'TOO_LONG_MCHAT_STATIC_MESSAGE' => 'The static message value is too long.',
|
||||||
'TOO_SMALL_MCHAT_TIMEOUT' => 'The user timeout value is too small.',
|
'TOO_SMALL_MCHAT_TIMEOUT' => 'The user timeout value is too small.',
|
||||||
'TOO_LARGE_MCHAT_TIMEOUT' => 'The user timeout value is too large.',
|
'TOO_LARGE_MCHAT_TIMEOUT' => 'The user timeout value is too large.',
|
||||||
'TOO_SMALL_MCHAT_WHOIS_REFRESH' => 'The whois refresh value is too small.',
|
'TOO_SMALL_MCHAT_WHOIS_REFRESH' => 'The whois refresh value is too small.',
|
||||||
'TOO_LARGE_MCHAT_WHOIS_REFRESH' => 'The whois refresh value is too large.',
|
'TOO_LARGE_MCHAT_WHOIS_REFRESH' => 'The whois refresh value is too large.',
|
||||||
|
|
||||||
|
'MCHAT_30X_REMNANTS' => 'The installation as 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',
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -49,9 +49,9 @@ $lang = array_merge($lang, array(
|
|||||||
'MCHAT_INPUT_AREA' => 'Input field',
|
'MCHAT_INPUT_AREA' => 'Input field',
|
||||||
'MCHAT_TEXT_AREA' => 'Text area',
|
'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' => 'Pause on input',
|
||||||
'MCHAT_PAUSE_ON_INPUT_EXPLAIN' => 'Do not update mChat upon entering a message',
|
'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',
|
||||||
@@ -64,6 +64,7 @@ $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.',
|
||||||
|
|||||||
@@ -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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -37,8 +37,10 @@ if (empty($lang) || !is_array($lang))
|
|||||||
$lang = array_merge($lang, array(
|
$lang = array_merge($lang, array(
|
||||||
'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 anyone’s messages',
|
||||||
|
'ACL_U_MCHAT_MODERATOR_DELETE' => 'Can delete anyone’s 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 like messages',
|
||||||
@@ -47,7 +49,7 @@ $lang = array_merge($lang, array(
|
|||||||
'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>',
|
||||||
|
|||||||
@@ -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)),
|
||||||
|
|
||||||
@@ -137,22 +158,14 @@ class mchat_2_0_0_rc3 extends \phpbb\db\migration\migration
|
|||||||
'UCP_MCHAT_CONFIG',
|
'UCP_MCHAT_CONFIG',
|
||||||
array('module_basename' => '\dmzx\mchat\ucp\ucp_mchat_module'),
|
array('module_basename' => '\dmzx\mchat\ucp\ucp_mchat_module'),
|
||||||
)),
|
)),
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 +184,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 +199,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',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
31
migrations/mchat_2_0_0_rc4.php
Normal file
31
migrations/mchat_2_0_0_rc4.php
Normal 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')),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
31
migrations/mchat_2_0_0_rc5.php
Normal file
31
migrations/mchat_2_0_0_rc5.php
Normal 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')),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
79
migrations/mchat_2_0_0_rc6.php
Normal file
79
migrations/mchat_2_0_0_rc6.php
Normal 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',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
67
migrations/mchat_2_0_0_rc7.php
Normal file
67
migrations/mchat_2_0_0_rc7.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
6
sounds/README.txt
Normal file
6
sounds/README.txt
Normal 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
|
||||||
BIN
sounds/add.mp3
BIN
sounds/add.mp3
Binary file not shown.
BIN
sounds/del.mp3
BIN
sounds/del.mp3
Binary file not shown.
BIN
sounds/edit.mp3
BIN
sounds/edit.mp3
Binary file not shown.
BIN
sounds/error.mp3
BIN
sounds/error.mp3
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
<!-- DEFINE $MCHAT_USE_WHITE_MESSAGE_ICONS = SOP_SKDARK_SW or FALSE -->
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<!-- INCLUDECSS @dmzx_mchat/mchat.css -->
|
||||||
|
<!-- INCLUDECSS @dmzx_mchat/mchat_custom.css -->
|
||||||
1
styles/Subway/template/mchat_navlink.html
Normal file
1
styles/Subway/template/mchat_navlink.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<li class="li-mchat"><a href="{U_MCHAT}" title="{MCHAT_TITLE_HINT}" class="mchat-nav-link-title"><i class="icon-mchat"></i><span class="mchat-nav-link">{MCHAT_TITLE}</span></a></li>
|
||||||
16
styles/Subway/theme/mchat_custom.css
Normal file
16
styles/Subway/theme/mchat_custom.css
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* @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
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
.icon-mchat {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-mchat:before, #mChat + .inner li.header dt:before {
|
||||||
|
content: '\e0e6';
|
||||||
|
}
|
||||||
@@ -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, '&').replace(/\s/g, ' ').replace(/</g, '<').replace(/>/g, '>'));
|
|
||||||
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));
|
|
||||||
211
styles/all/template/javascript/jquery.autogrow-textarea.js
Normal file
211
styles/all/template/javascript/jquery.autogrow-textarea.js
Normal file
@@ -0,0 +1,211 @@
|
|||||||
|
// Based off https://code.google.com/p/gaequery/source/browse/trunk/src/static/scripts/jquery.autogrow-textarea.js?r=2
|
||||||
|
// Modified by David Beck
|
||||||
|
// Mofified by kasimi (c) 2016
|
||||||
|
|
||||||
|
( function( factory ) {
|
||||||
|
// UMD wrapper
|
||||||
|
if ( typeof define === 'function' && define.amd ) {
|
||||||
|
// AMD
|
||||||
|
define( [ 'jquery' ], factory );
|
||||||
|
} else if ( typeof exports !== 'undefined' ) {
|
||||||
|
// Node/CommonJS
|
||||||
|
module.exports = factory( require( 'jquery' ) );
|
||||||
|
} else {
|
||||||
|
// Browser globals
|
||||||
|
factory( jQuery );
|
||||||
|
}
|
||||||
|
}( function( $ ) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Auto-growing textareas; technique ripped from Facebook
|
||||||
|
*/
|
||||||
|
$.fn.autogrow = function(options) {
|
||||||
|
|
||||||
|
options = $.extend( {
|
||||||
|
vertical: true,
|
||||||
|
horizontal: false,
|
||||||
|
characterSlop: 0
|
||||||
|
}, options);
|
||||||
|
|
||||||
|
this.filter('textarea,input').each(function() {
|
||||||
|
|
||||||
|
var $this = $(this),
|
||||||
|
borderBox = $this.css( 'box-sizing' ) === 'border-box',
|
||||||
|
// minHeight = borderBox ? $this.outerHeight() : $this.height(),
|
||||||
|
maxHeight = $this.attr( "maxHeight" ),
|
||||||
|
minWidth = typeof( $this.attr( "minWidth" ) ) == "undefined" ? 0 : $this.attr( "minWidth" );
|
||||||
|
|
||||||
|
if( typeof( maxHeight ) == "undefined" ) maxHeight = 1000000;
|
||||||
|
|
||||||
|
var shadow = $('<div class="autogrow-shadow"></div>').css( {
|
||||||
|
position: 'absolute',
|
||||||
|
top: -10000,
|
||||||
|
left: -10000,
|
||||||
|
fontSize: $this.css('fontSize'),
|
||||||
|
fontFamily: $this.css('fontFamily'),
|
||||||
|
fontWeight: $this.css('fontWeight'),
|
||||||
|
lineHeight: $this.css('lineHeight'),
|
||||||
|
paddingLeft: $this.css('paddingLeft'),
|
||||||
|
paddingRight: $this.css('paddingRight'),
|
||||||
|
paddingTop: $this.css('paddingTop'),
|
||||||
|
paddingBottom: $this.css('paddingBottom'),
|
||||||
|
borderTop: $this.css('borderTop'),
|
||||||
|
borderBottom: $this.css('borderBottom'),
|
||||||
|
borderLeft: $this.css('borderLeft'),
|
||||||
|
borderRight: $this.css('borderRight'),
|
||||||
|
whiteSpace: 'pre-wrap',
|
||||||
|
resize: 'none'
|
||||||
|
} ).appendTo(document.body);
|
||||||
|
|
||||||
|
shadow.html( 'a' );
|
||||||
|
var characterWidth = shadow.width();
|
||||||
|
shadow.html( '' );
|
||||||
|
var isTextarea = $this.is('textarea');
|
||||||
|
|
||||||
|
var update = function( val ) {
|
||||||
|
|
||||||
|
var times = function(string, number) {
|
||||||
|
for (var i = 0, r = ''; i < number; i ++) r += string;
|
||||||
|
return r;
|
||||||
|
};
|
||||||
|
|
||||||
|
if( typeof val === 'undefined' ) val = this.value;
|
||||||
|
if( val === '' && $(this).attr("placeholder") ) val = $(this).attr("placeholder");
|
||||||
|
|
||||||
|
if( options.vertical )
|
||||||
|
val = val.replace(/&/g, '&')
|
||||||
|
.replace(/</g, '<')
|
||||||
|
.replace(/>/g, '>')
|
||||||
|
.replace(/\n$/, '<br/> ')
|
||||||
|
.replace(/\n/g, '<br/>')
|
||||||
|
.replace(/ {2,}/g, function(space) { return times(' ', space.length -1) + ' '; });
|
||||||
|
else
|
||||||
|
val = escapeHtml( val );
|
||||||
|
|
||||||
|
//if( options.horizontal )
|
||||||
|
// val = $.trim( val );
|
||||||
|
|
||||||
|
// if( $(this).prop( 'tagName' ).toUpperCase() === 'INPUT' )
|
||||||
|
// shadow.text(val).css( "width", "auto" );
|
||||||
|
// else
|
||||||
|
shadow.html( val ).css( "width", "auto" ); // need to use html here otherwise no way to count spaces (with html we can use )
|
||||||
|
|
||||||
|
if( options.horizontal )
|
||||||
|
{
|
||||||
|
var slopWidth = options.characterSlop * characterWidth + 2;
|
||||||
|
|
||||||
|
var newWidth = Math.max( shadow.width() + slopWidth, minWidth );
|
||||||
|
var maxWidth = options.maxWidth;
|
||||||
|
//if( typeof( maxWidth ) === "undefined" ) maxWidth = $this.parent().width() - 12; // not sure why we were doing this but seems like a bad idea. doesn't work with inline-block parents for one thing, since it is the text area that should be "pushing" them to be wider
|
||||||
|
if( maxWidth ) newWidth = Math.min( newWidth, maxWidth );
|
||||||
|
// Take scrollbar into account
|
||||||
|
if (isTextarea && shadow.get(0).scrollHeight > shadow.height()) {
|
||||||
|
newWidth += 20;
|
||||||
|
}
|
||||||
|
$(this).css( "width", newWidth );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( options.vertical )
|
||||||
|
{
|
||||||
|
var shadowWidth = $(this).width();
|
||||||
|
if( ! borderBox ) shadowWidth = shadowWidth - parseInt($this.css('paddingLeft'),10) - parseInt($this.css('paddingRight'),10);
|
||||||
|
shadow.css( "width", shadowWidth );
|
||||||
|
var shadowHeight = borderBox ? shadow.outerHeight() : shadow.height();
|
||||||
|
|
||||||
|
$(this).css( "height", "auto" );
|
||||||
|
minHeight = borderBox ? $this.outerHeight() : $this.height();
|
||||||
|
|
||||||
|
var newHeight = Math.min( Math.max( shadowHeight, minHeight ), maxHeight );
|
||||||
|
$(this).css( "height", newHeight );
|
||||||
|
$(this).css( "overflow", newHeight == maxHeight ? "auto" : "hidden" );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$(this)
|
||||||
|
.change(function(){update.call( this );return true;})
|
||||||
|
.keyup(function(){update.call( this );return true;})
|
||||||
|
.keypress(function( event ) {
|
||||||
|
if( event.ctrlKey || event.metaKey ) return;
|
||||||
|
|
||||||
|
var val = this.value;
|
||||||
|
var caretInfo = _getCaretInfo( this );
|
||||||
|
|
||||||
|
var typedChar = event.which === 13 ? "\n" : String.fromCharCode( event.which );
|
||||||
|
var valAfterKeypress = val.slice( 0, caretInfo.start ) + typedChar + val.slice( caretInfo.end );
|
||||||
|
update.call( this, valAfterKeypress );
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.bind( "update.autogrow", function(){ update.apply(this); } )
|
||||||
|
.bind( "remove.autogrow", function() {
|
||||||
|
shadow.remove();
|
||||||
|
} );
|
||||||
|
|
||||||
|
update.apply(this);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
// comes from https://github.com/madapaja/jquery.selection/blob/master/src/jquery.selection.js
|
||||||
|
var _getCaretInfo = function(element){
|
||||||
|
var res = {
|
||||||
|
text: '',
|
||||||
|
start: 0,
|
||||||
|
end: 0
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!element.value) {
|
||||||
|
/* no value or empty string */
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (window.getSelection) {
|
||||||
|
/* except IE */
|
||||||
|
res.start = element.selectionStart;
|
||||||
|
res.end = element.selectionEnd;
|
||||||
|
res.text = element.value.slice(res.start, res.end);
|
||||||
|
} else if (doc.selection) {
|
||||||
|
/* for IE */
|
||||||
|
element.focus();
|
||||||
|
|
||||||
|
var range = doc.selection.createRange(),
|
||||||
|
range2 = doc.body.createTextRange();
|
||||||
|
|
||||||
|
res.text = range.text;
|
||||||
|
|
||||||
|
try {
|
||||||
|
range2.moveToElementText(element);
|
||||||
|
range2.setEndPoint('StartToStart', range);
|
||||||
|
} catch (e) {
|
||||||
|
range2 = element.createTextRange();
|
||||||
|
range2.setEndPoint('StartToStart', range);
|
||||||
|
}
|
||||||
|
|
||||||
|
res.start = element.value.length - range2.text.length;
|
||||||
|
res.end = res.start + range.text.length;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
/* give up */
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
};
|
||||||
|
|
||||||
|
var entityMap = {
|
||||||
|
"&": "&",
|
||||||
|
"<": "<",
|
||||||
|
">": ">",
|
||||||
|
'"': '"',
|
||||||
|
"'": ''',
|
||||||
|
"/": '/',
|
||||||
|
" ": ' '
|
||||||
|
};
|
||||||
|
|
||||||
|
function escapeHtml(string) {
|
||||||
|
return String(string).replace(/[&<>"'\/\ ]/g, function (s) {
|
||||||
|
return entityMap[s];
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
} ) );
|
||||||
@@ -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()});
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @package phpBB Extension - mChat
|
* @package phpBB Extension - mChat
|
||||||
* @copyright (c) 2009 By Shapoval Andrey Vladimirovich (AllCity) ~ http://allcity.net.ru/
|
* @copyright (c) 2009 Shapoval Andrey Vladimirovich (AllCity) ~ http://allcity.net.ru/
|
||||||
* @copyright (c) 2013 By Rich McGirr (RMcGirr83) http://rmcgirr83.org
|
* @copyright (c) 2013 Rich McGirr (RMcGirr83) http://rmcgirr83.org
|
||||||
* @copyright (c) 2015 By dmzx - http://www.dmzx-web.net
|
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
|
||||||
* @copyright (c) 2016 By kasimi
|
* @copyright (c) 2016 kasimi - mail@kasimi.net
|
||||||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -28,106 +28,172 @@ if (!Array.prototype.min) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!String.prototype.format) {
|
Array.prototype.removeValue = function(value) {
|
||||||
String.prototype.format = function() {
|
var index = -1;
|
||||||
var str = this.toString();
|
var elementsRemoved = 0;
|
||||||
if (!arguments.length) {
|
while ((index = this.indexOf(value)) !== -1) {
|
||||||
return str;
|
this.splice(index, 1);
|
||||||
}
|
elementsRemoved++;
|
||||||
var type = typeof arguments[0];
|
}
|
||||||
var args = 'string' == type || 'number' == type ? arguments : arguments[0];
|
return elementsRemoved;
|
||||||
jQuery.each(args, function(arg, value) {
|
};
|
||||||
str = str.replace(RegExp('\\{' + arg + '\\}', 'gi'), value);
|
|
||||||
});
|
String.prototype.format = function() {
|
||||||
|
var str = this.toString();
|
||||||
|
if (!arguments.length) {
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
}
|
var type = typeof arguments[0];
|
||||||
|
var args = 'string' == type || 'number' == type ? arguments : arguments[0];
|
||||||
|
for (var arg in args) {
|
||||||
|
if (args.hasOwnProperty(arg)) {
|
||||||
|
str = str.replace(new RegExp("\\{" + arg + "\\}", "gi"), args[arg]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
};
|
||||||
|
|
||||||
|
String.prototype.replaceMany = function() {
|
||||||
|
var result = this;
|
||||||
|
var args = arguments[0];
|
||||||
|
for (var arg in args) {
|
||||||
|
if (args.hasOwnProperty(arg)) {
|
||||||
|
result = result.replace(new RegExp(RegExp.escape(arg), "g"), args[arg]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
|
||||||
|
RegExp.escape = function(s) {
|
||||||
|
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
||||||
|
};
|
||||||
|
|
||||||
jQuery.fn.reverse = function(reverse) {
|
jQuery.fn.reverse = function(reverse) {
|
||||||
return reverse === 'undefined' || reverse ? jQuery(this.toArray().reverse()) : this;
|
return reverse === 'undefined' || reverse ? jQuery(this.toArray().reverse()) : this;
|
||||||
};
|
};
|
||||||
|
|
||||||
jQuery(function($) {
|
jQuery(function($) {
|
||||||
var ajaxRequest = function(mode, sendHiddenFields, data) {
|
|
||||||
var deferred = $.Deferred();
|
"use strict";
|
||||||
if (sendHiddenFields) {
|
|
||||||
$.extend(data, mChat.hiddenFields);
|
|
||||||
}
|
|
||||||
$.ajax({
|
|
||||||
url: mChat.actionUrls[mode],
|
|
||||||
timeout: Math.min(mChat.refreshTime, 10000),
|
|
||||||
type: 'POST',
|
|
||||||
dataType: 'json',
|
|
||||||
data: data
|
|
||||||
}).done(function(json, status, xhr) {
|
|
||||||
if (json[mode]) {
|
|
||||||
deferred.resolve(json, status, xhr);
|
|
||||||
} else {
|
|
||||||
deferred.reject(xhr, status, xhr.responseJSON ? 'session' : 'unexpected format');
|
|
||||||
}
|
|
||||||
}).fail(function(xhr, status, error) {
|
|
||||||
deferred.reject(xhr, status, error);
|
|
||||||
});
|
|
||||||
return deferred.promise().fail(function(xhr, textStatus, errorThrown) {
|
|
||||||
mChat.sound('error');
|
|
||||||
mChat.cached('status-load', 'status-ok', 'status-paused').hide();
|
|
||||||
mChat.cached('status-error').show();
|
|
||||||
if (errorThrown == 'session') {
|
|
||||||
mChat.endSession(true);
|
|
||||||
alert(mChat.sessOut);
|
|
||||||
} else if (xhr.status == 400) {
|
|
||||||
mChat.resetSession();
|
|
||||||
alert(mChat.flood);
|
|
||||||
} else if (xhr.status == 403) {
|
|
||||||
mChat.endSession(true);
|
|
||||||
alert(mChat.noAccess);
|
|
||||||
} else if (xhr.status == 413) {
|
|
||||||
mChat.resetSession();
|
|
||||||
alert(mChat.mssgLngthLong);
|
|
||||||
} else if (xhr.status == 501) {
|
|
||||||
mChat.resetSession();
|
|
||||||
alert(mChat.noMessageInput);
|
|
||||||
} else if (typeof console !== 'undefined' && console.log) {
|
|
||||||
console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$.extend(mChat, {
|
$.extend(mChat, {
|
||||||
clear: function() {
|
ajaxRequest: function(mode, sendHiddenFields, data) {
|
||||||
if (mChat.cached('input').val() !== '') {
|
var deferred = $.Deferred();
|
||||||
if (confirm(mChat.clearConfirm)) {
|
if (sendHiddenFields) {
|
||||||
mChat.resetSession();
|
$.extend(data, mChat.hiddenFields);
|
||||||
mChat.cached('input').val('').keyup().trigger('autogrow');
|
|
||||||
}
|
|
||||||
setTimeout(function() {
|
|
||||||
mChat.cached('input').focus();
|
|
||||||
}, 1);
|
|
||||||
}
|
}
|
||||||
|
$(mChat).trigger('mchat_send_request_before', [mode, data]);
|
||||||
|
$.ajax({
|
||||||
|
url: mChat.actionUrls[mode],
|
||||||
|
timeout: Math.min(mChat.refreshTime, 10000),
|
||||||
|
type: 'POST',
|
||||||
|
dataType: 'json',
|
||||||
|
data: data
|
||||||
|
}).done(function(json, status, xhr) {
|
||||||
|
var data = {
|
||||||
|
mode: mode,
|
||||||
|
json: json,
|
||||||
|
status: status,
|
||||||
|
xhr: xhr,
|
||||||
|
handle: true
|
||||||
|
};
|
||||||
|
$(mChat).trigger('mchat_ajax_done_before', [data]);
|
||||||
|
if (data.handle) {
|
||||||
|
if (json[mode]) {
|
||||||
|
deferred.resolve(data.json, data.status, data.xhr);
|
||||||
|
} else {
|
||||||
|
deferred.reject(data.xhr, data.status, mChat.lang.parserErr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).fail(deferred.reject);
|
||||||
|
return deferred.promise().fail(function(xhr, textStatus, errorThrown) {
|
||||||
|
if (mChat.pageIsUnloading) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (typeof console !== 'undefined' && console.log) {
|
||||||
|
console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown + ' (' + xhr.responseText + ')');
|
||||||
|
}
|
||||||
|
var data = {
|
||||||
|
mode: mode,
|
||||||
|
xhr: xhr,
|
||||||
|
textStatus: textStatus,
|
||||||
|
errorThrown: errorThrown,
|
||||||
|
updateSession: function() {
|
||||||
|
if (this.xhr.status == 403) {
|
||||||
|
mChat.endSession(true);
|
||||||
|
} else if (this.xhr.status == 400) {
|
||||||
|
mChat.resetSession();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$(mChat).trigger('mchat_ajax_fail_before', [data]);
|
||||||
|
mChat.sound('error');
|
||||||
|
mChat.cached('status-load', 'status-ok', 'status-paused').hide();
|
||||||
|
mChat.cached('status-error').show();
|
||||||
|
var responseText;
|
||||||
|
try {
|
||||||
|
responseText = data.xhr.responseJSON.message || data.errorThrown;
|
||||||
|
} catch (e) {
|
||||||
|
responseText = data.errorThrown;
|
||||||
|
}
|
||||||
|
if (responseText && responseText !== 'timeout') {
|
||||||
|
phpbb.alert(mChat.lang.err, responseText);
|
||||||
|
}
|
||||||
|
data.updateSession();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
sound: function(file) {
|
sound: function(file) {
|
||||||
if (!mChat.pageIsUnloading && !Cookies.get('mchat_no_sound')) {
|
if (!mChat.pageIsUnloading && !localStorage.getItem(mChat.cookie + 'mchat_no_sound')) {
|
||||||
var audio = mChat.cached('sound-' + file).get(0);
|
var data = {
|
||||||
if (audio.duration) {
|
audio: mChat.cached('sound-' + file).get(0),
|
||||||
audio.pause();
|
file: file,
|
||||||
audio.currentTime = 0;
|
play: true
|
||||||
audio.play();
|
};
|
||||||
|
$(mChat).trigger('mchat_sound_before', [data]);
|
||||||
|
if (data.play && data.audio.duration) {
|
||||||
|
data.audio.pause();
|
||||||
|
data.audio.currentTime = 0;
|
||||||
|
data.audio.play();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
notice: function() {
|
titleAlert: function() {
|
||||||
if (!document.hasFocus()) {
|
var data = {
|
||||||
$.titleAlert(mChat.newMessageAlert, {interval: 1000});
|
doAlert: !document.hasFocus(),
|
||||||
|
interval: 1000
|
||||||
|
};
|
||||||
|
$(mChat).trigger('mchat_titlealert_before', [data]);
|
||||||
|
if (data.doAlert) {
|
||||||
|
$.titleAlert(mChat.lang.newMessageAlert, data);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
toggle: function(name) {
|
toggle: function(name) {
|
||||||
var $elem = mChat.cached(name);
|
var $elem = mChat.cached(name);
|
||||||
$elem.stop().slideToggle(function() {
|
$elem.stop().slideToggle(200, function() {
|
||||||
var cookieName = 'mchat_show_' + name;
|
|
||||||
if ($elem.is(':visible')) {
|
if ($elem.is(':visible')) {
|
||||||
Cookies.set(cookieName, 'yes');
|
localStorage.setItem(mChat.cookie + 'mchat_show_' + name, 'yes');
|
||||||
} else {
|
} else {
|
||||||
Cookies.remove(cookieName);
|
localStorage.removeItem(mChat.cookie + 'mchat_show_' + name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
confirm: function(data) {
|
||||||
|
var $confirmFields = data.container.find('.mchat-confirm-fields');
|
||||||
|
$confirmFields.children().hide();
|
||||||
|
var fields = data.fields($confirmFields);
|
||||||
|
$.each(fields, function() {
|
||||||
|
$(this).show();
|
||||||
|
});
|
||||||
|
setTimeout(function() {
|
||||||
|
var $input = $confirmFields.find(':input:visible:enabled:first');
|
||||||
|
if ($input.length) {
|
||||||
|
var value = $input.val();
|
||||||
|
$input.focus().val('').val(value);
|
||||||
|
}
|
||||||
|
}, 1);
|
||||||
|
phpbb.confirm(data.container.show(), function() {
|
||||||
|
if (typeof data.confirm === 'function') {
|
||||||
|
data.confirm.apply(this, fields);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -135,23 +201,28 @@ jQuery(function($) {
|
|||||||
if (mChat.cached('add').prop('disabled')) {
|
if (mChat.cached('add').prop('disabled')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var messageLength = mChat.inputMessageLength();
|
var messageLength = mChat.cached('input').val().length;
|
||||||
if (!messageLength) {
|
if (!messageLength) {
|
||||||
alert(mChat.noMessageInput);
|
phpbb.alert(mChat.lang.err, mChat.lang.noMessageInput);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mChat.mssgLngth && messageLength > mChat.mssgLngth) {
|
if (mChat.mssgLngth && messageLength > mChat.mssgLngth) {
|
||||||
alert(mChat.mssgLngthLong);
|
phpbb.alert(mChat.lang.err, mChat.lang.mssgLngthLong);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mChat.cached('add').prop('disabled', true);
|
mChat.cached('add').prop('disabled', true);
|
||||||
mChat.pauseSession();
|
mChat.pauseSession();
|
||||||
mChat.lastInputValue = mChat.cached('input').val();
|
var originalInputValue = mChat.cached('input').val();
|
||||||
mChat.cached('input').val('').keyup().trigger('autogrow');
|
var inputValue = originalInputValue;
|
||||||
mChat.refresh(mChat.lastInputValue).done(function() {
|
var color = localStorage.getItem(mChat.cookie + 'mchat_color');
|
||||||
|
if (color && inputValue.indexOf('[color=') === -1) {
|
||||||
|
inputValue = '[color=#' + color + '] ' + inputValue + ' [/color]';
|
||||||
|
}
|
||||||
|
mChat.cached('input').val('').focus();
|
||||||
|
mChat.refresh(inputValue).done(function() {
|
||||||
mChat.resetSession();
|
mChat.resetSession();
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
mChat.cached('input').val(mChat.lastInputValue).keyup().trigger('autogrow');
|
mChat.cached('input').val(originalInputValue);
|
||||||
}).always(function() {
|
}).always(function() {
|
||||||
mChat.cached('add').prop('disabled', false);
|
mChat.cached('add').prop('disabled', false);
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
@@ -160,87 +231,65 @@ jQuery(function($) {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
edit: function() {
|
edit: function() {
|
||||||
var $container = $(this).closest('.mchat-message');
|
var $message = $(this).closest('.mchat-message');
|
||||||
var $message = mChat.cached('confirm').find('textarea').show().val($container.data('mchat-message'));
|
mChat.confirm({
|
||||||
mChat.cached('confirm').find('p').text(mChat.editInfo);
|
container: mChat.cached('confirm'),
|
||||||
phpbb.confirm(mChat.cached('confirm'), function() {
|
fields: function($container) {
|
||||||
ajaxRequest('edit', true, {
|
return [
|
||||||
message_id: $container.data('mchat-id'),
|
$container.find('p').text(mChat.lang.editInfo),
|
||||||
message: $message.val(),
|
$container.find('textarea').val($message.data('mchat-message'))
|
||||||
archive: mChat.archivePage ? 1 : 0
|
];
|
||||||
}).done(function(json) {
|
},
|
||||||
mChat.updateMessages($(json.edit));
|
confirm: function($p, $textarea) {
|
||||||
mChat.resetSession();
|
mChat.ajaxRequest('edit', true, {
|
||||||
});
|
message_id: $message.data('mchat-id'),
|
||||||
|
message: $textarea.val(),
|
||||||
|
archive: mChat.archivePage ? 1 : 0
|
||||||
|
}).done(function(json) {
|
||||||
|
mChat.updateMessages($(json.edit));
|
||||||
|
mChat.resetSession();
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
del: function() {
|
del: function() {
|
||||||
var $container = $(this).closest('.mchat-message');
|
var delId = $(this).closest('.mchat-message').data('mchat-id');
|
||||||
mChat.cached('confirm').find('textarea').hide();
|
mChat.confirm({
|
||||||
mChat.cached('confirm').find('p').text(mChat.delConfirm);
|
container: mChat.cached('confirm'),
|
||||||
phpbb.confirm(mChat.cached('confirm'), function() {
|
fields: function($container) {
|
||||||
var delId = $container.data('mchat-id');
|
return [
|
||||||
ajaxRequest('del', true, {
|
$container.find('p').text(mChat.lang.delConfirm)
|
||||||
message_id: delId
|
];
|
||||||
}).done(function() {
|
},
|
||||||
mChat.removeMessages([delId]);
|
confirm: function($p) {
|
||||||
mChat.resetSession();
|
mChat.ajaxRequest('del', true, {
|
||||||
});
|
message_id: delId
|
||||||
|
}).done(function() {
|
||||||
|
mChat.removeMessages([delId]);
|
||||||
|
mChat.resetSession();
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
refresh: function(message) {
|
refresh: function(message) {
|
||||||
var $messages = mChat.cached('messages').children();
|
if (mChat.isPaused && !message) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
var data = {
|
var data = {
|
||||||
message_last_id: mChat.messageIds.length ? mChat.messageIds.max() : 0
|
last: mChat.messageIds.length ? mChat.messageIds.max() : 0
|
||||||
};
|
};
|
||||||
if (message) {
|
if (message) {
|
||||||
data.message = message;
|
data.message = message;
|
||||||
}
|
}
|
||||||
if (mChat.liveUpdates) {
|
if (mChat.liveUpdates) {
|
||||||
data.message_first_id = mChat.messageIds.length ? mChat.messageIds.min() : 0;
|
data.log = mChat.logId;
|
||||||
data.message_edits = {};
|
|
||||||
var now = Math.floor(Date.now() / 1000);
|
|
||||||
$.each($messages, function() {
|
|
||||||
var $message = $(this);
|
|
||||||
var editTime = $message.data('mchat-edit-time');
|
|
||||||
if (editTime && (!mChat.editDeleteLimit || $message.data('mchat-message-time') >= now - mChat.editDeleteLimit / 1000)) {
|
|
||||||
data.message_edits[$message.data('mchat-id')] = editTime;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
mChat.cached('status-ok', 'status-error', 'status-paused').hide();
|
mChat.cached('status-ok', 'status-error', 'status-paused').hide();
|
||||||
mChat.cached('status-load').show();
|
mChat.cached('status-load').show();
|
||||||
return ajaxRequest(message ? 'add' : 'refresh', !!message, data).done(function(json) {
|
return mChat.ajaxRequest(message ? 'add' : 'refresh', !!message, data).done(function(json) {
|
||||||
|
$(mChat).trigger('mchat_response_handle_data_before', [json]);
|
||||||
if (json.add) {
|
if (json.add) {
|
||||||
var $html = $(json.add);
|
mChat.addMessages($(json.add));
|
||||||
$('.mchat-no-messages').remove();
|
|
||||||
$html.reverse(mChat.messageTop).hide().each(function(i) {
|
|
||||||
var $message = $(this);
|
|
||||||
if ($.inArray($message.data('mchat-id'), mChat.messageIds) !== -1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mChat.messageIds.push($message.data('mchat-id'));
|
|
||||||
setTimeout(function() {
|
|
||||||
if (mChat.messageTop) {
|
|
||||||
mChat.cached('messages').prepend($message);
|
|
||||||
} else {
|
|
||||||
mChat.cached('messages').append($message);
|
|
||||||
}
|
|
||||||
$message.css('opacity', 0).slideDown().animate({opacity: 1}, {queue: false});
|
|
||||||
mChat.cached('messages').animate({scrollTop: mChat.messageTop ? 0 : mChat.cached('messages')[0].scrollHeight});
|
|
||||||
}, i * 400);
|
|
||||||
if (mChat.editDeleteLimit && $message.data('mchat-edit-delete-limit') && $message.find('[data-mchat-action="edit"], [data-mchat-action="del"]').length > 0) {
|
|
||||||
var id = $message.prop('id');
|
|
||||||
setTimeout(function() {
|
|
||||||
$('#' + id).find('[data-mchat-action="edit"], [data-mchat-action="del"]').fadeOut(function() {
|
|
||||||
$(this).closest('li').remove();
|
|
||||||
});
|
|
||||||
}, mChat.editDeleteLimit);
|
|
||||||
}
|
|
||||||
mChat.startRelativeTimeUpdate($message);
|
|
||||||
});
|
|
||||||
mChat.sound('add');
|
|
||||||
mChat.notice();
|
|
||||||
}
|
}
|
||||||
if (json.edit) {
|
if (json.edit) {
|
||||||
mChat.updateMessages($(json.edit));
|
mChat.updateMessages($(json.edit));
|
||||||
@@ -249,12 +298,16 @@ jQuery(function($) {
|
|||||||
mChat.removeMessages(json.del);
|
mChat.removeMessages(json.del);
|
||||||
}
|
}
|
||||||
if (json.whois) {
|
if (json.whois) {
|
||||||
mChat.whois();
|
mChat.handleWhoisResponse(json);
|
||||||
|
}
|
||||||
|
if (json.log) {
|
||||||
|
mChat.logId = json.log;
|
||||||
}
|
}
|
||||||
if (mChat.refreshInterval) {
|
if (mChat.refreshInterval) {
|
||||||
mChat.cached('status-load', 'status-error', 'status-paused').hide();
|
mChat.cached('status-load', 'status-error', 'status-paused').hide();
|
||||||
mChat.cached('status-ok').show();
|
mChat.cached('status-ok').show();
|
||||||
}
|
}
|
||||||
|
$(mChat).trigger('mchat_response_handle_data_after', [json]);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
whois: function() {
|
whois: function() {
|
||||||
@@ -262,51 +315,144 @@ jQuery(function($) {
|
|||||||
mChat.cached('refresh-pending').show();
|
mChat.cached('refresh-pending').show();
|
||||||
mChat.cached('refresh-explain').hide();
|
mChat.cached('refresh-explain').hide();
|
||||||
}
|
}
|
||||||
ajaxRequest('whois', false, {}).done(function(json) {
|
mChat.ajaxRequest('whois', false, {}).done(mChat.handleWhoisResponse);
|
||||||
var $whois = $(json.whois);
|
},
|
||||||
var $userlist = $whois.find('#mchat-userlist');
|
handleWhoisResponse: function(json) {
|
||||||
if (Cookies.get('mchat_show_userlist')) {
|
var $whois = $(json.whois);
|
||||||
$userlist.show();
|
var $userlist = $whois.find('#mchat-userlist');
|
||||||
|
if (localStorage.getItem(mChat.cookie + 'mchat_show_userlist')) {
|
||||||
|
$userlist.show();
|
||||||
|
}
|
||||||
|
mChat.cached('whois').replaceWith($whois);
|
||||||
|
mChat.cache.whois = $whois;
|
||||||
|
mChat.cache.userlist = $userlist;
|
||||||
|
if (mChat.customPage) {
|
||||||
|
mChat.cached('refresh-pending').hide();
|
||||||
|
mChat.cached('refresh-explain').show();
|
||||||
|
}
|
||||||
|
if (json.navlink) {
|
||||||
|
$('.mchat-nav-link').html(json.navlink);
|
||||||
|
}
|
||||||
|
if (json.navlink_title) {
|
||||||
|
$('.mchat-nav-link-title').prop('title', json.navlink_title);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addMessages: function($messages) {
|
||||||
|
var playSound = true;
|
||||||
|
mChat.cached('messages').find('.mchat-no-messages').remove();
|
||||||
|
$messages.reverse(mChat.messageTop).hide().each(function(i) {
|
||||||
|
var $message = $(this);
|
||||||
|
var dataAddMessageBefore = {
|
||||||
|
message: $message,
|
||||||
|
delay: mChat.refreshInterval ? 400 : 0,
|
||||||
|
abort: $.inArray($message.data('mchat-id'), mChat.messageIds) !== -1,
|
||||||
|
playSound: playSound
|
||||||
|
};
|
||||||
|
$(mChat).trigger('mchat_add_message_before', [dataAddMessageBefore]);
|
||||||
|
if (dataAddMessageBefore.abort) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
mChat.cached('whois').replaceWith($whois);
|
if (dataAddMessageBefore.playSound) {
|
||||||
mChat.cache.whois = $whois;
|
mChat.sound('add');
|
||||||
mChat.cache.userlist = $userlist;
|
mChat.titleAlert();
|
||||||
if (mChat.customPage) {
|
playSound = false;
|
||||||
mChat.cached('refresh-pending').hide();
|
|
||||||
mChat.cached('refresh-explain').show();
|
|
||||||
}
|
}
|
||||||
|
mChat.messageIds.push($message.data('mchat-id'));
|
||||||
|
setTimeout(function() {
|
||||||
|
var dataAddMessageAnimateBefore = {
|
||||||
|
container: mChat.cached('messages'),
|
||||||
|
message: $message,
|
||||||
|
add: function() {
|
||||||
|
if (mChat.messageTop) {
|
||||||
|
this.container.prepend(this.message);
|
||||||
|
} else {
|
||||||
|
this.container.append(this.message);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
show: function() {
|
||||||
|
var container = this.container;
|
||||||
|
var scrollTop = container.scrollTop();
|
||||||
|
var scrollLeeway = 20;
|
||||||
|
if (mChat.messageTop && scrollTop <= scrollLeeway || !mChat.messageTop && scrollTop >= container.get(0).scrollHeight - container.height() - scrollLeeway) {
|
||||||
|
var animateOptions = {
|
||||||
|
duration: dataAddMessageBefore.delay - 10,
|
||||||
|
easing: 'swing'
|
||||||
|
};
|
||||||
|
this.message.slideDown(animateOptions);
|
||||||
|
if (mChat.messageTop) {
|
||||||
|
container.animate({scrollTop: 0}, animateOptions);
|
||||||
|
} else {
|
||||||
|
(animateOptions.complete = function() {
|
||||||
|
var scrollHeight = container.get(0).scrollHeight;
|
||||||
|
if (container.scrollTop() + container.height() < scrollHeight) {
|
||||||
|
container.animate({scrollTop: scrollHeight}, animateOptions);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.message.show();
|
||||||
|
if (mChat.messageTop) {
|
||||||
|
this.container.scrollTop(scrollTop + this.message.outerHeight());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.message.addClass('mchat-message-flash');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$(mChat).trigger('mchat_add_message_animate_before', [dataAddMessageAnimateBefore]);
|
||||||
|
dataAddMessageAnimateBefore.add();
|
||||||
|
dataAddMessageAnimateBefore.show();
|
||||||
|
}, i * dataAddMessageBefore.delay);
|
||||||
|
if (mChat.editDeleteLimit && $message.data('mchat-edit-delete-limit') && $message.find('[data-mchat-action="edit"], [data-mchat-action="del"]').length > 0) {
|
||||||
|
var id = $message.prop('id');
|
||||||
|
setTimeout(function() {
|
||||||
|
$('#' + id).find('[data-mchat-action="edit"], [data-mchat-action="del"]').fadeOut(function() {
|
||||||
|
$(this).closest('li').remove();
|
||||||
|
});
|
||||||
|
}, mChat.editDeleteLimit);
|
||||||
|
}
|
||||||
|
mChat.startRelativeTimeUpdate($message);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
updateMessages: function($messages) {
|
updateMessages: function($messages) {
|
||||||
var soundPlayed = false;
|
var playSound = true;
|
||||||
$messages.each(function() {
|
$messages.each(function() {
|
||||||
var $newMessage = $(this);
|
var $newMessage = $(this);
|
||||||
var $oldMessage = $('#mchat-message-' + $newMessage.data('mchat-id'));
|
var data = {
|
||||||
mChat.stopRelativeTimeUpdate($oldMessage);
|
newMessage: $newMessage,
|
||||||
mChat.startRelativeTimeUpdate($newMessage);
|
oldMessage: $('#mchat-message-' + $newMessage.data('mchat-id')),
|
||||||
$oldMessage.fadeOut(function() {
|
playSound: playSound
|
||||||
$oldMessage.replaceWith($newMessage.hide().fadeIn());
|
};
|
||||||
|
$(mChat).trigger('mchat_edit_message_before', [data]);
|
||||||
|
mChat.stopRelativeTimeUpdate(data.oldMessage);
|
||||||
|
mChat.startRelativeTimeUpdate(data.newMessage);
|
||||||
|
data.oldMessage.fadeOut(function() {
|
||||||
|
data.oldMessage.replaceWith(data.newMessage.hide().fadeIn());
|
||||||
});
|
});
|
||||||
if (!soundPlayed) {
|
if (data.playSound) {
|
||||||
soundPlayed = true;
|
|
||||||
mChat.sound('edit');
|
mChat.sound('edit');
|
||||||
|
playSound = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
removeMessages: function(ids) {
|
removeMessages: function(ids) {
|
||||||
var soundPlayed = false;
|
var playSound = true;
|
||||||
$.each(ids, function(i, id) {
|
$.each(ids, function(i, id) {
|
||||||
var index = 0;
|
if (mChat.messageIds.removeValue(id)) {
|
||||||
while ((index = $.inArray(id, mChat.messageIds, index)) !== -1) {
|
var data = {
|
||||||
mChat.messageIds.splice(index, 1);
|
id: id,
|
||||||
var $message = $('#mchat-message-' + id);
|
message: $('#mchat-message-' + id),
|
||||||
mChat.stopRelativeTimeUpdate($message);
|
playSound: playSound
|
||||||
$message.fadeOut(function() {
|
};
|
||||||
$message.remove();
|
$(mChat).trigger('mchat_delete_message_before', [data]);
|
||||||
});
|
mChat.stopRelativeTimeUpdate(data.message);
|
||||||
if (!soundPlayed) {
|
(function($message) {
|
||||||
soundPlayed = true;
|
$message.fadeOut(function() {
|
||||||
|
$message.remove();
|
||||||
|
});
|
||||||
|
})(data.message);
|
||||||
|
if (data.playSound) {
|
||||||
mChat.sound('del');
|
mChat.sound('del');
|
||||||
|
playSound = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -326,7 +472,7 @@ jQuery(function($) {
|
|||||||
},
|
},
|
||||||
relativeTimeUpdate: function($time) {
|
relativeTimeUpdate: function($time) {
|
||||||
var minutesAgo = $time.data('mchat-minutes-ago') + 1;
|
var minutesAgo = $time.data('mchat-minutes-ago') + 1;
|
||||||
var langMinutesAgo = mChat.minutesAgo[minutesAgo];
|
var langMinutesAgo = mChat.lang.minutesAgo[minutesAgo];
|
||||||
if (langMinutesAgo) {
|
if (langMinutesAgo) {
|
||||||
$time.text(langMinutesAgo).data('mchat-minutes-ago', minutesAgo);
|
$time.text(langMinutesAgo).data('mchat-minutes-ago', minutesAgo);
|
||||||
} else {
|
} else {
|
||||||
@@ -343,14 +489,14 @@ jQuery(function($) {
|
|||||||
},
|
},
|
||||||
countDown: function() {
|
countDown: function() {
|
||||||
mChat.sessionTime -= 1;
|
mChat.sessionTime -= 1;
|
||||||
mChat.cached('session').html(mChat.sessEnds.format({timeleft: mChat.timeLeft(mChat.sessionTime)}));
|
mChat.cached('session').html(mChat.lang.sessEnds.format({timeleft: mChat.timeLeft(mChat.sessionTime)}));
|
||||||
if (mChat.sessionTime < 1) {
|
if (mChat.sessionTime < 1) {
|
||||||
mChat.endSession();
|
mChat.endSession();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pauseSession: function() {
|
pauseSession: function() {
|
||||||
clearInterval(mChat.refreshInterval);
|
clearInterval(mChat.refreshInterval);
|
||||||
if (mChat.userTimeout) {
|
if (mChat.timeout) {
|
||||||
clearInterval(mChat.sessionCountdown);
|
clearInterval(mChat.sessionCountdown);
|
||||||
}
|
}
|
||||||
if (mChat.whoisRefresh) {
|
if (mChat.whoisRefresh) {
|
||||||
@@ -361,30 +507,27 @@ jQuery(function($) {
|
|||||||
if (!mChat.archivePage) {
|
if (!mChat.archivePage) {
|
||||||
clearInterval(mChat.refreshInterval);
|
clearInterval(mChat.refreshInterval);
|
||||||
mChat.refreshInterval = setInterval(mChat.refresh, mChat.refreshTime);
|
mChat.refreshInterval = setInterval(mChat.refresh, mChat.refreshTime);
|
||||||
if (mChat.userTimeout) {
|
if (mChat.timeout) {
|
||||||
mChat.sessionTime = mChat.userTimeout / 1000;
|
mChat.sessionTime = mChat.timeout / 1000;
|
||||||
clearInterval(mChat.sessionCountdown);
|
clearInterval(mChat.sessionCountdown);
|
||||||
mChat.cached('session').html(mChat.sessEnds.format({timeleft: mChat.timeLeft(mChat.sessionTime)}));
|
mChat.cached('session').html(mChat.lang.sessEnds.format({timeleft: mChat.timeLeft(mChat.sessionTime)}));
|
||||||
mChat.sessionCountdown = setInterval(mChat.countDown, 1000);
|
mChat.sessionCountdown = setInterval(mChat.countDown, 1000);
|
||||||
}
|
}
|
||||||
if (mChat.whoisRefresh) {
|
if (mChat.whoisRefresh) {
|
||||||
clearInterval(mChat.whoisInterval);
|
clearInterval(mChat.whoisInterval);
|
||||||
mChat.whoisInterval = setInterval(mChat.whois, mChat.whoisRefresh);
|
mChat.whoisInterval = setInterval(mChat.whois, mChat.whoisRefresh);
|
||||||
}
|
}
|
||||||
if (mChat.pause) {
|
|
||||||
mChat.cached('input').one('keypress', mChat.endSession);
|
|
||||||
}
|
|
||||||
mChat.cached('status-ok').show();
|
mChat.cached('status-ok').show();
|
||||||
mChat.cached('status-load', 'status-error', 'status-paused').hide();
|
mChat.cached('status-load', 'status-error', 'status-paused').hide();
|
||||||
mChat.cached('refresh-text').html(mChat.refreshYes);
|
mChat.cached('refresh-text').html(mChat.lang.refreshYes);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
endSession: function(skipUpdateWhois) {
|
endSession: function(skipUpdateWhois) {
|
||||||
clearInterval(mChat.refreshInterval);
|
clearInterval(mChat.refreshInterval);
|
||||||
mChat.refreshInterval = false;
|
mChat.refreshInterval = false;
|
||||||
if (mChat.userTimeout) {
|
if (mChat.timeout) {
|
||||||
clearInterval(mChat.sessionCountdown);
|
clearInterval(mChat.sessionCountdown);
|
||||||
mChat.cached('session').html(mChat.sessOut);
|
mChat.cached('session').html(mChat.lang.sessOut);
|
||||||
}
|
}
|
||||||
if (mChat.whoisRefresh) {
|
if (mChat.whoisRefresh) {
|
||||||
clearInterval(mChat.whoisInterval);
|
clearInterval(mChat.whoisInterval);
|
||||||
@@ -394,11 +537,31 @@ jQuery(function($) {
|
|||||||
}
|
}
|
||||||
mChat.cached('status-load', 'status-ok', 'status-error').hide();
|
mChat.cached('status-load', 'status-ok', 'status-error').hide();
|
||||||
mChat.cached('status-paused').show();
|
mChat.cached('status-paused').show();
|
||||||
mChat.cached('refresh-text').html(mChat.refreshNo);
|
mChat.cached('refresh-text').html(mChat.lang.refreshNo);
|
||||||
|
},
|
||||||
|
pauseStart: function() {
|
||||||
|
mChat.isPaused = true;
|
||||||
|
mChat.cached('refresh-text').html(mChat.lang.refreshNo);
|
||||||
|
mChat.cached('status-load', 'status-ok', 'status-error').hide();
|
||||||
|
mChat.cached('status-paused').show();
|
||||||
|
},
|
||||||
|
pauseEnd: function() {
|
||||||
|
mChat.cached('refresh-text').html(mChat.lang.refreshYes);
|
||||||
|
mChat.cached('status-load', 'status-error', 'status-paused').hide();
|
||||||
|
mChat.cached('status-ok').show();
|
||||||
|
mChat.isPaused = false;
|
||||||
|
},
|
||||||
|
updateCharCount: function() {
|
||||||
|
var count = mChat.cached('input').val().length;
|
||||||
|
var charCount = mChat.lang.charCount.format({current: count, max: mChat.mssgLngth});
|
||||||
|
var $elem = mChat.cached('character-count').html(charCount).toggleClass('invisible', count === 0);
|
||||||
|
if (mChat.mssgLngth) {
|
||||||
|
$elem.toggleClass('error', count > mChat.mssgLngth);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mention: function() {
|
mention: function() {
|
||||||
var $container = $(this).closest('.mchat-message');
|
var $container = $(this).closest('.mchat-message');
|
||||||
var username = mChat.entityDecode($container.data('mchat-username'));
|
var username = $container.data('mchat-username');
|
||||||
var usercolor = $container.data('mchat-usercolor');
|
var usercolor = $container.data('mchat-usercolor');
|
||||||
if (usercolor) {
|
if (usercolor) {
|
||||||
username = '[b][color=' + usercolor + ']' + username + '[/color][/b]';
|
username = '[b][color=' + usercolor + ']' + username + '[/color][/b]';
|
||||||
@@ -409,32 +572,19 @@ jQuery(function($) {
|
|||||||
},
|
},
|
||||||
quote: function() {
|
quote: function() {
|
||||||
var $container = $(this).closest('.mchat-message');
|
var $container = $(this).closest('.mchat-message');
|
||||||
var username = mChat.entityDecode($container.data('mchat-username'));
|
var username = $container.data('mchat-username');
|
||||||
var quote = mChat.entityDecode($container.data('mchat-message'));
|
var quote = $container.data('mchat-message');
|
||||||
insert_text('[quote="' + username + '"] ' + quote + '[/quote]');
|
insert_text('[quote="' + username + '"] ' + quote + '[/quote]');
|
||||||
},
|
},
|
||||||
like: function() {
|
like: function() {
|
||||||
var $container = $(this).closest('.mchat-message');
|
var $container = $(this).closest('.mchat-message');
|
||||||
var username = mChat.entityDecode($container.data('mchat-username'));
|
var username = $container.data('mchat-username');
|
||||||
var quote = mChat.entityDecode($container.data('mchat-message'));
|
var quote = $container.data('mchat-message');
|
||||||
insert_text(mChat.likes + '[quote="' + username + '"] ' + quote + '[/quote]');
|
insert_text('[i]' + mChat.lang.likes + '[/i][quote="' + username + '"] ' + quote + '[/quote]');
|
||||||
},
|
},
|
||||||
ip: function() {
|
ip: function() {
|
||||||
popup(this.href, 750, 500);
|
popup(this.href, 750, 500);
|
||||||
},
|
},
|
||||||
entityDecode: function(text) {
|
|
||||||
var s = decodeURIComponent(text.toString().replace(/\+/g, ' '));
|
|
||||||
s = s.replace(/</g, '<');
|
|
||||||
s = s.replace(/>/g, '>');
|
|
||||||
s = s.replace(/:/g, ':');
|
|
||||||
s = s.replace(/./g, '.');
|
|
||||||
s = s.replace(/&/g, '&');
|
|
||||||
s = s.replace(/"/g, "'");
|
|
||||||
return s;
|
|
||||||
},
|
|
||||||
inputMessageLength: function() {
|
|
||||||
return $.trim(mChat.cached('input').val()).replace(/\[\/?[^\[\]]+\]/g, '').length;
|
|
||||||
},
|
|
||||||
cached: function() {
|
cached: function() {
|
||||||
return $($.map(arguments, function(name) {
|
return $($.map(arguments, function(name) {
|
||||||
if (!mChat.cache[name]) {
|
if (!mChat.cache[name]) {
|
||||||
@@ -448,90 +598,123 @@ jQuery(function($) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mChat.cache = {};
|
mChat.cache = {};
|
||||||
mChat.cached('confirm').detach().show();
|
|
||||||
|
|
||||||
mChat.messageIds = mChat.cached('messages').children().map(function() {
|
mChat.messageIds = mChat.cached('messages').children().map(function() {
|
||||||
return $(this).data('mchat-id');
|
return $(this).data('mchat-id');
|
||||||
}).get();
|
}).get();
|
||||||
|
|
||||||
mChat.hiddenFields = {};
|
mChat.hiddenFields = {};
|
||||||
$('#mchat-form').find('input[type=hidden]').each(function() {
|
mChat.cached('form').find('input[type=hidden]').each(function() {
|
||||||
mChat.hiddenFields[this.name] = this.value;
|
mChat.hiddenFields[this.name] = this.value;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
mChat.isPaused = false;
|
||||||
|
|
||||||
if (!mChat.archivePage) {
|
if (!mChat.archivePage) {
|
||||||
mChat.resetSession();
|
mChat.resetSession();
|
||||||
|
|
||||||
if (!mChat.messageTop) {
|
if (!mChat.messageTop) {
|
||||||
mChat.cached('messages').animate({scrollTop: mChat.cached('messages')[0].scrollHeight, easing: 'swing', duration: 'slow'});
|
setTimeout(function() {
|
||||||
|
mChat.cached('messages').scrollTop(mChat.cached('messages')[0].scrollHeight);
|
||||||
|
}, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mChat.cached('user-sound').prop('checked')) {
|
mChat.cached('user-sound').prop('checked', mChat.playSound && !localStorage.getItem(mChat.cookie + 'mchat_no_sound')).change(function() {
|
||||||
Cookies.set('mchat_no_sound', 'yes');
|
|
||||||
}
|
|
||||||
|
|
||||||
mChat.cached('user-sound').prop('checked', mChat.playSound && !Cookies.get('mchat_no_sound')).change(function() {
|
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
Cookies.remove('mchat_no_sound');
|
localStorage.removeItem(mChat.cookie + 'mchat_no_sound');
|
||||||
} else {
|
} else {
|
||||||
Cookies.set('mchat_no_sound', 'yes');
|
localStorage.setItem(mChat.cookie + 'mchat_no_sound', 'yes');
|
||||||
}
|
}
|
||||||
});
|
}).change();
|
||||||
|
|
||||||
$.each(mChat.removeBBCodes.split('|'), function(i, bbcode) {
|
$.each(mChat.removeBBCodes.split('|'), function(i, bbcode) {
|
||||||
$('#format-buttons .bbcode-' + bbcode).remove();
|
var bbCodeClass = '.bbcode-' + bbcode.replaceMany({
|
||||||
|
'=': '-',
|
||||||
|
'*': 'asterisk'
|
||||||
|
});
|
||||||
|
$('#format-buttons').find(bbCodeClass).remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
var $colourPalette = $('#colour_palette');
|
var $colourPalette = $('#colour_palette');
|
||||||
$colourPalette.appendTo($colourPalette.parent()).wrap('<div id="mchat-colour"></div>').show();
|
$colourPalette.appendTo($colourPalette.parent()).wrap('<div id="mchat-colour"></div>').show();
|
||||||
$('#bbpalette,#abbc3_bbpalette').prop('onclick', null).attr('data-mchat-toggle', 'colour');
|
$('#bbpalette,#abbc3_bbpalette,#color_wheel').prop('onclick', null).attr('data-mchat-toggle', 'colour');
|
||||||
|
|
||||||
$.each(['userlist', 'smilies', 'bbcodes', 'colour'], function(i, elem) {
|
$.each(['userlist', 'smilies', 'bbcodes', 'colour'], function(i, elem) {
|
||||||
if (Cookies.get('mchat_show_' + elem)) {
|
if (localStorage.getItem(mChat.cookie + 'mchat_show_' + elem)) {
|
||||||
mChat.cached(elem).toggle();
|
mChat.cached(elem).toggle();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mChat.startRelativeTimeUpdate(mChat.cached('messages'));
|
mChat.isTextarea = mChat.cached('input').is('textarea');
|
||||||
|
mChat.cached('form').submit(function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
}).keypress(function(e) {
|
||||||
|
if ((e.which == 10 || e.which == 13) && (!mChat.isTextarea || e.ctrlKey || e.metaKey) && mChat.cached('input').is(e.target)) {
|
||||||
|
mChat.add();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (mChat.cached('input').is('input')) {
|
if (mChat.pause) {
|
||||||
$('#mchat-form').keypress(function(e) {
|
mChat.cached('form').on('input', function() {
|
||||||
if (e.which == 13) {
|
if (mChat.refreshInterval !== false) {
|
||||||
mChat.add();
|
var val = mChat.cached('input').val();
|
||||||
e.preventDefault();
|
if (mChat.isPaused && val === '') {
|
||||||
e.stopImmediatePropagation();
|
mChat.pauseEnd();
|
||||||
|
} else if (!mChat.isPaused && val !== '') {
|
||||||
|
mChat.pauseStart();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mChat.showCharCount) {
|
if (mChat.showCharCount) {
|
||||||
$('#mchat-form').keyup(function(e) {
|
mChat.cached('form').on('input', mChat.updateCharCount);
|
||||||
var count = mChat.inputMessageLength();
|
mChat.cached('input').on('focus', function() {
|
||||||
var $elem = mChat.cached('character-count');
|
setTimeout(function() {
|
||||||
$elem.html(mChat.charCount.format({current: count, max: mChat.mssgLngth})).css('visibility', count > 0 ? 'visible' : 'hidden');
|
mChat.updateCharCount();
|
||||||
if (mChat.mssgLngth) {
|
}, 1);
|
||||||
$elem.toggleClass('error', count > mChat.mssgLngth);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
mChat.cached('input').autoGrowInput({
|
mChat.cached('input').autogrow({
|
||||||
minWidth: mChat.cached('input').width(),
|
vertical: false,
|
||||||
maxWidth: mChat.cached('form').width() - (mChat.cached('input').outerWidth(true) - mChat.cached('input').width())
|
horizontal: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mChat.startRelativeTimeUpdate(mChat.cached('messages'));
|
||||||
|
|
||||||
$(window).on('beforeunload', function() {
|
$(window).on('beforeunload', function() {
|
||||||
mChat.pageIsUnloading = true;
|
mChat.pageIsUnloading = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
mChat.cached('colour').find('.colour-palette').on('click', 'a', function(e) {
|
||||||
|
if (e.ctrlKey || e.metaKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopImmediatePropagation();
|
||||||
|
var $this = $(this);
|
||||||
|
var newColor = $this.data('color');
|
||||||
|
if (localStorage.getItem(mChat.cookie + 'mchat_color') === newColor) {
|
||||||
|
localStorage.removeItem(mChat.cookie + 'mchat_color');
|
||||||
|
} else {
|
||||||
|
localStorage.setItem(mChat.cookie + 'mchat_color', newColor);
|
||||||
|
mChat.cached('colour').find('.colour-palette a').removeClass('remember-color');
|
||||||
|
}
|
||||||
|
$this.toggleClass('remember-color');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var color = localStorage.getItem(mChat.cookie + 'mchat_color');
|
||||||
|
if (color) {
|
||||||
|
mChat.cached('colour').find('.colour-palette a[data-color="' + color + '"]').addClass('remember-color');
|
||||||
|
}
|
||||||
|
|
||||||
$('#phpbb').on('click', '[data-mchat-action]', function(e) {
|
$('#phpbb').on('click', '[data-mchat-action]', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
var action = $(this).data('mchat-action');
|
var action = $(this).data('mchat-action');
|
||||||
mChat[action].call(this);
|
mChat[action].call(this);
|
||||||
e.preventDefault();
|
|
||||||
}).on('click', '[data-mchat-toggle]', function(e) {
|
}).on('click', '[data-mchat-toggle]', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
var elem = $(this).data('mchat-toggle');
|
var elem = $(this).data('mchat-toggle');
|
||||||
mChat.toggle(elem);
|
mChat.toggle(elem);
|
||||||
e.preventDefault();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
64
styles/all/template/mchat_script_data.html
Normal file
64
styles/all/template/mchat_script_data.html
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
<!-- IF MCHAT_IS_ARCHIVE_PAGE or not (MCHAT_ALLOW_USE and S_BBCODE_ALLOWED) -->
|
||||||
|
<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/editor.js -->
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
<!-- INCLUDEJS @dmzx_mchat/javascript/jquery.autogrow-textarea.js -->
|
||||||
|
<!-- INCLUDEJS @dmzx_mchat/javascript/jquery.titlealert.min.js -->
|
||||||
|
<!-- INCLUDEJS @dmzx_mchat/javascript/mchat.js -->
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
// <![CDATA[
|
||||||
|
var form_name = 'postform';
|
||||||
|
var text_name = 'message';
|
||||||
|
var mChat = {
|
||||||
|
// General settings
|
||||||
|
actionUrls : {
|
||||||
|
<!-- BEGIN mchaturl -->
|
||||||
|
{mchaturl.ACTION}: '{mchaturl.URL}'<!-- IF not mchaturl.IS_LAST -->,<!-- ENDIF -->
|
||||||
|
<!-- END mchaturl -->
|
||||||
|
},
|
||||||
|
page : '{MCHAT_PAGE}',
|
||||||
|
cookie : '{A_COOKIE_NAME}',
|
||||||
|
customPage : <!-- IF MCHAT_IS_CUSTOM_PAGE -->true<!-- ELSE -->false<!-- ENDIF -->,
|
||||||
|
archivePage : <!-- IF MCHAT_IS_ARCHIVE_PAGE -->true<!-- ELSE -->false<!-- ENDIF -->,
|
||||||
|
pause : <!-- IF MCHAT_PAUSE_ON_INPUT -->true<!-- ELSE -->false<!-- ENDIF -->,
|
||||||
|
playSound : <!-- IF MCHAT_SOUND -->true<!-- ELSE -->false<!-- ENDIF -->,
|
||||||
|
messageTop : <!-- IF MCHAT_MESSAGE_TOP -->true<!-- ELSE -->false<!-- ENDIF -->,
|
||||||
|
allowBBCodes : <!-- IF S_BBCODE_ALLOWED -->true<!-- ELSE -->false<!-- ENDIF -->,
|
||||||
|
liveUpdates : <!-- IF MCHAT_LIVE_UPDATES -->true<!-- ELSE -->false<!-- ENDIF -->,
|
||||||
|
relativeTime : <!-- IF MCHAT_RELATIVE_TIME -->true<!-- ELSE -->false<!-- ENDIF -->,
|
||||||
|
showCharCount : <!-- IF MCHAT_CHARACTER_COUNT -->true<!-- ELSE -->false<!-- ENDIF -->,
|
||||||
|
|
||||||
|
// Limits & timeouts
|
||||||
|
refreshTime : {MCHAT_REFRESH_JS},
|
||||||
|
whoisRefresh : {MCHAT_WHOIS_REFRESH},
|
||||||
|
timeout : {MCHAT_TIMEOUT},
|
||||||
|
mssgLngth : {MCHAT_MESSAGE_LNGTH},
|
||||||
|
editDeleteLimit : {MCHAT_EDIT_DELETE_LIMIT},
|
||||||
|
logId : {MCHAT_LOG_ID},
|
||||||
|
removeBBCodes : '{A_MCHAT_DISALLOWED_BBCODES}',
|
||||||
|
|
||||||
|
// Language
|
||||||
|
lang: {
|
||||||
|
minutesAgo : {
|
||||||
|
<!-- BEGIN mchattime -->
|
||||||
|
{mchattime.KEY}: '{mchattime.A_LANG}'<!-- IF not mchattime.IS_LAST -->,<!-- ENDIF -->
|
||||||
|
<!-- END mchattime -->
|
||||||
|
},
|
||||||
|
err : '{LA_ERROR}',
|
||||||
|
parserErr : '{LA_AJAX_ERROR_TEXT_PARSERERROR}',
|
||||||
|
newMessageAlert : '{LA_MCHAT_NEW_CHAT}',
|
||||||
|
noMessageInput : '{LA_MCHAT_NOMESSAGEINPUT}',
|
||||||
|
editInfo : '{LA_MCHAT_EDITINFO}',
|
||||||
|
delConfirm : '{LA_MCHAT_DELCONFIRM}',
|
||||||
|
sessOut : '{LA_MCHAT_SESSION_OUT}',
|
||||||
|
sessEnds : '{LA_MCHAT_SESSION_ENDS_JS}',
|
||||||
|
refreshYes : '{A_MCHAT_REFRESH_YES}',
|
||||||
|
refreshNo : '{LA_MCHAT_REFRESH_NO}',
|
||||||
|
charCount : '<!-- IF MCHAT_MESSAGE_LNGTH -->{LA_MCHAT_CHARACTER_COUNT_LIMIT}<!-- ELSE -->{LA_MCHAT_CHARACTER_COUNT}<!-- ENDIF -->',
|
||||||
|
mssgLngthLong : '{A_MCHAT_MESS_LONG}',
|
||||||
|
likes : '{LA_MCHAT_LIKES}'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// ]]>
|
||||||
|
</script>
|
||||||
@@ -1 +1 @@
|
|||||||
<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>
|
<li class="tab mchat" data-select-match="mchat" data-responsive-class="tab small-icon icon-mchat"><a class="nav-link" href="{U_MCHAT}" title="{MCHAT_TITLE_HINT}" class="mchat-nav-link mchat-nav-link-title" role="menuitem">{MCHAT_TITLE}</a></li>
|
||||||
|
|||||||
@@ -2,38 +2,38 @@
|
|||||||
*
|
*
|
||||||
* @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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.icon-mchat {
|
.icon-mchat {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-mchat:after {
|
.icon-mchat:after {
|
||||||
content: '\f086';
|
content: '\f086';
|
||||||
font-family: 'FontAwesome';
|
font-family: 'FontAwesome';
|
||||||
width: 18px;
|
width: 18px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 0;
|
left: 0;
|
||||||
height: 14px;
|
height: 14px;
|
||||||
margin-top: -7px;
|
margin-top: -7px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
vertical-align: baseline;
|
vertical-align: baseline;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
text-indent: 0;
|
text-indent: 0;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar .nav-tabs .mchat .nav-link {
|
.navbar .nav-tabs .mchat .nav-link {
|
||||||
position: relative;
|
position: relative;
|
||||||
text-indent: 999px;
|
text-indent: 999px;
|
||||||
width: 15px;
|
width: 15px;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
.navbar .nav-tabs .mchat .nav-link:after {
|
.navbar .nav-tabs .mchat .nav-link:after {
|
||||||
content: '\f086';
|
content: '\f086';
|
||||||
font-family: 'FontAwesome';
|
font-family: 'FontAwesome';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
margin-top: -7.5px;
|
margin-top: -7.5px;
|
||||||
@@ -51,18 +51,18 @@
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
text-indent: 0;
|
text-indent: 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
left:8px
|
left:8px
|
||||||
}
|
}
|
||||||
|
|
||||||
.rtl .navbar .nav-tabs .mchat .nav-link {
|
.rtl .navbar .nav-tabs .mchat .nav-link {
|
||||||
padding-left: 12px;
|
padding-left: 12px;
|
||||||
padding-right: 30px;
|
padding-right: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rtl .navbar .nav-tabs .mchat .nav-link:after {
|
.rtl .navbar .nav-tabs .mchat .nav-link:after {
|
||||||
left: auto;
|
left: auto;
|
||||||
right: 8px;
|
right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
<!-- DEFINE $MCHAT_USE_WHITE_MESSAGE_ICONS = TRUE -->
|
||||||
@@ -1 +1 @@
|
|||||||
<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>
|
<li class="tab mchat" data-select-match="mchat" data-responsive-class="tab small-icon icon-mchat"><a class="nav-link" href="{U_MCHAT}" title="{MCHAT_TITLE_HINT}" class="mchat-nav-link mchat-nav-link-title" role="menuitem">{MCHAT_TITLE}</a></li>
|
||||||
|
|||||||
@@ -2,7 +2,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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -65,7 +65,3 @@
|
|||||||
left: auto;
|
left: auto;
|
||||||
right: 8px;
|
right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mchat-button:before {
|
|
||||||
background-image: url("./images/message_icons.png");
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<!-- IF MCHAT_INDEX and MCHAT_LOCATION -->
|
||||||
|
<!-- INCLUDE @dmzx_mchat/mchat_body.html -->
|
||||||
|
<!-- ENDIF -->
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<!-- Leave empty -->
|
||||||
3
styles/canvas/template/event/overall_footer_after.html
Normal file
3
styles/canvas/template/event/overall_footer_after.html
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<!-- IF MCHAT_ALLOW_USE -->
|
||||||
|
<script>$.sceditor = false;</script>
|
||||||
|
<!-- ENDIF -->
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
<!-- INCLUDECSS @dmzx_mchat/mchat.css -->
|
||||||
|
<!-- INCLUDECSS @dmzx_mchat/mchat_custom.css -->
|
||||||
32
styles/canvas/theme/mchat_custom.css
Normal file
32
styles/canvas/theme/mchat_custom.css
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* @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
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
ul#mchat-messages.topiclist li {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mchat-text {
|
||||||
|
font-size: 1.1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.mchat-buttons > li {
|
||||||
|
background: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mchat-panel.cp-mini .button2 {
|
||||||
|
float: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mchat-panel #st_editor_buttons {
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mchat-footer label {
|
||||||
|
padding-left: 3px;
|
||||||
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
<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>
|
<li class="tab mchat" data-select-match="mchat" data-responsive-class="tab small-icon icon-mchat"><a class="nav-link" href="{U_MCHAT}" title="{MCHAT_TITLE_HINT}" class="mchat-nav-link mchat-nav-link-title" role="menuitem">{MCHAT_TITLE}</a></li>
|
||||||
|
|||||||
@@ -2,7 +2,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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<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>
|
<li class="tab mchat" data-select-match="mchat" data-responsive-class="tab small-icon icon-mchat"><a class="nav-link" href="{U_MCHAT}" title="{MCHAT_TITLE_HINT}" class="mchat-nav-link mchat-nav-link-title" role="menuitem">{MCHAT_TITLE}</a></li>
|
||||||
|
|||||||
@@ -2,7 +2,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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<li class="small-icon icon-mchat" data-last-responsive="true"><a href="{U_MCHAT}" title="{L_MCHAT_TITLE}" role="menuitem"><span>{L_MCHAT_TITLE}</span></a></li>
|
<li class="small-icon icon-mchat" data-last-responsive="true"><a href="{U_MCHAT}" title="{MCHAT_TITLE_HINT}" class="mchat-nav-link-title" role="menuitem"><span class="mchat-nav-link">{MCHAT_TITLE}</span></a></li>
|
||||||
|
|||||||
@@ -2,7 +2,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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<!-- IF MCHAT_INDEX and MCHAT_LOCATION -->
|
||||||
|
<!-- INCLUDE @dmzx_mchat/mchat_body.html -->
|
||||||
|
<!-- ENDIF -->
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<!-- Leave empty -->
|
||||||
@@ -1 +1 @@
|
|||||||
<li class="small-icon icon-mchat"><a href="{U_MCHAT}" title="{L_MCHAT_TITLE}" role="menuitem">{L_MCHAT_TITLE}</a></li>
|
<li class="small-icon icon-mchat"><a href="{U_MCHAT}" title="{MCHAT_TITLE_HINT}" class="mchat-nav-link mchat-nav-link-title" role="menuitem">{MCHAT_TITLE}</a></li>
|
||||||
|
|||||||
@@ -2,7 +2,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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -12,10 +12,15 @@
|
|||||||
font-family: 'FontAwesome';
|
font-family: 'FontAwesome';
|
||||||
}
|
}
|
||||||
|
|
||||||
#mchat-panel.cp-mini {
|
#mchat-body .cp-mini {
|
||||||
background-color: #E5E4E3;
|
background-color: #E5E4E3;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mChat + .forabg .collapse-box a:before {
|
#mChat + .forabg .collapse-box a:before {
|
||||||
content: '';
|
content: '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes flash-message {
|
||||||
|
0% { background-color: rgba(255, 155, 0, .5); }
|
||||||
|
100% { background-color: #D8D8D8; }
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
<!-- DEFINE $MCHAT_USE_WHITE_MESSAGE_ICONS = TRUE -->
|
||||||
@@ -1 +1 @@
|
|||||||
<li class="small-icon icon-mchat"><a href="{U_MCHAT}" title="{L_MCHAT_TITLE}" role="menuitem">{L_MCHAT_TITLE}</a></li>
|
<li class="small-icon icon-mchat"><a href="{U_MCHAT}" title="{MCHAT_TITLE_HINT}" class="mchat-nav-link mchat-nav-link-title" role="menuitem">{MCHAT_TITLE}</a></li>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB |
@@ -2,7 +2,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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -20,7 +20,3 @@
|
|||||||
content: '';
|
content: '';
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mchat-button:before {
|
|
||||||
background-image: url("./images/message_icons.png");
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
<!-- DEFINE $MCHAT_USE_WHITE_MESSAGE_ICONS = FALSE -->
|
||||||
@@ -3,5 +3,5 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="stat-block online-list mchat-stats-index">
|
<div class="stat-block online-list mchat-stats-index">
|
||||||
<h3><a href="<!-- IF MCHAT_CUSTOM_PAGE and not MCHAT_INDEX -->{U_MCHAT}<!-- ENDIF -->#mChat">{L_MCHAT_WHO_IS_CHATTING}</a></h3>
|
<h3><a href="<!-- IF MCHAT_CUSTOM_PAGE and not MCHAT_INDEX -->{U_MCHAT}<!-- ENDIF -->#mChat">{L_MCHAT_WHO_IS_CHATTING}</a></h3>
|
||||||
<p>{MCHAT_USERS_COUNT} {MCHAT_ONLINE_EXPLAIN}<br />{MCHAT_USERS_LIST}
|
<p>{MCHAT_USERS_TOTAL} {MCHAT_ONLINE_EXPLAIN}<br />{MCHAT_USERS_LIST}
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
<!-- IF MCHAT_INDEX and not MCHAT_LOCATION --><!-- INCLUDE mchat_body.html --><!-- ENDIF -->
|
<!-- IF MCHAT_INDEX and not MCHAT_LOCATION -->
|
||||||
|
<!-- INCLUDE @dmzx_mchat/mchat_body.html -->
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
<!-- IF MCHAT_INDEX and MCHAT_LOCATION --><!-- INCLUDE mchat_body.html --><!-- ENDIF -->
|
<!-- IF MCHAT_INDEX and MCHAT_LOCATION -->
|
||||||
|
<!-- INCLUDE @dmzx_mchat/mchat_body.html -->
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
<!-- IF MCHAT_IS_INDEX or MCHAT_IS_ARCHIVE_PAGE or MCHAT_IS_CUSTOM_PAGE -->
|
<!-- IF MCHAT_IS_INDEX or MCHAT_IS_ARCHIVE_PAGE or MCHAT_IS_CUSTOM_PAGE -->
|
||||||
<div>{MCHAT_DISPLAY_NAME} © {L_POST_BY_AUTHOR} {MCHAT_AUTHOR_HOMEPAGES}</div>
|
<br />
|
||||||
|
<span>{MCHAT_DISPLAY_NAME} © {L_POST_BY_AUTHOR} {MCHAT_AUTHOR_HOMEPAGES}</span>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<!-- IF MCHAT_CUSTOM_PAGE and MCHAT_NAVBAR_LINK and MCHAT_ALLOW_VIEW -->
|
<!-- IF MCHAT_CUSTOM_PAGE and MCHAT_NAVBAR_LINK -->
|
||||||
<!-- INCLUDE mchat_navlink.html -->
|
<!-- INCLUDE @dmzx_mchat/mchat_navlink.html -->
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<!-- IF not MCHAT_IS_ARCHIVE_PAGE -->
|
||||||
|
<style>
|
||||||
|
#mchat-messages {
|
||||||
|
height: <!-- IF MCHAT_IS_CUSTOM_PAGE -->{MCHAT_CUSTOM_HEIGHT}<!-- ELSE -->{MCHAT_INDEX_HEIGHT}<!-- ENDIF -->px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<!-- ENDIF -->
|
||||||
@@ -2,16 +2,23 @@
|
|||||||
<!-- INCLUDE overall_header.html -->
|
<!-- INCLUDE overall_header.html -->
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<!-- IF MCHAT_IS_ARCHIVE_PAGE or not (MCHAT_ALLOW_USE and S_BBCODE_ALLOWED) -->
|
<!-- EVENT dmzx_mchat_overall_header_after -->
|
||||||
<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/editor.js -->
|
|
||||||
|
<!-- EVENT dmzx_mchat_header_before -->
|
||||||
|
|
||||||
|
<!-- IF MCHAT_IS_CUSTOM_PAGE -->
|
||||||
|
<h2>{L_MCHAT_CUSTOM_PAGE}</h2>
|
||||||
|
<!-- ELSEIF MCHAT_IS_ARCHIVE_PAGE -->
|
||||||
|
<h2>{L_MCHAT_ARCHIVE_PAGE}</h2>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- INCLUDEJS javascript/jquery.auto-grow-input.js -->
|
|
||||||
<!-- INCLUDEJS javascript/jquery.titlealert.min.js -->
|
<!-- EVENT dmzx_mchat_header_after -->
|
||||||
<!-- INCLUDEJS javascript/js.cookie-2.0.4.min.js -->
|
|
||||||
<!-- INCLUDEJS javascript/mchat.js -->
|
<!-- INCLUDE @dmzx_mchat/mchat_script_data.html -->
|
||||||
|
|
||||||
<!-- IF MCHAT_IS_ARCHIVE_PAGE and (.pagination or MCHAT_TOTAL_MESSAGES) -->
|
<!-- IF MCHAT_IS_ARCHIVE_PAGE and (.pagination or MCHAT_TOTAL_MESSAGES) -->
|
||||||
<div class="action-bar bar-top">
|
<div class="action-bar bar-top">
|
||||||
|
<!-- EVENT dmzx_mchat_action_bar_top_before -->
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
{MCHAT_TOTAL_MESSAGES}
|
{MCHAT_TOTAL_MESSAGES}
|
||||||
<!-- IF .pagination -->
|
<!-- IF .pagination -->
|
||||||
@@ -20,22 +27,36 @@
|
|||||||
• {PAGE_NUMBER}
|
• {PAGE_NUMBER}
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
</div>
|
</div>
|
||||||
|
<!-- EVENT dmzx_mchat_action_bar_top_after -->
|
||||||
</div>
|
</div>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<!-- EVENT dmzx_mchat_body_before -->
|
<!-- EVENT dmzx_mchat_before -->
|
||||||
<div class="forabg">
|
|
||||||
|
<!-- IF MCHAT_IS_COLLAPSIBLE -->
|
||||||
|
<a class="category<!-- IF S_MCHAT_HIDDEN --> hidden-category<!-- ENDIF --> mchat-category"></a>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
<div class="forabg mchat-wrapper">
|
||||||
<a id="mChat"></a>
|
<a id="mChat"></a>
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<ul class="topiclist">
|
<ul class="topiclist">
|
||||||
<li class="header">
|
<li class="header">
|
||||||
<!-- INCLUDE mchat_header.html -->
|
<!-- INCLUDE @dmzx_mchat/mchat_header.html -->
|
||||||
|
<!-- IF MCHAT_IS_COLLAPSIBLE -->
|
||||||
|
<a href="{U_MCHAT_COLLAPSE_URL}"
|
||||||
|
class="collapse-btn collapse-<!-- IF S_MCHAT_HIDDEN -->show<!-- ELSE -->hide<!-- ENDIF --> mchat-collapse"
|
||||||
|
data-hidden="{S_MCHAT_HIDDEN}"
|
||||||
|
data-ajax="phpbb_collapse"
|
||||||
|
data-overlay="true"
|
||||||
|
title="{L_MCHAT_COLLAPSE_TITLE}"></a>
|
||||||
|
<!-- ENDIF -->
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div id="mchat-body" class="postbody">
|
<!-- EVENT dmzx_mchat_body_before -->
|
||||||
<!-- INCLUDE mchat_script_data.html -->
|
|
||||||
|
|
||||||
|
<div id="mchat-body"<!-- IF MCHAT_IS_COLLAPSIBLE --> class="collapsible"<!-- ENDIF -->>
|
||||||
<!-- IF not MCHAT_SOUND_DISABLED -->
|
<!-- IF not MCHAT_SOUND_DISABLED -->
|
||||||
<audio id="mchat-sound-add" class="hidden" src="{EXT_URL}sounds/add.mp3" preload="auto"></audio>
|
<audio id="mchat-sound-add" class="hidden" src="{EXT_URL}sounds/add.mp3" preload="auto"></audio>
|
||||||
<audio id="mchat-sound-edit" class="hidden" src="{EXT_URL}sounds/edit.mp3" preload="auto"></audio>
|
<audio id="mchat-sound-edit" class="hidden" src="{EXT_URL}sounds/edit.mp3" preload="auto"></audio>
|
||||||
@@ -45,8 +66,10 @@
|
|||||||
|
|
||||||
<div id="mchat-confirm" class="hidden">
|
<div id="mchat-confirm" class="hidden">
|
||||||
<h3>{L_CONFIRM}</h3>
|
<h3>{L_CONFIRM}</h3>
|
||||||
<p></p>
|
<div class="mchat-confirm-fields">
|
||||||
<textarea></textarea>
|
<p></p>
|
||||||
|
<textarea></textarea>
|
||||||
|
</div>
|
||||||
<fieldset class="submit-buttons">
|
<fieldset class="submit-buttons">
|
||||||
<input type="button" name="confirm" value="{L_MCHAT_OK}" class="button2" />
|
<input type="button" name="confirm" value="{L_MCHAT_OK}" class="button2" />
|
||||||
<input type="button" name="cancel" value="{L_CANCEL}" class="button2" />
|
<input type="button" name="cancel" value="{L_CANCEL}" class="button2" />
|
||||||
@@ -60,22 +83,31 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<ul id="mchat-messages" class="topiclist forums"<!-- IF not MCHAT_IS_ARCHIVE_PAGE --> style="height:<!-- IF MCHAT_IS_CUSTOM_PAGE -->{MCHAT_CUSTOM_HEIGHT}<!-- ELSE -->{MCHAT_INDEX_HEIGHT}<!-- ENDIF -->px"<!-- ENDIF -->>
|
<!-- EVENT dmzx_mchat_messages_container_before -->
|
||||||
|
|
||||||
|
<ul id="mchat-messages" class="topiclist forums">
|
||||||
<!-- IF .mchatrow -->
|
<!-- IF .mchatrow -->
|
||||||
<!-- INCLUDE mchat_messages.html -->
|
<!-- INCLUDE @dmzx_mchat/mchat_messages.html -->
|
||||||
<!-- ELSE -->
|
<!-- ELSE -->
|
||||||
<li class="row mchat-static mchat-no-messages">{L_MCHAT_NOMESSAGE}</li>
|
<li class="row mchat-static mchat-no-messages">{L_MCHAT_NOMESSAGE}</li>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_messages_container_after -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- INCLUDE mchat_panel.html -->
|
<!-- INCLUDE @dmzx_mchat/mchat_panel.html -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_body_after -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_after -->
|
||||||
|
|
||||||
<!-- IF MCHAT_IS_ARCHIVE_PAGE -->
|
<!-- IF MCHAT_IS_ARCHIVE_PAGE -->
|
||||||
<div class="action-bar bottom">
|
<div class="action-bar bottom">
|
||||||
|
<!-- EVENT dmzx_mchat_action_bar_bottom_before -->
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
{MCHAT_TOTAL_MESSAGES}
|
{MCHAT_TOTAL_MESSAGES}
|
||||||
<!-- IF .pagination -->
|
<!-- IF .pagination -->
|
||||||
@@ -84,12 +116,13 @@
|
|||||||
• {PAGE_NUMBER}
|
• {PAGE_NUMBER}
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
</div>
|
</div>
|
||||||
|
<!-- EVENT dmzx_mchat_action_bar_top_after -->
|
||||||
</div>
|
</div>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<!-- IF MCHAT_IS_CUSTOM_PAGE and MCHAT_WHOIS_REFRESH -->
|
<!-- IF MCHAT_IS_CUSTOM_PAGE and MCHAT_WHOIS_REFRESH -->
|
||||||
<h3>{L_MCHAT_WHO_IS_CHATTING}</h3>
|
<h3>{L_MCHAT_WHO_IS_CHATTING}</h3>
|
||||||
<!-- INCLUDE mchat_whois.html -->
|
<!-- INCLUDE @dmzx_mchat/mchat_whois.html -->
|
||||||
<div id="mchat-refresh">
|
<div id="mchat-refresh">
|
||||||
<span id="mchat-refresh-explain">{MCHAT_WHOIS_REFRESH_EXPLAIN}</span>
|
<span id="mchat-refresh-explain">{MCHAT_WHOIS_REFRESH_EXPLAIN}</span>
|
||||||
<span id="mchat-refresh-pending" class="hidden">{L_MCHAT_REFRESHING}</span>
|
<span id="mchat-refresh-pending" class="hidden">{L_MCHAT_REFRESHING}</span>
|
||||||
@@ -102,6 +135,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_overall_footer_before -->
|
||||||
|
|
||||||
<!-- IF MCHAT_IS_ARCHIVE_PAGE or MCHAT_IS_CUSTOM_PAGE -->
|
<!-- IF MCHAT_IS_ARCHIVE_PAGE or MCHAT_IS_CUSTOM_PAGE -->
|
||||||
<!-- INCLUDE overall_footer.html -->
|
<!-- INCLUDE overall_footer.html -->
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<dl class="row-item">
|
<dl class="row-item">
|
||||||
<dt><!-- IF MCHAT_IS_ARCHIVE_PAGE -->{L_MCHAT_ARCHIVE_PAGE}<!-- ELSEIF MCHAT_CUSTOM_PAGE --><a href="{U_MCHAT_CUSTOM_PAGE}" title="{L_MCHAT_TITLE}">{L_MCHAT_TITLE}</a><!-- ELSE -->{L_MCHAT_TITLE}<!-- ENDIF --></dt>
|
<dt><!-- IF MCHAT_IS_ARCHIVE_PAGE -->{L_MCHAT_ARCHIVE_PAGE}<!-- ELSEIF MCHAT_CUSTOM_PAGE --><a href="{U_MCHAT_CUSTOM_PAGE}" title="{L_MCHAT_TITLE}">{L_MCHAT_TITLE}</a><!-- ELSE -->{L_MCHAT_TITLE}<!-- ENDIF --></dt>
|
||||||
<dd style="border:none"> </dd>
|
<dd></dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
|
<!-- EVENT dmzx_mchat_messages_before -->
|
||||||
|
<!-- EVENT dmzx_mchat_messages_define_icons -->
|
||||||
|
|
||||||
<!-- BEGIN mchatrow -->
|
<!-- BEGIN mchatrow -->
|
||||||
<li id="mchat-message-{mchatrow.MCHAT_MESSAGE_ID}" class="row mchat-message" data-mchat-id="{mchatrow.MCHAT_MESSAGE_ID}" data-mchat-username="{mchatrow.MCHAT_USERNAME}"<!-- IF mchatrow.MCHAT_USERNAME_COLOR --> data-mchat-usercolor="{mchatrow.MCHAT_USERNAME_COLOR}"<!-- ENDIF --> data-mchat-message="{mchatrow.MCHAT_MESSAGE_EDIT}" data-mchat-message-time="{mchatrow.MCHAT_MESSAGE_TIME}" data-mchat-edit-time="{mchatrow.MCHAT_EDIT_TIME}"<!-- IF MCHAT_EDIT_DELETE_LIMIT and not MCHAT_EDIT_DELETE_IGNORE and (mchatrow.MCHAT_ALLOW_EDIT or mchatrow.MCHAT_ALLOW_DEL) --> data-mchat-edit-delete-limit="1"<!-- ENDIF -->>
|
<li id="mchat-message-{mchatrow.MCHAT_MESSAGE_ID}" class="row mchat-message<!-- IF mchatrow.MCHAT_IS_NOTIFICATION --> mchat-notification-message<!-- ENDIF -->" data-mchat-id="{mchatrow.MCHAT_MESSAGE_ID}" data-mchat-username="{mchatrow.MCHAT_USERNAME}"<!-- IF mchatrow.MCHAT_USERNAME_COLOR --> data-mchat-usercolor="{mchatrow.MCHAT_USERNAME_COLOR}"<!-- ENDIF --> data-mchat-message="{mchatrow.MCHAT_MESSAGE_EDIT}" data-mchat-message-time="{mchatrow.MCHAT_MESSAGE_TIME}"<!-- IF MCHAT_EDIT_DELETE_LIMIT and not MCHAT_EDIT_DELETE_IGNORE and (mchatrow.MCHAT_ALLOW_EDIT or mchatrow.MCHAT_ALLOW_DEL) --> data-mchat-edit-delete-limit="1"<!-- ENDIF --> <!-- EVENT dmzx_mchat_message_attributes -->>
|
||||||
<!-- IF S_MCHAT_AVATARS -->
|
<!-- IF S_MCHAT_AVATARS -->
|
||||||
<div class="mchat-avatar">
|
<div class="mchat-avatar">
|
||||||
<!-- IF mchatrow.U_VIEWPROFILE --><a href="{mchatrow.U_VIEWPROFILE}" title="{L_READ_PROFILE}"><!-- ENDIF -->
|
<!-- IF mchatrow.U_VIEWPROFILE --><a href="{mchatrow.U_VIEWPROFILE}" title="{L_READ_PROFILE}"><!-- ENDIF -->
|
||||||
@@ -8,9 +11,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<div class="mchat-message-wrapper">
|
<div class="mchat-message-wrapper">
|
||||||
<!-- INCLUDE mchat_messages_icons.html -->
|
<!-- INCLUDE @dmzx_mchat/mchat_messages_icons.html -->
|
||||||
<div class="mchat-message-header">{mchatrow.MCHAT_USERNAME_FULL} • <span class="mchat-time" title="{mchatrow.MCHAT_DATETIME}"<!-- IF mchatrow.MCHAT_MINUTES_AGO != -1 --> data-mchat-minutes-ago="{mchatrow.MCHAT_MINUTES_AGO}" data-mchat-relative-update="{mchatrow.MCHAT_RELATIVE_UPDATE}"<!-- ENDIF -->>{mchatrow.MCHAT_TIME}</span></div>
|
<div class="mchat-message-header">{mchatrow.MCHAT_USERNAME_FULL} • <span class="mchat-time" title="{mchatrow.MCHAT_DATETIME}"<!-- IF mchatrow.MCHAT_MINUTES_AGO != -1 --> data-mchat-minutes-ago="{mchatrow.MCHAT_MINUTES_AGO}" data-mchat-relative-update="{mchatrow.MCHAT_RELATIVE_UPDATE}"<!-- ENDIF -->>{mchatrow.MCHAT_TIME}</span></div>
|
||||||
<div class="mchat-text">{mchatrow.MCHAT_MESSAGE}</div>
|
<div class="mchat-text">{mchatrow.MCHAT_MESSAGE}</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<!-- END mchatrow -->
|
<!-- END mchatrow -->
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_messages_after -->
|
||||||
|
|||||||
@@ -1,20 +1,25 @@
|
|||||||
|
<!-- EVENT dmzx_mchat_messages_icons_before -->
|
||||||
<!-- IF not S_IS_BOT -->
|
<!-- IF not S_IS_BOT -->
|
||||||
<!-- DEFINE $MCHAT_ALLOW_MENTION = not mchatrow.MCHAT_IS_POSTER and not MCHAT_IS_ARCHIVE_PAGE -->
|
<!-- DEFINE $MCHAT_ALLOW_MENTION = MCHAT_ALLOW_USE and not mchatrow.MCHAT_IS_POSTER and not MCHAT_IS_ARCHIVE_PAGE -->
|
||||||
<!-- DEFINE $MCHAT_ALLOW_QUOTE = MCHAT_ALLOW_QUOTE and not MCHAT_IS_ARCHIVE_PAGE and not mchatrow.MCHAT_IS_POSTER -->
|
<!-- DEFINE $MCHAT_ALLOW_QUOTE = MCHAT_ALLOW_USE and S_BBCODE_ALLOWED and MCHAT_ALLOW_QUOTE and not MCHAT_IS_ARCHIVE_PAGE -->
|
||||||
<!-- DEFINE $MCHAT_ALLOW_LIKE = MCHAT_ALLOW_LIKE and not MCHAT_IS_ARCHIVE_PAGE and not mchatrow.MCHAT_IS_POSTER -->
|
<!-- DEFINE $MCHAT_ALLOW_LIKE = MCHAT_ALLOW_USE and S_BBCODE_ALLOWED and MCHAT_ALLOW_LIKE and not MCHAT_IS_ARCHIVE_PAGE and not mchatrow.MCHAT_IS_POSTER -->
|
||||||
<!-- DEFINE $MCHAT_ALLOW_PM = MCHAT_ALLOW_PM and mchatrow.MCHAT_PM and mchatrow.U_VIEWPROFILE -->
|
<!-- DEFINE $MCHAT_ALLOW_PM = MCHAT_ALLOW_PM and mchatrow.MCHAT_PM and mchatrow.U_VIEWPROFILE -->
|
||||||
<!-- DEFINE $MCHAT_ALLOW_EDIT = mchatrow.MCHAT_ALLOW_EDIT -->
|
<!-- DEFINE $MCHAT_ALLOW_IP = MCHAT_ALLOW_IP and TRUE -->
|
||||||
|
<!-- DEFINE $MCHAT_ALLOW_PERMISSIONS = MCHAT_ALLOW_PERMISSIONS and TRUE -->
|
||||||
|
<!-- DEFINE $MCHAT_ALLOW_EDIT = mchatrow.MCHAT_ALLOW_EDIT and not mchatrow.MCHAT_IS_NOTIFICATION -->
|
||||||
<!-- DEFINE $MCHAT_ALLOW_DEL = mchatrow.MCHAT_ALLOW_DEL -->
|
<!-- DEFINE $MCHAT_ALLOW_DEL = mchatrow.MCHAT_ALLOW_DEL -->
|
||||||
<!-- IF $MCHAT_ALLOW_MENTION or $MCHAT_ALLOW_QUOTE or $MCHAT_ALLOW_LIKE or $MCHAT_ALLOW_PM or MCHAT_ALLOW_IP or MCHAT_ALLOW_PERMISSIONS or $MCHAT_ALLOW_EDIT or $MCHAT_ALLOW_DEL -->
|
<!-- IF $MCHAT_ALLOW_MENTION or $MCHAT_ALLOW_QUOTE or $MCHAT_ALLOW_LIKE or $MCHAT_ALLOW_PM or MCHAT_ALLOW_IP or MCHAT_ALLOW_PERMISSIONS or $MCHAT_ALLOW_EDIT or $MCHAT_ALLOW_DEL or $MCHAT_ADD_CUSTOM_BUTTON -->
|
||||||
<ul class="mchat-buttons">
|
<ul class="mchat-buttons <!-- IF $MCHAT_USE_WHITE_MESSAGE_ICONS -->mchat-icons-white<!-- ELSE -->mchat-icons-black<!-- ENDIF -->">
|
||||||
<!-- IF $MCHAT_ALLOW_MENTION --><li><a href="#" title="{L_MCHAT_RESPOND}" data-mchat-action="mention"><i class="mchat-button <!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-mention<!-- ELSEIF IS_PHPBB32 -->fa fa-at<!-- ENDIF -->"><span>{L_MCHAT_RESPOND}</span></i></a></li><!-- ENDIF -->
|
<!-- EVENT dmzx_mchat_messages_icons_add_before -->
|
||||||
<!-- IF $MCHAT_ALLOW_QUOTE --><li><a href="#" title="{L_REPLY_WITH_QUOTE}" data-mchat-action="quote"><i class="mchat-button <!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-quote<!-- ELSEIF IS_PHPBB32 -->fa fa-quote-left<!-- ENDIF -->"><span>{L_REPLY_WITH_QUOTE}</span></i></a></li><!-- ENDIF -->
|
<!-- IF $MCHAT_ALLOW_MENTION --><li><a href="#" title="{L_MCHAT_RESPOND}" data-mchat-action="mention"><i class="<!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-mention<!-- ELSEIF IS_PHPBB32 -->fa fa-at<!-- ENDIF -->"><span>{L_MCHAT_RESPOND}</span></i></a></li><!-- ENDIF -->
|
||||||
<!-- IF $MCHAT_ALLOW_LIKE --><li><a href="#" title="{L_MCHAT_LIKE}" data-mchat-action="like"><i class="mchat-button <!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-like<!-- ELSEIF IS_PHPBB32 -->fa fa-thumbs-o-up<!-- ENDIF -->"><span>{L_MCHAT_LIKE}</span></i></a></li><!-- ENDIF -->
|
<!-- IF $MCHAT_ALLOW_QUOTE --><li><a href="#" title="{L_REPLY_WITH_QUOTE}" data-mchat-action="quote"><i class="<!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-quote<!-- ELSEIF IS_PHPBB32 -->fa fa-quote-left<!-- ENDIF -->"><span>{L_REPLY_WITH_QUOTE}</span></i></a></li><!-- ENDIF -->
|
||||||
<!-- IF $MCHAT_ALLOW_PM --><li><a href="{mchatrow.MCHAT_PM}" title="{L_MCHAT_SEND_PM}"><i class="mchat-button <!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-pm<!-- ELSEIF IS_PHPBB32 -->fa fa-envelope-o<!-- ENDIF -->"><span>{L_MCHAT_SEND_PM}</span></i></a></li><!-- ENDIF -->
|
<!-- IF $MCHAT_ALLOW_LIKE --><li><a href="#" title="{L_MCHAT_LIKE}" data-mchat-action="like"><i class="<!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-like<!-- ELSEIF IS_PHPBB32 -->fa fa-thumbs-o-up<!-- ENDIF -->"><span>{L_MCHAT_LIKE}</span></i></a></li><!-- ENDIF -->
|
||||||
<!-- IF MCHAT_ALLOW_IP --><li><a href="{mchatrow.MCHAT_U_IP}" title="{mchatrow.MCHAT_WHOIS_USER}" data-mchat-action="ip"><i class="mchat-button <!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-ip<!-- ELSEIF IS_PHPBB32 -->fa fa-wifi<!-- ENDIF -->"><span>{mchatrow.MCHAT_WHOIS_USER}</span></i></a></li><!-- ENDIF -->
|
<!-- IF $MCHAT_ALLOW_PM --><li><a href="{mchatrow.MCHAT_PM}" title="{L_MCHAT_SEND_PM}"><i class="<!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-pm<!-- ELSEIF IS_PHPBB32 -->fa fa-envelope-o<!-- ENDIF -->"><span>{L_MCHAT_SEND_PM}</span></i></a></li><!-- ENDIF -->
|
||||||
<!-- IF MCHAT_ALLOW_PERMISSIONS --><li><a href="{mchatrow.MCHAT_U_PERMISSIONS}" title="{L_MCHAT_PERMISSIONS}"><i class="mchat-button <!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-permissions<!-- ELSEIF IS_PHPBB32 -->fa fa-exclamation-triangle<!-- ENDIF -->"><span>{L_MCHAT_PERMISSIONS}</span></i></a></li><!-- ENDIF -->
|
<!-- IF $MCHAT_ALLOW_IP --><li><a href="{mchatrow.MCHAT_U_IP}" title="{mchatrow.MCHAT_WHOIS_USER}" data-mchat-action="ip"><i class="<!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-ip<!-- ELSEIF IS_PHPBB32 -->fa fa-wifi<!-- ENDIF -->"><span>{mchatrow.MCHAT_WHOIS_USER}</span></i></a></li><!-- ENDIF -->
|
||||||
<!-- IF $MCHAT_ALLOW_EDIT --><li><a href="#" title="{L_MCHAT_EDIT}"data-mchat-action="edit"><i class="mchat-button <!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-edit<!-- ELSEIF IS_PHPBB32 -->fa fa-pencil<!-- ENDIF -->"><span>{L_MCHAT_EDIT}</span></i></a></li><!-- ENDIF -->
|
<!-- IF $MCHAT_ALLOW_PERMISSIONS --><li><a href="{mchatrow.MCHAT_U_PERMISSIONS}" title="{L_MCHAT_PERMISSIONS}"><i class="<!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-permissions<!-- ELSEIF IS_PHPBB32 -->fa fa-exclamation-triangle<!-- ENDIF -->"><span>{L_MCHAT_PERMISSIONS}</span></i></a></li><!-- ENDIF -->
|
||||||
<!-- IF $MCHAT_ALLOW_DEL --><li><a href="#" title="{L_DELETE}" data-mchat-action="del"><i class="mchat-button <!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-delete<!-- ELSEIF IS_PHPBB32 -->fa fa-trash-o<!-- ENDIF -->"><span>{L_DELETE}</span></i></a></li><!-- ENDIF -->
|
<!-- IF $MCHAT_ALLOW_EDIT --><li><a href="#" title="{L_MCHAT_EDIT}" data-mchat-action="edit"><i class="<!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-edit<!-- ELSEIF IS_PHPBB32 -->fa fa-pencil<!-- ENDIF -->"><span>{L_MCHAT_EDIT}</span></i></a></li><!-- ENDIF -->
|
||||||
|
<!-- IF $MCHAT_ALLOW_DEL --><li><a href="#" title="{L_DELETE}" data-mchat-action="del"><i class="<!-- IF IS_PHPBB31 -->mchat-icon mchat-icon-delete<!-- ELSEIF IS_PHPBB32 -->fa fa-trash-o<!-- ENDIF -->"><span>{L_DELETE}</span></i></a></li><!-- ENDIF -->
|
||||||
|
<!-- EVENT dmzx_mchat_messages_icons_add_after -->
|
||||||
</ul>
|
</ul>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<li <!-- IF IS_PHPBB31 -->class="small-icon icon-mchat"<!-- ELSEIF IS_PHPBB32 -->data-last-responsive="true"<!-- ENDIF -->>
|
<li<!-- IF IS_PHPBB31 --> class="small-icon icon-mchat"<!-- ENDIF --> data-last-responsive="true">
|
||||||
<a href="{U_MCHAT}" title="{L_MCHAT_TITLE}" role="menuitem">
|
<a href="{U_MCHAT}" title="{MCHAT_TITLE_HINT}" class="mchat-nav-link-title" role="menuitem">
|
||||||
<i<!-- IF IS_PHPBB32 --> class="icon fa fa-weixin"<!-- ENDIF --> aria-hidden="true"></i><span>{L_MCHAT_TITLE}</span>
|
<i<!-- IF IS_PHPBB32 --> class="icon fa fa-weixin"<!-- ENDIF --> aria-hidden="true"></i>
|
||||||
|
<span class="mchat-nav-link">{MCHAT_TITLE}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<div id="mchat-panel" class="panel cp-mini<!-- IF MCHAT_IS_ARCHIVE_PAGE --> hidden<!-- ENDIF -->">
|
<div id="mchat-panel" class="panel cp-mini<!-- IF MCHAT_IS_ARCHIVE_PAGE --> hidden<!-- ENDIF -->">
|
||||||
<!-- IF MCHAT_IS_INDEX and MCHAT_WHOIS_REFRESH and MCHAT_WHOIS_INDEX -->
|
<!-- IF MCHAT_IS_INDEX and MCHAT_WHOIS_REFRESH and MCHAT_WHOIS_INDEX -->
|
||||||
<!-- INCLUDE mchat_whois.html -->
|
<!-- INCLUDE @dmzx_mchat/mchat_whois.html -->
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<!-- IF MCHAT_CHARACTER_COUNT and not MCHAT_IS_ARCHIVE_PAGE -->
|
<!-- IF MCHAT_CHARACTER_COUNT and not MCHAT_IS_ARCHIVE_PAGE -->
|
||||||
<div id="mchat-character-count">{MCHAT_CHARACTER_COUNT}</div>
|
<div id="mchat-character-count" class="invisible">{MCHAT_CHARACTER_COUNT}</div>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<form id="mchat-form" name="postform" action="{U_MCHAT_CUSTOM_PAGE}" method="POST">
|
<form id="mchat-form" name="postform" action="{U_MCHAT_CUSTOM_PAGE}" method="POST">
|
||||||
@@ -13,34 +13,33 @@
|
|||||||
<noscript><div class="error">{L_MCHAT_NOJAVASCRIPT}</div></noscript>
|
<noscript><div class="error">{L_MCHAT_NOJAVASCRIPT}</div></noscript>
|
||||||
<!-- IF MCHAT_ALLOW_USE -->
|
<!-- IF MCHAT_ALLOW_USE -->
|
||||||
<!-- IF MCHAT_INPUT_AREA -->
|
<!-- IF MCHAT_INPUT_AREA -->
|
||||||
<input id="mchat-input" type="text" name="message" class="inputbox medium" />
|
<input id="mchat-input" type="text" name="message" class="inputbox medium" autocomplete="off" />
|
||||||
<!-- ELSE -->
|
<!-- ELSE -->
|
||||||
<textarea id="mchat-input" name="message" class="inputbox no-auto-resize" cols="32" rows="5"></textarea>
|
<textarea id="mchat-input" name="message" class="inputbox no-auto-resize"></textarea>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- EVENT dmzx_mchat_buttons_before -->
|
<!-- EVENT dmzx_mchat_buttons_container_before -->
|
||||||
<div id="mchat-buttons">
|
<div id="mchat-buttons">
|
||||||
|
<!-- EVENT dmzx_mchat_buttons_before -->
|
||||||
<!-- IF MCHAT_ALLOW_USE -->
|
<!-- IF MCHAT_ALLOW_USE -->
|
||||||
<input id="mchat-add" type="button" class="button2" data-mchat-action="add" value="{L_MCHAT_ADD}" />
|
<input id="mchat-add" class="<!-- IF IS_PHPBB31 -->button2<!-- ELSEIF IS_PHPBB32 -->button<!-- ENDIF -->" type="button" data-mchat-action="add" value="{L_MCHAT_ADD}" />
|
||||||
<!-- IF MCHAT_USER_TIMEOUT or MCHAT_PAUSE_ON_INPUT -->
|
|
||||||
<input id="mchat-clear" type="button" class="button2" data-mchat-action="clear" value="{L_RESET}" />
|
|
||||||
<!-- ENDIF -->
|
|
||||||
<!-- IF MCHAT_ALLOW_SMILES and .smiley -->
|
<!-- IF MCHAT_ALLOW_SMILES and .smiley -->
|
||||||
<input type="button" class="button2" data-mchat-toggle="smilies" value="{L_MCHAT_SMILES}" />
|
<input type="button" class="<!-- IF IS_PHPBB31 -->button2<!-- ELSEIF IS_PHPBB32 -->button<!-- ENDIF -->" data-mchat-toggle="smilies" value="{L_MCHAT_SMILES}" />
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- IF S_BBCODE_ALLOWED -->
|
<!-- IF S_BBCODE_ALLOWED -->
|
||||||
<input type="button" class="button2" data-mchat-toggle="bbcodes" value="{L_MCHAT_BBCODES}" />
|
<input type="button" class="<!-- IF IS_PHPBB31 -->button2<!-- ELSEIF IS_PHPBB32 -->button<!-- ENDIF -->" data-mchat-toggle="bbcodes" value="{L_MCHAT_BBCODES}" />
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- IF MCHAT_RULES -->
|
<!-- IF MCHAT_RULES -->
|
||||||
<input type="button" class="button2" onclick="popup('{U_MCHAT_RULES}', 450, 275); return false;" value="{L_MCHAT_RULES}" />
|
<input type="button" class="<!-- IF IS_PHPBB31 -->button2<!-- ELSEIF IS_PHPBB32 -->button<!-- ENDIF -->" onclick="popup('{U_MCHAT_RULES}', 450, 275); return false;" value="{L_MCHAT_RULES}" />
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- EVENT dmzx_mchat_buttons_mid -->
|
<!-- EVENT dmzx_mchat_buttons_mid -->
|
||||||
<!-- IF MCHAT_ARCHIVE -->
|
<!-- IF MCHAT_ARCHIVE -->
|
||||||
<input type="button" class="button2" onclick="window.location.href = '{U_MCHAT_ARCHIVE_URL}';" value="{L_MCHAT_ARCHIVE}" />
|
<input type="button" class="<!-- IF IS_PHPBB31 -->button2<!-- ELSEIF IS_PHPBB32 -->button<!-- ENDIF -->" onclick="window.location.href = '{U_MCHAT_ARCHIVE_URL}';" value="{L_MCHAT_ARCHIVE}" />
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- EVENT dmzx_mchat_buttons_after -->
|
<!-- EVENT dmzx_mchat_buttons_after -->
|
||||||
</div>
|
</div>
|
||||||
|
<!-- EVENT dmzx_mchat_buttons_container_after -->
|
||||||
<!-- IF MCHAT_ALLOW_USE and S_BBCODE_ALLOWED -->
|
<!-- IF MCHAT_ALLOW_USE and S_BBCODE_ALLOWED -->
|
||||||
<div id="mchat-bbcodes">
|
<div id="mchat-bbcodes">
|
||||||
<!-- INCLUDE posting_buttons.html -->
|
<!-- INCLUDE posting_buttons.html -->
|
||||||
@@ -58,16 +57,20 @@
|
|||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- EVENT dmzx_mchat_body_smiley_after -->
|
<!-- EVENT dmzx_mchat_body_smiley_after -->
|
||||||
<div id="mchat-status">
|
<div id="mchat-status">
|
||||||
<div id="mchat-status-icons">
|
<ul class="mchat-footer">
|
||||||
<i id="mchat-status-load" class="<!-- IF IS_PHPBB31 -->mchat-status-load<!-- ELSEIF IS_PHPBB32 -->fa fa-refresh fa-spin icon icon-blue<!-- ENDIF -->" title="{L_LOADING}"></i>
|
<li>
|
||||||
<i id="mchat-status-ok" class="<!-- IF IS_PHPBB31 -->mchat-status-ok<!-- ELSEIF IS_PHPBB32 -->fa fa-check icon icon-green<!-- ENDIF -->" title="{L_MCHAT_OK}"></i>
|
<span id="mchat-status-icons">
|
||||||
<i id="mchat-status-paused" class="<!-- IF IS_PHPBB31 -->mchat-status-paused<!-- ELSEIF IS_PHPBB32 -->fa fa-pause icon icon-orange<!-- ENDIF -->" title="{L_MCHAT_PAUSE}"></i>
|
<i id="mchat-status-load" class="<!-- IF IS_PHPBB31 -->mchat-status-load<!-- ELSEIF IS_PHPBB32 -->fa fa-refresh fa-spin icon icon-blue<!-- ENDIF -->" title="{L_LOADING}"></i>
|
||||||
<i id="mchat-status-error" class="<!-- IF IS_PHPBB31 -->mchat-status-error<!-- ELSEIF IS_PHPBB32 -->fa fa-times icon icon-red<!-- ENDIF -->" title="{L_ERROR}"></i>
|
<i id="mchat-status-ok" class="<!-- IF IS_PHPBB31 -->mchat-status-ok<!-- ELSEIF IS_PHPBB32 -->fa fa-check icon icon-green<!-- ENDIF -->" title="{L_MCHAT_OK}"></i>
|
||||||
</div>
|
<i id="mchat-status-paused" class="<!-- IF IS_PHPBB31 -->mchat-status-paused<!-- ELSEIF IS_PHPBB32 -->fa fa-pause icon icon-orange<!-- ENDIF -->" title="{L_MCHAT_PAUSE}"></i>
|
||||||
<span id="mchat-refresh-text">{MCHAT_REFRESH_YES}</span>
|
<i id="mchat-status-error" class="<!-- IF IS_PHPBB31 -->mchat-status-error<!-- ELSEIF IS_PHPBB32 -->fa fa-times icon icon-red<!-- ENDIF -->" title="{L_ERROR}"></i>
|
||||||
<!-- IF MCHAT_USER_TIMEOUT --> • <span id="mchat-session">{MCHAT_SESSION_TIMELEFT}</span><!-- ENDIF -->
|
</span>
|
||||||
<!-- IF not MCHAT_SOUND_DISABLED --> • <label for="mchat-user-sound">{L_MCHAT_USESOUND} <input type="checkbox" id="mchat-user-sound"<!-- IF MCHAT_SOUND --> checked="checked"<!-- ENDIF --> /></label><!-- ENDIF -->
|
<span id="mchat-refresh-text">{MCHAT_REFRESH_YES}</span>
|
||||||
<span class="mchat-copyright" title="{MCHAT_AUTHOR_NAMES}">©</span>
|
</li>
|
||||||
|
<!-- IF MCHAT_TIMEOUT --><li><span id="mchat-session">{MCHAT_SESSION_TIMELEFT}</span></li><!-- ENDIF -->
|
||||||
|
<!-- IF not MCHAT_SOUND_DISABLED --><li class="mchat-sound"><input type="checkbox" id="mchat-user-sound"<!-- IF MCHAT_SOUND --> checked="checked"<!-- ENDIF --> /><label for="mchat-user-sound">{L_MCHAT_USESOUND}</label></li><!-- ENDIF -->
|
||||||
|
<li><span class="mchat-copyright" title="{MCHAT_AUTHOR_NAMES}">©</span></li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
var form_name = 'postform';
|
|
||||||
var text_name = 'message';
|
|
||||||
var mChat = {
|
|
||||||
// General settings
|
|
||||||
actionUrls : {
|
|
||||||
<!-- BEGIN mchaturl -->
|
|
||||||
{mchaturl.ACTION}: '{mchaturl.URL}'<!-- IF not mchaturl.IS_LAST -->,<!-- ENDIF -->
|
|
||||||
<!-- END mchaturl -->
|
|
||||||
},
|
|
||||||
customPage : <!-- IF MCHAT_IS_CUSTOM_PAGE -->true<!-- ELSE -->false<!-- ENDIF -->,
|
|
||||||
archivePage : <!-- IF MCHAT_IS_ARCHIVE_PAGE -->true<!-- ELSE -->false<!-- ENDIF -->,
|
|
||||||
pause : <!-- IF MCHAT_PAUSE_ON_INPUT -->true<!-- ELSE -->false<!-- ENDIF -->,
|
|
||||||
playSound : <!-- IF MCHAT_SOUND -->true<!-- ELSE -->false<!-- ENDIF -->,
|
|
||||||
messageTop : <!-- IF MCHAT_MESSAGE_TOP -->true<!-- ELSE -->false<!-- ENDIF -->,
|
|
||||||
allowBBCodes : <!-- IF S_BBCODE_ALLOWED -->true<!-- ELSE -->false<!-- ENDIF -->,
|
|
||||||
liveUpdates : <!-- IF MCHAT_LIVE_UPDATES -->true<!-- ELSE -->false<!-- ENDIF -->,
|
|
||||||
relativeTime : <!-- IF MCHAT_RELATIVE_TIME -->true<!-- ELSE -->false<!-- ENDIF -->,
|
|
||||||
showCharCount : <!-- IF MCHAT_CHARACTER_COUNT -->true<!-- ELSE -->false<!-- ENDIF -->,
|
|
||||||
|
|
||||||
// Limits & timeouts
|
|
||||||
refreshTime : {MCHAT_REFRESH_JS},
|
|
||||||
whoisRefresh : {MCHAT_WHOIS_REFRESH},
|
|
||||||
userTimeout : {MCHAT_USER_TIMEOUT},
|
|
||||||
mssgLngth : {MCHAT_MESSAGE_LNGTH},
|
|
||||||
editDeleteLimit : {MCHAT_EDIT_DELETE_LIMIT},
|
|
||||||
removeBBCodes : '{MCHAT_DISALLOWED_BBCODES}',
|
|
||||||
|
|
||||||
// Language
|
|
||||||
minutesAgo : {
|
|
||||||
<!-- BEGIN mchattime -->
|
|
||||||
{mchattime.KEY}: '{mchattime.LANG}'<!-- IF not mchattime.IS_LAST -->,<!-- ENDIF -->
|
|
||||||
<!-- END mchattime -->
|
|
||||||
},
|
|
||||||
newMessageAlert : '{LA_MCHAT_NEW_CHAT}',
|
|
||||||
noMessageInput : '{LA_MCHAT_NOMESSAGEINPUT}',
|
|
||||||
noMessages : '{LA_MCHAT_NOMESSAGE}',
|
|
||||||
editInfo : '{LA_MCHAT_EDITINFO}',
|
|
||||||
noAccess : '{LA_NO_AUTH_OPERATION}',
|
|
||||||
flood : '{LA_MCHAT_FLOOD}',
|
|
||||||
delConfirm : '{LA_MCHAT_DELCONFIRM}',
|
|
||||||
clearConfirm : '{LA_MCHAT_RESET_QUESTION}',
|
|
||||||
sessOut : '{LA_MCHAT_SESSION_OUT}',
|
|
||||||
sessEnds : '{LA_MCHAT_SESSION_ENDS_JS}',
|
|
||||||
refreshYes : '{MCHAT_REFRESH_YES}',
|
|
||||||
refreshNo : '{LA_MCHAT_REFRESH_NO}',
|
|
||||||
charCount : '<!-- IF MCHAT_MESSAGE_LNGTH -->{LA_MCHAT_CHARACTER_COUNT_LIMIT}<!-- ELSE -->{LA_MCHAT_CHARACTER_COUNT}<!-- ENDIF -->',
|
|
||||||
mssgLngthLong : '{MCHAT_MESS_LONG}',
|
|
||||||
likes : '{LA_MCHAT_LIKES}'
|
|
||||||
};
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
<div id="mchat-whois">
|
<div id="mchat-whois">
|
||||||
<span title="{MCHAT_ONLINE_EXPLAIN}">
|
<span title="{MCHAT_ONLINE_EXPLAIN}">
|
||||||
<!-- IF MCHAT_USERS_LIST -->
|
<!-- IF MCHAT_USERS_LIST -->
|
||||||
<a href="#" data-mchat-toggle="userlist">{MCHAT_USERS_COUNT}</a>
|
<a href="#" data-mchat-toggle="userlist">{MCHAT_USERS_TOTAL}</a>
|
||||||
<!-- ELSE -->
|
<!-- ELSE -->
|
||||||
{MCHAT_USERS_COUNT}
|
{MCHAT_USERS_TOTAL}
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
</span>
|
</span>
|
||||||
<div id="mchat-userlist" class="hidden">{MCHAT_USERS_LIST}</div>
|
<div id="mchat-userlist" class="hidden">{MCHAT_USERS_LIST}</div>
|
||||||
|
|||||||
@@ -15,6 +15,9 @@
|
|||||||
|
|
||||||
<!-- IF MCHAT_AUTH_COUNT > 0 -->
|
<!-- IF MCHAT_AUTH_COUNT > 0 -->
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_ucp_index_before -->
|
||||||
|
|
||||||
<!-- IF MCHAT_INDEX_AUTH -->
|
<!-- IF MCHAT_INDEX_AUTH -->
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label for="user_mchat_index">{L_MCHAT_INDEX}{L_COLON}</label></dt>
|
<dt><label for="user_mchat_index">{L_MCHAT_INDEX}{L_COLON}</label></dt>
|
||||||
@@ -51,7 +54,13 @@
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_ucp_location_after -->
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_ucp_message_top_before -->
|
||||||
|
|
||||||
<!-- IF MCHAT_MESSAGE_TOP_AUTH -->
|
<!-- IF MCHAT_MESSAGE_TOP_AUTH -->
|
||||||
<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">{L_MCHAT_MESSAGE_TOP}{L_COLON}</label><br /><span>{L_MCHAT_MESSAGE_TOP_EXPLAIN}</span></dt>
|
||||||
@@ -99,7 +108,7 @@
|
|||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<!-- IF MCHAT_CHARACTER_COUNT_AUTH -->
|
<!-- IF MCHAT_CHARACTER_COUNT_AUTH -->
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label for="user_mchat_character_count">{L_MCHAT_CHARACTER_COUNT}{L_COLON}</label></dt>
|
<dt><label for="user_mchat_character_count">{L_MCHAT_DISPLAY_CHARACTER_COUNT}{L_COLON}</label></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 --> /> {L_YES}</label>
|
<label><input type="radio" name="user_mchat_character_count" value="1"<!-- IF MCHAT_CHARACTER_COUNT --> id="user_mchat_character_count" checked="checked"<!-- ENDIF --> /> {L_YES}</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 --> /> {L_NO}</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 --> /> {L_NO}</label>
|
||||||
@@ -135,7 +144,13 @@
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_ucp_relative_time_after -->
|
||||||
|
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_ucp_posts_before -->
|
||||||
|
|
||||||
<!-- IF MCHAT_POSTS_AUTH and MCHAT_POSTS_ENABLED_LANG -->
|
<!-- IF MCHAT_POSTS_AUTH and MCHAT_POSTS_ENABLED_LANG -->
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label for="user_mchat_posts">{MCHAT_POSTS_ENABLED_LANG}{L_COLON}</label></dt>
|
<dt><label for="user_mchat_posts">{MCHAT_POSTS_ENABLED_LANG}{L_COLON}</label></dt>
|
||||||
@@ -145,6 +160,9 @@
|
|||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
<!-- EVENT dmzx_mchat_ucp_posts_after -->
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
@@ -2,7 +2,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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -12,10 +12,19 @@
|
|||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mChat + .inner li.header dd {
|
.mchat-wrapper li.header dd {
|
||||||
width: 0;
|
width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#mchat-body {
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mchat-main {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
.icon-mchat {
|
.icon-mchat {
|
||||||
background-image: url("./images/icon_mchat.png");
|
background-image: url("./images/icon_mchat.png");
|
||||||
}
|
}
|
||||||
@@ -24,10 +33,6 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mchat-body {
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
#mchat-confirm textarea {
|
#mchat-confirm textarea {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
@@ -35,7 +40,6 @@
|
|||||||
|
|
||||||
#mchat-messages {
|
#mchat-messages {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
width: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mchat-message-wrapper {
|
.mchat-message-wrapper {
|
||||||
@@ -51,56 +55,64 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mchat-message-flash {
|
||||||
|
animation-name: flash-message;
|
||||||
|
animation-duration: .4s;
|
||||||
|
animation-timing-function: ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes flash-message {
|
||||||
|
|
||||||
|
0% {
|
||||||
|
background-color: #FFD070;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
background-color: transparent;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.mchat-avatar {
|
.mchat-avatar {
|
||||||
float: left;
|
float: left;
|
||||||
width: 40px;
|
width: 40px;
|
||||||
padding-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) {
|
|
||||||
|
|
||||||
.mchat-buttons > li {
|
|
||||||
padding: 0 8px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mchat-avatar a, .mchat-avatar img {
|
.mchat-avatar a, .mchat-avatar img {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mchat-message .mchat-buttons li {
|
.mchat-wrapper .mchat-buttons li {
|
||||||
opacity: .3;
|
opacity: .3;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mchat-message:hover .mchat-buttons li {
|
.mchat-wrapper li:hover .mchat-buttons li {
|
||||||
opacity: .6;
|
opacity: .6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mchat-message .mchat-buttons li:hover {
|
.mchat-wrapper li:hover .mchat-buttons li:hover {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mchat-buttons {
|
.mchat-wrapper .mchat-buttons {
|
||||||
float: right;
|
float: right;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin-top: 1px;
|
margin-top: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mchat-message-wrapper .mchat-buttons > li {
|
.mchat-wrapper .mchat-buttons > li {
|
||||||
float: left;
|
float: left;
|
||||||
margin: 0 3px;
|
margin: 0 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mchat-button {
|
.mchat-wrapper .mchat-buttons .fa {
|
||||||
margin-left: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mchat-button.fa {
|
|
||||||
font-size: 12pt;
|
font-size: 12pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mchat-button span {
|
.mchat-wrapper .mchat-buttons span {
|
||||||
display: block;
|
display: block;
|
||||||
height: 0;
|
height: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@@ -108,9 +120,16 @@
|
|||||||
width: 1px;
|
width: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mchat-icons-black .mchat-icon:before {
|
||||||
|
background-image: url("./images/message_icons_black.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
.mchat-icons-white .mchat-icon:before {
|
||||||
|
background-image: url("./images/message_icons_white.png");
|
||||||
|
}
|
||||||
|
|
||||||
.mchat-icon:before {
|
.mchat-icon:before {
|
||||||
content: '';
|
content: '';
|
||||||
background-image: url("./images/message_icons.png");
|
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
@@ -118,22 +137,34 @@
|
|||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mchat-icon-mention:before { background-position: -2px -2px; }
|
.mchat-icon-mention:before { background-position: -2px -2px; }
|
||||||
.mchat-icon-edit:before { background-position: -22px -2px; }
|
.mchat-icon-edit:before { background-position: -22px -2px; }
|
||||||
.mchat-icon-pm:before { background-position: -42px -2px; }
|
.mchat-icon-pm:before { background-position: -42px -2px; }
|
||||||
.mchat-icon-quote:before { background-position: -62px -2px; }
|
.mchat-icon-quote:before { background-position: -62px -2px; }
|
||||||
.mchat-icon-like:before { background-position: -82px -2px; }
|
.mchat-icon-like:before { background-position: -82px -2px; }
|
||||||
.mchat-icon-delete:before { background-position: -102px -2px; }
|
.mchat-icon-delete:before { background-position: -102px -2px; }
|
||||||
.mchat-icon-permissions:before { background-position: -122px -2px; }
|
.mchat-icon-permissions:before { background-position: -122px -2px; }
|
||||||
.mchat-icon-ip:before { background-position: -142px -2px; }
|
.mchat-icon-ip:before { background-position: -142px -2px; }
|
||||||
|
|
||||||
.mchat-text {
|
.mchat-text {
|
||||||
clear: both;
|
clear: both;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: 0 5px 2px;
|
padding: 2px 5px;
|
||||||
font-size: 1.2em;
|
font-size: 1.2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mchat-notification-message .mchat-text {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mchat-text strong {
|
||||||
|
font-weight: bold !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mchat-text img {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.mchat-text li {
|
.mchat-text li {
|
||||||
display: list-item !important;
|
display: list-item !important;
|
||||||
list-style-type: inherit !important;
|
list-style-type: inherit !important;
|
||||||
@@ -156,12 +187,8 @@
|
|||||||
list-style-type: circle;
|
list-style-type: circle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mchat-text blockquote {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.mchat-text blockquote, .mchat-text .codebox, .mchat-text ul, .mchat-text ol {
|
.mchat-text blockquote, .mchat-text .codebox, .mchat-text ul, .mchat-text ol {
|
||||||
margin-top: 5px;
|
margin-bottom: 5px;
|
||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,14 +208,17 @@
|
|||||||
|
|
||||||
#mchat-character-count {
|
#mchat-character-count {
|
||||||
float: right;
|
float: right;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mchat-character-count.invisible {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
padding: 5px 0 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#mchat-panel {
|
#mchat-panel {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
max-height: initial;
|
max-height: initial;
|
||||||
overflow-y: auto;
|
overflow: hidden;
|
||||||
padding: 0 5px 5px 5px;
|
padding: 0 5px 5px 5px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
@@ -201,13 +231,19 @@
|
|||||||
#mchat-input {
|
#mchat-input {
|
||||||
cursor: text;
|
cursor: text;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
min-width: 50%;
|
||||||
|
max-width: 95%;
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
padding: 5px 5px 4px;
|
padding: 5px 5px 4px;
|
||||||
margin: 5px 20px;
|
margin: 5px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea#mchat-input {
|
||||||
|
height: 8em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mchat-buttons {
|
#mchat-buttons {
|
||||||
padding-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mchat-bbcodes {
|
#mchat-bbcodes {
|
||||||
@@ -227,6 +263,10 @@
|
|||||||
margin: 0 auto 5px;
|
margin: 0 auto 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#mchat-bbcodes #colour_palette td a.remember-color {
|
||||||
|
box-shadow: 0 0 0 1px #F00;
|
||||||
|
}
|
||||||
|
|
||||||
#mchat-smilies {
|
#mchat-smilies {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
@@ -284,6 +324,23 @@
|
|||||||
background-image: url("./images/paused.gif");
|
background-image: url("./images/paused.gif");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mchat-footer li {
|
||||||
|
display: inline;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mchat-footer li:before {
|
||||||
|
content: '\2022\A';
|
||||||
|
}
|
||||||
|
|
||||||
|
.mchat-footer li:first-child:before {
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
|
||||||
|
.mchat-footer label {
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
#mchat-legend {
|
#mchat-legend {
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
@@ -314,6 +371,22 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) {
|
||||||
|
|
||||||
|
#mchat-body {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mchat-wrapper .mchat-buttons > li {
|
||||||
|
padding: 0 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mchat-input {
|
||||||
|
width: 95% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* Compatibility with Advanced BBCode Box extension */
|
/* Compatibility with Advanced BBCode Box extension */
|
||||||
|
|
||||||
#mchat-panel #abbc3_buttons {
|
#mchat-panel #abbc3_buttons {
|
||||||
@@ -324,3 +397,19 @@
|
|||||||
#mchat-panel #abbc3_buttons .abbc3_buttons_row {
|
#mchat-panel #abbc3_buttons .abbc3_buttons_row {
|
||||||
margin: 0 auto !important;
|
margin: 0 auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Compatibility with Collapsible Categories extension */
|
||||||
|
|
||||||
|
.mchat-category {
|
||||||
|
display: none;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mchat-collapse {
|
||||||
|
display: none;
|
||||||
|
line-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden-category + .forabg #mchat-body .topiclist.forums {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<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>
|
<li class="tab mchat" data-select-match="mchat" data-responsive-class="tab small-icon icon-mchat"><a class="nav-link mchat-nav-link mchat-nav-link-title" href="{U_MCHAT}" title="{MCHAT_TITLE_HINT}" role="menuitem">{MCHAT_TITLE}</a></li>
|
||||||
|
|||||||
@@ -2,7 +2,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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -65,3 +65,8 @@
|
|||||||
left: auto;
|
left: auto;
|
||||||
right: 8px;
|
right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes flash-message {
|
||||||
|
0% { background-color: #F6F4D0; }
|
||||||
|
100% { background-color: #F4F4F4; }
|
||||||
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -24,7 +24,7 @@ class ucp_mchat_info
|
|||||||
'modes' => array(
|
'modes' => array(
|
||||||
'configuration' => array(
|
'configuration' => array(
|
||||||
'title' => 'UCP_MCHAT_CONFIG',
|
'title' => 'UCP_MCHAT_CONFIG',
|
||||||
'auth' => 'ext_dmzx/mchat && acl_u_mchat_use',
|
'auth' => 'ext_dmzx/mchat && acl_u_mchat_view',
|
||||||
'cat' => array('UCP_MCHAT_CONFIG'),
|
'cat' => array('UCP_MCHAT_CONFIG'),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -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
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -24,7 +24,7 @@ class ucp_mchat_module
|
|||||||
|
|
||||||
// Set template
|
// Set template
|
||||||
$this->tpl_name = 'ucp_mchat';
|
$this->tpl_name = 'ucp_mchat';
|
||||||
$this->page_title = 'UCP_PROFILE_MCHAT';
|
$this->page_title = 'UCP_MCHAT_CONFIG';
|
||||||
|
|
||||||
// Get an instance of the UCP controller and display the options
|
// Get an instance of the UCP controller and display the options
|
||||||
$controller = $phpbb_container->get('dmzx.mchat.ucp.controller');
|
$controller = $phpbb_container->get('dmzx.mchat.ucp.controller');
|
||||||
|
|||||||
Reference in New Issue
Block a user