Version 2.0.0-RC4

This commit is contained in:
dmzx
2016-04-02 11:36:20 +02:00
parent 91dfd6d9fc
commit ca5bcaa947
20 changed files with 509 additions and 380 deletions

View File

@@ -12,189 +12,182 @@
<!-- ENDIF -->
<form id="acp_mchat" method="post" action="{U_ACTION}">
<!-- IF MCHAT_PURGE and MCHAT_FOUNDER -->
<fieldset>
<legend>{L_CONFIRM}</legend>
<span>{L_MCHAT_PURGE_CONFIRM}{L_COLON}</span>
<p class="submit-buttons">
<input class="button1" type="submit" name="mchat_purge_confirm" value="{L_YES}" />&nbsp;
<input class="button2" type="submit" value="{L_NO}" />
{S_FORM_TOKEN}
</p>
</fieldset>
<!-- ELSE -->
<fieldset>
<legend>{L_MCHAT_SETTINGS_INDEX}</legend>
<dl>
<dt><label for="mchat_index_height">{L_MCHAT_INDEX_HEIGHT}{L_COLON}</label><br />
<span>{L_MCHAT_INDEX_HEIGHT_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_index_height" id="mchat_index_height" size="10" maxlength="4" value="{MCHAT_INDEX_HEIGHT}" /></dd>
</dl>
<dl>
<dt><label for="mchat_message_num_index">{L_MCHAT_MESSAGE_NUM_INDEX}{L_COLON}</label><br />
<span>{L_MCHAT_MESSAGE_NUM_INDEX_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_message_num_index" id="mchat_message_num_index" size="10" maxlength="4" value="{MCHAT_MESSAGE_NUM_INDEX}" /></dd>
</dl>
</fieldset>
<!-- EVENT acp_dmzx_mchat_globalsettings_index_after -->
<fieldset>
<legend>{L_MCHAT_SETTINGS_CUSTOM}</legend>
<dl>
<dt><label for="mchat_custom_page">{L_MCHAT_CUSTOM_PAGE}{L_COLON}</label><br />
<span>{L_MCHAT_CUSTOM_PAGE_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="mchat_custom_page" value="1"<!-- IF MCHAT_CUSTOM_PAGE --> id="mchat_custom_page" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<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>
<dt><label for="mchat_custom_height">{L_MCHAT_CUSTOM_HEIGHT}{L_COLON}</label><br />
<span>{L_MCHAT_CUSTOM_HEIGHT_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_custom_height" id="mchat_custom_height" size="10" maxlength="4" value="{MCHAT_CUSTOM_HEIGHT}" /></dd>
</dl>
<dl>
<dt><label for="mchat_message_num_custom">{L_MCHAT_MESSAGE_NUM_CUSTOM}{L_COLON}</label><br />
<span>{L_MCHAT_MESSAGE_NUM_CUSTOM_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_message_num_custom" id="mchat_message_num_custom" size="10" value="{MCHAT_MESSAGE_NUM_CUSTOM}" /></dd>
</dl>
<dl>
<dt><label for="mchat_navbar_link">{L_MCHAT_NAVBAR_LINK}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="mchat_navbar_link" value="1"<!-- IF MCHAT_NAVBAR_LINK --> id="mchat_navbar_link" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="mchat_navbar_link" value="0"<!-- IF not MCHAT_NAVBAR_LINK --> id="mchat_navbar_link" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_MCHAT_SETTINGS_ARCHIVE}</legend>
<dl>
<dt><label for="mchat_message_num_archive">{L_MCHAT_MESSAGE_NUM_ARCHIVE}{L_COLON}</label><br />
<span>{L_MCHAT_MESSAGE_NUM_ARCHIVE_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_message_num_archive" id="mchat_message_num_archive" size="10" value="{MCHAT_MESSAGE_NUM_ARCHIVE}" /></dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_MCHAT_SETTINGS_MESSAGES}</legend>
<dl>
<dt><label for="mchat_timeout">{L_MCHAT_USER_TIMEOUT}{L_COLON}</label><br />
<span>{L_MCHAT_TIMEOUT_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_timeout" id="mchat_timeout" size="10" maxlength="4" value="{MCHAT_TIMEOUT}" /></dd>
</dl>
<dl>
<dt><label for="mchat_refresh">{L_MCHAT_REFRESH}{L_COLON}</label><br />
<span>{L_MCHAT_REFRESH_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_refresh" id="mchat_refresh" size="10" value="{MCHAT_REFRESH}" /></dd>
</dl>
<dl>
<dt><label for="mchat_edit_delete_limit">{L_MCHAT_EDIT_DELETE_LIMIT}{L_COLON}</label><br />
<span>{L_MCHAT_EDIT_DELETE_LIMIT_EXPLAIN}</span>
<dd><input type="text" name="mchat_edit_delete_limit" id="mchat_edit_delete_limit" size="10" value="{MCHAT_EDIT_DELETE_LIMIT}" /></dd>
</dl>
<dl>
<dt><label for="mchat_live_updates">{L_MCHAT_LIVE_UPDATES}{L_COLON}</label><br />
<span>{L_MCHAT_LIVE_UPDATES_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>
<label><input type="radio" class="radio" name="mchat_live_updates" value="0"<!-- IF not MCHAT_LIVE_UPDATES --> id="mchat_live_updates" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="mchat_flood_time">{L_MCHAT_FLOOD_TIME}{L_COLON}</label><br />
<span>{L_MCHAT_FLOOD_TIME_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_flood_time" id="mchat_flood_time" size="10" value="{MCHAT_FLOOD_TIME}" /></dd>
</dl>
<dl>
<dt><label for="mchat_max_message_lngth">{L_MCHAT_MAX_MESSAGE_LENGTH}{L_COLON}</label><br />
<span>{L_MCHAT_MAX_MESSAGE_LENGTH_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>
</dl>
<dl>
<dt><label for="mchat_override_min_post_chars">{L_MCHAT_OVERRIDE_MIN_POST_CHARS}{L_COLON}</label><br />
<span>{L_MCHAT_OVERRIDE_MIN_POST_CHARS_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>
<label><input type="radio" class="radio" name="mchat_override_min_post_chars" value="0"<!-- IF not MCHAT_OVERRIDE_MIN_POST_CHARS --> id="mchat_override_min_post_chars" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="mchat_override_smilie_limit">{L_MCHAT_OVERRIDE_SMILIE_LIMIT}{L_COLON}</label><br />
<span>{L_MCHAT_OVERRIDE_SMILIE_LIMIT_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="mchat_override_smilie_limit" value="1"<!-- IF MCHAT_OVERRIDE_SMILIE_LIMIT --> id="mchat_override_smilie_limit" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="mchat_override_smilie_limit" value="0"<!-- IF not MCHAT_OVERRIDE_SMILIE_LIMIT --> id="mchat_override_smilie_limit" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="mchat_bbcode_disallowed">{L_MCHAT_BBCODES_DISALLOWED}{L_COLON}</label><br />
<span>{L_MCHAT_BBCODES_DISALLOWED_EXPLAIN}</span></dt>
<dd><textarea name="mchat_bbcode_disallowed" id="mchat_bbcode_disallowed" rows="3" cols="40">{MCHAT_BBCODE_DISALLOWED}</textarea></dd>
</dl>
<dl>
<dt><label for="mchat_rules">{L_MCHAT_RULES}{L_COLON}</label><br />
<span>{L_MCHAT_RULES_EXPLAIN}</span></dt>
<dd><textarea name="mchat_rules" id="mchat_rules" rows="5" cols="40">{MCHAT_RULES}</textarea></dd>
</dl>
<dl>
<dt><label for="mchat_static_message">{L_MCHAT_STATIC_MESSAGE}{L_COLON}</label><br />
<span>{L_MCHAT_STATIC_MESSAGE_EXPLAIN}</span></dt>
<dd><textarea name="mchat_static_message" id="mchat_static_message" rows="5" cols="40">{MCHAT_STATIC_MESSAGE}</textarea></dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_MCHAT_SETTINGS_POSTS}</legend>
<dl>
<dt><label for="mchat_posts_topic">{L_MCHAT_POSTS_TOPIC}{L_COLON}</label></dt>
<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="0"<!-- IF not MCHAT_POSTS_TOPIC --> id="mchat_posts_topic" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_TOPIC_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
<dt><label for="mchat_posts_reply">{L_MCHAT_POSTS_REPLY}{L_COLON}</label></dt>
<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="0"<!-- IF not MCHAT_POSTS_REPLY --> id="mchat_posts_reply" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_REPLY_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
<dt><label for="mchat_posts_edit">{L_MCHAT_POSTS_EDIT}{L_COLON}</label></dt>
<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="0"<!-- IF not MCHAT_POSTS_EDIT --> id="mchat_posts_edit" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_EDIT_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
<dt><label for="mchat_posts_quote">{L_MCHAT_POSTS_QUOTE}{L_COLON}</label></dt>
<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="0"<!-- IF not MCHAT_POSTS_QUOTE --> id="mchat_posts_quote" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_QUOTE_NOAUTH --> disabled<!-- 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>
<dd><input type="text" name="mchat_whois_refresh" id="mchat_whois_refresh" size="10" value="{MCHAT_WHOIS_REFRESH}" /></dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_MCHAT_SETTINGS_PRUNE}</legend>
<dl>
<dt><label for="mchat_prune">{L_MCHAT_PRUNE}{L_COLON}</label><br />
<span>{L_MCHAT_PRUNE_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="mchat_prune" value="1"<!-- IF MCHAT_PRUNE --> id="mchat_prune" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<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>
<dd><input type="text" name="mchat_prune_num" size="10" id="mchat_prune_num" value="{MCHAT_PRUNE_NUM}" /></dd>
</dl>
<!-- IF MCHAT_FOUNDER -->
<dl>
<dt><label for="mchat_purge">{L_MCHAT_PURGE}{L_COLON}</label></dt>
<dd><input class="button1" type="submit" id="mchat_purge" name="mchat_purge" value="{L_MCHAT_PURGE}" /></dd>
</dl>
<!-- ENDIF -->
</fieldset>
<!-- 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>
<!-- ENDIF -->
<fieldset>
<legend>{L_MCHAT_SETTINGS_INDEX}</legend>
<dl>
<dt><label for="mchat_index_height">{L_MCHAT_INDEX_HEIGHT}{L_COLON}</label><br />
<span>{L_MCHAT_INDEX_HEIGHT_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_index_height" id="mchat_index_height" size="10" maxlength="4" value="{MCHAT_INDEX_HEIGHT}" /></dd>
</dl>
<dl>
<dt><label for="mchat_message_num_index">{L_MCHAT_MESSAGE_NUM_INDEX}{L_COLON}</label><br />
<span>{L_MCHAT_MESSAGE_NUM_INDEX_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_message_num_index" id="mchat_message_num_index" size="10" maxlength="4" value="{MCHAT_MESSAGE_NUM_INDEX}" /></dd>
</dl>
</fieldset>
<!-- EVENT acp_dmzx_mchat_globalsettings_index_after -->
<fieldset>
<legend>{L_MCHAT_SETTINGS_CUSTOM}</legend>
<dl>
<dt><label for="mchat_custom_page">{L_MCHAT_CUSTOM_PAGE}{L_COLON}</label><br />
<span>{L_MCHAT_CUSTOM_PAGE_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="mchat_custom_page" value="1"<!-- IF MCHAT_CUSTOM_PAGE --> id="mchat_custom_page" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<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>
<dt><label for="mchat_custom_height">{L_MCHAT_CUSTOM_HEIGHT}{L_COLON}</label><br />
<span>{L_MCHAT_CUSTOM_HEIGHT_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_custom_height" id="mchat_custom_height" size="10" maxlength="4" value="{MCHAT_CUSTOM_HEIGHT}" /></dd>
</dl>
<dl>
<dt><label for="mchat_message_num_custom">{L_MCHAT_MESSAGE_NUM_CUSTOM}{L_COLON}</label><br />
<span>{L_MCHAT_MESSAGE_NUM_CUSTOM_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_message_num_custom" id="mchat_message_num_custom" size="10" value="{MCHAT_MESSAGE_NUM_CUSTOM}" /></dd>
</dl>
<dl>
<dt><label for="mchat_navbar_link">{L_MCHAT_NAVBAR_LINK}{L_COLON}</label></dt>
<dd><label><input type="radio" class="radio" name="mchat_navbar_link" value="1"<!-- IF MCHAT_NAVBAR_LINK --> id="mchat_navbar_link" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="mchat_navbar_link" value="0"<!-- IF not MCHAT_NAVBAR_LINK --> id="mchat_navbar_link" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_MCHAT_SETTINGS_ARCHIVE}</legend>
<dl>
<dt><label for="mchat_message_num_archive">{L_MCHAT_MESSAGE_NUM_ARCHIVE}{L_COLON}</label><br />
<span>{L_MCHAT_MESSAGE_NUM_ARCHIVE_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_message_num_archive" id="mchat_message_num_archive" size="10" value="{MCHAT_MESSAGE_NUM_ARCHIVE}" /></dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_MCHAT_SETTINGS_MESSAGES}</legend>
<dl>
<dt><label for="mchat_timeout">{L_MCHAT_USER_TIMEOUT}{L_COLON}</label><br />
<span>{L_MCHAT_TIMEOUT_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_timeout" id="mchat_timeout" size="10" maxlength="4" value="{MCHAT_TIMEOUT}" /></dd>
</dl>
<dl>
<dt><label for="mchat_refresh">{L_MCHAT_REFRESH}{L_COLON}</label><br />
<span>{L_MCHAT_REFRESH_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_refresh" id="mchat_refresh" size="10" value="{MCHAT_REFRESH}" /></dd>
</dl>
<dl>
<dt><label for="mchat_edit_delete_limit">{L_MCHAT_EDIT_DELETE_LIMIT}{L_COLON}</label><br />
<span>{L_MCHAT_EDIT_DELETE_LIMIT_EXPLAIN}</span>
<dd><input type="text" name="mchat_edit_delete_limit" id="mchat_edit_delete_limit" size="10" value="{MCHAT_EDIT_DELETE_LIMIT}" /></dd>
</dl>
<dl>
<dt><label for="mchat_live_updates">{L_MCHAT_LIVE_UPDATES}{L_COLON}</label><br />
<span>{L_MCHAT_LIVE_UPDATES_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>
<label><input type="radio" class="radio" name="mchat_live_updates" value="0"<!-- IF not MCHAT_LIVE_UPDATES --> id="mchat_live_updates" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="mchat_flood_time">{L_MCHAT_FLOOD_TIME}{L_COLON}</label><br />
<span>{L_MCHAT_FLOOD_TIME_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_flood_time" id="mchat_flood_time" size="10" value="{MCHAT_FLOOD_TIME}" /></dd>
</dl>
<dl>
<dt><label for="mchat_max_message_lngth">{L_MCHAT_MAX_MESSAGE_LENGTH}{L_COLON}</label><br />
<span>{L_MCHAT_MAX_MESSAGE_LENGTH_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>
</dl>
<dl>
<dt><label for="mchat_override_min_post_chars">{L_MCHAT_OVERRIDE_MIN_POST_CHARS}{L_COLON}</label><br />
<span>{L_MCHAT_OVERRIDE_MIN_POST_CHARS_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>
<label><input type="radio" class="radio" name="mchat_override_min_post_chars" value="0"<!-- IF not MCHAT_OVERRIDE_MIN_POST_CHARS --> id="mchat_override_min_post_chars" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="mchat_override_smilie_limit">{L_MCHAT_OVERRIDE_SMILIE_LIMIT}{L_COLON}</label><br />
<span>{L_MCHAT_OVERRIDE_SMILIE_LIMIT_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="mchat_override_smilie_limit" value="1"<!-- IF MCHAT_OVERRIDE_SMILIE_LIMIT --> id="mchat_override_smilie_limit" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="mchat_override_smilie_limit" value="0"<!-- IF not MCHAT_OVERRIDE_SMILIE_LIMIT --> id="mchat_override_smilie_limit" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="mchat_bbcode_disallowed">{L_MCHAT_BBCODES_DISALLOWED}{L_COLON}</label><br />
<span>{L_MCHAT_BBCODES_DISALLOWED_EXPLAIN}</span></dt>
<dd><textarea name="mchat_bbcode_disallowed" id="mchat_bbcode_disallowed" rows="3" cols="40">{MCHAT_BBCODE_DISALLOWED}</textarea></dd>
</dl>
<dl>
<dt><label for="mchat_rules">{L_MCHAT_RULES}{L_COLON}</label><br />
<span>{L_MCHAT_RULES_EXPLAIN}</span></dt>
<dd><textarea name="mchat_rules" id="mchat_rules" rows="5" cols="40">{MCHAT_RULES}</textarea></dd>
</dl>
<dl>
<dt><label for="mchat_static_message">{L_MCHAT_STATIC_MESSAGE}{L_COLON}</label><br />
<span>{L_MCHAT_STATIC_MESSAGE_EXPLAIN}</span></dt>
<dd><textarea name="mchat_static_message" id="mchat_static_message" rows="5" cols="40">{MCHAT_STATIC_MESSAGE}</textarea></dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_MCHAT_SETTINGS_POSTS}</legend>
<dl>
<dt><label for="mchat_posts_topic">{L_MCHAT_POSTS_TOPIC}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="mchat_posts_topic" value="1"<!-- IF MCHAT_POSTS_TOPIC --> id="mchat_posts_topic" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="mchat_posts_topic" value="0"<!-- IF not MCHAT_POSTS_TOPIC --> id="mchat_posts_topic" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
<dt><label for="mchat_posts_reply">{L_MCHAT_POSTS_REPLY}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="mchat_posts_reply" value="1"<!-- IF MCHAT_POSTS_REPLY --> id="mchat_posts_reply" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="mchat_posts_reply" value="0"<!-- IF not MCHAT_POSTS_REPLY --> id="mchat_posts_reply" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
<dt><label for="mchat_posts_edit">{L_MCHAT_POSTS_EDIT}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="mchat_posts_edit" value="1"<!-- IF MCHAT_POSTS_EDIT --> id="mchat_posts_edit" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="mchat_posts_edit" value="0"<!-- IF not MCHAT_POSTS_EDIT --> id="mchat_posts_edit" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
<dt><label for="mchat_posts_quote">{L_MCHAT_POSTS_QUOTE}{L_COLON}</label></dt>
<dd>
<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 --> /> {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>
<dd><input type="text" name="mchat_whois_refresh" id="mchat_whois_refresh" size="10" value="{MCHAT_WHOIS_REFRESH}" /></dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_MCHAT_SETTINGS_PRUNE}</legend>
<dl>
<dt><label for="mchat_prune">{L_MCHAT_PRUNE}{L_COLON}</label><br />
<span>{L_MCHAT_PRUNE_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="mchat_prune" value="1"<!-- IF MCHAT_PRUNE --> id="mchat_prune" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<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>
<dd><input type="text" name="mchat_prune_num" size="10" id="mchat_prune_num" value="{MCHAT_PRUNE_NUM}" /></dd>
</dl>
<!-- IF MCHAT_FOUNDER -->
<dl>
<dt><label for="mchat_purge">{L_MCHAT_PURGE}{L_COLON}</label></dt>
<dd>
<input class="button1" type="submit" id="mchat_purge" name="mchat_purge" value="{L_MCHAT_PURGE}" />
<label>{L_MCHAT_PURGE_CONFIRM}{L_COLON}</label>
<label><input type="radio" name="mchat_purge_confirm" value="1" /> {L_YES}</label>
<label><input type="radio" name="mchat_purge_confirm" value="0" id="mchat_purge_confirm" checked="checked" /> {L_NO}</label>
</dd>
</dl>
<!-- ENDIF -->
</fieldset>
<!-- 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>
<!-- INCLUDE overall_footer.html -->

View File

@@ -15,12 +15,29 @@
<form id="acp_mchat" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_MCHAT_ACP_GLOBALUSERSETTINGS_TITLE}</legend>
<legend>{L_ACP_MCHAT_GLOBALUSERSETTINGS}</legend>
<!-- INCLUDE acp_mchat_globalusersettings_content.html -->
</fieldset>
<fieldset>
<legend>{L_MCHAT_GLOBALUSERSETTINGS_OVERWRITE}</legend>
<dl>
<dt><label for="mchat_overwrite">{L_MCHAT_GLOBALUSERSETTINGS_OVERWRITE}{L_COLON}</label><br /><span>{L_MCHAT_GLOBALUSERSETTINGS_OVERWRITE_EXPLAIN}</span></dt>
<dd>
<label><input type="radio" name="mchat_overwrite" value="1" /> {L_YES}</label>
<label><input type="radio" name="mchat_overwrite" value="0" id="mchat_overwrite" checked="checked" /> {L_NO}</label>
</dd>
</dl>
<dl>
<dt><label for="mchat_overwrite_confirm">{L_MCHAT_GLOBALUSERSETTINGS_OVERWRITE_CONFIRM}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="mchat_overwrite_confirm" value="1" /> {L_YES}</label>
<label><input type="radio" name="mchat_overwrite_confirm" value="0" id="mchat_overwrite_confirm" checked="checked" /> {L_NO}</label>
</dd>
</dl>
</fieldset>
<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}" />
<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>

View File

@@ -3,8 +3,8 @@
"type": "phpbb-extension",
"description": "mChat Extension",
"homepage": "http://www.dmzx-web.net",
"version": "2.0.0-RC3",
"time": "2016-03-24",
"version": "2.0.0-RC4",
"time": "2016-03-31",
"keywords": ["phpbb", "extension", "mchat"],
"license": "GPL-2.0",
"authors": [

View File

@@ -49,6 +49,7 @@ services:
- '@ext.manager'
- '%core.root_path%'
- '%core.php_ext%'
- '@?phpbb.collapsiblecategories.operator'
dmzx.mchat.functions:
class: dmzx\mchat\core\functions
arguments:

View File

@@ -87,20 +87,13 @@ class acp_controller
$error = array();
if ($this->request->is_set_post('mchat_purge'))
if ($this->request->is_set_post('mchat_purge') && $this->request->variable('mchat_purge_confirm', false) && check_form_key('acp_mchat') && $this->user->data['user_type'] == USER_FOUNDER)
{
$this->template->assign_var('MCHAT_PURGE', true);
}
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));
}
$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'))
{
@@ -203,6 +196,18 @@ class acp_controller
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
foreach ($mchat_new_config as $config_name => $config_value)
{

View File

@@ -54,7 +54,7 @@ class main_controller
* Controller for mChat actions called with Ajax requests
*
* @param string $action The action to perform, one of add|edit|del|refresh|whois
* @return A Symfony JsonResponse object
* @return \Symfony\Component\HttpFoundation\JsonResponse A Symfony JsonResponse object
*/
public function action($action)
{

View File

@@ -49,26 +49,30 @@ class mchat
/** @var string */
protected $php_ext;
/** @var \phpbb\collapsiblecategories\operator\operator */
protected $cc_operator;
/** @var boolean */
protected $remove_disallowed_bbcodes = false;
/**
* Constructor
*
* @param \dmzx\mchat\core\functions $functions
* @param \dmzx\mchat\core\settings $settings
* @param \phpbb\controller\helper $helper
* @param \phpbb\template\template $template
* @param \phpbb\user $user
* @param \phpbb\auth\auth $auth
* @param \phpbb\pagination $pagination
* @param \phpbb\request\request $request
* @param \phpbb\event\dispatcher_interface $dispatcher
* @param \phpbb\extension\manager $extension_manager
* @param string $root_path
* @param string $php_ext
* @param \dmzx\mchat\core\functions $functions
* @param \dmzx\mchat\core\settings $settings
* @param \phpbb\controller\helper $helper
* @param \phpbb\template\template $template
* @param \phpbb\user $user
* @param \phpbb\auth\auth $auth
* @param \phpbb\pagination $pagination
* @param \phpbb\request\request $request
* @param \phpbb\event\dispatcher_interface $dispatcher
* @param \phpbb\extension\manager $extension_manager
* @param string $root_path
* @param string $php_ext
* @param \phpbb\collapsiblecategories\operator\operator $cc_operator
*/
public function __construct(\dmzx\mchat\core\functions $functions, \dmzx\mchat\core\settings $settings, \phpbb\controller\helper $helper, \phpbb\template\template $template, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \phpbb\request\request $request, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\extension\manager $extension_manager, $root_path, $php_ext)
public function __construct(\dmzx\mchat\core\functions $functions, \dmzx\mchat\core\settings $settings, \phpbb\controller\helper $helper, \phpbb\template\template $template, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \phpbb\request\request $request, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\extension\manager $extension_manager, $root_path, $php_ext, \phpbb\collapsiblecategories\operator\operator $cc_operator = null)
{
$this->functions = $functions;
$this->settings = $settings;
@@ -82,6 +86,7 @@ class mchat
$this->extension_manager = $extension_manager;
$this->root_path = $root_path;
$this->php_ext = $php_ext;
$this->cc_operator = $cc_operator;
$this->template->assign_vars(array(
'IS_PHPBB31' => $this->settings->is_phpbb31,
@@ -307,8 +312,7 @@ class mchat
throw new \phpbb\exception\http_exception(403, 'MCHAT_NOACCESS');
}
$is_archive = $this->request->variable('archive', 0);
$this->template->assign_var('MCHAT_IS_ARCHIVE_PAGE', $is_archive);
$this->template->assign_var('MCHAT_IS_ARCHIVE_PAGE', $this->request->variable('archive', false));
$message = $this->request->variable('message', '', true);
@@ -330,7 +334,7 @@ class mchat
$rows = $this->functions->mchat_get_messages($sql_where, 1);
$this->assign_global_template_data();
$this->assign_messages($rows, $is_archive ? 'archive' : '');
$this->assign_messages($rows);
return array('edit' => $this->render_template('mchat_messages.html'));
}
@@ -520,22 +524,22 @@ class mchat
'MCHAT_WHOIS_REFRESH_EXPLAIN' => $this->user->lang('MCHAT_WHO_IS_REFRESH_EXPLAIN', $this->settings->cfg('mchat_whois_refresh')),
'MCHAT_SESSION_TIMELEFT' => $this->user->lang('MCHAT_SESSION_ENDS', gmdate('H:i:s', (int) $this->settings->cfg('mchat_timeout'))),
'MCHAT_STATIC_MESS' => htmlspecialchars_decode($static_message),
'MCHAT_MESS_LONG' => addslashes($this->user->lang('MCHAT_MESS_LONG', $this->settings->cfg('mchat_max_message_lngth'))),
'MCHAT_REFRESH_YES' => addslashes($this->user->lang('MCHAT_REFRESH_YES', $this->settings->cfg('mchat_refresh'))),
'A_MCHAT_MESS_LONG' => addslashes($this->user->lang('MCHAT_MESS_LONG', $this->settings->cfg('mchat_max_message_lngth'))),
'A_MCHAT_REFRESH_YES' => addslashes($this->user->lang('MCHAT_REFRESH_YES', $this->settings->cfg('mchat_refresh'))),
'U_MCHAT_CUSTOM_PAGE' => $this->helper->route('dmzx_mchat_controller'),
'U_MCHAT_RULES' => $this->helper->route('dmzx_mchat_page_controller', array('page' => 'rules')),
'U_MCHAT_ARCHIVE_URL' => $this->helper->route('dmzx_mchat_page_controller', array('page' => 'archive')),
));
// The template needs some language variables if we display relative time for messages
if ($this->settings->cfg('mchat_relative_time') && $page != 'archive')
if ($this->settings->cfg('mchat_relative_time'))
{
$minutes_limit = $this->get_relative_minutes_limit();
for ($i = 0; $i < $minutes_limit; $i++)
{
$this->template->assign_block_vars('mchattime', array(
'KEY' => $i,
'LANG' => addslashes($this->user->lang('MCHAT_MINUTES_AGO', $i)),
'A_LANG' => addslashes($this->user->lang('MCHAT_MINUTES_AGO', $i)),
'IS_LAST' => $i + 1 === $minutes_limit,
));
}
@@ -545,9 +549,9 @@ class mchat
$actions = array_keys(array_filter(array(
'edit' => $this->auth_message('u_mchat_edit', true, time()),
'del' => $this->auth_message('u_mchat_delete', true, time()),
'refresh' => $page != 'archive' && $this->auth->acl_get('u_mchat_view'),
'add' => $page != 'archive' && $u_mchat_use,
'whois' => $page != 'archive' && $this->settings->cfg('mchat_whois'),
'refresh' => $page !== 'archive' && $this->auth->acl_get('u_mchat_view'),
'add' => $page !== 'archive' && $u_mchat_use,
'whois' => $page !== 'archive' && $this->settings->cfg('mchat_whois'),
)));
foreach ($actions as $i => $action)
@@ -560,14 +564,14 @@ class mchat
}
$limit = $this->settings->cfg('mchat_message_num_' . $page);
$start = $page == 'archive' ? $this->request->variable('start', 0) : 0;
$start = $page === 'archive' ? $this->request->variable('start', 0) : 0;
$rows = $this->functions->mchat_get_messages('', $limit, $start);
$this->assign_global_template_data();
$this->assign_messages($rows, $page);
$this->assign_messages($rows);
// Render pagination
if ($page == 'archive')
if ($page === 'archive')
{
$archive_url = $this->helper->route('dmzx_mchat_page_controller', array('page' => 'archive'));
$total_messages = $this->functions->mchat_total_message_count();
@@ -576,12 +580,26 @@ class mchat
}
// Render legend
if ($page != 'index' && $this->settings->cfg('mchat_whois'))
if ($page !== 'index' && $this->settings->cfg('mchat_whois'))
{
$legend = $this->functions->mchat_legend();
$this->template->assign_var('LEGEND', implode($this->user->lang('COMMA_SEPARATOR'), $legend));
}
// Make mChat collapsible
if ($page === 'index' && $this->cc_operator !== null)
{
$cc_fid = 'mchat';
$this->template->assign_vars(array(
'MCHAT_IS_COLLAPSIBLE' => true,
'S_MCHAT_HIDDEN' => in_array($cc_fid, $this->cc_operator->get_user_categories()),
'U_MCHAT_COLLAPSE_URL' => $this->helper->route('phpbb_collapsiblecategories_main_controller', array(
'forum_id' => $cc_fid,
'hash' => generate_link_hash('collapsible_' . $cc_fid),
)),
));
}
$this->assign_authors();
if ($u_mchat_use)
@@ -657,9 +675,8 @@ class mchat
* Assigns all message rows to the template
*
* @param array $rows
* @param string $page
*/
protected function assign_messages($rows, $page = '')
protected function assign_messages($rows)
{
if (!$rows)
{
@@ -718,7 +735,7 @@ class mchat
}
$message_age = time() - $row['message_time'];
$minutes_ago = $this->get_minutes_ago($message_age, $page);
$minutes_ago = $this->get_minutes_ago($message_age);
$datetime = $this->user->format_date($row['message_time'], $this->settings->cfg('mchat_date'));
$is_poster = $row['user_id'] != ANONYMOUS && $this->user->data['user_id'] == $row['user_id'];
@@ -754,12 +771,11 @@ class mchat
* or the message is older than 59 minutes or we render for the archive, -1 is returned.
*
* @param int $message_age
* @param string $page
* @return int
*/
protected function get_minutes_ago($message_age, $page)
protected function get_minutes_ago($message_age)
{
if ($this->settings->cfg('mchat_relative_time') && $page != 'archive')
if ($this->settings->cfg('mchat_relative_time'))
{
$minutes_ago = floor($message_age / 60);
if ($minutes_ago < $this->get_relative_minutes_limit())
@@ -780,11 +796,11 @@ class mchat
*/
protected function get_relative_minutes_limit()
{
$timeout = $this->settings->cfg('session_length');
$timeout = $this->settings->cfg('mchat_timeout');
if ($this->settings->cfg('mchat_timeout'))
if (!$timeout)
{
$timeout = $this->settings->cfg('mchat_timeout');
$timeout = $this->settings->cfg('session_length');
}
return min(max((int) ceil($timeout / 60), 1), 60);
@@ -823,7 +839,7 @@ class mchat
$this->template->assign_var($option['template_var'], !$is_disallowed);
}
$this->template->assign_var('MCHAT_DISALLOWED_BBCODES', addslashes(str_replace('=', '-', $this->settings->cfg('mchat_bbcode_disallowed'))));
$this->template->assign_var('A_MCHAT_DISALLOWED_BBCODES', addslashes(str_replace('=', '-', $this->settings->cfg('mchat_bbcode_disallowed'))));
if (!function_exists('display_custom_bbcodes'))
{
@@ -863,6 +879,22 @@ class mchat
return $sql_ary;
}
/**
* Sets the default values when a user registers a new account as configured in the global user settings
*
* @param array $sql_ary
* @return array
*/
public function set_user_default_values($sql_ary)
{
foreach (array_keys($this->settings->ucp) as $config_name)
{
$sql_ary['user_' . $config_name] = $this->settings->cfg($config_name, true);
}
return $sql_ary;
}
/** Inserts a message with posting information into the database
*
* @param string $mode One of post|quote|edit|reply
@@ -910,7 +942,7 @@ class mchat
return true;
}
$can_edit_delete = $this->settings->cfg('mchat_edit_delete_limit') == 0 || $message_time >= time() - $this->settings->cfg('mchat_edit_delete_limit');
$can_edit_delete = !$this->settings->cfg('mchat_edit_delete_limit') || $message_time >= time() - $this->settings->cfg('mchat_edit_delete_limit');
return $can_edit_delete && $this->user->data['user_id'] == $author_id && $this->user->data['is_registered'];
}

View File

@@ -154,7 +154,7 @@ class acp_listener implements EventSubscriberInterface
*/
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'];

View File

@@ -55,6 +55,7 @@ class main_listener implements EventSubscriberInterface
'core.index_modify_page_title' => 'display_mchat_on_index',
'core.posting_modify_submit_post_after' => 'posting_modify_submit_post_after',
'core.display_custom_bbcodes_modify_sql' => 'display_custom_bbcodes_modify_sql',
'core.user_add_modify_data' => 'user_registration_set_default_values',
);
}
@@ -123,4 +124,12 @@ class main_listener implements EventSubscriberInterface
{
$event['sql_ary'] = $this->mchat->remove_disallowed_bbcodes($event['sql_ary']);
}
/**
* @param object $event The event object
*/
public function user_registration_set_default_values($event)
{
$event['sql_ary'] = $this->mchat->set_user_default_values($event['sql_ary']);
}
}

View File

@@ -36,17 +36,15 @@ if (empty($lang) || !is_array($lang))
$lang = array_merge($lang, array(
// Module titles
'ACP_CAT_MCHAT' => 'mChat',
'ACP_CAT_MCHAT_USER_CONFIG' => 'mChat in UCP',
'ACP_MCHAT_GLOBALSETTINGS' => 'Global settings',
'ACP_MCHAT_GLOBALUSERSETTINGS' => 'Global user settings',
'MCHAT_ACP_USER_PREFS_EXPLAIN' => 'Below are listed all mChat preferences of the selected user. Settings for which the selected user does not have permission to customise are disabled. These settings can be changed in the <em>Global user settings</em> mChat configuration section.',
'ACP_CAT_MCHAT' => 'mChat',
'ACP_CAT_MCHAT_USER_CONFIG' => 'mChat in UCP',
'ACP_MCHAT_GLOBALSETTINGS' => 'Global settings',
'ACP_MCHAT_GLOBALUSERSETTINGS' => 'Global user settings',
// 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_TABLE_PRUNED' => '<strong>mChat messages pruned</strong><br />» %1$s',
'LOG_MCHAT_TABLE_PURGED' => '<strong>mChat messages purged</strong><br />» %1$s',
'LOG_DELETED_MCHAT' => '<strong>mChat message deleted</strong><br />» %1$s',
'LOG_EDITED_MCHAT' => '<strong>mChat message edited</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_PURGED' => '<strong>mChat messages purged</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

@@ -66,12 +66,12 @@ $lang = array_merge($lang, array(
'MCHAT_REFRESH_NO' => 'Update is off',
'MCHAT_REFRESH_YES' => 'Updates every <strong>%1$d</strong> seconds',
'MCHAT_RESPOND' => 'Respond to user',
'MCHAT_RESET_QUESTION' => 'Clear the input area?',
'MCHAT_SESSION_ENDS' => 'Chat session ends in %1$s',
'MCHAT_SESSION_OUT' => 'Chat session has expired',
'MCHAT_SMILES' => 'Smilies',
'MCHAT_TOTALMESSAGES' => 'Total messages: <strong>%1$d</strong>',
'MCHAT_USESOUND' => 'Play sound',
'MCHAT_COLLAPSE_TITLE' => 'Toggle visibility of mChat',
'MCHAT_WHO_IS_REFRESH_EXPLAIN' => 'Refreshes every <strong>%1$d</strong> seconds',
'MCHAT_MINUTES_AGO' => array(
0 => 'just now',

View File

@@ -36,95 +36,100 @@ if (empty($lang) || !is_array($lang))
$lang = array_merge($lang, array(
// ACP Configuration sections
'MCHAT_SETTINGS_INDEX' => 'Index page settings',
'MCHAT_SETTINGS_CUSTOM' => 'Custom page settings',
'MCHAT_SETTINGS_ARCHIVE' => 'Archive page settings',
'MCHAT_SETTINGS_POSTS' => 'New posts settings',
'MCHAT_SETTINGS_MESSAGES' => 'Message settings',
'MCHAT_SETTINGS_PRUNE' => 'Pruning settings',
'MCHAT_SETTINGS_STATS' => 'Who is chatting settings',
'MCHAT_SETTINGS_INDEX' => 'Index page settings',
'MCHAT_SETTINGS_CUSTOM' => 'Custom page settings',
'MCHAT_SETTINGS_ARCHIVE' => 'Archive page settings',
'MCHAT_SETTINGS_POSTS' => 'New posts settings',
'MCHAT_SETTINGS_MESSAGES' => 'Message settings',
'MCHAT_SETTINGS_PRUNE' => 'Pruning 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
'MCHAT_ACP_GLOBALSETTINGS_TITLE' => 'mChat Global settings',
'MCHAT_ACP_GLOBALUSERSETTINGS_TITLE' => 'mChat Global user settings',
'MCHAT_VERSION' => 'Version',
'MCHAT_RULES' => 'Rules',
'MCHAT_RULES_EXPLAIN' => 'Enter the rules of the forum here. HTML code is allowed. <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_AVATARS' => 'Display avatars',
'MCHAT_AVATARS_EXPLAIN' => 'If set to yes, resized user avatars will be displayed',
'MCHAT_INDEX' => 'Display mChat on the index page',
'MCHAT_INDEX_HEIGHT' => 'Index page height',
'MCHAT_INDEX_HEIGHT_EXPLAIN' => 'The height of the chat box in pixels on the index page.<br /><em>You are limited from 50 to 1000. Default is 250.</em>',
'MCHAT_TOP_OF_FORUM' => 'Top',
'MCHAT_BOTTOM_OF_FORUM' => 'Bottom',
'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_LIVE_UPDATES' => 'Live updates of edited and deleted messages',
'MCHAT_LIVE_UPDATES_EXPLAIN' => 'When a user edits or deletes messages, the changes are updated live for all others, without them having to refresh the page. Disable this if you experience performance issues.',
'MCHAT_PRUNE' => 'Enable message pruning',
'MCHAT_PRUNE_EXPLAIN' => 'Only occurs if a user views the custom or archive pages.',
'MCHAT_PRUNE_NUM' => 'Number of messages to retain when pruning',
'MCHAT_NAVBAR_LINK' => 'Display link to the custom page in the navbar',
'MCHAT_MESSAGE_NUM_CUSTOM' => 'Initial number of messages to display on the custom page',
'MCHAT_MESSAGE_NUM_CUSTOM_EXPLAIN' => '<em>You are limited from 5 to 50. Default is 10.</em>',
'MCHAT_MESSAGE_NUM_INDEX' => 'Initial number of messages to display on the index page',
'MCHAT_MESSAGE_NUM_INDEX_EXPLAIN' => '<em>You are limited from 5 to 50. Default is 10.</em>',
'MCHAT_MESSAGE_NUM_ARCHIVE' => 'Number of messages to display on the archive page',
'MCHAT_MESSAGE_NUM_ARCHIVE_EXPLAIN' => 'The maximum number of messages to show per page on the archive page.<br /><em>You are limited from 10 to 100. Default is 25.</em>',
'MCHAT_FLOOD_TIME' => 'Flood time',
'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_EDIT_DELETE_LIMIT' => 'Time limit for editing and deleting messages',
'MCHAT_EDIT_DELETE_LIMIT_EXPLAIN' => 'Messages older than the specified number of seconds cannot be edited or deleted by the author any more.<br />Users who have <em>edit/delete permission as well as moderator permission are exempt</em> from this time limit.<br />Set to 0 to allow unlimited editing and deleting.',
'MCHAT_MAX_MESSAGE_LENGTH' => 'Maximum message length',
'MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN' => 'Maximum number of characters allowed per message posted.<br /><em>You are limited from 0 to 1000. Default is 500. Set to 0 to disable.</em>',
'MCHAT_CUSTOM_PAGE' => 'Enable custom Page',
'MCHAT_CUSTOM_PAGE_EXPLAIN' => 'Allow the use of the custom page',
'MCHAT_CUSTOM_HEIGHT' => 'Custom page height',
'MCHAT_CUSTOM_HEIGHT_EXPLAIN' => 'The height of the chat box in pixels on the custom page.<br /><em>You are limited from 50 to 1000. Default is 350.</em>',
'MCHAT_BBCODES_DISALLOWED' => 'Disallowed bbcodes',
'MCHAT_BBCODES_DISALLOWED_EXPLAIN' => 'Here you can input the bbcodes that are <strong>not</strong> to be used in a message.<br />Separate bbcodes with a vertical bar, for example: <br />b|i|u|code|list|list=|flash|quote and/or a %1$scustom bbcode tag name%2$s',
'MCHAT_STATIC_MESSAGE' => 'Static message',
'MCHAT_STATIC_MESSAGE_EXPLAIN' => 'Here you can define a static message to display to users of the chat. HTML code is allowed.<br />Set to empty to disable the display. <em>You are limited to 255 characters.</em><br />This message can be translated: edit the MCHAT_STATIC_MESSAGE language key in /ext/dmzx/mchat/language/XX/mchat.php.',
'MCHAT_USER_TIMEOUT' => 'User session timeout',
'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_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_ACP_GLOBALSETTINGS_TITLE' => 'mChat Global settings',
'MCHAT_ACP_GLOBALUSERSETTINGS_TITLE' => 'mChat Global user settings',
'MCHAT_VERSION' => 'Version',
'MCHAT_RULES' => 'Rules',
'MCHAT_RULES_EXPLAIN' => 'Enter the rules of the forum here. HTML code is allowed. <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_AVATARS' => 'Display avatars',
'MCHAT_AVATARS_EXPLAIN' => 'If set to yes, resized user avatars will be displayed',
'MCHAT_INDEX' => 'Display mChat on the index page',
'MCHAT_INDEX_HEIGHT' => 'Index page height',
'MCHAT_INDEX_HEIGHT_EXPLAIN' => 'The height of the chat box in pixels on the index page.<br /><em>You are limited from 50 to 1000. Default is 250.</em>',
'MCHAT_TOP_OF_FORUM' => 'Top',
'MCHAT_BOTTOM_OF_FORUM' => 'Bottom',
'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_LIVE_UPDATES' => 'Live updates of edited and deleted messages',
'MCHAT_LIVE_UPDATES_EXPLAIN' => 'When a user edits or deletes messages, the changes are updated live for all others, without them having to refresh the page. Disable this if you experience performance issues.',
'MCHAT_PRUNE' => 'Enable message pruning',
'MCHAT_PRUNE_EXPLAIN' => 'Only occurs if a user views the custom or archive pages.',
'MCHAT_PRUNE_NUM' => 'Number of messages to retain when pruning',
'MCHAT_NAVBAR_LINK' => 'Display link to the custom page in the navbar',
'MCHAT_MESSAGE_NUM_CUSTOM' => 'Initial number of messages to display on the custom page',
'MCHAT_MESSAGE_NUM_CUSTOM_EXPLAIN' => '<em>You are limited from 5 to 50. Default is 10.</em>',
'MCHAT_MESSAGE_NUM_INDEX' => 'Initial number of messages to display on the index page',
'MCHAT_MESSAGE_NUM_INDEX_EXPLAIN' => '<em>You are limited from 5 to 50. Default is 10.</em>',
'MCHAT_MESSAGE_NUM_ARCHIVE' => 'Number of messages to display on the archive page',
'MCHAT_MESSAGE_NUM_ARCHIVE_EXPLAIN' => 'The maximum number of messages to show per page on the archive page.<br /><em>You are limited from 10 to 100. Default is 25.</em>',
'MCHAT_FLOOD_TIME' => 'Flood time',
'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_EDIT_DELETE_LIMIT' => 'Time limit for editing and deleting messages',
'MCHAT_EDIT_DELETE_LIMIT_EXPLAIN' => 'Messages older than the specified number of seconds cannot be edited or deleted by the author any more.<br />Users who have <em>edit/delete permission as well as moderator permission are exempt</em> from this time limit.<br />Set to 0 to allow unlimited editing and deleting.',
'MCHAT_MAX_MESSAGE_LENGTH' => 'Maximum message length',
'MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN' => 'Maximum number of characters allowed per message posted.<br /><em>You are limited from 0 to 1000. Default is 500. Set to 0 to disable.</em>',
'MCHAT_CUSTOM_PAGE' => 'Enable custom Page',
'MCHAT_CUSTOM_PAGE_EXPLAIN' => 'Allow the use of the custom page',
'MCHAT_CUSTOM_HEIGHT' => 'Custom page height',
'MCHAT_CUSTOM_HEIGHT_EXPLAIN' => 'The height of the chat box in pixels on the custom page.<br /><em>You are limited from 50 to 1000. Default is 350.</em>',
'MCHAT_BBCODES_DISALLOWED' => 'Disallowed bbcodes',
'MCHAT_BBCODES_DISALLOWED_EXPLAIN' => 'Here you can input the bbcodes that are <strong>not</strong> to be used in a message.<br />Separate bbcodes with a vertical bar, for example: <br />b|i|u|code|list|list=|flash|quote and/or a %1$scustom bbcode tag name%2$s',
'MCHAT_STATIC_MESSAGE' => 'Static message',
'MCHAT_STATIC_MESSAGE_EXPLAIN' => 'Here you can define a static message to display to users of the chat. HTML code is allowed.<br />Set to empty to disable the display. <em>You are limited to 255 characters.</em><br />This message can be translated: edit the MCHAT_STATIC_MESSAGE language key in /ext/dmzx/mchat/language/XX/mchat.php.',
'MCHAT_USER_TIMEOUT' => 'User session timeout',
'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_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_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_PURGE' => 'Delete all messages now',
'MCHAT_PURGE_CONFIRM' => 'Confirm deleting all messages',
'MCHAT_PURGED' => 'All mChat messages have been successfully deleted',
'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_SOUND' => 'Play sounds for new, edited and deleted messages',
'MCHAT_PURGE' => 'Delete all messages now',
'MCHAT_PURGE_CONFIRM' => 'Confirm deleting all messages',
'MCHAT_PURGED' => 'All mChat messages have been successfully deleted',
// Error reporting
'TOO_LONG_MCHAT_BBCODE_DISALLOWED' => 'The disallowed bbcodes value is too long.',
'TOO_SMALL_MCHAT_CUSTOM_HEIGHT' => 'The custom height value is too small.',
'TOO_LARGE_MCHAT_CUSTOM_HEIGHT' => 'The custom height value is too large.',
'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_SMALL_MCHAT_FLOOD_TIME' => 'The flood time value is too small.',
'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_LARGE_MCHAT_INDEX_HEIGHT' => 'The index height value is too large.',
'TOO_SMALL_MCHAT_MAX_MESSAGE_LNGTH' => 'The max message length value is too small.',
'TOO_LARGE_MCHAT_MAX_MESSAGE_LNGTH' => 'The max message length value is too large.',
'TOO_SMALL_MCHAT_MESSAGE_NUM_CUSTOM' => 'The number of message to display on the custom page is too small.',
'TOO_LARGE_MCHAT_MESSAGE_NUM_CUSTOM' => 'The number of message to display on the custom page is too large.',
'TOO_SMALL_MCHAT_MESSAGE_NUM_INDEX' => 'The number of messages to display on the index page is too small.',
'TOO_LARGE_MCHAT_MESSAGE_NUM_INDEX' => 'The number of messages to display on the index page is too large.',
'TOO_SMALL_MCHAT_MESSAGE_NUM_ARCHIVE' => 'The number of message to display on the archive page is too small.',
'TOO_LARGE_MCHAT_MESSAGE_NUM_ARCHIVE' => 'The number of message to display on the archive page is too large.',
'TOO_SMALL_MCHAT_REFRESH' => 'The refresh value is too small.',
'TOO_LARGE_MCHAT_REFRESH' => 'The refresh value is too large.',
'TOO_LONG_MCHAT_STATIC_MESSAGE' => 'The static message value is too long.',
'TOO_SMALL_MCHAT_TIMEOUT' => 'The user timeout value is too small.',
'TOO_LARGE_MCHAT_TIMEOUT' => 'The user timeout value is too large.',
'TOO_SMALL_MCHAT_WHOIS_REFRESH' => 'The whois refresh value is too small.',
'TOO_LARGE_MCHAT_WHOIS_REFRESH' => 'The whois refresh value is too large.',
'TOO_LONG_MCHAT_BBCODE_DISALLOWED' => 'The disallowed bbcodes value is too long.',
'TOO_SMALL_MCHAT_CUSTOM_HEIGHT' => 'The custom height value is too small.',
'TOO_LARGE_MCHAT_CUSTOM_HEIGHT' => 'The custom height value is too large.',
'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_SMALL_MCHAT_FLOOD_TIME' => 'The flood time value is too small.',
'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_LARGE_MCHAT_INDEX_HEIGHT' => 'The index height value is too large.',
'TOO_SMALL_MCHAT_MAX_MESSAGE_LNGTH' => 'The max message length value is too small.',
'TOO_LARGE_MCHAT_MAX_MESSAGE_LNGTH' => 'The max message length value is too large.',
'TOO_SMALL_MCHAT_MESSAGE_NUM_CUSTOM' => 'The number of message to display on the custom page is too small.',
'TOO_LARGE_MCHAT_MESSAGE_NUM_CUSTOM' => 'The number of message to display on the custom page is too large.',
'TOO_SMALL_MCHAT_MESSAGE_NUM_INDEX' => 'The number of messages to display on the index page is too small.',
'TOO_LARGE_MCHAT_MESSAGE_NUM_INDEX' => 'The number of messages to display on the index page is too large.',
'TOO_SMALL_MCHAT_MESSAGE_NUM_ARCHIVE' => 'The number of message to display on the archive page is too small.',
'TOO_LARGE_MCHAT_MESSAGE_NUM_ARCHIVE' => 'The number of message to display on the archive page is too large.',
'TOO_SMALL_MCHAT_REFRESH' => 'The refresh value is too small.',
'TOO_LARGE_MCHAT_REFRESH' => 'The refresh value is too large.',
'TOO_LONG_MCHAT_STATIC_MESSAGE' => 'The static message value is too long.',
'TOO_SMALL_MCHAT_TIMEOUT' => 'The user timeout value is too small.',
'TOO_LARGE_MCHAT_TIMEOUT' => 'The user timeout value is too large.',
'TOO_SMALL_MCHAT_WHOIS_REFRESH' => 'The whois refresh value is too small.',
'TOO_LARGE_MCHAT_WHOIS_REFRESH' => 'The whois refresh value is too large.',
));

View File

@@ -13,9 +13,6 @@ namespace dmzx\mchat\migrations;
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;
@@ -24,11 +21,6 @@ class mchat_2_0_0_rc3 extends \phpbb\db\migration\migration
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)
@@ -62,7 +54,7 @@ class mchat_2_0_0_rc3 extends \phpbb\db\migration\migration
}
return array_merge($update_data, array(
array('config.add', array('mchat_version', self::MCHAT_VERSION)),
array('config.add', array('mchat_version', '2.0.0-RC3')),
// Add user permissions
array('permission.add', array('u_mchat_use', true)),

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

@@ -94,17 +94,6 @@ jQuery(function($) {
};
$.extend(mChat, {
clear: function() {
if (mChat.cached('input').val() !== '') {
if (confirm(mChat.clearConfirm)) {
mChat.resetSession();
mChat.cached('input').val('').keyup().trigger('autogrow');
}
setTimeout(function() {
mChat.cached('input').focus();
}, 1);
}
},
sound: function(file) {
if (!mChat.pageIsUnloading && !Cookies.get('mchat_no_sound')) {
var audio = mChat.cached('sound-' + file).get(0);
@@ -189,6 +178,9 @@ jQuery(function($) {
});
},
refresh: function(message) {
if (mChat.isPaused && !message) {
return false;
}
var $messages = mChat.cached('messages').children();
var data = {
message_last_id: mChat.messageIds.length ? mChat.messageIds.max() : 0
@@ -371,9 +363,6 @@ jQuery(function($) {
clearInterval(mChat.whoisInterval);
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-load', 'status-error', 'status-paused').hide();
mChat.cached('refresh-text').html(mChat.refreshYes);
@@ -396,6 +385,18 @@ jQuery(function($) {
mChat.cached('status-paused').show();
mChat.cached('refresh-text').html(mChat.refreshNo);
},
pauseStart: function() {
mChat.isPaused = true;
mChat.cached('refresh-text').html(mChat.refreshNo);
mChat.cached('status-load', 'status-ok', 'status-error').hide();
mChat.cached('status-paused').show();
},
pauseEnd: function() {
mChat.cached('refresh-text').html(mChat.refreshYes);
mChat.cached('status-load', 'status-error', 'status-paused').hide();
mChat.cached('status-ok').show();
mChat.isPaused = false;
},
mention: function() {
var $container = $(this).closest('.mchat-message');
var username = mChat.entityDecode($container.data('mchat-username'));
@@ -455,10 +456,12 @@ jQuery(function($) {
}).get();
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.isPaused = false;
if (!mChat.archivePage) {
mChat.resetSession();
@@ -492,10 +495,8 @@ jQuery(function($) {
}
});
mChat.startRelativeTimeUpdate(mChat.cached('messages'));
if (mChat.cached('input').is('input')) {
$('#mchat-form').keypress(function(e) {
mChat.cached('form').keypress(function(e) {
if (e.which == 13) {
mChat.add();
e.preventDefault();
@@ -504,8 +505,21 @@ jQuery(function($) {
});
}
if (mChat.pause) {
mChat.cached('form').keyup(function(e) {
if (mChat.refreshInterval !== false) {
var val = mChat.cached('input').val();
if (mChat.isPaused && val === '') {
mChat.pauseEnd();
} else if (!mChat.isPaused && val !== '') {
mChat.pauseStart();
}
}
});
}
if (mChat.showCharCount) {
$('#mchat-form').keyup(function(e) {
mChat.cached('form').keyup(function(e) {
var count = mChat.inputMessageLength();
var $elem = mChat.cached('character-count');
$elem.html(mChat.charCount.format({current: count, max: mChat.mssgLngth})).css('visibility', count > 0 ? 'visible' : 'hidden');
@@ -515,12 +529,16 @@ jQuery(function($) {
});
}
mChat.cached('input').autoGrowInput({
minWidth: mChat.cached('input').width(),
maxWidth: mChat.cached('form').width() - (mChat.cached('input').outerWidth(true) - mChat.cached('input').width())
mChat.cached('form').one('keypress', function() {
mChat.cached('input').autoGrowInput({
minWidth: mChat.cached('input').width(),
maxWidth: mChat.cached('form').width() - (mChat.cached('input').outerWidth(true) - mChat.cached('input').width())
});
});
}
mChat.startRelativeTimeUpdate(mChat.cached('messages'));
$(window).on('beforeunload', function() {
mChat.pageIsUnloading = true;
});

View File

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

View File

@@ -24,16 +24,29 @@
<!-- ENDIF -->
<!-- EVENT dmzx_mchat_body_before -->
<!-- IF MCHAT_IS_COLLAPSIBLE -->
<a class="category<!-- IF S_MCHAT_HIDDEN --> hidden-category<!-- ENDIF --> mchat-category"></a>
<!-- ENDIF -->
<div class="forabg">
<a id="mChat"></a>
<div class="inner">
<ul class="topiclist">
<li class="header">
<!-- 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>
</ul>
<div id="mchat-body" class="postbody">
<div id="mchat-body" class="postbody<!-- IF MCHAT_IS_COLLAPSIBLE --> collapsible<!-- ENDIF -->">
<!-- INCLUDE mchat_script_data.html -->
<!-- IF not MCHAT_SOUND_DISABLED -->

View File

@@ -13,7 +13,7 @@
<noscript><div class="error">{L_MCHAT_NOJAVASCRIPT}</div></noscript>
<!-- IF MCHAT_ALLOW_USE -->
<!-- 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 -->
<textarea id="mchat-input" name="message" class="inputbox no-auto-resize" cols="32" rows="5"></textarea>
<!-- ENDIF -->
@@ -22,9 +22,6 @@
<div id="mchat-buttons">
<!-- IF MCHAT_ALLOW_USE -->
<input id="mchat-add" type="button" class="button2" 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 -->
<input type="button" class="button2" data-mchat-toggle="smilies" value="{L_MCHAT_SMILES}" />
<!-- ENDIF -->

View File

@@ -25,12 +25,12 @@
userTimeout : {MCHAT_USER_TIMEOUT},
mssgLngth : {MCHAT_MESSAGE_LNGTH},
editDeleteLimit : {MCHAT_EDIT_DELETE_LIMIT},
removeBBCodes : '{MCHAT_DISALLOWED_BBCODES}',
removeBBCodes : '{A_MCHAT_DISALLOWED_BBCODES}',
// Language
minutesAgo : {
<!-- BEGIN mchattime -->
{mchattime.KEY}: '{mchattime.LANG}'<!-- IF not mchattime.IS_LAST -->,<!-- ENDIF -->
{mchattime.KEY}: '{mchattime.A_LANG}'<!-- IF not mchattime.IS_LAST -->,<!-- ENDIF -->
<!-- END mchattime -->
},
newMessageAlert : '{LA_MCHAT_NEW_CHAT}',
@@ -40,13 +40,12 @@
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}',
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 : '{MCHAT_MESS_LONG}',
mssgLngthLong : '{A_MCHAT_MESS_LONG}',
likes : '{LA_MCHAT_LIKES}'
};
// ]]>

View File

@@ -130,10 +130,14 @@
.mchat-text {
clear: both;
overflow: hidden;
padding: 0 5px 2px;
padding: 2px 5px;
font-size: 1.2em;
}
.mchat-text strong {
font-weight: bold !important;
}
.mchat-text li {
display: list-item !important;
list-style-type: inherit !important;
@@ -324,3 +328,19 @@
#mchat-panel #abbc3_buttons .abbc3_buttons_row {
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;
}