17 Commits

Author SHA1 Message Date
dmzx
233dc89a8a Version 2.0.0-RC6 2016-09-20 22:38:19 +02:00
dmzx
aac8ce6f58 Travis 2016-06-12 13:00:35 +02:00
dmzx
13a8dc2162 Fixed posts not being displayed 2016-04-07 21:13:46 +02:00
dmzx
46380fea08 Update 2016-04-05 19:27:59 +02:00
dmzx
b9a1b38d8c Update 2016-04-05 19:25:07 +02:00
dmzx
172b9734f1 Update 2016-04-05 19:21:38 +02:00
dmzx
78a25e8ab3 Update 2016-04-05 19:18:00 +02:00
dmzx
2c6f1a8990 Update 2016-04-05 19:14:59 +02:00
dmzx
19b96ea4ba 2.0.0-RC5 2016-04-04 22:38:34 +02:00
dmzx
b89c3bec93 Version 2.0.0-RC5 2016-04-04 22:33:08 +02:00
dmzx
3d34f58884 Version 2.0.0-RC5 2016-04-04 22:26:53 +02:00
dmzx
b5f716e448 Version 2.0.0-RC5 2016-04-04 22:17:37 +02:00
dmzx
0d71f9f3f7 Version 2.0.0-RC5 2016-04-04 22:08:48 +02:00
dmzx
1404928202 Version 2.0.0-RC4 2016-04-02 11:49:54 +02:00
dmzx
ca5bcaa947 Version 2.0.0-RC4 2016-04-02 11:36:20 +02:00
dmzx
91dfd6d9fc Merge pull request #45 from jakubsuchybio/master
Fix issue #44 - Replace event for pbtech style from index_body_markforums_before to index_body_markforums_after
2016-03-26 13:10:09 +01:00
jakubsuchybio
463e7b37a9 Fix issue #44 - Replace event for pbtech style from index_body_markforums_before to index_body_markforums_after 2016-03-26 12:19:10 +01:00
80 changed files with 3251 additions and 1696 deletions

View File

@@ -1,13 +1,9 @@
sudo: required
language: php language: php
matrix: matrix:
include: include:
- php: 5.4 - php: 5.4
env: DB=none;NOTESTS=1 env: DB=mysqli
- php: 5.4
env: DB=mysqli #myisam
- php: 5.4 - php: 5.4
env: DB=mysql env: DB=mysql
- php: 5.4 - php: 5.4
@@ -20,12 +16,9 @@ matrix:
env: DB=mysqli env: DB=mysqli
- php: 5.6 - php: 5.6
env: DB=mysqli env: DB=mysqli
- php: 7.0
env: DB=mysqli
- php: hhvm - php: hhvm
env: DB=mysqli env: DB=mysqli
allow_failures: allow_failures:
- php: 7.0
- php: hhvm - php: hhvm
fast_finish: true fast_finish: true
@@ -34,8 +27,8 @@ env:
- EXTNAME="dmzx/mChat-Extension" # CHANGE name of the extension HERE - EXTNAME="dmzx/mChat-Extension" # CHANGE name of the extension HERE
- SNIFF="1" # Should we run code sniffer on your code? - SNIFF="1" # Should we run code sniffer on your code?
- IMAGE_ICC="0" # Should we run icc profile sniffer on your images? - IMAGE_ICC="0" # Should we run icc profile sniffer on your images?
- EPV="0" # Should we run EPV (Extension Pre Validator) on your code? - EPV="1" # Should we run EPV (Extension Pre Validator) on your code?
- PHPBB_BRANCH="develop-ascraeus" - PHPBB_BRANCH="3.1.x"
branches: branches:
only: only:
@@ -61,7 +54,7 @@ before_script:
- travis/setup-database.sh $DB $TRAVIS_PHP_VERSION - travis/setup-database.sh $DB $TRAVIS_PHP_VERSION
script: script:
- sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME $NOTESTS; fi" - sh -c "if [ '$SNIFF' != '0' ]; then travis/ext-sniff.sh $DB $TRAVIS_PHP_VERSION $EXTNAME; fi"
- sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION $NOTESTS; fi" - sh -c "if [ '$IMAGE_ICC' != '0' ]; then travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION; 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" - phpBB/vendor/bin/phpunit --configuration phpBB/ext/$EXTNAME/travis/phpunit-$DB-travis.xml --bootstrap ./tests/bootstrap.php
- sh -c "if [ '$EPV' != '0' ] && [ '$NOTESTS' = '1' ]; then phpBB/ext/$EXTNAME/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi" - sh -c "if [ '$EPV' != '0' ] && [ '$TRAVIS_PHP_VERSION' = '5.3.3' ] && [ '$DB' = 'mysqli' ]; then phpBB/ext/$EXTNAME/vendor/bin/EPV.php run --dir='phpBB/ext/$EXTNAME/'; fi"

View File

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

View File

@@ -12,189 +12,204 @@
<!-- 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> <dl>
<span>{L_MCHAT_PURGE_CONFIRM}{L_COLON}</span> <dt><label for="mchat_index_height">{L_MCHAT_INDEX_HEIGHT}{L_COLON}</label><br />
<p class="submit-buttons"> <span>{L_MCHAT_INDEX_HEIGHT_EXPLAIN}</span></dt>
<input class="button1" type="submit" name="mchat_purge_confirm" value="{L_YES}" />&nbsp; <dd><input type="text" name="mchat_index_height" id="mchat_index_height" size="10" maxlength="4" value="{MCHAT_INDEX_HEIGHT}" /></dd>
<input class="button2" type="submit" value="{L_NO}" /> </dl>
{S_FORM_TOKEN} <dl>
</p> <dt><label for="mchat_message_num_index">{L_MCHAT_MESSAGE_NUM_INDEX}{L_COLON}</label><br />
</fieldset> <span>{L_MCHAT_MESSAGE_NUM_INDEX_EXPLAIN}</span></dt>
<!-- ELSE --> <dd><input type="text" name="mchat_message_num_index" id="mchat_message_num_index" size="10" maxlength="4" value="{MCHAT_MESSAGE_NUM_INDEX}" /></dd>
<fieldset> </dl>
<legend>{L_MCHAT_SETTINGS_INDEX}</legend> </fieldset>
<dl> <!-- EVENT acp_dmzx_mchat_globalsettings_index_after -->
<dt><label for="mchat_index_height">{L_MCHAT_INDEX_HEIGHT}{L_COLON}</label><br /> <fieldset>
<span>{L_MCHAT_INDEX_HEIGHT_EXPLAIN}</span></dt> <legend>{L_MCHAT_SETTINGS_CUSTOM}</legend>
<dd><input type="text" name="mchat_index_height" id="mchat_index_height" size="10" maxlength="4" value="{MCHAT_INDEX_HEIGHT}" /></dd> <dl>
</dl> <dt><label for="mchat_custom_page">{L_MCHAT_CUSTOM_PAGE}{L_COLON}</label><br />
<dl> <span>{L_MCHAT_CUSTOM_PAGE_EXPLAIN}</span></dt>
<dt><label for="mchat_message_num_index">{L_MCHAT_MESSAGE_NUM_INDEX}{L_COLON}</label><br /> <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>
<span>{L_MCHAT_MESSAGE_NUM_INDEX_EXPLAIN}</span></dt> <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>
<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>
</dl> <dl>
</fieldset> <dt><label for="mchat_custom_height">{L_MCHAT_CUSTOM_HEIGHT}{L_COLON}</label><br />
<!-- EVENT acp_dmzx_mchat_globalsettings_index_after --> <span>{L_MCHAT_CUSTOM_HEIGHT_EXPLAIN}</span></dt>
<fieldset> <dd><input type="text" name="mchat_custom_height" id="mchat_custom_height" size="10" maxlength="4" value="{MCHAT_CUSTOM_HEIGHT}" /></dd>
<legend>{L_MCHAT_SETTINGS_CUSTOM}</legend> </dl>
<dl> <dl>
<dt><label for="mchat_custom_page">{L_MCHAT_CUSTOM_PAGE}{L_COLON}</label><br /> <dt><label for="mchat_message_num_custom">{L_MCHAT_MESSAGE_NUM_CUSTOM}{L_COLON}</label><br />
<span>{L_MCHAT_CUSTOM_PAGE_EXPLAIN}</span></dt> <span>{L_MCHAT_MESSAGE_NUM_CUSTOM_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><input type="text" name="mchat_message_num_custom" id="mchat_message_num_custom" size="10" value="{MCHAT_MESSAGE_NUM_CUSTOM}" /></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_navbar_link">{L_MCHAT_NAVBAR_LINK}{L_COLON}</label></dt>
<dt><label for="mchat_custom_height">{L_MCHAT_CUSTOM_HEIGHT}{L_COLON}</label><br /> <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>
<span>{L_MCHAT_CUSTOM_HEIGHT_EXPLAIN}</span></dt> <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>
<dd><input type="text" name="mchat_custom_height" id="mchat_custom_height" size="10" maxlength="4" value="{MCHAT_CUSTOM_HEIGHT}" /></dd> </dl>
</dl> <dl>
<dl> <dt><label for="mchat_navbar_link_count">{L_MCHAT_NAVBAR_LINK_COUNT}{L_COLON}</label></dt>
<dt><label for="mchat_message_num_custom">{L_MCHAT_MESSAGE_NUM_CUSTOM}{L_COLON}</label><br /> <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>
<span>{L_MCHAT_MESSAGE_NUM_CUSTOM_EXPLAIN}</span></dt> <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>
<dd><input type="text" name="mchat_message_num_custom" id="mchat_message_num_custom" size="10" value="{MCHAT_MESSAGE_NUM_CUSTOM}" /></dd> </dl>
</dl> </fieldset>
<dl> <fieldset>
<dt><label for="mchat_navbar_link">{L_MCHAT_NAVBAR_LINK}{L_COLON}</label></dt> <legend>{L_MCHAT_SETTINGS_ARCHIVE}</legend>
<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> <dl>
<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> <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>
</fieldset> <dd><input type="text" name="mchat_message_num_archive" id="mchat_message_num_archive" size="10" value="{MCHAT_MESSAGE_NUM_ARCHIVE}" /></dd>
<fieldset> </dl>
<legend>{L_MCHAT_SETTINGS_ARCHIVE}</legend> </fieldset>
<dl> <fieldset>
<dt><label for="mchat_message_num_archive">{L_MCHAT_MESSAGE_NUM_ARCHIVE}{L_COLON}</label><br /> <legend>{L_MCHAT_SETTINGS_MESSAGES}</legend>
<span>{L_MCHAT_MESSAGE_NUM_ARCHIVE_EXPLAIN}</span></dt> <dl>
<dd><input type="text" name="mchat_message_num_archive" id="mchat_message_num_archive" size="10" value="{MCHAT_MESSAGE_NUM_ARCHIVE}" /></dd> <dt><label for="mchat_timeout">{L_MCHAT_TIMEOUT}{L_COLON}</label><br />
</dl> <span>{L_MCHAT_TIMEOUT_EXPLAIN}</span></dt>
</fieldset> <dd><input type="text" name="mchat_timeout" id="mchat_timeout" size="10" maxlength="4" value="{MCHAT_TIMEOUT}" /></dd>
<fieldset> </dl>
<legend>{L_MCHAT_SETTINGS_MESSAGES}</legend> <dl>
<dl> <dt><label for="mchat_refresh">{L_MCHAT_REFRESH}{L_COLON}</label><br />
<dt><label for="mchat_timeout">{L_MCHAT_USER_TIMEOUT}{L_COLON}</label><br /> <span>{L_MCHAT_REFRESH_EXPLAIN}</span></dt>
<span>{L_MCHAT_TIMEOUT_EXPLAIN}</span></dt> <dd><input type="text" name="mchat_refresh" id="mchat_refresh" size="10" value="{MCHAT_REFRESH}" /></dd>
<dd><input type="text" name="mchat_timeout" id="mchat_timeout" size="10" maxlength="4" value="{MCHAT_TIMEOUT}" /></dd> </dl>
</dl> <dl>
<dl> <dt><label for="mchat_edit_delete_limit">{L_MCHAT_EDIT_DELETE_LIMIT}{L_COLON}</label><br />
<dt><label for="mchat_refresh">{L_MCHAT_REFRESH}{L_COLON}</label><br /> <span>{L_MCHAT_EDIT_DELETE_LIMIT_EXPLAIN}</span>
<span>{L_MCHAT_REFRESH_EXPLAIN}</span></dt> <dd><input type="text" name="mchat_edit_delete_limit" id="mchat_edit_delete_limit" size="10" value="{MCHAT_EDIT_DELETE_LIMIT}" /></dd>
<dd><input type="text" name="mchat_refresh" id="mchat_refresh" size="10" value="{MCHAT_REFRESH}" /></dd> </dl>
</dl> <dl>
<dl> <dt><label for="mchat_live_updates">{L_MCHAT_LIVE_UPDATES}{L_COLON}</label><br />
<dt><label for="mchat_edit_delete_limit">{L_MCHAT_EDIT_DELETE_LIMIT}{L_COLON}</label><br /> <span>{L_MCHAT_LIVE_UPDATES_EXPLAIN}</span></dt>
<span>{L_MCHAT_EDIT_DELETE_LIMIT_EXPLAIN}</span> <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>
<dd><input type="text" name="mchat_edit_delete_limit" id="mchat_edit_delete_limit" size="10" value="{MCHAT_EDIT_DELETE_LIMIT}" /></dd> <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>
<dl> <dl>
<dt><label for="mchat_live_updates">{L_MCHAT_LIVE_UPDATES}{L_COLON}</label><br /> <dt><label for="mchat_flood_time">{L_MCHAT_FLOOD_TIME}{L_COLON}</label><br />
<span>{L_MCHAT_LIVE_UPDATES_EXPLAIN}</span></dt> <span>{L_MCHAT_FLOOD_TIME_EXPLAIN}</span></dt>
<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> <dd><input type="text" name="mchat_flood_time" id="mchat_flood_time" size="10" value="{MCHAT_FLOOD_TIME}" /></dd>
<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> <dl>
<dl> <dt><label for="mchat_max_message_lngth">{L_MCHAT_MAX_MESSAGE_LENGTH}{L_COLON}</label><br />
<dt><label for="mchat_flood_time">{L_MCHAT_FLOOD_TIME}{L_COLON}</label><br /> <span>{L_MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN}</span></dt>
<span>{L_MCHAT_FLOOD_TIME_EXPLAIN}</span></dt> <dd><input type="text" name="mchat_max_message_lngth" id="mchat_max_message_lngth" size="10" value="{MCHAT_MAX_MESSAGE_LNGTH}" /></dd>
<dd><input type="text" name="mchat_flood_time" id="mchat_flood_time" size="10" value="{MCHAT_FLOOD_TIME}" /></dd> </dl>
</dl> <dl>
<dl> <dt><label for="mchat_override_min_post_chars">{L_MCHAT_OVERRIDE_MIN_POST_CHARS}{L_COLON}</label><br />
<dt><label for="mchat_max_message_lngth">{L_MCHAT_MAX_MESSAGE_LENGTH}{L_COLON}</label><br /> <span>{L_MCHAT_OVERRIDE_MIN_POST_CHARS_EXPLAIN}</span></dt>
<span>{L_MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN}</span></dt> <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>
<dd><input type="text" name="mchat_max_message_lngth" id="mchat_max_message_lngth" size="10" value="{MCHAT_MAX_MESSAGE_LNGTH}" /></dd> <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>
<dl> <dl>
<dt><label for="mchat_override_min_post_chars">{L_MCHAT_OVERRIDE_MIN_POST_CHARS}{L_COLON}</label><br /> <dt><label for="mchat_override_smilie_limit">{L_MCHAT_OVERRIDE_SMILIE_LIMIT}{L_COLON}</label><br />
<span>{L_MCHAT_OVERRIDE_MIN_POST_CHARS_EXPLAIN}</span></dt> <span>{L_MCHAT_OVERRIDE_SMILIE_LIMIT_EXPLAIN}</span></dt>
<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> <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_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> <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>
<dl> <dl>
<dt><label for="mchat_override_smilie_limit">{L_MCHAT_OVERRIDE_SMILIE_LIMIT}{L_COLON}</label><br /> <dt><label for="mchat_bbcode_disallowed">{L_MCHAT_BBCODES_DISALLOWED}{L_COLON}</label><br />
<span>{L_MCHAT_OVERRIDE_SMILIE_LIMIT_EXPLAIN}</span></dt> <span>{L_MCHAT_BBCODES_DISALLOWED_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> <dd><textarea name="mchat_bbcode_disallowed" id="mchat_bbcode_disallowed" rows="3" cols="40">{MCHAT_BBCODE_DISALLOWED}</textarea></dd>
<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> <dl>
<dl> <dt><label for="mchat_rules">{L_MCHAT_RULES}{L_COLON}</label><br />
<dt><label for="mchat_bbcode_disallowed">{L_MCHAT_BBCODES_DISALLOWED}{L_COLON}</label><br /> <span>{L_MCHAT_RULES_EXPLAIN}</span></dt>
<span>{L_MCHAT_BBCODES_DISALLOWED_EXPLAIN}</span></dt> <dd><textarea name="mchat_rules" id="mchat_rules" rows="5" cols="40">{MCHAT_RULES}</textarea></dd>
<dd><textarea name="mchat_bbcode_disallowed" id="mchat_bbcode_disallowed" rows="3" cols="40">{MCHAT_BBCODE_DISALLOWED}</textarea></dd> </dl>
</dl> <dl>
<dl> <dt><label for="mchat_static_message">{L_MCHAT_STATIC_MESSAGE}{L_COLON}</label><br />
<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>
<fieldset> <fieldset>
<legend>{L_MCHAT_SETTINGS_POSTS}</legend> <legend>{L_MCHAT_SETTINGS_POSTS}</legend>
<dl> <dl>
<dt><label for="mchat_posts_topic">{L_MCHAT_POSTS_TOPIC}{L_COLON}</label></dt> <dt><label for="mchat_posts_topic">{L_MCHAT_POSTS_TOPIC}{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 --><!-- IF MCHAT_POSTS_TOPIC_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label> <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_topic" value="0"<!-- IF not MCHAT_POSTS_TOPIC --> id="mchat_posts_topic" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_TOPIC_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label> <label><input type="radio" name="mchat_posts_topic" value="0"<!-- IF not MCHAT_POSTS_TOPIC --> id="mchat_posts_topic" checked="checked"<!-- 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_reply">{L_MCHAT_POSTS_REPLY}{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 --><!-- IF MCHAT_POSTS_REPLY_NOAUTH --> disabled<!-- 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 --> /> {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 --><!-- IF MCHAT_POSTS_REPLY_NOAUTH --> disabled<!-- 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 --> /> {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_edit">{L_MCHAT_POSTS_EDIT}{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 --><!-- IF MCHAT_POSTS_EDIT_NOAUTH --> disabled<!-- 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 --> /> {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 --><!-- IF MCHAT_POSTS_EDIT_NOAUTH --> disabled<!-- 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 --> /> {L_NO}</label>
</dd> </dd>
</dl> </dl>
<dl> <dl>
<dt><label for="mchat_posts_quote">{L_MCHAT_POSTS_QUOTE}{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_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_quote" value="1"<!-- IF MCHAT_POSTS_QUOTE --> id="mchat_posts_quote" checked="checked"<!-- ENDIF --> /> {L_YES}</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> <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>
</dd> </dd>
</dl> </dl>
</fieldset> <dl>
<fieldset> <dt><label for="mchat_posts_login">{L_MCHAT_POSTS_LOGIN}{L_COLON}</label></dt>
<legend>{L_MCHAT_SETTINGS_STATS}</legend> <dd>
<dl> <label><input type="radio" name="mchat_posts_login" value="1"<!-- IF MCHAT_POSTS_LOGIN --> id="mchat_posts_login" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<dt><label for="mchat_whois_refresh">{L_MCHAT_WHOIS_REFRESH}{L_COLON}</label><br /> <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>
</fieldset>
<fieldset>
<legend>{L_MCHAT_SETTINGS_STATS}</legend>
<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}" /></dd>
</dl> </dl>
</fieldset> </fieldset>
<fieldset> <!-- IF MCHAT_FOUNDER -->
<legend>{L_MCHAT_SETTINGS_PRUNE}</legend> <fieldset>
<dl> <legend>{L_MCHAT_SETTINGS_PRUNE}</legend>
<dt><label for="mchat_prune">{L_MCHAT_PRUNE}{L_COLON}</label><br /> <dl>
<span>{L_MCHAT_PRUNE_EXPLAIN}</span></dt> <dt><label for="mchat_prune">{L_MCHAT_PRUNE}{L_COLON}</label><br />
<dd><label><input type="radio" class="radio" name="mchat_prune" value="1"<!-- IF MCHAT_PRUNE --> id="mchat_prune" checked="checked"<!-- ENDIF --> /> {L_YES}</label> <span>{L_MCHAT_PRUNE_EXPLAIN}</span></dt>
<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> <dd><label><input type="radio" class="radio" name="mchat_prune" value="1"<!-- IF MCHAT_PRUNE --> id="mchat_prune" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
</dl> <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_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_num">{L_MCHAT_PRUNE_NUM}{L_COLON}</label><br />
</dl> <span>{L_MCHAT_PRUNE_NUM_EXPLAIN}</span></dt>
<!-- IF MCHAT_FOUNDER --> <dd><input type="text" name="mchat_prune_num" size="10" id="mchat_prune_num" value="{MCHAT_PRUNE_NUM}" /></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_now">{L_MCHAT_PRUNE_NOW}{L_COLON}</label></dt>
</dl> <dd>
<!-- ENDIF --> <input class="button1" type="submit" id="mchat_prune_now" name="mchat_prune_now" value="{L_MCHAT_PRUNE_NOW}" />
</fieldset> <label>{L_MCHAT_PRUNE_NOW_CONFIRM}{L_COLON}</label>
<!-- EVENT acp_dmzx_mchat_globalsettings_after --> <label><input type="radio" name="mchat_prune_now_confirm" value="1" /> {L_YES}</label>
<p class="submit-buttons"> <label><input type="radio" name="mchat_prune_now_confirm" value="0" id="mchat_prune_now_confirm" checked="checked" /> {L_NO}</label>
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; </dd>
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> </dl>
{S_FORM_TOKEN} <dl>
</p> <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>
</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}" />&nbsp;
<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 -->

View File

@@ -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 acp_mchat_globalusersettings_content.html -->
</fieldset> </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>
<p class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<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>

View File

@@ -1,45 +1,42 @@
{ {
"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-RC6",
"time": "2016-03-24", "time": "2016-09-18",
"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.7-PL1,<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.7-PL1,<3.3.0@dev"
},
"version-check": {
"host": "www.dmzx-web.net",
"directory": "/versions",
"filename": "mchat_version.json"
} }
} }
} }

View File

@@ -1,174 +0,0 @@
parameters:
# Global settings that only the administrator is allowed to modify.
# The values are stored in the phpbb_config table and can be
# accessed using the \phpbb\config\config $config class.
dmzx.mchat.config_global:
mchat_bbcode_disallowed:
default: ''
validation:
- 'string'
- false
- 0
- 255
mchat_custom_height:
default: 350
validation:
- 'num'
- false
- 50
- 1000
mchat_custom_page:
default: 1
mchat_edit_delete_limit:
default: 0
mchat_flood_time:
default: 0
validation:
- 'num'
- false
- 0
- 60
mchat_index_height:
default: 250
validation:
- 'num'
- false
- 50
- 1000
mchat_live_updates:
default: 1
mchat_max_message_lngth:
default: 500
validation:
- 'num'
- false
- 0
- 1000
mchat_message_num_archive:
default: 25
validation:
- 'num'
- false
- 10
- 100
mchat_message_num_custom:
default: 10
validation:
- 'num'
- false
- 5
- 50
mchat_message_num_index:
default: 10
validation:
- 'num'
- false
- 5
- 50
mchat_navbar_link:
default: 1
mchat_override_min_post_chars:
default: 0
mchat_override_smilie_limit:
default: 0
mchat_posts_edit:
default: 0
mchat_posts_quote:
default: 0
mchat_posts_reply:
default: 0
mchat_posts_topic:
default: 0
mchat_prune:
default: 0
mchat_prune_num:
default: 0
mchat_refresh:
default: 10
validation:
- 'num'
- false
- 5
- 60
mchat_rules:
default: ''
validation:
- 'string'
- false
- 0
- 255
mchat_static_message:
default: ''
validation:
- 'string'
- false
- 0
- 255
mchat_timeout:
default: 0
validation:
- 'num'
- false
- 0
- -1 # This value is replaced with $config['session_length'] in the \dmzx\mchat\core\settings class
mchat_whois:
default: 1
mchat_whois_refresh:
default: 60
validation:
- 'num'
- false
- 10
- 300
# User-specific settings for which the administrator can set default
# values as well as adjust permissions to allow users to customize them.
# For each setting a new column is added to the phpbb_users table.
dmzx.mchat.config_ucp:
mchat_avatars:
default: 1
type: 'BOOL'
mchat_capital_letter:
default: 1
type: 'BOOL'
mchat_character_count:
default: 1
type: 'BOOL'
mchat_date:
default: 'D M d, Y g:i a'
type: 'VCHAR:64'
validation:
- 'string'
- false
- 0
- 64
mchat_index:
default: 1
type: 'BOOL'
mchat_input_area:
default: 1
type: 'BOOL'
mchat_location:
default: 1
type: 'BOOL'
mchat_message_top:
default: 1
type: 'BOOL'
mchat_pause_on_input:
default: 0
type: 'BOOL'
mchat_posts:
default: 1
type: 'BOOL'
mchat_relative_time:
default: 1
type: 'BOOL'
mchat_sound:
default: 1
type: 'BOOL'
mchat_stats_index:
default: 0
type: 'BOOL'
mchat_whois_index:
default: 1
type: 'BOOL'

View File

@@ -1,16 +1,37 @@
dmzx_mchat_controller: dmzx_mchat_page_custom_controller:
path: /mchat path: /mchat
methods: [GET] methods: [GET]
defaults: { _controller: dmzx.mchat.main.controller:page, page: custom } defaults: { _controller: dmzx.mchat.core:page_custom }
dmzx_mchat_page_controller: dmzx_mchat_page_archive_controller:
path: /mchat/{page} path: /mchat/archive
methods: [GET] methods: [GET]
defaults: { _controller: dmzx.mchat.main.controller:page } defaults: { _controller: dmzx.mchat.core:page_archive }
requirements: dmzx_mchat_page_rules_controller:
page: 'archive|rules|whois' path: /mchat/rules
dmzx_mchat_action_controller: methods: [GET]
path: /mchat/action-{action} defaults: { _controller: dmzx.mchat.core:page_rules }
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 }

View File

@@ -1,11 +1,11 @@
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'
@@ -14,7 +14,7 @@ services:
- '@request' - '@request'
- '@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:
@@ -28,12 +28,6 @@ services:
- '@dmzx.mchat.settings' - '@dmzx.mchat.settings'
- '%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 +43,7 @@ services:
- '@ext.manager' - '@ext.manager'
- '%core.root_path%' - '%core.root_path%'
- '%core.php_ext%' - '%core.php_ext%'
- '@?phpbb.collapsiblecategories.operator'
dmzx.mchat.functions: dmzx.mchat.functions:
class: dmzx\mchat\core\functions class: dmzx\mchat\core\functions
arguments: arguments:
@@ -58,10 +53,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 +65,6 @@ services:
- '@user' - '@user'
- '@config' - '@config'
- '@auth' - '@auth'
- '%dmzx.mchat.config_global%'
- '%dmzx.mchat.config_ucp%'
dmzx.mchat.acp.listener: dmzx.mchat.acp.listener:
class: dmzx\mchat\event\acp_listener class: dmzx\mchat\event\acp_listener
arguments: arguments:
@@ -88,6 +82,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 }

View File

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

View File

@@ -13,6 +13,9 @@ namespace dmzx\mchat\controller;
class acp_controller class acp_controller
{ {
/** @var \dmzx\mchat\core\functions */
protected $functions;
/** @var \phpbb\template\template */ /** @var \phpbb\template\template */
protected $template; protected $template;
@@ -38,7 +41,7 @@ class acp_controller
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,6 +52,7 @@ class acp_controller
/** /**
* Constructor * Constructor
* *
* @param \dmzx\mchat\core\functions $functions
* @param \phpbb\template\template $template * @param \phpbb\template\template $template
* @param \phpbb\log\log_interface $log * @param \phpbb\log\log_interface $log
* @param \phpbb\user $user * @param \phpbb\user $user
@@ -57,23 +61,24 @@ class acp_controller
* @param \phpbb\request\request $request * @param \phpbb\request\request $request
* @param \dmzx\mchat\core\settings $settings * @param \dmzx\mchat\core\settings $settings
* @param string $mchat_table * @param string $mchat_table
* @param string $mchat_deleted_messages_table * @param string $mchat_log_table
* @param string $root_path * @param string $root_path
* @param string $php_ext * @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(\dmzx\mchat\core\functions $functions, \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_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->settings = $settings;
$this->mchat_deleted_messages_table = $mchat_deleted_messages_table; $this->mchat_table = $mchat_table;
$this->root_path = $root_path; $this->mchat_log_table = $mchat_log_table;
$this->php_ext = $php_ext; $this->root_path = $root_path;
$this->php_ext = $php_ext;
} }
/** /**
@@ -87,22 +92,9 @@ 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();
@@ -117,6 +109,13 @@ 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_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);
@@ -147,17 +146,34 @@ class acp_controller
$error = array_map(array($this->user, 'lang'), $error); $error = array_map(array($this->user, 'lang'), $error);
} }
if (!$error)
{
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));
}
}
foreach (array_keys($this->settings->global) as $key) foreach (array_keys($this->settings->global) as $key)
{ {
$this->template->assign_var(strtoupper($key), $this->settings->cfg($key)); $this->template->assign_var(strtoupper($key), $this->settings->cfg($key));
} }
$this->template->assign_vars(array( $this->template->assign_vars(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,
'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&amp;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&amp;mode=load', true, $this->user->session_id) . '">', '</a>', $this->settings->cfg('session_length')),
'U_ACTION' => $u_action, 'U_ACTION' => $u_action,
)); ));
} }
@@ -203,6 +219,18 @@ class acp_controller
if (!$error) if (!$error)
{ {
if ($this->request->variable('mchat_overwrite', 0) && $this->request->variable('mchat_overwrite_confirm', 0))
{
$mchat_new_user_config = array();
foreach ($mchat_new_config as $config_name => $config_value)
{
$mchat_new_user_config['user_' . $config_name] = $config_value;
}
$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)
{ {
@@ -233,9 +261,9 @@ class acp_controller
$this->template->assign_var('MCHAT_POSTS_ENABLED_LANG', $notifications_template_data); $this->template->assign_var('MCHAT_POSTS_ENABLED_LANG', $notifications_template_data);
$this->template->assign_vars(array( $this->template->assign_vars(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'),
'U_ACTION' => $u_action, 'U_ACTION' => $u_action,
)); ));
} }
} }

View File

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

View File

@@ -31,6 +31,9 @@ class functions
/** @var \phpbb\cache\driver\driver_interface */ /** @var \phpbb\cache\driver\driver_interface */
protected $cache; protected $cache;
/** @var \phpbb\event\dispatcher_interface */
protected $dispatcher;
/** @var string */ /** @var string */
protected $root_path; protected $root_path;
@@ -41,13 +44,28 @@ 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
@@ -58,25 +76,27 @@ class functions
* @param \phpbb\log\log_interface $log * @param \phpbb\log\log_interface $log
* @param \phpbb\db\driver\driver_interface $db * @param \phpbb\db\driver\driver_interface $db
* @param \phpbb\cache\driver\driver_interface $cache * @param \phpbb\cache\driver\driver_interface $cache
* @param \phpbb\event\dispatcher_interface $dispatcher
* @param string $root_path * @param string $root_path
* @param string $php_ext * @param string $php_ext
* @param string $mchat_table * @param string $mchat_table
* @param string $mchat_deleted_messages_table * @param string $mchat_log_table
* @param string $mchat_sessions_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(\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, \phpbb\event\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 +135,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 +161,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 +214,146 @@ 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')) $sql_aray = array(
'SELECT' => 'message_id',
'FROM' => array($this->mchat_table => 'm'),
);
$prune_num = $this->settings->cfg('mchat_prune_num');
if (ctype_digit($prune_num))
{ {
$mchat_total_messages = $this->mchat_total_message_count(); // Retain fixed number of messages
$offset = $prune_num;
if ($mchat_total_messages > $this->settings->cfg('mchat_prune_num')) $sql_aray['ORDER_BY'] = 'message_id DESC';
{
$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);
}
} }
else
{
// Retain messages of a time period
$time_period = strtotime($prune_num, 0);
if ($time_period === false)
{
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_MCHAT_TABLE_PRUNE_FAIL', false, array($this->user->data['username']));
return false;
}
$offset = 0;
$sql_aray['WHERE'] = 'message_time < ' . (int) (time() - $time_period);
}
$sql = $this->db->sql_build_query('SELECT', $sql_aray);
$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 +363,116 @@ class functions
*/ */
public function mchat_total_message_count() public function mchat_total_message_count()
{ {
return $this->db->get_row_count($this->mchat_table); $sql_array = array(
'SELECT' => 'COUNT(*) AS rows_total',
'FROM' => array($this->mchat_table => 'm'),
);
/**
* 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 = $sql_where_message_id ? array(implode(' OR ', $sql_where_message_id)) : 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';
} }
$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 +490,59 @@ class functions
return $rows; return $rows;
} }
/**
* 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 +552,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 +602,61 @@ 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)
{
$foes[] = $row['zebra_id'];
}
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)
{
// Skip deleted posts
if (isset($row['post_subject']))
{ {
$this->foes[] = $row['zebra_id']; $post_subjects[$row['post_id']] = array(
'post_subject' => $row['post_subject'],
'forum_name' => $row['forum_name'],
);
} }
} }
return $this->foes; return $post_subjects;
} }
/** /**
@@ -405,43 +680,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 +774,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 +785,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;
}
} }

File diff suppressed because it is too large Load Diff

View File

@@ -13,11 +13,6 @@ namespace dmzx\mchat\core;
class settings class settings
{ {
const VALIDATE_TYPE = 0;
const VALIDATE_IS_OPTIONAL = 1;
const VALIDATE_MIN_VALUE = 2;
const VALIDATE_MAX_VALUE = 3;
/** @var \phpbb\user */ /** @var \phpbb\user */
protected $user; protected $user;
@@ -27,10 +22,23 @@ class settings
/** @var \phpbb\auth\auth */ /** @var \phpbb\auth\auth */
protected $auth; protected $auth;
/** @var array */ /**
* Keys for global settings that only the administrator is allowed to modify.
* The values are stored in the phpbb_config table.
*
* @var array
*/
public $global; public $global;
/** @var array */ /**
* 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
*/
public $ucp; public $ucp;
/** @var bool */ /** @var bool */
@@ -45,30 +53,62 @@ class settings
* @param \phpbb\user $user * @param \phpbb\user $user
* @param \phpbb\config\config $config * @param \phpbb\config\config $config
* @param \phpbb\auth\auth $auth * @param \phpbb\auth\auth $auth
* @param array $global
* @param array $ucp
*/ */
public function __construct(\phpbb\user $user, \phpbb\config\config $config, \phpbb\auth\auth $auth, $global, $ucp) public function __construct(\phpbb\user $user, \phpbb\config\config $config, \phpbb\auth\auth $auth)
{ {
$this->user = $user; $this->user = $user;
$this->config = $config; $this->config = $config;
$this->auth = $auth; $this->auth = $auth;
$this->global = $global;
$this->ucp = $ucp;
$this->is_phpbb31 = phpbb_version_compare($config['version'], '3.1.0@dev', '>=') && phpbb_version_compare($config['version'], '3.2.0@dev', '<'); $this->global = array(
$this->is_phpbb32 = phpbb_version_compare($config['version'], '3.2.0@dev', '>=') && phpbb_version_compare($config['version'], '3.3.0@dev', '<'); '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_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)),
);
$this->inject_core_config_values(); $this->ucp = 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),
);
/** $this->is_phpbb31 = phpbb_version_compare(PHPBB_VERSION, '3.1.0@dev', '>=') && phpbb_version_compare(PHPBB_VERSION, '3.2.0@dev', '<');
* Writes phpBB config values into the mChat config for validating input data $this->is_phpbb32 = phpbb_version_compare(PHPBB_VERSION, '3.2.0@dev', '>=') && phpbb_version_compare(PHPBB_VERSION, '3.3.0@dev', '<');
*/
protected function inject_core_config_values()
{
// Limit mChat session timeout to phpBB session length
$this->global['mchat_timeout']['validation'][self::VALIDATE_MAX_VALUE] = (int) $this->cfg('session_length');
} }
/** /**
@@ -101,10 +141,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);
}
} }
/** /**
@@ -146,7 +194,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))
{ {

67
cron/mchat_prune.php Normal file
View File

@@ -0,0 +1,67 @@
<?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\cron;
class mchat_prune extends \phpbb\cron\task\base
{
/** @var \dmzx\mchat\core\functions */
protected $functions;
/** @var \dmzx\mchat\core\settings */
protected $settings;
/**
* Constructor
*
* @param \dmzx\mchat\core\functions $functions
* @param \dmzx\mchat\core\settings $settings
*/
public function __construct(\dmzx\mchat\core\functions $functions, \dmzx\mchat\core\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');
}
}

View File

@@ -11,6 +11,7 @@
namespace dmzx\mchat\event; namespace dmzx\mchat\event;
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
@@ -66,11 +67,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) as $config_name)
{
$ucp_configs[] = 'u_' . $config_name;
}
$permission_categories = array( $permission_categories = array(
'mchat' => array( 'mchat' => array(
@@ -78,6 +84,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 +97,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 +117,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)
{ {
@@ -150,11 +160,11 @@ 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'];

View File

@@ -11,6 +11,7 @@
namespace dmzx\mchat\event; namespace dmzx\mchat\event;
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
@@ -24,6 +25,9 @@ class main_listener implements EventSubscriberInterface
/** @var \phpbb\user */ /** @var \phpbb\user */
protected $user; protected $user;
/** @var \phpbb\request\request */
protected $request;
/** @var string */ /** @var string */
protected $php_ext; protected $php_ext;
@@ -33,14 +37,16 @@ class main_listener implements EventSubscriberInterface
* @param \dmzx\mchat\core\mchat $mchat * @param \dmzx\mchat\core\mchat $mchat
* @param \phpbb\controller\helper $helper * @param \phpbb\controller\helper $helper
* @param \phpbb\user $user * @param \phpbb\user $user
* @param \phpbb\request\request $request
* @param string $php_ext * @param string $php_ext
*/ */
public function __construct(\dmzx\mchat\core\mchat $mchat, \phpbb\controller\helper $helper, \phpbb\user $user, $php_ext) public function __construct(\dmzx\mchat\core\mchat $mchat, \phpbb\controller\helper $helper, \phpbb\user $user, \phpbb\request\request $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 +59,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 +95,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 +105,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 +113,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();
}
} }

71
ext.php
View File

@@ -22,6 +22,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');
// 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($config['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&amp;mode=main'));
trigger_error($error_msg, E_USER_WARNING);
}
}
return phpbb_version_compare($config['version'], '3.1.7-PL1', '>='); return phpbb_version_compare($config['version'], '3.1.7-PL1', '>=');
} }
/**
* 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;
}
} }

View File

@@ -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(
@@ -63,4 +64,5 @@ $lang = array_merge($lang, array(
'MCHAT_NEW_REPLY' => 'posted a reply: %1$s in %2$s', 'MCHAT_NEW_REPLY' => 'posted a reply: %1$s in %2$s',
'MCHAT_NEW_QUOTE' => 'replied with a quote: %1$s in %2$s', 'MCHAT_NEW_QUOTE' => 'replied with a quote: %1$s in %2$s',
'MCHAT_NEW_EDIT' => 'edited a post: %1$s in %2$s', 'MCHAT_NEW_EDIT' => 'edited a post: %1$s in %2$s',
'MCHAT_NEW_LOGIN' => 'just logged in',
)); ));

View File

@@ -36,17 +36,16 @@ 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_PRUNE_FAIL' => '<strong>mChat pruning failed: invalid time period</strong><br />» %1$s',
'LOG_DELETED_MCHAT' => '<strong>mChat message deleted</strong><br />» %1$s', 'LOG_MCHAT_TABLE_PURGED' => '<strong>mChat messages purged</strong><br />» %1$s',
'LOG_EDITED_MCHAT' => '<strong>mChat message edited</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',
)); ));

View File

@@ -40,23 +40,22 @@ $lang = array_merge($lang, array(
'MCHAT_ARCHIVE_PAGE' => 'mChat Archive', 'MCHAT_ARCHIVE_PAGE' => 'mChat Archive',
'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 dont have permission to post in the chat', 'MCHAT_NOACCESS_ARCHIVE' => 'You dont have permission to view the archive.',
'MCHAT_NOACCESS_ARCHIVE' => 'You dont have permission to view the archive', 'MCHAT_NOJAVASCRIPT' => 'Please enable JavaScript to use mChat.',
'MCHAT_NOJAVASCRIPT' => 'Your browser does not support JavaScript or JavaScript is disabled',
'MCHAT_NOMESSAGE' => 'No messages', 'MCHAT_NOMESSAGE' => 'No messages',
'MCHAT_NOMESSAGEINPUT' => 'You have not entered a message', 'MCHAT_NOMESSAGEINPUT' => 'You have not entered a message',
'MCHAT_OK' => 'OK', 'MCHAT_OK' => 'OK',
@@ -66,12 +65,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 +78,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}',

View File

@@ -36,95 +36,107 @@ 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 users settings.', 'MCHAT_GLOBALUSERSETTINGS_EXPLAIN' => 'Settings for which a user does <strong>not</strong> have permission to customise are applied as configured below.<br />New user accounts will have initial settings as configured below.<br /><br />Go to the <em>mChat in UCP</em> tab of the user permissions section to adjust customisation permissions.<br />Go to the <em>Preferences</em> form in the <em>user management</em> section to see the status of each users 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_GLOBALSETTINGS_TITLE' => 'mChat Global settings',
'MCHAT_ACP_GLOBALUSERSETTINGS_TITLE' => 'mChat Global user settings', 'MCHAT_ACP_GLOBALUSERSETTINGS_TITLE' => 'mChat Global user settings',
'MCHAT_VERSION' => 'Version', 'MCHAT_VERSION' => 'Version',
'MCHAT_RULES' => 'Rules', 'MCHAT_RULES' => 'Rules',
'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_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_CONFIG_SAVED' => 'mChat configuration has been updated', 'MCHAT_CONFIG_SAVED' => 'mChat configuration has been updated',
'MCHAT_AVATARS' => 'Display avatars', 'MCHAT_AVATARS' => 'Display avatars',
'MCHAT_AVATARS_EXPLAIN' => 'If set to yes, resized user avatars will be displayed', 'MCHAT_AVATARS_EXPLAIN' => 'If set to yes, resized user avatars will be displayed',
'MCHAT_INDEX' => 'Display mChat on the index page', 'MCHAT_INDEX' => 'Display mChat on the index page',
'MCHAT_INDEX_HEIGHT' => 'Index page height', 'MCHAT_INDEX_HEIGHT' => 'Index page height',
'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_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_TOP_OF_FORUM' => 'Top', 'MCHAT_TOP_OF_FORUM' => 'Top',
'MCHAT_BOTTOM_OF_FORUM' => 'Bottom', 'MCHAT_BOTTOM_OF_FORUM' => 'Bottom',
'MCHAT_REFRESH' => 'Refresh interval', 'MCHAT_REFRESH' => 'Refresh interval',
'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_REFRESH_EXPLAIN' => 'Number of seconds before the chat refreshes.<br /><em>You are limited from 5 to 60 seconds. Default is 10.</em>',
'MCHAT_LIVE_UPDATES' => 'Live updates of edited and deleted messages', 'MCHAT_LIVE_UPDATES' => 'Live updates of edited and deleted messages',
'MCHAT_LIVE_UPDATES_EXPLAIN' => 'When a user edits or deletes messages, the changes are updated live for all others, without them having to refresh the page. Disable this if you experience performance issues.', 'MCHAT_LIVE_UPDATES_EXPLAIN' => 'When a user edits or deletes messages, the changes are updated live for all others, without them having to refresh the page. Disable this if you experience performance issues.',
'MCHAT_PRUNE' => 'Enable message pruning', 'MCHAT_PRUNE' => 'Enable message pruning',
'MCHAT_PRUNE_EXPLAIN' => 'Only occurs if a user views the custom or archive pages.', 'MCHAT_PRUNE_EXPLAIN' => 'The messages table is pruned every 24 hours.',
'MCHAT_PRUNE_NUM' => 'Number of messages to retain when pruning', 'MCHAT_PRUNE_NUM' => 'Messages to retain when pruning',
'MCHAT_NAVBAR_LINK' => 'Display link to the custom page in the navbar', 'MCHAT_PRUNE_NUM_EXPLAIN' => 'You can specify either a number to keep a fixed number of messages (example: <em>42</em>) or a time period (examples: <em>24 hours</em>, <em>5 days</em>, <em>2 weeks</em>, <em>1 month</em>). All messages older than the time period at the time of pruning will be deleted.',
'MCHAT_MESSAGE_NUM_CUSTOM' => 'Initial number of messages to display on the custom page', 'MCHAT_PRUNE_NOW' => 'Prune messages now',
'MCHAT_MESSAGE_NUM_CUSTOM_EXPLAIN' => '<em>You are limited from 5 to 50. Default is 10.</em>', 'MCHAT_PRUNE_NOW_CONFIRM' => 'Confirm pruning messages',
'MCHAT_MESSAGE_NUM_INDEX' => 'Initial number of messages to display on the index page', 'MCHAT_PRUNED' => '%1$d mChat messages have been pruned',
'MCHAT_MESSAGE_NUM_INDEX_EXPLAIN' => '<em>You are limited from 5 to 50. Default is 10.</em>', 'MCHAT_NAVBAR_LINK' => 'Display link to the custom page in the navbar',
'MCHAT_MESSAGE_NUM_ARCHIVE' => 'Number of messages to display on the archive page', 'MCHAT_NAVBAR_LINK_COUNT' => 'Display number of active chat sessions in navbar link',
'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_MESSAGE_NUM_CUSTOM' => 'Initial number of messages to display on the custom page',
'MCHAT_FLOOD_TIME' => 'Flood time', 'MCHAT_MESSAGE_NUM_CUSTOM_EXPLAIN' => '<em>You are limited from 5 to 50. Default is 10.</em>',
'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_MESSAGE_NUM_INDEX' => 'Initial number of messages to display on the index page',
'MCHAT_EDIT_DELETE_LIMIT' => 'Time limit for editing and deleting messages', 'MCHAT_MESSAGE_NUM_INDEX_EXPLAIN' => '<em>You are limited from 5 to 50. Default is 10.</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_MESSAGE_NUM_ARCHIVE' => 'Number of messages to display on the archive page',
'MCHAT_MAX_MESSAGE_LENGTH' => 'Maximum message length', '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_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_FLOOD_TIME' => 'Flood time',
'MCHAT_CUSTOM_PAGE' => 'Enable custom Page', '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_CUSTOM_PAGE_EXPLAIN' => 'Allow the use of the custom page', 'MCHAT_EDIT_DELETE_LIMIT' => 'Time limit for editing and deleting messages',
'MCHAT_CUSTOM_HEIGHT' => 'Custom page height', '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_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_MAX_MESSAGE_LENGTH' => 'Maximum message length',
'MCHAT_BBCODES_DISALLOWED' => 'Disallowed bbcodes', '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_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_CUSTOM_PAGE' => 'Enable custom Page',
'MCHAT_STATIC_MESSAGE' => 'Static message', 'MCHAT_CUSTOM_PAGE_EXPLAIN' => 'Allow the use of the custom page',
'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_CUSTOM_HEIGHT' => 'Custom page height',
'MCHAT_USER_TIMEOUT' => 'User session timeout', '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_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_BBCODES_DISALLOWED' => 'Disallowed bbcodes',
'MCHAT_OVERRIDE_SMILIE_LIMIT' => 'Override smilie limit', '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_OVERRIDE_SMILIE_LIMIT_EXPLAIN' => 'Set to yes to override the forums smilie limit setting for chat messages', 'MCHAT_STATIC_MESSAGE' => 'Static message',
'MCHAT_OVERRIDE_MIN_POST_CHARS' => 'Override minimum characters limit', '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_OVERRIDE_MIN_POST_CHARS_EXPLAIN' => 'Set to yes to override the forums minimum characters setting for chat messages', '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',
)); ));

View File

@@ -51,7 +51,7 @@ $lang = array_merge($lang, array(
'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_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.',

View File

@@ -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 anyones messages',
'ACL_U_MCHAT_MODERATOR_DELETE' => 'Can delete anyones messages',
'ACL_U_MCHAT_IP' => 'Can view IP addresses', 'ACL_U_MCHAT_IP' => 'Can view IP addresses',
'ACL_U_MCHAT_PM' => 'Can use private message', 'ACL_U_MCHAT_PM' => 'Can use private message',
'ACL_U_MCHAT_LIKE' => 'Can like messages', 'ACL_U_MCHAT_LIKE' => 'Can 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>',

View File

@@ -13,56 +13,59 @@ namespace dmzx\mchat\migrations;
class mchat_2_0_0_rc3 extends \phpbb\db\migration\migration class mchat_2_0_0_rc3 extends \phpbb\db\migration\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 +82,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 +156,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 +182,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 +197,53 @@ class mchat_2_0_0_rc3 extends \phpbb\db\migration\migration
), ),
), ),
'add_columns' => array( 'add_columns' => array(
$this->table_prefix . 'users' => $user_columns, $this->table_prefix . 'users' => array(
'user_mchat_avatars' => array('BOOL', 1),
'user_mchat_capital_letter' => array('BOOL', 1),
'user_mchat_character_count' => array('BOOL', 1),
'user_mchat_date' => array('VCHAR:64', 'D M d, Y g:i a'),
'user_mchat_index' => array('BOOL', 1),
'user_mchat_input_area' => array('BOOL', 1),
'user_mchat_location' => array('BOOL', 1),
'user_mchat_message_top' => array('BOOL', 1),
'user_mchat_pause_on_input' => array('BOOL', 0),
'user_mchat_posts' => array('BOOL', 1),
'user_mchat_relative_time' => array('BOOL', 1),
'user_mchat_sound' => array('BOOL', 1),
'user_mchat_stats_index' => array('BOOL', 0),
'user_mchat_whois_index' => array('BOOL', 1),
),
), ),
); );
} }
public function revert_schema() public function revert_schema()
{ {
$config = $this->get_config();
$user_columns = array();
foreach (array_keys($config['dmzx.mchat.config_ucp']) as $key)
{
$user_columns[] = 'user_' . $key;
}
return array( return array(
'drop_tables' => array( 'drop_tables' => array(
$this->table_prefix . 'mchat', $this->table_prefix . 'mchat',
$this->table_prefix . 'mchat_deleted_messages', $this->table_prefix . 'mchat_deleted_messages',
$this->table_prefix . 'mchat_sessions', $this->table_prefix . 'mchat_sessions',
), ),
'drop_columns' => array( 'drop_columns' => array(
$this->table_prefix . 'users' => $user_columns, $this->table_prefix . 'users' => array(
'user_mchat_avatars',
'user_mchat_capital_letter',
'user_mchat_character_count',
'user_mchat_date',
'user_mchat_index',
'user_mchat_input_area',
'user_mchat_location',
'user_mchat_message_top',
'user_mchat_pause_on_input',
'user_mchat_posts',
'user_mchat_relative_time',
'user_mchat_sound',
'user_mchat_stats_index',
'user_mchat_whois_index',
),
), ),
); );
} }

View File

@@ -0,0 +1,29 @@
<?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\migrations;
class mchat_2_0_0_rc4 extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\dmzx\mchat\migrations\mchat_2_0_0_rc3',
);
}
public function update_data()
{
return array(
array('config.update', array('mchat_version', '2.0.0-RC4')),
);
}
}

View File

@@ -0,0 +1,29 @@
<?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\migrations;
class mchat_2_0_0_rc5 extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\dmzx\mchat\migrations\mchat_2_0_0_rc4',
);
}
public function update_data()
{
return array(
array('config.update', array('mchat_version', '2.0.0-RC5')),
);
}
}

View File

@@ -0,0 +1,77 @@
<?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\migrations;
class mchat_2_0_0_rc6 extends \phpbb\db\migration\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',
),
);
}
}

6
sounds/README.txt Normal file
View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
<!-- DEFINE $MCHAT_USE_WHITE_MESSAGE_ICONS = SOP_SKDARK_SW or FALSE -->

View File

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

View 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>

View File

@@ -0,0 +1,16 @@
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2016 dmzx - http://www.dmzx-web.net
* @copyright (c) 2016 kasimi
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
.icon-mchat {
background: none;
}
.icon-mchat:before, #mChat + .inner li.header dt:before {
content: '\e0e6';
}

View File

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

View File

@@ -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, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/\n$/, '<br/>&nbsp;')
.replace(/\n/g, '<br/>')
.replace(/ {2,}/g, function(space) { return times('&nbsp;', 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 &nbsp;)
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 = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': '&quot;',
"'": '&#39;',
"/": '&#x2F;',
" ": '&nbsp;'
};
function escapeHtml(string) {
return String(string).replace(/[&<>"'\/\ ]/g, function (s) {
return entityMap[s];
} );
}
} ) );

View File

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

View File

@@ -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(function(xhr, status, error) {
deferred.reject(xhr, status, error);
});
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(xhr) {
if (xhr.status == 403) {
mChat.endSession(true);
} else if (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 = xhr.responseJSON.message || errorThrown;
} catch (e) {
responseText = errorThrown;
}
phpbb.alert(mChat.lang.err, responseText);
data.updateSession(data.xhr);
});
}, },
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('fast', 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,34 @@ 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('');
if (mChat.showCharCount) {
mChat.updateCharCount();
}
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);
if (mChat.showCharCount) {
mChat.updateCharCount();
}
}).always(function() { }).always(function() {
mChat.cached('add').prop('disabled', false); mChat.cached('add').prop('disabled', false);
setTimeout(function() { setTimeout(function() {
@@ -160,87 +237,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 +304,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 +321,133 @@ 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 data = {
message: $message,
delay: mChat.refreshInterval ? 400 : 0,
abort: $.inArray($message.data('mchat-id'), mChat.messageIds) !== -1,
playSound: playSound
};
$(mChat).trigger('mchat_add_message_before', [data]);
if (data.abort) {
return;
} }
mChat.cached('whois').replaceWith($whois); if (data.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 $container = mChat.cached('messages');
var data = {
container: $container,
message: $message,
add: function() {
if (mChat.messageTop) {
this.container.prepend(this.message);
} else {
this.container.append(this.message);
}
},
show: function() {
var scrollTop, scrollHeight = mChat.messageTop ? 0 : $container.get(0).scrollHeight;
if (mChat.messageTop && (scrollTop = this.container.scrollTop()) > 0) {
this.message.show();
this.container.scrollTop(scrollTop + this.message.outerHeight());
} else {
this.message.css('opacity', 0).slideDown('fast').animate({opacity: 1}, {duration: 'fast', queue: false});
}
if (!mChat.messageTop && this.container.scrollTop() >= scrollHeight - this.container.height()) {
this.container.animate({
scrollTop: scrollHeight,
easing: 'swing',
duration: 'slow'
});
}
}
};
$(mChat).trigger('mchat_add_message_animate_before', [data]);
data.add();
data.show();
}, i * data.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 +467,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 +484,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 +502,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 +532,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('hidden', 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 +567,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(/&lt;/g, '<');
s = s.replace(/&gt;/g, '>');
s = s.replace(/&#58;/g, ':');
s = s.replace(/&#46;/g, '.');
s = s.replace(/&amp;/g, '&');
s = s.replace(/&quot;/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,17 +593,17 @@ 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();
@@ -466,72 +611,98 @@ jQuery(function($) {
mChat.cached('messages').animate({scrollTop: mChat.cached('messages')[0].scrollHeight, easing: 'swing', duration: 'slow'}); mChat.cached('messages').animate({scrollTop: mChat.cached('messages')[0].scrollHeight, easing: 'swing', duration: 'slow'});
} }
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();
var $elem = mChat.cached('character-count');
$elem.html(mChat.charCount.format({current: count, max: mChat.mssgLngth})).css('visibility', count > 0 ? 'visible' : 'hidden');
if (mChat.mssgLngth) {
$elem.toggleClass('error', count > mChat.mssgLngth);
}
});
} }
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();
}); });
}); });

View 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 javascript/jquery.autogrow-textarea.js -->
<!-- INCLUDEJS javascript/jquery.titlealert.min.js -->
<!-- INCLUDEJS 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>

View File

@@ -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>

View File

@@ -8,32 +8,32 @@
*/ */
.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;
} }

View File

@@ -0,0 +1 @@
<!-- DEFINE $MCHAT_USE_WHITE_MESSAGE_ICONS = TRUE -->

View File

@@ -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>

View File

@@ -65,7 +65,3 @@
left: auto; left: auto;
right: 8px; right: 8px;
} }
.mchat-button:before {
background-image: url("./images/message_icons.png");
}

View File

@@ -0,0 +1,3 @@
<!-- IF MCHAT_ALLOW_USE -->
<script>$.sceditor = false;</script>
<!-- ENDIF -->

View File

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

View File

@@ -0,0 +1,28 @@
/**
*
* @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
*
*/
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;
}

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -0,0 +1 @@
<!-- IF MCHAT_INDEX and MCHAT_LOCATION --><!-- INCLUDE mchat_body.html --><!-- ENDIF -->

View File

@@ -0,0 +1 @@
<!-- Leave empty -->

View File

@@ -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>

View File

@@ -12,7 +12,7 @@
font-family: 'FontAwesome'; font-family: 'FontAwesome';
} }
#mchat-panel.cp-mini { #mchat-body .cp-mini {
background-color: #E5E4E3; background-color: #E5E4E3;
} }

View File

@@ -0,0 +1 @@
<!-- DEFINE $MCHAT_USE_WHITE_MESSAGE_ICONS = TRUE -->

View File

@@ -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

View File

@@ -20,7 +20,3 @@
content: ''; content: '';
margin-right: 0; margin-right: 0;
} }
.mchat-button:before {
background-image: url("./images/message_icons.png");
}

View File

@@ -0,0 +1,3 @@
<!-- IF MCHAT_CUSTOM_INCLUDE -->
<!-- INCLUDE mchat_body.html -->
<!-- ENDIF -->

View File

@@ -0,0 +1 @@
<!-- DEFINE $MCHAT_USE_WHITE_MESSAGE_ICONS = FALSE -->

View File

@@ -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 -->

View File

@@ -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} &copy; {L_POST_BY_AUTHOR} {MCHAT_AUTHOR_HOMEPAGES}</div> <br />
<span>{MCHAT_DISPLAY_NAME} &copy; {L_POST_BY_AUTHOR} {MCHAT_AUTHOR_HOMEPAGES}</span>
<!-- ENDIF --> <!-- ENDIF -->

View File

@@ -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 mchat_navlink.html -->
<!-- ENDIF --> <!-- ENDIF -->

View File

@@ -2,16 +2,11 @@
<!-- INCLUDE overall_header.html --> <!-- INCLUDE overall_header.html -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF MCHAT_IS_ARCHIVE_PAGE or not (MCHAT_ALLOW_USE and S_BBCODE_ALLOWED) --> <!-- INCLUDE mchat_script_data.html -->
<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/editor.js -->
<!-- ENDIF -->
<!-- INCLUDEJS javascript/jquery.auto-grow-input.js -->
<!-- INCLUDEJS javascript/jquery.titlealert.min.js -->
<!-- INCLUDEJS javascript/js.cookie-2.0.4.min.js -->
<!-- INCLUDEJS javascript/mchat.js -->
<!-- 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 +15,36 @@
&bull; {PAGE_NUMBER} &bull; {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 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 +54,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" />&nbsp; <input type="button" name="confirm" value="{L_MCHAT_OK}" class="button2" />&nbsp;
<input type="button" name="cancel" value="{L_CANCEL}" class="button2" /> <input type="button" name="cancel" value="{L_CANCEL}" class="button2" />
@@ -60,6 +71,8 @@
</ul> </ul>
<!-- ENDIF --> <!-- ENDIF -->
<!-- EVENT dmzx_mchat_messages_container_before -->
<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 -->> <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 -->>
<!-- IF .mchatrow --> <!-- IF .mchatrow -->
<!-- INCLUDE mchat_messages.html --> <!-- INCLUDE mchat_messages.html -->
@@ -67,15 +80,22 @@
<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 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,6 +104,7 @@
&bull; {PAGE_NUMBER} &bull; {PAGE_NUMBER}
<!-- ENDIF --> <!-- ENDIF -->
</div> </div>
<!-- EVENT dmzx_mchat_action_bar_top_after -->
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->

View File

@@ -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">&nbsp;</dd> <dd></dd>
</dl> </dl>

View File

@@ -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 -->
@@ -14,3 +17,5 @@
</div> </div>
</li> </li>
<!-- END mchatrow --> <!-- END mchatrow -->
<!-- EVENT dmzx_mchat_messages_after -->

View File

@@ -1,20 +1,20 @@
<!-- 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_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 -->
<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 --> <!-- 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_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_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_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_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_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_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_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_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_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_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_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_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="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_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 -->
</ul> </ul>
<!-- ENDIF --> <!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->

View File

@@ -1,5 +1,5 @@
<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"<!-- ELSEIF IS_PHPBB32 -->data-last-responsive="true"<!-- ENDIF -->>
<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>

View File

@@ -4,7 +4,7 @@
<!-- 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="hidden">{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 --> &bull; <span id="mchat-session">{MCHAT_SESSION_TIMELEFT}</span><!-- ENDIF --> </span>
<!-- IF not MCHAT_SOUND_DISABLED --> &bull; <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}">&copy;</span> </li>
<!-- IF MCHAT_TIMEOUT --><li><span id="mchat-session">{MCHAT_SESSION_TIMELEFT}</span></li><!-- ENDIF -->
<!-- IF not MCHAT_SOUND_DISABLED --><li><label for="mchat-user-sound">{L_MCHAT_USESOUND} <input type="checkbox" id="mchat-user-sound"<!-- IF MCHAT_SOUND --> checked="checked"<!-- ENDIF --> /></label></li><!-- ENDIF -->
<li><span class="mchat-copyright" title="{MCHAT_AUTHOR_NAMES}">&copy;</span></li>
</ul>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
</form> </form>

View File

@@ -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>

View File

@@ -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>

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -16,6 +16,11 @@
width: 0; width: 0;
} }
#mchat-body {
overflow: hidden;
width: 100%;
}
.icon-mchat { .icon-mchat {
background-image: url("./images/icon_mchat.png"); background-image: url("./images/icon_mchat.png");
} }
@@ -24,10 +29,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 +36,6 @@
#mchat-messages { #mchat-messages {
overflow: auto; overflow: auto;
width: 100%;
} }
.mchat-message-wrapper { .mchat-message-wrapper {
@@ -59,8 +59,17 @@
@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) { @media only screen and (max-width: 700px), only screen and (max-device-width: 700px) {
#mchat-body {
overflow: visible;
}
.mchat-buttons > li { .mchat-buttons > li {
padding: 0 8px !important; padding: 0 6px !important;
}
#mchat-input {
width: 95% !important;
margin: 5px 0 !important;
} }
} }
@@ -69,38 +78,34 @@
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 +113,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 +130,30 @@
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 li { .mchat-text li {
display: list-item !important; display: list-item !important;
list-style-type: inherit !important; list-style-type: inherit !important;
@@ -156,12 +176,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,10 +197,13 @@
#mchat-character-count { #mchat-character-count {
float: right; float: right;
visibility: hidden;
padding: 5px 0 0; padding: 5px 0 0;
} }
#mchat-character-count.hidden {
visibility: hidden;
}
#mchat-panel { #mchat-panel {
text-align: center; text-align: center;
max-height: initial; max-height: initial;
@@ -201,11 +220,17 @@
#mchat-input { #mchat-input {
cursor: text; cursor: text;
width: 50%; width: 50%;
min-width: 50%;
max-width: 90%;
font-size: 1.1em; font-size: 1.1em;
padding: 5px 5px 4px; padding: 5px 5px 4px;
margin: 5px 20px; margin: 5px 20px;
} }
textarea#mchat-input {
height: 8em;
}
#mchat-buttons { #mchat-buttons {
padding-bottom: 5px; padding-bottom: 5px;
} }
@@ -227,6 +252,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 +313,20 @@
background-image: url("./images/paused.gif"); background-image: url("./images/paused.gif");
} }
.mchat-footer li {
display: inline;
padding-left: .1em;
white-space: nowrap;
}
.mchat-footer li:before {
content: '\2022\A';
}
.mchat-footer li:first-child:before, .mchat-footer li:last-child:before {
content: '';
}
#mchat-legend { #mchat-legend {
clear: both; clear: both;
} }
@@ -324,3 +367,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;
}

View File

@@ -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>

View File

@@ -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'),
), ),
), ),

View File

@@ -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');