Version 2.0.0-RC3
@@ -1,4 +1,4 @@
|
||||
# mChat Extension for phpBB 3.1
|
||||
# mChat Extension
|
||||
|
||||
[](https://travis-ci.org/dmzx/mChat-Extension)
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
3. In the `ext` directory of your phpBB board, create a new directory named `dmzx` (if it does not already exist).
|
||||
4. Copy the `mchat` folder to `/ext/dmzx/` (if done correctly, you'll have the main extension class at (your forum root)/ext/dmzx/mchat/composer.json).
|
||||
5. Navigate in the ACP to `Customise -> Manage extensions`.
|
||||
6. Look for `mChat Extension for phpBB 3.1` under the Disabled Extensions list, and click its `Enable` link.
|
||||
6. Look for `mChat Extension` under the Disabled Extensions list, and click its `Enable` link.
|
||||
|
||||
## Uninstall
|
||||
|
||||
1. Navigate in the ACP to `Customise -> Extension Management -> Extensions`.
|
||||
2. Look for `mChat Extension for phpBB 3.1` under the Enabled Extensions list, and click its `Disable` link.
|
||||
2. Look for `mChat Extension` under the Enabled Extensions list, and click its `Disable` link.
|
||||
3. To permanently uninstall, click `Delete Data` and then delete the `/ext/dmzx/mchat` folder.
|
||||
|
||||
## License
|
||||
|
||||
@@ -19,8 +19,13 @@ class acp_mchat_info
|
||||
'filename' => '\dmzx\mchat\acp\acp_mchat_module',
|
||||
'title' => 'ACP_CAT_MCHAT',
|
||||
'modes' => array(
|
||||
'configuration' => array(
|
||||
'title' => 'ACP_MCHAT_CONFIG',
|
||||
'globalsettings' => array(
|
||||
'title' => 'ACP_MCHAT_GLOBALSETTINGS',
|
||||
'auth' => 'ext_dmzx/mchat && acl_a_mchat',
|
||||
'cat' => array('ACP_CAT_MCHAT'),
|
||||
),
|
||||
'globalusersettings' => array(
|
||||
'title' => 'ACP_MCHAT_GLOBALUSERSETTINGS',
|
||||
'auth' => 'ext_dmzx/mchat && acl_a_mchat',
|
||||
'cat' => array('ACP_CAT_MCHAT'),
|
||||
),
|
||||
|
||||
@@ -20,14 +20,14 @@ class acp_mchat_module
|
||||
global $phpbb_container, $user;
|
||||
|
||||
// Add the ACP lang file
|
||||
$user->add_lang_ext('dmzx/mchat', 'mchat_acp');
|
||||
$user->add_lang_ext('dmzx/mchat', array('mchat_acp', 'mchat_ucp'));
|
||||
|
||||
// Set template
|
||||
$this->tpl_name = 'acp_mchat';
|
||||
$this->page_title = 'MCHAT_ACP_TITLE';
|
||||
$this->tpl_name = 'acp_mchat_' . strtolower($mode);
|
||||
$this->page_title = 'MCHAT_ACP_' . strtoupper($mode) . '_TITLE';
|
||||
|
||||
// Get an instance of the ACP controller and display the options
|
||||
$controller = $phpbb_container->get('dmzx.mchat.acp.controller');
|
||||
$controller->display_options($this->u_action);
|
||||
$controller->$mode($this->u_action);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
|
||||
{L_MCHAT_VERSION}{L_COLON} <em>{MCHAT_VERSION}</em>
|
||||
|
||||
<!-- IF MCHAT_ERROR -->
|
||||
<div class="errorbox">
|
||||
<h3>{L_WARNING}</h3>
|
||||
<p>{MCHAT_ERROR}</p>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<form id="acp_mchat" method="post" action="{U_ACTION}">
|
||||
<!-- IF MCHAT_PURGE and MCHAT_FOUNDER -->
|
||||
<fieldset>
|
||||
@@ -18,27 +25,18 @@
|
||||
<!-- ELSE -->
|
||||
<fieldset>
|
||||
<legend>{L_MCHAT_SETTINGS_INDEX}</legend>
|
||||
<dl>
|
||||
<dt><label for="mchat_on_index">{L_MCHAT_ON_INDEX}{L_COLON}</label></dt>
|
||||
<dd><label><input type="radio" class="radio" name="mchat_on_index" value="1"<!-- IF MCHAT_ON_INDEX --> id="mchat_on_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" class="radio" name="mchat_on_index" value="0"<!-- IF not MCHAT_ON_INDEX --> id="mchat_on_index" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="mchat_location">{L_MCHAT_LOCATION}{L_COLON}</label></dt>
|
||||
<dd><label><input type="radio" class="radio" name="mchat_location" value="1"<!-- IF MCHAT_LOCATION --> id="mchat_location" checked="checked"<!-- ENDIF --> /> {L_MCHAT_TOP_OF_FORUM}</label>
|
||||
<label><input type="radio" class="radio" name="mchat_location" value="0"<!-- IF not MCHAT_LOCATION --> id="mchat_location" checked="checked"<!-- ENDIF --> /> {L_MCHAT_BOTTOM_OF_FORUM}</label></dd>
|
||||
</dl>
|
||||
<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">{L_MCHAT_MESSAGE_NUM}{L_COLON}</label><br />
|
||||
<span>{L_MCHAT_MESSAGE_NUM_EXPLAIN}</span></dt>
|
||||
<dd><input type="text" name="mchat_message_num" id="mchat_message_num" size="10" maxlength="4" value="{MCHAT_MESSAGE_NUM}" /></dd>
|
||||
<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>
|
||||
@@ -53,9 +51,9 @@
|
||||
<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_limit">{L_MCHAT_MESSAGE_LIMIT}{L_COLON}</label><br />
|
||||
<span>{L_MCHAT_MESSAGE_LIMIT_EXPLAIN}</span></dt>
|
||||
<dd><input type="text" name="mchat_message_limit" id="mchat_message_limit" size="10" value="{MCHAT_MESSAGE_LIMIT}" /></dd>
|
||||
<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>
|
||||
@@ -66,9 +64,9 @@
|
||||
<fieldset>
|
||||
<legend>{L_MCHAT_SETTINGS_ARCHIVE}</legend>
|
||||
<dl>
|
||||
<dt><label for="mchat_archive_limit">{L_MCHAT_ARCHIVE_LIMIT}{L_COLON}</label><br />
|
||||
<span>{L_MCHAT_ARCHIVE_LIMIT_EXPLAIN}</span></dt>
|
||||
<dd><input type="text" name="mchat_archive_limit" id="mchat_archive_limit" size="10" value="{MCHAT_ARCHIVE_LIMIT}" /></dd>
|
||||
<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>
|
||||
@@ -85,7 +83,7 @@
|
||||
</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></dt>
|
||||
<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>
|
||||
@@ -94,39 +92,6 @@
|
||||
<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_message_top">{L_MCHAT_MESSAGE_TOP}{L_COLON}</label><br />
|
||||
<span>{L_MCHAT_MESSAGE_TOP_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="mchat_message_top" value="1"<!-- IF MCHAT_MESSAGE_TOP --> id="mchat_message_top" checked="checked"<!-- ENDIF --> /> {L_MCHAT_TOP}</label>
|
||||
<label><input type="radio" class="radio" name="mchat_message_top" value="0"<!-- IF not MCHAT_MESSAGE_TOP --> id="mchat_message_top" checked="checked"<!-- ENDIF --> /> {L_MCHAT_BOTTOM}</label></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="mchat_avatars">{L_MCHAT_AVATARS}{L_COLON}</label><br />
|
||||
<span>{L_MCHAT_AVATARS_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="mchat_avatars" value="1"<!-- IF MCHAT_AVATARS --> id="mchat_avatars" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" class="radio" name="mchat_avatars" value="0"<!-- IF not MCHAT_AVATARS --> id="mchat_avatars" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="mchat_dateoptions">{L_MCHAT_DATE_FORMAT}{L_COLON}</label><br /><span>{L_MCHAT_DATE_FORMAT_EXPLAIN}</span></dt>
|
||||
<dd>
|
||||
<select name="mchat_dateoptions" id="mchat_dateoptions" onchange="if(this.value=='custom'){phpbb.toggleDisplay('custom_date',1);}else{phpbb.toggleDisplay('custom_date',-1);} if (this.value == 'custom') { document.getElementById('mchat_date').value = default_dateformat; } else { document.getElementById('mchat_date').value = this.value; }">
|
||||
{S_MCHAT_DATEFORMAT_OPTIONS}
|
||||
</select>
|
||||
</dd>
|
||||
<dd><div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="mchat_date" id="mchat_date" value="{MCHAT_DATE}" maxlength="30" /></div></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="mchat_relative_time">{L_MCHAT_RELATIVE_TIME}{L_COLON}</label><br />
|
||||
<span>{L_MCHAT_RELATIVE_TIME_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="mchat_relative_time" value="1"<!-- IF MCHAT_RELATIVE_TIME --> id="mchat_relative_time" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" class="radio" name="mchat_relative_time" value="0"<!-- IF not MCHAT_RELATIVE_TIME --> id="mchat_relative_time" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="mchat_pause_on_input">{L_MCHAT_PAUSE_ON_INPUT}{L_COLON}</label><br />
|
||||
<span>{L_MCHAT_PAUSE_ON_INPUT_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="mchat_pause_on_input" value="1"<!-- IF MCHAT_PAUSE_ON_INPUT --> id="mchat_pause_on_input" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" class="radio" name="mchat_pause_on_input" value="0"<!-- IF not MCHAT_PAUSE_ON_INPUT --> id="mchat_pause_on_input" 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>
|
||||
@@ -168,28 +133,40 @@
|
||||
<fieldset>
|
||||
<legend>{L_MCHAT_SETTINGS_POSTS}</legend>
|
||||
<dl>
|
||||
<dt><label for="mchat_new_posts_topic">{L_MCHAT_NEW_POSTS_TOPIC}{L_COLON}</label><br />
|
||||
<span>{L_MCHAT_NEW_POSTS_TOPIC_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="mchat_new_posts_topic" value="1"<!-- IF MCHAT_NEW_POSTS_TOPIC --> id="mchat_new_posts_topic" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" class="radio" name="mchat_new_posts_topic" value="0"<!-- IF not MCHAT_NEW_POSTS_TOPIC --> id="mchat_new_posts_topic" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
<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_new_posts_reply">{L_MCHAT_NEW_POSTS_REPLY}{L_COLON}</label><br />
|
||||
<span>{L_MCHAT_NEW_POSTS_REPLY_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="mchat_new_posts_reply" value="1"<!-- IF MCHAT_NEW_POSTS_REPLY --> id="mchat_new_posts_reply" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" class="radio" name="mchat_new_posts_reply" value="0"<!-- IF not MCHAT_NEW_POSTS_REPLY --> id="mchat_new_posts_reply" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
<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_new_posts_edit">{L_MCHAT_NEW_POSTS_EDIT}{L_COLON}</label><br />
|
||||
<span>{L_MCHAT_NEW_POSTS_EDIT_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="mchat_new_posts_edit" value="1"<!-- IF MCHAT_NEW_POSTS_EDIT --> id="mchat_new_posts_edit" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" class="radio" name="mchat_new_posts_edit" value="0"<!-- IF not MCHAT_NEW_POSTS_EDIT --> id="mchat_new_posts_edit" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
<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_new_posts_quote">{L_MCHAT_NEW_POSTS_QUOTE}{L_COLON}</label><br />
|
||||
<span>{L_MCHAT_NEW_POSTS_QUOTE_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="mchat_new_posts_quote" value="1"<!-- IF MCHAT_NEW_POSTS_QUOTE --> id="mchat_new_posts_quote" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" class="radio" name="mchat_new_posts_quote" value="0"<!-- IF not MCHAT_NEW_POSTS_QUOTE --> id="mchat_new_posts_quote" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
<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>
|
||||
@@ -211,25 +188,7 @@
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{L_MCHAT_SETTINGS_STATS}</legend>
|
||||
<dl>
|
||||
<dt><label for="mchat_whois">{L_MCHAT_WHOIS}{L_COLON}</label></dt>
|
||||
<dd><label><input type="radio" class="radio" name="mchat_whois" value="1"<!-- IF MCHAT_WHOIS --> id="mchat_whois" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" class="radio" name="mchat_whois" value="0"<!-- IF not MCHAT_WHOIS --> id="mchat_whois" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="mchat_stats_index">{L_MCHAT_STATS_INDEX}{L_COLON}</label><br />
|
||||
<span>{L_MCHAT_STATS_INDEX_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="mchat_stats_index" value="1"<!-- IF MCHAT_STATS_INDEX --> id="mchat_stats_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" class="radio" name="mchat_stats_index" value="0"<!-- IF not MCHAT_STATS_INDEX --> id="mchat_stats_index" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="mchat_whois">{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" size="10" value="{MCHAT_WHOIS_REFRESH}" /></dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
<!-- EVENT acp_dmzx_mchat_globalsettings_after -->
|
||||
<p class="submit-buttons">
|
||||
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
|
||||
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
|
||||
28
adm/style/acp_mchat_globalusersettings.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<!-- INCLUDE overall_header.html -->
|
||||
|
||||
<h1>{L_MCHAT_TITLE}</h1>
|
||||
|
||||
{L_MCHAT_VERSION}{L_COLON} <em>{MCHAT_VERSION}</em>
|
||||
|
||||
<div class="successbox notice">{L_MCHAT_GLOBALUSERSETTINGS_EXPLAIN}</div>
|
||||
|
||||
<!-- IF MCHAT_ERROR -->
|
||||
<div class="errorbox">
|
||||
<h3>{L_WARNING}</h3>
|
||||
<p>{MCHAT_ERROR}</p>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<form id="acp_mchat" method="post" action="{U_ACTION}">
|
||||
<fieldset>
|
||||
<legend>{L_MCHAT_ACP_GLOBALUSERSETTINGS_TITLE}</legend>
|
||||
<!-- INCLUDE acp_mchat_globalusersettings_content.html -->
|
||||
</fieldset>
|
||||
<p class="submit-buttons">
|
||||
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
|
||||
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
|
||||
{S_FORM_TOKEN}
|
||||
</p>
|
||||
</form>
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
102
adm/style/acp_mchat_globalusersettings_content.html
Normal file
@@ -0,0 +1,102 @@
|
||||
<dl>
|
||||
<dt><label for="user_mchat_index">{L_MCHAT_INDEX}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_index" value="1"<!-- IF MCHAT_INDEX --> id="user_mchat_index" checked="checked"<!-- ENDIF --><!-- IF MCHAT_INDEX_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_index" value="0"<!-- IF not MCHAT_INDEX --> id="user_mchat_index" checked="checked"<!-- ENDIF --><!-- IF MCHAT_INDEX_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_whois_index">{L_MCHAT_WHOIS_INDEX}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_whois_index" value="1"<!-- IF MCHAT_WHOIS_INDEX --> id="user_mchat_whois_index" checked="checked"<!-- ENDIF --><!-- IF MCHAT_WHOIS_INDEX_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_whois_index" value="0"<!-- IF not MCHAT_WHOIS_INDEX --> id="user_mchat_whois_index" checked="checked"<!-- ENDIF --><!-- IF MCHAT_WHOIS_INDEX_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_stats_index">{L_MCHAT_STATS_INDEX}{L_COLON}</label><br /><span>{L_MCHAT_STATS_INDEX_EXPLAIN}</span></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_stats_index" value="1"<!-- IF MCHAT_STATS_INDEX --> id="user_mchat_stats_index" checked="checked"<!-- ENDIF --><!-- IF MCHAT_STATS_INDEX_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_stats_index" value="0"<!-- IF not MCHAT_STATS_INDEX --> id="user_mchat_stats_index" checked="checked"<!-- ENDIF --><!-- IF MCHAT_STATS_INDEX_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_location">{L_MCHAT_LOCATION}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_location" value="1"<!-- IF MCHAT_LOCATION --> id="user_mchat_location" checked="checked"<!-- ENDIF --><!-- IF MCHAT_LOCATION_NOAUTH --> disabled<!-- ENDIF --> /> {L_MCHAT_TOP}</label>
|
||||
<label><input type="radio" name="user_mchat_location" value="0"<!-- IF not MCHAT_LOCATION --> id="user_mchat_location" checked="checked"<!-- ENDIF --><!-- IF MCHAT_LOCATION_NOAUTH --> disabled<!-- ENDIF --> /> {L_MCHAT_BOTTOM}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<hr />
|
||||
<dl>
|
||||
<dt><label for="user_mchat_message_top">{L_MCHAT_MESSAGE_TOP}{L_COLON}</label><br /><span>{L_MCHAT_MESSAGE_TOP_EXPLAIN}</span></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_message_top" value="1"<!-- IF MCHAT_MESSAGE_TOP --> id="user_mchat_message_top" checked="checked"<!-- ENDIF --><!-- IF MCHAT_MESSAGE_TOP_NOAUTH --> disabled<!-- ENDIF --> /> {L_MCHAT_TOP}</label>
|
||||
<label><input type="radio" name="user_mchat_message_top" value="0"<!-- IF not MCHAT_MESSAGE_TOP --> id="user_mchat_message_top" checked="checked"<!-- ENDIF --><!-- IF MCHAT_MESSAGE_TOP_NOAUTH --> disabled<!-- ENDIF --> /> {L_MCHAT_BOTTOM}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_capital_letter">{L_MCHAT_CAPITAL_LETTER}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_capital_letter" value="1"<!-- IF MCHAT_CAPITAL_LETTER --> id="user_mchat_capital_letter" checked="checked"<!-- ENDIF --><!-- IF MCHAT_CAPITAL_LETTER_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_capital_letter" value="0"<!-- IF not MCHAT_CAPITAL_LETTER --> id="user_mchat_capital_letter" checked="checked"<!-- ENDIF --><!-- IF MCHAT_CAPITAL_LETTER_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_sound">{L_MCHAT_SOUND}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_sound" value="1"<!-- IF MCHAT_SOUND --> id="user_mchat_sound" checked="checked"<!-- ENDIF --><!-- IF MCHAT_SOUND_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_sound" value="0"<!-- IF not MCHAT_SOUND --> id="user_mchat_sound" checked="checked"<!-- ENDIF --><!-- IF MCHAT_SOUND_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_avatars">{L_MCHAT_AVATARS}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_avatars" value="1"<!-- IF MCHAT_AVATARS --> id="user_mchat_avatars" checked="checked"<!-- ENDIF --><!-- IF MCHAT_AVATARS_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_avatars" value="0"<!-- IF not MCHAT_AVATARS --> id="user_mchat_avatars" checked="checked"<!-- ENDIF --><!-- IF MCHAT_AVATARS_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_input_area">{L_MCHAT_CHAT_AREA}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_input_area" value="1"<!-- IF MCHAT_INPUT_AREA --> id="user_mchat_input_area" checked="checked"<!-- ENDIF --><!-- IF MCHAT_INPUT_AREA_NOAUTH --> disabled<!-- ENDIF --> /> {L_MCHAT_INPUT_AREA}</label>
|
||||
<label><input type="radio" name="user_mchat_input_area" value="0"<!-- IF not MCHAT_INPUT_AREA --> id="user_mchat_input_area" checked="checked"<!-- ENDIF --><!-- IF MCHAT_INPUT_AREA_NOAUTH --> disabled<!-- ENDIF --> /> {L_MCHAT_TEXT_AREA}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_character_count">{L_MCHAT_CHARACTER_COUNT}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_character_count" value="1"<!-- IF MCHAT_CHARACTER_COUNT --> id="user_mchat_character_count" checked="checked"<!-- ENDIF --><!-- IF MCHAT_CHARACTER_COUNT_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_character_count" value="0"<!-- IF not MCHAT_CHARACTER_COUNT --> id="user_mchat_character_count" checked="checked"<!-- ENDIF --><!-- IF MCHAT_CHARACTER_COUNT_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_pause_on_input">{L_MCHAT_PAUSE_ON_INPUT}{L_COLON}</label><br /><span>{L_MCHAT_PAUSE_ON_INPUT_EXPLAIN}</span></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_pause_on_input" value="1"<!-- IF MCHAT_PAUSE_ON_INPUT --> id="user_mchat_pause_on_input" checked="checked"<!-- ENDIF --><!-- IF MCHAT_PAUSE_ON_INPUT_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_pause_on_input" value="0"<!-- IF not MCHAT_PAUSE_ON_INPUT --> id="user_mchat_pause_on_input" checked="checked"<!-- ENDIF --><!-- IF MCHAT_PAUSE_ON_INPUT_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_dateoptions">{L_MCHAT_DATE_FORMAT}{L_COLON}</label><br /><span>{L_MCHAT_DATE_FORMAT_EXPLAIN}</span></dt>
|
||||
<dd>
|
||||
<select name="user_mchat_dateoptions" id="user_mchat_dateoptions" onchange="phpbb.toggleDisplay('user_mchat_custom_date', this.value == 'custom' ? 1 : -1); document.getElementById('user_mchat_date').value = this.value == 'custom' ? '{A_MCHAT_DEFAULT_DATEFORMAT}' : this.value;"<!-- IF MCHAT_DATE_NOAUTH --> disabled<!-- ENDIF -->>
|
||||
{S_MCHAT_DATEFORMAT_OPTIONS}
|
||||
</select>
|
||||
</dd>
|
||||
<dd><div id="user_mchat_custom_date"<!-- IF not S_MCHAT_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="user_mchat_date" id="user_mchat_date" value="{MCHAT_DATE}"<!-- IF MCHAT_DATE_NOAUTH --> disabled<!-- ENDIF --> /></div></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_relative_time">{L_MCHAT_RELATIVE_TIME}{L_COLON}</label><br /><span>{L_MCHAT_RELATIVE_TIME_EXPLAIN}</span></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_relative_time" value="1"<!-- IF MCHAT_RELATIVE_TIME --> id="user_mchat_relative_time" checked="checked"<!-- ENDIF --><!-- IF MCHAT_RELATIVE_TIME_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_relative_time" value="0"<!-- IF not MCHAT_RELATIVE_TIME --> id="user_mchat_relative_time" checked="checked"<!-- ENDIF --><!-- IF MCHAT_RELATIVE_TIME_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<hr />
|
||||
<dl>
|
||||
<dt><label for="user_mchat_posts"><!-- IF MCHAT_POSTS_ENABLED_LANG -->{MCHAT_POSTS_ENABLED_LANG}<!-- ELSE -->{L_MCHAT_POSTS}<!-- ENDIF -->{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_posts" value="1"<!-- IF MCHAT_POSTS --> id="user_mchat_posts" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_NOAUTH --> disabled<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_posts" value="0"<!-- IF not MCHAT_POSTS --> id="user_mchat_posts" checked="checked"<!-- ENDIF --><!-- IF MCHAT_POSTS_NOAUTH --> disabled<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1,52 +1,5 @@
|
||||
<fieldset>
|
||||
<p class="successbox notice">{L_MCHAT_ACP_USER_PREFS_EXPLAIN}</p>
|
||||
<legend>{L_MCHAT_PREFERENCES}</legend>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_index">{L_MCHAT_DISPLAY}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_index" value="1"<!-- IF USER_MCHAT_INDEX --> id="user_mchat_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_index" value="0"<!-- IF not USER_MCHAT_INDEX --> id="user_mchat_index" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_sound">{L_MCHAT_SOUND}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_sound" value="1"<!-- IF USER_MCHAT_SOUND --> id="user_mchat_sound" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_sound" value="0"<!-- IF not USER_MCHAT_SOUND --> id="user_mchat_sound" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_stats_index">{L_MCHAT_DISPLAY_STATS_INDEX}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_stats_index" value="1"<!-- IF USER_MCHAT_STATS_INDEX --> id="user_mchat_stats_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_stats_index" value="0"<!-- IF not USER_MCHAT_STATS_INDEX --> id="user_mchat_stats_index" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_topics">{L_MCHAT_DISPLAY_NEW_TOPICS}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_topics" value="1"<!-- IF USER_MCHAT_TOPICS --> id="user_mchat_topics" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_topics" value="0"<!-- IF not USER_MCHAT_TOPICS --> id="user_mchat_topics" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_avatars">{L_MCHAT_DISPLAY_AVATARS}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_avatars" value="1"<!-- IF USER_MCHAT_AVATARS --> id="user_mchat_avatars" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_avatars" value="0"<!-- IF not USER_MCHAT_AVATARS --> id="user_mchat_avatars" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_capital_letter">{L_MCHAT_CAPITAL_LETTER}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_capital_letter" value="1"<!-- IF USER_MCHAT_CAPITAL_LETTER --> id="user_mchat_capital_letter" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_capital_letter" value="0"<!-- IF not USER_MCHAT_CAPITAL_LETTER --> id="user_mchat_capital_letter" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_input_area">{L_MCHAT_CHAT_AREA}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_input_area" value="1"<!-- IF USER_MCHAT_INPUT_AREA --> id="user_mchat_input_area" checked="checked"<!-- ENDIF --> /> {L_MCHAT_INPUT_AREA}</label>
|
||||
<label><input type="radio" name="user_mchat_input_area" value="0"<!-- IF not USER_MCHAT_INPUT_AREA --> id="user_mchat_input_area" checked="checked"<!-- ENDIF --> /> {L_MCHAT_TEXT_AREA}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- INCLUDE acp_mchat_globalusersettings_content.html -->
|
||||
</fieldset>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "dmzx/mchat",
|
||||
"type": "phpbb-extension",
|
||||
"description": "mChat Extension for phpBB 3.1",
|
||||
"description": "mChat Extension",
|
||||
"homepage": "http://www.dmzx-web.net",
|
||||
"version": "1.0.0-RC2",
|
||||
"time": "2015-03-10",
|
||||
"version": "2.0.0-RC3",
|
||||
"time": "2016-03-24",
|
||||
"keywords": ["phpbb", "extension", "mchat"],
|
||||
"license": "GPL-2.0",
|
||||
"authors": [
|
||||
@@ -32,9 +32,9 @@
|
||||
"phpbb/epv": "dev-master"
|
||||
},
|
||||
"extra": {
|
||||
"display-name": "mChat Extension for phpBB 3.1",
|
||||
"display-name": "mChat Extension",
|
||||
"soft-require": {
|
||||
"phpbb/phpbb": ">=3.1.7-PL1,<3.2.0@dev"
|
||||
"phpbb/phpbb": ">=3.1.7-PL1,<3.3.0@dev"
|
||||
},
|
||||
"version-check": {
|
||||
"host": "www.dmzx-web.net",
|
||||
|
||||
174
config/config_2_0_0.yml
Normal file
@@ -0,0 +1,174 @@
|
||||
parameters:
|
||||
# Global settings that only the administrator is allowed to modify.
|
||||
# The values are stored in the phpbb_config table and can be
|
||||
# accessed using the \phpbb\config\config $config class.
|
||||
dmzx.mchat.config_global:
|
||||
mchat_bbcode_disallowed:
|
||||
default: ''
|
||||
validation:
|
||||
- 'string'
|
||||
- false
|
||||
- 0
|
||||
- 255
|
||||
mchat_custom_height:
|
||||
default: 350
|
||||
validation:
|
||||
- 'num'
|
||||
- false
|
||||
- 50
|
||||
- 1000
|
||||
mchat_custom_page:
|
||||
default: 1
|
||||
mchat_edit_delete_limit:
|
||||
default: 0
|
||||
mchat_flood_time:
|
||||
default: 0
|
||||
validation:
|
||||
- 'num'
|
||||
- false
|
||||
- 0
|
||||
- 60
|
||||
mchat_index_height:
|
||||
default: 250
|
||||
validation:
|
||||
- 'num'
|
||||
- false
|
||||
- 50
|
||||
- 1000
|
||||
mchat_live_updates:
|
||||
default: 1
|
||||
mchat_max_message_lngth:
|
||||
default: 500
|
||||
validation:
|
||||
- 'num'
|
||||
- false
|
||||
- 0
|
||||
- 1000
|
||||
mchat_message_num_archive:
|
||||
default: 25
|
||||
validation:
|
||||
- 'num'
|
||||
- false
|
||||
- 10
|
||||
- 100
|
||||
mchat_message_num_custom:
|
||||
default: 10
|
||||
validation:
|
||||
- 'num'
|
||||
- false
|
||||
- 5
|
||||
- 50
|
||||
mchat_message_num_index:
|
||||
default: 10
|
||||
validation:
|
||||
- 'num'
|
||||
- false
|
||||
- 5
|
||||
- 50
|
||||
mchat_navbar_link:
|
||||
default: 1
|
||||
mchat_override_min_post_chars:
|
||||
default: 0
|
||||
mchat_override_smilie_limit:
|
||||
default: 0
|
||||
mchat_posts_edit:
|
||||
default: 0
|
||||
mchat_posts_quote:
|
||||
default: 0
|
||||
mchat_posts_reply:
|
||||
default: 0
|
||||
mchat_posts_topic:
|
||||
default: 0
|
||||
mchat_prune:
|
||||
default: 0
|
||||
mchat_prune_num:
|
||||
default: 0
|
||||
mchat_refresh:
|
||||
default: 10
|
||||
validation:
|
||||
- 'num'
|
||||
- false
|
||||
- 5
|
||||
- 60
|
||||
mchat_rules:
|
||||
default: ''
|
||||
validation:
|
||||
- 'string'
|
||||
- false
|
||||
- 0
|
||||
- 255
|
||||
mchat_static_message:
|
||||
default: ''
|
||||
validation:
|
||||
- 'string'
|
||||
- false
|
||||
- 0
|
||||
- 255
|
||||
mchat_timeout:
|
||||
default: 0
|
||||
validation:
|
||||
- 'num'
|
||||
- false
|
||||
- 0
|
||||
- -1 # This value is replaced with $config['session_length'] in the \dmzx\mchat\core\settings class
|
||||
mchat_whois:
|
||||
default: 1
|
||||
mchat_whois_refresh:
|
||||
default: 60
|
||||
validation:
|
||||
- 'num'
|
||||
- false
|
||||
- 10
|
||||
- 300
|
||||
|
||||
# User-specific settings for which the administrator can set default
|
||||
# values as well as adjust permissions to allow users to customize them.
|
||||
# For each setting a new column is added to the phpbb_users table.
|
||||
dmzx.mchat.config_ucp:
|
||||
mchat_avatars:
|
||||
default: 1
|
||||
type: 'BOOL'
|
||||
mchat_capital_letter:
|
||||
default: 1
|
||||
type: 'BOOL'
|
||||
mchat_character_count:
|
||||
default: 1
|
||||
type: 'BOOL'
|
||||
mchat_date:
|
||||
default: 'D M d, Y g:i a'
|
||||
type: 'VCHAR:64'
|
||||
validation:
|
||||
- 'string'
|
||||
- false
|
||||
- 0
|
||||
- 64
|
||||
mchat_index:
|
||||
default: 1
|
||||
type: 'BOOL'
|
||||
mchat_input_area:
|
||||
default: 1
|
||||
type: 'BOOL'
|
||||
mchat_location:
|
||||
default: 1
|
||||
type: 'BOOL'
|
||||
mchat_message_top:
|
||||
default: 1
|
||||
type: 'BOOL'
|
||||
mchat_pause_on_input:
|
||||
default: 0
|
||||
type: 'BOOL'
|
||||
mchat_posts:
|
||||
default: 1
|
||||
type: 'BOOL'
|
||||
mchat_relative_time:
|
||||
default: 1
|
||||
type: 'BOOL'
|
||||
mchat_sound:
|
||||
default: 1
|
||||
type: 'BOOL'
|
||||
mchat_stats_index:
|
||||
default: 0
|
||||
type: 'BOOL'
|
||||
mchat_whois_index:
|
||||
default: 1
|
||||
type: 'BOOL'
|
||||
@@ -1,18 +1,18 @@
|
||||
imports:
|
||||
- { resource: tables.yml }
|
||||
- { resource: user_config_keys.yml }
|
||||
- { resource: config_2_0_0.yml }
|
||||
|
||||
services:
|
||||
dmzx.mchat.acp.controller:
|
||||
class: dmzx\mchat\controller\acp_controller
|
||||
arguments:
|
||||
- '@config'
|
||||
- '@template'
|
||||
- '@log'
|
||||
- '@user'
|
||||
- '@dbal.conn'
|
||||
- '@cache'
|
||||
- '@request'
|
||||
- '@dmzx.mchat.settings'
|
||||
- '%dmzx.mchat.table.mchat%'
|
||||
- '%dmzx.mchat.table.mchat_deleted_messages%'
|
||||
- '%core.root_path%'
|
||||
@@ -20,12 +20,14 @@ services:
|
||||
dmzx.mchat.ucp.controller:
|
||||
class: dmzx\mchat\controller\ucp_controller
|
||||
arguments:
|
||||
- '@config'
|
||||
- '@template'
|
||||
- '@user'
|
||||
- '@auth'
|
||||
- '@dbal.conn'
|
||||
- '@request'
|
||||
- '%user_config_keys%'
|
||||
- '@dmzx.mchat.settings'
|
||||
- '%core.root_path%'
|
||||
- '%core.php_ext%'
|
||||
dmzx.mchat.main.controller:
|
||||
class: dmzx\mchat\controller\main_controller
|
||||
arguments:
|
||||
@@ -36,7 +38,7 @@ services:
|
||||
class: dmzx\mchat\core\mchat
|
||||
arguments:
|
||||
- '@dmzx.mchat.functions'
|
||||
- '@config'
|
||||
- '@dmzx.mchat.settings'
|
||||
- '@controller.helper'
|
||||
- '@template'
|
||||
- '@user'
|
||||
@@ -50,7 +52,7 @@ services:
|
||||
dmzx.mchat.functions:
|
||||
class: dmzx\mchat\core\functions
|
||||
arguments:
|
||||
- '@config'
|
||||
- '@dmzx.mchat.settings'
|
||||
- '@user'
|
||||
- '@auth'
|
||||
- '@log'
|
||||
@@ -61,19 +63,28 @@ services:
|
||||
- '%dmzx.mchat.table.mchat%'
|
||||
- '%dmzx.mchat.table.mchat_deleted_messages%'
|
||||
- '%dmzx.mchat.table.mchat_sessions%'
|
||||
dmzx.mchat.settings:
|
||||
class: dmzx\mchat\core\settings
|
||||
arguments:
|
||||
- '@user'
|
||||
- '@config'
|
||||
- '@auth'
|
||||
- '%dmzx.mchat.config_global%'
|
||||
- '%dmzx.mchat.config_ucp%'
|
||||
dmzx.mchat.acp.listener:
|
||||
class: dmzx\mchat\event\acp_listener
|
||||
arguments:
|
||||
- '@template'
|
||||
- '@request'
|
||||
- '@user'
|
||||
- '%user_config_keys%'
|
||||
- '@dmzx.mchat.settings'
|
||||
- '%core.root_path%'
|
||||
- '%core.php_ext%'
|
||||
tags:
|
||||
- { name: event.listener }
|
||||
dmzx.mchat.main.listener:
|
||||
class: dmzx\mchat\event\main_listener
|
||||
arguments:
|
||||
- '@dmzx.mchat.functions'
|
||||
- '@dmzx.mchat.core'
|
||||
- '@controller.helper'
|
||||
- '@user'
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
parameters:
|
||||
user_config_keys:
|
||||
- user_mchat_index
|
||||
- user_mchat_sound
|
||||
- user_mchat_stats_index
|
||||
- user_mchat_topics
|
||||
- user_mchat_avatars
|
||||
- user_mchat_capital_letter
|
||||
- user_mchat_input_area
|
||||
@@ -13,9 +13,6 @@ namespace dmzx\mchat\controller;
|
||||
|
||||
class acp_controller
|
||||
{
|
||||
/** @var \phpbb\config\config */
|
||||
protected $config;
|
||||
|
||||
/** @var \phpbb\template\template */
|
||||
protected $template;
|
||||
|
||||
@@ -34,6 +31,9 @@ class acp_controller
|
||||
/** @var \phpbb\request\request */
|
||||
protected $request;
|
||||
|
||||
/** @var \dmzx\mchat\core\settings */
|
||||
protected $settings;
|
||||
|
||||
/** @var string */
|
||||
protected $mchat_table;
|
||||
|
||||
@@ -49,27 +49,27 @@ class acp_controller
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \phpbb\config\config $config
|
||||
* @param \phpbb\template\template $template
|
||||
* @param \phpbb\log\log_interface $log
|
||||
* @param \phpbb\user $user
|
||||
* @param \phpbb\db\driver\driver_interface $db
|
||||
* @param \phpbb\cache\service $cache
|
||||
* @param \phpbb\request\request $request
|
||||
* @param \dmzx\mchat\core\settings $settings
|
||||
* @param string $mchat_table
|
||||
* @param string $mchat_deleted_messages_table
|
||||
* @param string $root_path
|
||||
* @param string $php_ext
|
||||
*/
|
||||
public function __construct(\phpbb\config\config $config, \phpbb\template\template $template, \phpbb\log\log_interface $log, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, \phpbb\request\request $request, $mchat_table, $mchat_deleted_messages_table, $root_path, $php_ext)
|
||||
public function __construct(\phpbb\template\template $template, \phpbb\log\log_interface $log, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, \phpbb\request\request $request, \dmzx\mchat\core\settings $settings, $mchat_table, $mchat_deleted_messages_table, $root_path, $php_ext)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->template = $template;
|
||||
$this->log = $log;
|
||||
$this->user = $user;
|
||||
$this->db = $db;
|
||||
$this->cache = $cache;
|
||||
$this->request = $request;
|
||||
$this->settings = $settings;
|
||||
$this->mchat_table = $mchat_table;
|
||||
$this->mchat_deleted_messages_table = $mchat_deleted_messages_table;
|
||||
$this->root_path = $root_path;
|
||||
@@ -79,48 +79,13 @@ class acp_controller
|
||||
/**
|
||||
* Display the options the admin can configure for this extension
|
||||
*
|
||||
* @param $u_action
|
||||
* @param string $u_action
|
||||
*/
|
||||
public function display_options($u_action)
|
||||
public function globalsettings($u_action)
|
||||
{
|
||||
add_form_key('acp_mchat');
|
||||
|
||||
$mchat_config = array(
|
||||
'mchat_archive_limit' => array('default' => 25, 'validation' => array('num', false, 25, 50)),
|
||||
'mchat_avatars' => array('default' => 1, 'validation' => array()),
|
||||
'mchat_bbcode_disallowed' => array('default' => '', 'validation' => array('string', false, 0, 255)),
|
||||
'mchat_custom_height' => array('default' => 350, 'validation' => array('num', false, 50, 1000)),
|
||||
'mchat_custom_page' => array('default' => 1, 'validation' => array()),
|
||||
'mchat_relative_time' => array('default' => 1, 'validation' => array()),
|
||||
'mchat_date' => array('default' => 'D M d, Y g:i a', 'validation' => array('string', false, 0, 255)),
|
||||
'mchat_edit_delete_limit' => array('default' => 0, 'validation' => array()),
|
||||
'mchat_flood_time' => array('default' => 0, 'validation' => array('num', false, 0, 30)),
|
||||
'mchat_index_height' => array('default' => 250, 'validation' => array('num', false, 50, 1000)),
|
||||
'mchat_live_updates' => array('default' => 1, 'validation' => array()),
|
||||
'mchat_location' => array('default' => 0, 'validation' => array()),
|
||||
'mchat_max_message_lngth' => array('default' => 500, 'validation' => array('num', false, 0, 500)),
|
||||
'mchat_message_limit' => array('default' => 10, 'validation' => array('num', false, 10, 30)),
|
||||
'mchat_message_num' => array('default' => 10, 'validation' => array('num', false, 10, 50)),
|
||||
'mchat_message_top' => array('default' => 1, 'validation' => array()),
|
||||
'mchat_navbar_link' => array('default' => 1, 'validation' => array()),
|
||||
'mchat_new_posts_edit' => array('default' => 0, 'validation' => array()),
|
||||
'mchat_new_posts_quote' => array('default' => 0, 'validation' => array()),
|
||||
'mchat_new_posts_reply' => array('default' => 0, 'validation' => array()),
|
||||
'mchat_new_posts_topic' => array('default' => 0, 'validation' => array()),
|
||||
'mchat_on_index' => array('default' => 1, 'validation' => array()),
|
||||
'mchat_override_min_post_chars' => array('default' => 0, 'validation' => array()),
|
||||
'mchat_override_smilie_limit' => array('default' => 0, 'validation' => array()),
|
||||
'mchat_pause_on_input' => array('default' => 0, 'validation' => array()),
|
||||
'mchat_prune' => array('default' => 0, 'validation' => array()),
|
||||
'mchat_prune_num' => array('default' => 0, 'validation' => array()),
|
||||
'mchat_refresh' => array('default' => 10, 'validation' => array('num', false, 5, 60)),
|
||||
'mchat_rules' => array('default' => '', 'validation' => array('string', false, 0, 255)),
|
||||
'mchat_static_message' => array('default' => '', 'validation' => array('string', false, 0, 255)),
|
||||
'mchat_stats_index' => array('default' => 0, 'validation' => array()),
|
||||
'mchat_timeout' => array('default' => 0, 'validation' => array('num', false, 0, (int) $this->config['session_length'])),
|
||||
'mchat_whois' => array('default' => 1, 'validation' => array()),
|
||||
'mchat_whois_refresh' => array('default' => 60, 'validation' => array('num', false, 30, 300)),
|
||||
);
|
||||
$error = array();
|
||||
|
||||
if ($this->request->is_set_post('mchat_purge'))
|
||||
{
|
||||
@@ -139,35 +104,37 @@ class acp_controller
|
||||
}
|
||||
else if ($this->request->is_set_post('submit'))
|
||||
{
|
||||
$mchat_new_config = array();
|
||||
$validation = array();
|
||||
foreach ($this->settings->global as $config_name => $config_data)
|
||||
{
|
||||
$default = $this->settings->cfg($config_name);
|
||||
settype($default, gettype($config_data['default']));
|
||||
$mchat_new_config[$config_name] = $this->request->variable($config_name, $default, is_string($default));
|
||||
if (isset($config_data['validation']))
|
||||
{
|
||||
$validation[$config_name] = $config_data['validation'];
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('validate_data'))
|
||||
{
|
||||
include($this->root_path . 'includes/functions_user.' . $this->php_ext);
|
||||
}
|
||||
|
||||
$mchat_new_config = array();
|
||||
$validation = array();
|
||||
foreach ($mchat_config as $key => $value)
|
||||
{
|
||||
$mchat_new_config[$key] = $this->request->variable($key, $value['default'], is_string($value['default']));
|
||||
if (!empty($value['validation']))
|
||||
{
|
||||
$validation[$key] = $value['validation'];
|
||||
}
|
||||
}
|
||||
|
||||
$error = validate_data($mchat_new_config, $validation);
|
||||
$error = array_merge($error, validate_data($mchat_new_config, $validation));
|
||||
|
||||
if (!check_form_key('acp_mchat'))
|
||||
{
|
||||
$error[] = 'FORM_INVALID';
|
||||
}
|
||||
|
||||
if (empty($error))
|
||||
if (!$error)
|
||||
{
|
||||
// Set the options the user configured
|
||||
foreach ($mchat_new_config as $config_name => $config_value)
|
||||
{
|
||||
$this->config->set($config_name, $config_value);
|
||||
$this->settings->set_cfg($config_name, $config_value);
|
||||
}
|
||||
|
||||
// Add an entry into the log table
|
||||
@@ -180,36 +147,94 @@ class acp_controller
|
||||
$error = array_map(array($this->user, 'lang'), $error);
|
||||
}
|
||||
|
||||
$dateformat_options = '';
|
||||
foreach ($this->user->lang['dateformats'] as $format => $null)
|
||||
foreach (array_keys($this->settings->global) as $key)
|
||||
{
|
||||
$dateformat_options .= '<option value="' . $format . '"' . (($format == $this->config['mchat_date']) ? ' selected="selected"' : '') . '>';
|
||||
$dateformat_options .= $this->user->format_date(time(), $format, false) . ((strpos($format, '|') !== false) ? $this->user->lang('VARIANT_DATE_SEPARATOR') . $this->user->format_date(time(), $format, true) : '');
|
||||
$dateformat_options .= '</option>';
|
||||
}
|
||||
|
||||
$s_custom = false;
|
||||
$dateformat_options .= '<option value="custom"';
|
||||
if (!isset($this->user->lang['dateformats'][$this->config['mchat_date']]))
|
||||
{
|
||||
$dateformat_options .= ' selected="selected"';
|
||||
$s_custom = true;
|
||||
}
|
||||
$dateformat_options .= '>' . $this->user->lang('MCHAT_CUSTOM_DATEFORMAT') . '</option>';
|
||||
|
||||
foreach (array_keys($mchat_config) as $key)
|
||||
{
|
||||
$this->template->assign_var(strtoupper($key), $this->config[$key]);
|
||||
$this->template->assign_var(strtoupper($key), $this->settings->cfg($key));
|
||||
}
|
||||
|
||||
$this->template->assign_vars(array(
|
||||
'MCHAT_ERROR' => !empty($error) ? implode('<br />', $error) : '',
|
||||
'MCHAT_VERSION' => $this->config['mchat_version'],
|
||||
'MCHAT_ERROR' => $error ? implode('<br />', $error) : '',
|
||||
'MCHAT_VERSION' => $this->settings->cfg('mchat_version'),
|
||||
'MCHAT_FOUNDER' => $this->user->data['user_type'] == USER_FOUNDER,
|
||||
'L_MCHAT_BBCODES_DISALLOWED_EXPLAIN' => $this->user->lang('MCHAT_BBCODES_DISALLOWED_EXPLAIN', '<a href="' . append_sid("{$this->root_path}adm/index.$this->php_ext", 'i=bbcodes', true, $this->user->session_id) . '">', '</a>'),
|
||||
'L_MCHAT_TIMEOUT_EXPLAIN' => $this->user->lang('MCHAT_USER_TIMEOUT_EXPLAIN','<a href="' . append_sid("{$this->root_path}adm/index.$this->php_ext", 'i=board&mode=load', true, $this->user->session_id) . '">', '</a>', $this->config['session_length']),
|
||||
'S_MCHAT_DATEFORMAT_OPTIONS' => $dateformat_options,
|
||||
'S_CUSTOM_DATEFORMAT' => $s_custom,
|
||||
'L_MCHAT_TIMEOUT_EXPLAIN' => $this->user->lang('MCHAT_USER_TIMEOUT_EXPLAIN','<a href="' . append_sid("{$this->root_path}adm/index.$this->php_ext", 'i=board&mode=load', true, $this->user->session_id) . '">', '</a>', $this->settings->cfg('session_length')),
|
||||
'U_ACTION' => $u_action,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $u_action
|
||||
*/
|
||||
public function globalusersettings($u_action)
|
||||
{
|
||||
add_form_key('acp_mchat');
|
||||
|
||||
$this->user->add_lang_ext('dmzx/mchat', 'mchat_ucp');
|
||||
|
||||
$error = array();
|
||||
|
||||
if ($this->request->is_set_post('submit'))
|
||||
{
|
||||
$mchat_new_config = array();
|
||||
$validation = array();
|
||||
foreach ($this->settings->ucp as $config_name => $config_data)
|
||||
{
|
||||
$default = $this->settings->cfg($config_name, true);
|
||||
settype($default, gettype($config_data['default']));
|
||||
$mchat_new_config[$config_name] = $this->request->variable('user_' . $config_name, $default, is_string($default));
|
||||
|
||||
if (isset($config_data['validation']))
|
||||
{
|
||||
$validation[$config_name] = $config_data['validation'];
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('validate_data'))
|
||||
{
|
||||
include($this->root_path . 'includes/functions_user.' . $this->php_ext);
|
||||
}
|
||||
|
||||
$error = array_merge($error, validate_data($mchat_new_config, $validation));
|
||||
|
||||
if (!check_form_key('acp_mchat'))
|
||||
{
|
||||
$error[] = 'FORM_INVALID';
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
// Set the options the user configured
|
||||
foreach ($mchat_new_config as $config_name => $config_value)
|
||||
{
|
||||
$this->settings->set_cfg($config_name, $config_value);
|
||||
}
|
||||
|
||||
// Add an entry into the log table
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_MCHAT_CONFIG_UPDATE', false, array($this->user->data['username']));
|
||||
|
||||
trigger_error($this->user->lang('MCHAT_CONFIG_SAVED') . adm_back_link($u_action));
|
||||
}
|
||||
|
||||
// Replace "error" strings with their real, localised form
|
||||
$error = array_map(array($this->user, 'lang'), $error);
|
||||
}
|
||||
|
||||
foreach (array_keys($this->settings->ucp) as $key)
|
||||
{
|
||||
$this->template->assign_var(strtoupper($key), $this->settings->cfg($key, true));
|
||||
}
|
||||
|
||||
// Force global date format for $selected value, not user-specific
|
||||
$selected = $this->settings->cfg('mchat_date', true);
|
||||
$date_template_data = $this->settings->get_date_template_data($selected);
|
||||
$this->template->assign_vars($date_template_data);
|
||||
|
||||
$notifications_template_data = $this->settings->get_enabled_post_notifications_lang();
|
||||
$this->template->assign_var('MCHAT_POSTS_ENABLED_LANG', $notifications_template_data);
|
||||
|
||||
$this->template->assign_vars(array(
|
||||
'MCHAT_ERROR' => $error ? implode('<br />', $error) : '',
|
||||
'MCHAT_VERSION' => $this->settings->cfg('mchat_version'),
|
||||
'U_ACTION' => $u_action,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -13,42 +13,52 @@ namespace dmzx\mchat\controller;
|
||||
|
||||
class ucp_controller
|
||||
{
|
||||
/** @var \phpbb\config\config */
|
||||
protected $config;
|
||||
|
||||
/** @var \phpbb\template\template */
|
||||
protected $template;
|
||||
|
||||
/** @var \phpbb\user */
|
||||
protected $user;
|
||||
|
||||
/** @var \phpbb\auth\auth */
|
||||
protected $auth;
|
||||
|
||||
/** @var \phpbb\db\driver\driver_interface */
|
||||
protected $db;
|
||||
|
||||
/** @var \phpbb\request\request */
|
||||
protected $request;
|
||||
|
||||
/** @var array */
|
||||
protected $user_config_keys;
|
||||
/** @var \dmzx\mchat\core\settings */
|
||||
protected $settings;
|
||||
|
||||
/** @var string */
|
||||
protected $root_path;
|
||||
|
||||
/** @var string */
|
||||
protected $php_ext;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \phpbb\config\config $config
|
||||
* @param \phpbb\template\template $template
|
||||
* @param \phpbb\user $user
|
||||
* @param \phpbb\auth\auth $auth
|
||||
* @param \phpbb\db\driver\driver_interface $db
|
||||
* @param \phpbb\request\request $request
|
||||
* @param array $user_config_keys
|
||||
* @param \dmzx\mchat\core\settings $settings
|
||||
* @param string $root_path
|
||||
* @param string $php_ext
|
||||
*/
|
||||
public function __construct(\phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, \phpbb\request\request $request, $user_config_keys)
|
||||
public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db, \phpbb\request\request $request, \dmzx\mchat\core\settings $settings, $root_path, $php_ext)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->template = $template;
|
||||
$this->user = $user;
|
||||
$this->db = $db;
|
||||
$this->request = $request;
|
||||
$this->user_config_keys = $user_config_keys;
|
||||
$this->template = $template;
|
||||
$this->user = $user;
|
||||
$this->auth = $auth;
|
||||
$this->db = $db;
|
||||
$this->request = $request;
|
||||
$this->settings = $settings;
|
||||
$this->root_path = $root_path;
|
||||
$this->php_ext = $php_ext;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,7 +66,7 @@ class ucp_controller
|
||||
*
|
||||
* @param $u_action
|
||||
*/
|
||||
public function display_options($u_action)
|
||||
public function configuration($u_action)
|
||||
{
|
||||
add_form_key('ucp_mchat');
|
||||
|
||||
@@ -64,21 +74,39 @@ class ucp_controller
|
||||
|
||||
if ($this->request->is_set_post('submit'))
|
||||
{
|
||||
$mchat_new_config = array();
|
||||
$validation = array();
|
||||
foreach ($this->settings->ucp as $config_name => $config_data)
|
||||
{
|
||||
if ($this->auth->acl_get('u_' . $config_name))
|
||||
{
|
||||
$default = $this->user->data['user_' . $config_name];
|
||||
settype($default, gettype($config_data['default']));
|
||||
$mchat_new_config['user_' . $config_name] = $this->request->variable('user_' . $config_name, $default, is_string($default));
|
||||
|
||||
if (isset($config_data['validation']))
|
||||
{
|
||||
$validation['user_' . $config_name] = $config_data['validation'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('validate_data'))
|
||||
{
|
||||
include($this->root_path . 'includes/functions_user.' . $this->php_ext);
|
||||
}
|
||||
|
||||
$error = array_merge($error, validate_data($mchat_new_config, $validation));
|
||||
|
||||
if (!check_form_key('ucp_mchat'))
|
||||
{
|
||||
$error[] = 'FORM_INVALID';
|
||||
}
|
||||
|
||||
if (empty($error))
|
||||
if (!$error)
|
||||
{
|
||||
$data = array();
|
||||
foreach ($this->user_config_keys as $config_key)
|
||||
{
|
||||
$data[$config_key] = $this->request->variable($config_key, (int) $this->user->data[$config_key]);
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $this->db->sql_build_array('UPDATE', $data) . '
|
||||
SET ' . $this->db->sql_build_array('UPDATE', $mchat_new_config) . '
|
||||
WHERE user_id = ' . (int) $this->user->data['user_id'];
|
||||
$this->db->sql_query($sql);
|
||||
|
||||
@@ -91,19 +119,35 @@ class ucp_controller
|
||||
$error = array_map(array($this->user, 'lang'), $error);
|
||||
}
|
||||
|
||||
foreach ($this->user_config_keys as $config_key)
|
||||
$auth_count = 0;
|
||||
|
||||
foreach (array_keys($this->settings->ucp) as $config_name)
|
||||
{
|
||||
$this->template->assign_var(strtoupper($config_key), $this->user->data[$config_key]);
|
||||
$upper = strtoupper($config_name);
|
||||
$auth = $this->auth->acl_get('u_' . $config_name);
|
||||
|
||||
$this->template->assign_vars(array(
|
||||
$upper => $this->settings->cfg($config_name),
|
||||
$upper . '_AUTH' => $auth,
|
||||
));
|
||||
|
||||
if ($auth)
|
||||
{
|
||||
$auth_count++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->template->assign_vars(array(
|
||||
'ERROR' => sizeof($error) ? implode('<br />', $error) : '',
|
||||
'S_UCP_ACTION' => $u_action,
|
||||
$selected = $this->settings->cfg('mchat_date');
|
||||
$date_template_data = $this->settings->get_date_template_data($selected);
|
||||
$this->template->assign_vars($date_template_data);
|
||||
|
||||
'S_MCHAT_TOPICS' => $this->config['mchat_new_posts_edit'] || $this->config['mchat_new_posts_quote'] || $this->config['mchat_new_posts_reply'] || $this->config['mchat_new_posts_topic'],
|
||||
'S_MCHAT_INDEX' => $this->config['mchat_on_index'],
|
||||
'S_MCHAT_INDEX_STATS' => $this->config['mchat_stats_index'],
|
||||
'S_MCHAT_AVATARS' => $this->config['mchat_avatars'],
|
||||
$notifications_template_data = $this->settings->get_enabled_post_notifications_lang();
|
||||
$this->template->assign_var('MCHAT_POSTS_ENABLED_LANG', $notifications_template_data);
|
||||
|
||||
$this->template->assign_vars(array(
|
||||
'ERROR' => sizeof($error) ? implode('<br />', $error) : '',
|
||||
'MCHAT_AUTH_COUNT' => $auth_count,
|
||||
'S_UCP_ACTION' => $u_action,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ namespace dmzx\mchat\core;
|
||||
|
||||
class functions
|
||||
{
|
||||
/** @var \phpbb\config\config */
|
||||
protected $config;
|
||||
/** @var \dmzx\mchat\core\settings */
|
||||
protected $settings;
|
||||
|
||||
/** @var \phpbb\user */
|
||||
protected $user;
|
||||
@@ -52,7 +52,7 @@ class functions
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \phpbb\config\config $config
|
||||
* @param \dmzx\mchat\core\settings $settings
|
||||
* @param \phpbb\user $user
|
||||
* @param \phpbb\auth\auth $auth
|
||||
* @param \phpbb\log\log_interface $log
|
||||
@@ -64,9 +64,9 @@ class functions
|
||||
* @param string $mchat_deleted_messages_table
|
||||
* @param string $mchat_sessions_table
|
||||
*/
|
||||
function __construct(\phpbb\config\config $config, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\log\log_interface $log, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, $root_path, $php_ext, $mchat_table, $mchat_deleted_messages_table, $mchat_sessions_table)
|
||||
function __construct(\dmzx\mchat\core\settings $settings, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\log\log_interface $log, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, $root_path, $php_ext, $mchat_table, $mchat_deleted_messages_table, $mchat_sessions_table)
|
||||
{
|
||||
$this->config = $config;
|
||||
$this->settings = $settings;
|
||||
$this->user = $user;
|
||||
$this->auth = $auth;
|
||||
$this->log = $log;
|
||||
@@ -119,7 +119,19 @@ class functions
|
||||
*/
|
||||
protected function mchat_session_time()
|
||||
{
|
||||
return !empty($this->config['mchat_timeout']) ? $this->config['mchat_timeout'] : (!empty($this->config['load_online_time']) ? $this->config['load_online_time'] * 60 : $this->config['session_length']);
|
||||
$mchat_timeout = $this->settings->cfg('mchat_timeout');
|
||||
if ($mchat_timeout)
|
||||
{
|
||||
return $mchat_timeout;
|
||||
}
|
||||
|
||||
$load_online_time = $this->settings->cfg('load_online_time');
|
||||
if ($load_online_time)
|
||||
{
|
||||
return $load_online_time * 60;
|
||||
}
|
||||
|
||||
return $this->settings->cfg('session_length');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -216,11 +228,11 @@ class functions
|
||||
*/
|
||||
public function mchat_prune()
|
||||
{
|
||||
if ($this->config['mchat_prune'])
|
||||
if ($this->settings->cfg('mchat_prune'))
|
||||
{
|
||||
$mchat_total_messages = $this->mchat_total_message_count();
|
||||
|
||||
if ($mchat_total_messages > $this->config['mchat_prune_num'])
|
||||
if ($mchat_total_messages > $this->settings->cfg('mchat_prune_num'))
|
||||
{
|
||||
$sql = 'SELECT message_id
|
||||
FROM '. $this->mchat_table . '
|
||||
@@ -230,10 +242,10 @@ class functions
|
||||
$this->db->sql_freeresult($result);
|
||||
|
||||
// Compute new oldest message id
|
||||
$delete_id = $mchat_total_messages - $this->config['mchat_prune_num'] + $first_id;
|
||||
$delete_id = $mchat_total_messages - $this->settings->cfg('mchat_prune_num') + $first_id;
|
||||
|
||||
// Delete older messages
|
||||
$this->mchat_action('prune', null, $delete_id, $this->user->data['username']);
|
||||
$this->mchat_action('prune', null, $delete_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -258,6 +270,16 @@ class functions
|
||||
*/
|
||||
public function mchat_get_messages($sql_where, $total = 0, $offset = 0)
|
||||
{
|
||||
// Exclude post notifications
|
||||
if (!$this->settings->cfg('mchat_posts'))
|
||||
{
|
||||
if (!empty($sql_where))
|
||||
{
|
||||
$sql_where = '(' . $sql_where . ') AND ';
|
||||
}
|
||||
$sql_where .= 'm.forum_id = 0';
|
||||
}
|
||||
|
||||
$sql_array = array(
|
||||
'SELECT' => 'm.*, u.username, u.user_colour, u.user_avatar, u.user_avatar_type, u.user_avatar_width, u.user_avatar_height, u.user_allow_pm',
|
||||
'FROM' => array($this->mchat_table => 'm'),
|
||||
@@ -276,6 +298,15 @@ class functions
|
||||
$rows = $this->db->sql_fetchrowset($result);
|
||||
$this->db->sql_freeresult($result);
|
||||
|
||||
// Set deleted users to ANONYMOUS
|
||||
foreach ($rows as $i => $row)
|
||||
{
|
||||
if (!isset($row['username']))
|
||||
{
|
||||
$rows[$i]['user_id'] = ANONYMOUS;
|
||||
}
|
||||
}
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
@@ -287,7 +318,7 @@ class functions
|
||||
public function mchat_legend()
|
||||
{
|
||||
// Grab group details for legend display for who is online on the custom page
|
||||
$order_legend = $this->config['legend_sort_groupname'] ? 'group_name' : 'group_legend';
|
||||
$order_legend = $this->settings->cfg('legend_sort_groupname') ? 'group_name' : 'group_legend';
|
||||
if ($this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
|
||||
{
|
||||
$sql = 'SELECT group_id, group_name, group_colour, group_type
|
||||
@@ -361,7 +392,7 @@ class functions
|
||||
*/
|
||||
public function mchat_sql_append_forbidden_bbcodes($sql_where)
|
||||
{
|
||||
$disallowed_bbcodes = explode('|', $this->config['mchat_bbcode_disallowed']);
|
||||
$disallowed_bbcodes = explode('|', $this->settings->cfg('mchat_bbcode_disallowed'));
|
||||
|
||||
if (!empty($disallowed_bbcodes))
|
||||
{
|
||||
@@ -380,13 +411,13 @@ class functions
|
||||
public function mchat_insert_posting($mode, $data)
|
||||
{
|
||||
$mode_config = array(
|
||||
'post' => $this->config['mchat_new_posts_topic'],
|
||||
'quote' => $this->config['mchat_new_posts_quote'],
|
||||
'edit' => $this->config['mchat_new_posts_edit'],
|
||||
'reply' => $this->config['mchat_new_posts_reply'],
|
||||
'post' => 'mchat_posts_topic',
|
||||
'quote' => 'mchat_posts_quote',
|
||||
'edit' => 'mchat_posts_edit',
|
||||
'reply' => 'mchat_posts_reply',
|
||||
);
|
||||
|
||||
if (empty($mode_config[$mode]))
|
||||
if (empty($mode_config[$mode]) || !$this->settings->cfg($mode_config[$mode]))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -420,7 +451,7 @@ class functions
|
||||
*/
|
||||
public function mchat_is_user_flooding()
|
||||
{
|
||||
if (!$this->config['mchat_flood_time'] || $this->auth->acl_get('u_mchat_flood_ignore'))
|
||||
if (!$this->settings->cfg('mchat_flood_time') || $this->auth->acl_get('u_mchat_flood_ignore'))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -433,7 +464,7 @@ class functions
|
||||
$message_time = (int) $this->db->sql_fetchfield('message_time');
|
||||
$this->db->sql_freeresult($result);
|
||||
|
||||
return $message_time && time() - $message_time < $this->config['mchat_flood_time'];
|
||||
return $message_time && time() - $message_time < $this->settings->cfg('mchat_flood_time');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -486,10 +517,9 @@ class functions
|
||||
* @param string $action One of add|edit|del|prune
|
||||
* @param array $sql_ary
|
||||
* @param int $message_id
|
||||
* @param string $log_username
|
||||
* @return bool
|
||||
*/
|
||||
public function mchat_action($action, $sql_ary = null, $message_id = 0, $log_username = '')
|
||||
public function mchat_action($action, $sql_ary = null, $message_id = 0)
|
||||
{
|
||||
$is_new_session = false;
|
||||
|
||||
@@ -507,7 +537,7 @@ class functions
|
||||
$this->user->update_session_infos();
|
||||
$is_new_session = $this->mchat_add_user_session();
|
||||
$this->db->sql_query('UPDATE ' . $this->mchat_table . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE message_id = ' . (int) $message_id);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EDITED_MCHAT', false, array($log_username));
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EDITED_MCHAT', false, array($this->user->data['username']));
|
||||
break;
|
||||
|
||||
// User deletes a message
|
||||
@@ -517,7 +547,7 @@ class functions
|
||||
$this->db->sql_query('DELETE FROM ' . $this->mchat_table . ' WHERE message_id = ' . (int) $message_id);
|
||||
$this->db->sql_query('INSERT INTO ' . $this->mchat_deleted_messages_table . ' ' . $this->db->sql_build_array('INSERT', array('message_id' => (int) $message_id)));
|
||||
$this->cache->destroy('sql', $this->mchat_deleted_messages_table);
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DELETED_MCHAT', false, array($log_username));
|
||||
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_DELETED_MCHAT', false, array($this->user->data['username']));
|
||||
break;
|
||||
|
||||
// User triggers messages to be pruned
|
||||
@@ -539,7 +569,6 @@ class functions
|
||||
$this->db->sql_query('DELETE FROM ' . $this->mchat_table . ' WHERE ' .$this->db->sql_in_set('message_id', $prune_ids));
|
||||
$this->db->sql_multi_insert($this->mchat_deleted_messages_table, $rows);
|
||||
$this->cache->destroy('sql', $this->mchat_deleted_messages_table);
|
||||
// $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_MCHAT_TABLE_PRUNED', false, array($log_username));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
314
core/mchat.php
@@ -16,8 +16,8 @@ class mchat
|
||||
/** @var \dmzx\mchat\core\functions */
|
||||
protected $functions;
|
||||
|
||||
/** @var \phpbb\config\config */
|
||||
protected $config;
|
||||
/** @var \dmzx\mchat\core\settings */
|
||||
protected $settings;
|
||||
|
||||
/** @var \phpbb\controller\helper */
|
||||
protected $helper;
|
||||
@@ -56,7 +56,7 @@ class mchat
|
||||
* Constructor
|
||||
*
|
||||
* @param \dmzx\mchat\core\functions $functions
|
||||
* @param \phpbb\config\config $config
|
||||
* @param \dmzx\mchat\core\settings $settings
|
||||
* @param \phpbb\controller\helper $helper
|
||||
* @param \phpbb\template\template $template
|
||||
* @param \phpbb\user $user
|
||||
@@ -68,10 +68,10 @@ class mchat
|
||||
* @param string $root_path
|
||||
* @param string $php_ext
|
||||
*/
|
||||
public function __construct(\dmzx\mchat\core\functions $functions, \phpbb\config\config $config, \phpbb\controller\helper $helper, \phpbb\template\template $template, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \phpbb\request\request $request, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\extension\manager $extension_manager, $root_path, $php_ext)
|
||||
public function __construct(\dmzx\mchat\core\functions $functions, \dmzx\mchat\core\settings $settings, \phpbb\controller\helper $helper, \phpbb\template\template $template, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\pagination $pagination, \phpbb\request\request $request, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\extension\manager $extension_manager, $root_path, $php_ext)
|
||||
{
|
||||
$this->functions = $functions;
|
||||
$this->config = $config;
|
||||
$this->settings = $settings;
|
||||
$this->helper = $helper;
|
||||
$this->template = $template;
|
||||
$this->user = $user;
|
||||
@@ -82,6 +82,11 @@ class mchat
|
||||
$this->extension_manager = $extension_manager;
|
||||
$this->root_path = $root_path;
|
||||
$this->php_ext = $php_ext;
|
||||
|
||||
$this->template->assign_vars(array(
|
||||
'IS_PHPBB31' => $this->settings->is_phpbb31,
|
||||
'IS_PHPBB32' => $this->settings->is_phpbb32,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,12 +101,7 @@ class mchat
|
||||
|
||||
$this->assign_whois();
|
||||
|
||||
if (!$this->config['mchat_on_index'])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$this->user->data['user_mchat_index'])
|
||||
if (!$this->settings->cfg('mchat_index'))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -111,6 +111,8 @@ class mchat
|
||||
$this->assign_bbcodes_smilies();
|
||||
|
||||
$this->render_page('index');
|
||||
|
||||
$this->template->assign_var('MCHAT_IS_INDEX', true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,7 +127,7 @@ class mchat
|
||||
throw new \phpbb\exception\http_exception(403, 'NOT_AUTHORISED');
|
||||
}
|
||||
|
||||
if (!$this->config['mchat_custom_page'])
|
||||
if (!$this->settings->cfg('mchat_custom_page'))
|
||||
{
|
||||
throw new \phpbb\exception\http_exception(403, 'MCHAT_NO_CUSTOM_PAGE');
|
||||
}
|
||||
@@ -138,7 +140,7 @@ class mchat
|
||||
|
||||
$this->assign_bbcodes_smilies();
|
||||
|
||||
$this->template->assign_var('MCHAT_CUSTOM_PAGE', true);
|
||||
$this->template->assign_var('MCHAT_IS_CUSTOM_PAGE', true);
|
||||
|
||||
$this->render_page('custom');
|
||||
|
||||
@@ -165,7 +167,7 @@ class mchat
|
||||
|
||||
$this->functions->mchat_prune();
|
||||
|
||||
$this->template->assign_var('MCHAT_ARCHIVE_PAGE', true);
|
||||
$this->template->assign_var('MCHAT_IS_ARCHIVE_PAGE', true);
|
||||
|
||||
$this->render_page('archive');
|
||||
|
||||
@@ -219,13 +221,13 @@ class mchat
|
||||
}
|
||||
|
||||
$lang_rules = $this->user->lang('MCHAT_RULES_MESSAGE');
|
||||
if (!$this->config['mchat_rules'] && !$lang_rules)
|
||||
if (!$this->settings->cfg('mchat_rules') && !$lang_rules)
|
||||
{
|
||||
throw new \phpbb\exception\http_exception(404, 'MCHAT_NO_RULES');
|
||||
}
|
||||
|
||||
// If the rules are defined in the language file use them, else just use the entry in the database
|
||||
$mchat_rules = $lang_rules ?: $this->config['mchat_rules'];
|
||||
$mchat_rules = $lang_rules ?: $this->settings->cfg('mchat_rules');
|
||||
$mchat_rules = htmlspecialchars_decode($mchat_rules);
|
||||
$mchat_rules = str_replace("\n", '<br />', $mchat_rules);
|
||||
|
||||
@@ -253,7 +255,7 @@ class mchat
|
||||
|
||||
$message = $this->request->variable('message', '', true);
|
||||
|
||||
if ($this->user->data['user_mchat_capital_letter'])
|
||||
if ($this->settings->cfg('mchat_capital_letter'))
|
||||
{
|
||||
$message = utf8_ucfirst($message);
|
||||
}
|
||||
@@ -306,7 +308,7 @@ class mchat
|
||||
}
|
||||
|
||||
$is_archive = $this->request->variable('archive', 0);
|
||||
$this->template->assign_var('MCHAT_ARCHIVE_PAGE', $is_archive);
|
||||
$this->template->assign_var('MCHAT_IS_ARCHIVE_PAGE', $is_archive);
|
||||
|
||||
$message = $this->request->variable('message', '', true);
|
||||
|
||||
@@ -314,7 +316,7 @@ class mchat
|
||||
'edit_time' => time(),
|
||||
));
|
||||
|
||||
$this->functions->mchat_action('edit', $sql_ary, $message_id, $author['username']);
|
||||
$this->functions->mchat_action('edit', $sql_ary, $message_id);
|
||||
|
||||
/**
|
||||
* Event render_helper_edit
|
||||
@@ -362,7 +364,7 @@ class mchat
|
||||
*/
|
||||
$this->dispatcher->dispatch('dmzx.mchat.core.render_helper_delete');
|
||||
|
||||
$this->functions->mchat_action('del', null, $message_id, $author['username']);
|
||||
$this->functions->mchat_action('del', null, $message_id);
|
||||
|
||||
return array('del' => true);
|
||||
}
|
||||
@@ -380,7 +382,7 @@ class mchat
|
||||
}
|
||||
|
||||
// Keep the session alive forever if there is no user session timeout
|
||||
if (!$this->config['mchat_timeout'])
|
||||
if (!$this->settings->cfg('mchat_timeout'))
|
||||
{
|
||||
$this->user->update_session_infos();
|
||||
}
|
||||
@@ -393,21 +395,15 @@ class mchat
|
||||
$sql_where = 'm.message_id > ' . (int) $message_last_id;
|
||||
|
||||
// Request edited messages
|
||||
if ($this->config['mchat_live_updates'] && $message_last_id > 0)
|
||||
if ($this->settings->cfg('mchat_live_updates') && $message_last_id > 0)
|
||||
{
|
||||
$sql_where .= sprintf(' OR (m.message_id BETWEEN %d AND %d AND m.edit_time > 0)', (int) $message_first_id , (int) $message_last_id);
|
||||
if ($this->config['mchat_edit_delete_limit'])
|
||||
if ($this->settings->cfg('mchat_edit_delete_limit'))
|
||||
{
|
||||
$sql_where .= sprintf(' AND m.message_time > %d', time() - $this->config['mchat_edit_delete_limit']);
|
||||
$sql_where .= sprintf(' AND m.message_time > %d', time() - $this->settings->cfg('mchat_edit_delete_limit'));
|
||||
}
|
||||
}
|
||||
|
||||
// Exclude post notifications
|
||||
if (!$this->user->data['user_mchat_topics'])
|
||||
{
|
||||
$sql_where = '(' . $sql_where . ') AND m.forum_id = 0';
|
||||
}
|
||||
|
||||
$rows = $this->functions->mchat_get_messages($sql_where);
|
||||
$rows_refresh = array();
|
||||
$rows_edit = array();
|
||||
@@ -447,7 +443,7 @@ class mchat
|
||||
}
|
||||
|
||||
// Assign deleted messages
|
||||
if ($this->config['mchat_live_updates'] && $message_last_id > 0)
|
||||
if ($this->settings->cfg('mchat_live_updates') && $message_last_id > 0)
|
||||
{
|
||||
$deleted_message_ids = $this->functions->mchat_deleted_ids($message_first_id);
|
||||
if ($deleted_message_ids)
|
||||
@@ -478,8 +474,8 @@ class mchat
|
||||
{
|
||||
$this->template->assign_vars(array(
|
||||
'MCHAT_ALLOW_VIEW' => $this->auth->acl_get('u_mchat_view'),
|
||||
'MCHAT_NAVBAR_LINK' => $this->config['mchat_navbar_link'],
|
||||
'S_MCHAT_CUSTOM_PAGE' => $this->config['mchat_custom_page'],
|
||||
'MCHAT_NAVBAR_LINK' => $this->settings->cfg('mchat_navbar_link'),
|
||||
'MCHAT_CUSTOM_PAGE' => $this->settings->cfg('mchat_custom_page'),
|
||||
'U_MCHAT' => $this->helper->route('dmzx_mchat_controller'),
|
||||
));
|
||||
}
|
||||
@@ -496,51 +492,50 @@ class mchat
|
||||
|
||||
// If the static message is defined in the language file use it, else the entry in the database is used
|
||||
$lang_static_message = $this->user->lang('MCHAT_STATIC_MESSAGE');
|
||||
$static_message = $lang_static_message ?: $this->config['mchat_static_message'];
|
||||
$static_message = $lang_static_message ?: $this->settings->cfg('mchat_static_message');
|
||||
|
||||
$u_mchat_use = $this->auth->acl_get('u_mchat_use');
|
||||
|
||||
$this->template->assign_vars(array(
|
||||
'U_MCHAT_CUSTOM_PAGE' => $this->helper->route('dmzx_mchat_controller'),
|
||||
'MCHAT_REFRESH_JS' => 1000 * $this->config['mchat_refresh'],
|
||||
'MCHAT_INPUT_TYPE' => $this->user->data['user_mchat_input_area'],
|
||||
'MCHAT_RULES' => $this->user->lang('MCHAT_RULES_MESSAGE') || $this->config['mchat_rules'],
|
||||
'MCHAT_ALLOW_USE' => $this->auth->acl_get('u_mchat_use'),
|
||||
'MCHAT_ALLOW_SMILES' => $this->config['allow_smilies'] && $this->auth->acl_get('u_mchat_smilies'),
|
||||
'S_BBCODE_ALLOWED' => $this->config['allow_bbcode'] && $this->auth->acl_get('u_mchat_bbcode'),
|
||||
'MCHAT_MESSAGE_TOP' => $this->config['mchat_message_top'],
|
||||
'MCHAT_ARCHIVE_URL' => $this->helper->route('dmzx_mchat_page_controller', array('page' => 'archive')),
|
||||
'MCHAT_INDEX_HEIGHT' => $this->config['mchat_index_height'],
|
||||
'MCHAT_CUSTOM_HEIGHT' => $this->config['mchat_custom_height'],
|
||||
'MCHAT_READ_ARCHIVE_BUTTON' => $this->auth->acl_get('u_mchat_archive'),
|
||||
'MCHAT_ALLOW_USE' => $u_mchat_use,
|
||||
'S_BBCODE_ALLOWED' => $this->settings->cfg('allow_bbcode') && $this->auth->acl_get('u_mchat_bbcode'),
|
||||
'MCHAT_ALLOW_SMILES' => $this->settings->cfg('allow_smilies') && $this->auth->acl_get('u_mchat_smilies'),
|
||||
'MCHAT_INPUT_AREA' => $this->settings->cfg('mchat_input_area'),
|
||||
'MCHAT_MESSAGE_TOP' => $this->settings->cfg('mchat_message_top'),
|
||||
'MCHAT_INDEX_HEIGHT' => $this->settings->cfg('mchat_index_height'),
|
||||
'MCHAT_CUSTOM_HEIGHT' => $this->settings->cfg('mchat_custom_height'),
|
||||
'MCHAT_LIVE_UPDATES' => $this->settings->cfg('mchat_live_updates'),
|
||||
'MCHAT_LOCATION' => $this->settings->cfg('mchat_location'),
|
||||
'MCHAT_CHARACTER_COUNT' => $this->settings->cfg('mchat_character_count'),
|
||||
'MCHAT_SOUND' => $this->settings->cfg('mchat_sound'),
|
||||
'MCHAT_SOUND_DISABLED' => !$this->settings->cfg('mchat_sound') && !$this->settings->cfg('mchat_sound', true),
|
||||
'MCHAT_INDEX' => $this->settings->cfg('mchat_index'),
|
||||
'MCHAT_PAUSE_ON_INPUT' => $this->settings->cfg('mchat_pause_on_input'),
|
||||
'MCHAT_MESSAGE_LNGTH' => $this->settings->cfg('mchat_max_message_lngth'),
|
||||
'MCHAT_WHOIS_INDEX' => $this->settings->cfg('mchat_whois_index'),
|
||||
'MCHAT_WHOIS_REFRESH' => $this->settings->cfg('mchat_whois') ? $this->settings->cfg('mchat_whois_refresh') * 1000 : 0,
|
||||
'MCHAT_REFRESH_JS' => $this->settings->cfg('mchat_refresh') * 1000,
|
||||
'MCHAT_ARCHIVE' => $this->auth->acl_get('u_mchat_archive'),
|
||||
'MCHAT_RULES' => $this->user->lang('MCHAT_RULES_MESSAGE') || $this->settings->cfg('mchat_rules'),
|
||||
'MCHAT_WHOIS_REFRESH_EXPLAIN' => $this->user->lang('MCHAT_WHO_IS_REFRESH_EXPLAIN', $this->settings->cfg('mchat_whois_refresh')),
|
||||
'MCHAT_SESSION_TIMELEFT' => $this->user->lang('MCHAT_SESSION_ENDS', gmdate('H:i:s', (int) $this->settings->cfg('mchat_timeout'))),
|
||||
'MCHAT_STATIC_MESS' => htmlspecialchars_decode($static_message),
|
||||
'L_MCHAT_COPYRIGHT' => base64_decode('PHNwYW4gY2xhc3M9Im1jaGF0LWNvcHlyaWdodCIgdGl0bGU9ImRtenggJmJ1bGw7IGthc2ltaSAmYnVsbDsgUk1jR2lycjgzIj4mY29weTs8L3NwYW4+'),
|
||||
'MCHAT_MESSAGE_LNGTH' => $this->config['mchat_max_message_lngth'],
|
||||
'MCHAT_MESS_LONG' => $this->user->lang('MCHAT_MESS_LONG', $this->config['mchat_max_message_lngth']),
|
||||
'MCHAT_USER_TIMEOUT_TIME' => gmdate('H:i:s', (int) $this->config['mchat_timeout']),
|
||||
'MCHAT_WHOIS_REFRESH' => $this->config['mchat_whois'] ? 1000 * $this->config['mchat_whois_refresh'] : 0,
|
||||
'MCHAT_WHOIS_REFRESH_EXPLAIN' => $this->user->lang('MCHAT_WHO_IS_REFRESH_EXPLAIN', $this->config['mchat_whois_refresh']),
|
||||
'MCHAT_PAUSE_ON_INPUT' => $this->config['mchat_pause_on_input'],
|
||||
'MCHAT_REFRESH_YES' => $this->user->lang('MCHAT_REFRESH_YES', $this->config['mchat_refresh']),
|
||||
'MCHAT_LIVE_UPDATES' => $this->config['mchat_live_updates'],
|
||||
'S_MCHAT_LOCATION' => $this->config['mchat_location'],
|
||||
'S_MCHAT_SOUND_YES' => $this->user->data['user_mchat_sound'],
|
||||
'U_MORE_SMILIES' => generate_board_url() . append_sid("/{$this->root_path}/posting.{$this->php_ext}", 'mode=smilies'),
|
||||
'MCHAT_MESS_LONG' => addslashes($this->user->lang('MCHAT_MESS_LONG', $this->settings->cfg('mchat_max_message_lngth'))),
|
||||
'MCHAT_REFRESH_YES' => addslashes($this->user->lang('MCHAT_REFRESH_YES', $this->settings->cfg('mchat_refresh'))),
|
||||
'U_MCHAT_CUSTOM_PAGE' => $this->helper->route('dmzx_mchat_controller'),
|
||||
'U_MCHAT_RULES' => $this->helper->route('dmzx_mchat_page_controller', array('page' => 'rules')),
|
||||
'S_MCHAT_ON_INDEX' => $this->config['mchat_on_index'] && $this->user->data['user_mchat_index'],
|
||||
'U_MCHAT_ARCHIVE_URL' => $this->helper->route('dmzx_mchat_page_controller', array('page' => 'archive')),
|
||||
));
|
||||
|
||||
$md_manager = $this->extension_manager->create_extension_metadata_manager('dmzx/mchat', $this->template);
|
||||
$md_manager->get_metadata('all');
|
||||
$md_manager->output_template_data();
|
||||
|
||||
// The template needs some language variables if we display relative time for messages
|
||||
if ($this->config['mchat_relative_time'] && $page != 'archive')
|
||||
if ($this->settings->cfg('mchat_relative_time') && $page != 'archive')
|
||||
{
|
||||
$minutes_limit = $this->get_relative_minutes_limit();
|
||||
for ($i = 0; $i < $minutes_limit; $i++)
|
||||
{
|
||||
$this->template->assign_block_vars('mchattime', array(
|
||||
'KEY' => $i,
|
||||
'LANG' => $this->user->lang('MCHAT_MINUTES_AGO', $i),
|
||||
'LANG' => addslashes($this->user->lang('MCHAT_MINUTES_AGO', $i)),
|
||||
'IS_LAST' => $i + 1 === $minutes_limit,
|
||||
));
|
||||
}
|
||||
@@ -551,8 +546,8 @@ class mchat
|
||||
'edit' => $this->auth_message('u_mchat_edit', true, time()),
|
||||
'del' => $this->auth_message('u_mchat_delete', true, time()),
|
||||
'refresh' => $page != 'archive' && $this->auth->acl_get('u_mchat_view'),
|
||||
'add' => $page != 'archive' && $this->auth->acl_get('u_mchat_use'),
|
||||
'whois' => $page != 'archive' && $this->config['mchat_whois'],
|
||||
'add' => $page != 'archive' && $u_mchat_use,
|
||||
'whois' => $page != 'archive' && $this->settings->cfg('mchat_whois'),
|
||||
)));
|
||||
|
||||
foreach ($actions as $i => $action)
|
||||
@@ -564,10 +559,9 @@ class mchat
|
||||
));
|
||||
}
|
||||
|
||||
$sql_where = $this->user->data['user_mchat_topics'] ? '' : 'm.forum_id = 0';
|
||||
$limit = $page == 'archive' ? $this->config['mchat_archive_limit'] : $this->config[$page == 'index' ? 'mchat_message_num' : 'mchat_message_limit'];
|
||||
$limit = $this->settings->cfg('mchat_message_num_' . $page);
|
||||
$start = $page == 'archive' ? $this->request->variable('start', 0) : 0;
|
||||
$rows = $this->functions->mchat_get_messages($sql_where, $limit, $start);
|
||||
$rows = $this->functions->mchat_get_messages('', $limit, $start);
|
||||
|
||||
$this->assign_global_template_data();
|
||||
$this->assign_messages($rows, $page);
|
||||
@@ -582,13 +576,15 @@ class mchat
|
||||
}
|
||||
|
||||
// Render legend
|
||||
if ($page != 'index' && $this->config['mchat_whois'])
|
||||
if ($page != 'index' && $this->settings->cfg('mchat_whois'))
|
||||
{
|
||||
$legend = $this->functions->mchat_legend();
|
||||
$this->template->assign_var('LEGEND', implode(', ', $legend));
|
||||
$this->template->assign_var('LEGEND', implode($this->user->lang('COMMA_SEPARATOR'), $legend));
|
||||
}
|
||||
|
||||
if ($this->auth->acl_get('u_mchat_use'))
|
||||
$this->assign_authors();
|
||||
|
||||
if ($u_mchat_use)
|
||||
{
|
||||
add_form_key('mchat');
|
||||
}
|
||||
@@ -602,6 +598,30 @@ class mchat
|
||||
$this->dispatcher->dispatch('dmzx.mchat.core.render_helper_aft');
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigns author names and homepages for copyright
|
||||
*/
|
||||
protected function assign_authors()
|
||||
{
|
||||
$md_manager = $this->extension_manager->create_extension_metadata_manager('dmzx/mchat', $this->template);
|
||||
$meta = $md_manager->get_metadata();
|
||||
|
||||
$author_names = array();
|
||||
$author_homepages = array();
|
||||
|
||||
foreach ($meta['authors'] as $author)
|
||||
{
|
||||
$author_names[] = $author['name'];
|
||||
$author_homepages[] = sprintf('<a href="%1$s" title="%2$s">%2$s</a>', $author['homepage'], $author['name']);
|
||||
}
|
||||
|
||||
$this->template->assign_vars(array(
|
||||
'MCHAT_DISPLAY_NAME' => $meta['extra']['display-name'],
|
||||
'MCHAT_AUTHOR_NAMES' => implode(' • ', $author_names),
|
||||
'MCHAT_AUTHOR_HOMEPAGES' => implode(' • ', $author_homepages),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigns common template data that is required for displaying messages
|
||||
*/
|
||||
@@ -612,13 +632,14 @@ class mchat
|
||||
'MCHAT_ALLOW_PM' => $this->auth->acl_get('u_mchat_pm'),
|
||||
'MCHAT_ALLOW_LIKE' => $this->auth->acl_get('u_mchat_like'),
|
||||
'MCHAT_ALLOW_QUOTE' => $this->auth->acl_get('u_mchat_quote'),
|
||||
'MCHAT_EDIT_DELETE_LIMIT' => 1000 * $this->config['mchat_edit_delete_limit'],
|
||||
'MCHAT_EDIT_DELETE_IGNORE' => $this->config['mchat_edit_delete_limit'] && $this->auth->acl_get('m_'),
|
||||
'MCHAT_RELATIVE_TIME' => $this->config['mchat_relative_time'],
|
||||
'MCHAT_USER_TIMEOUT' => 1000 * $this->config['mchat_timeout'],
|
||||
'MCHAT_ALLOW_PERMISSIONS' => $this->auth->acl_get('a_authusers'),
|
||||
'MCHAT_EDIT_DELETE_LIMIT' => 1000 * $this->settings->cfg('mchat_edit_delete_limit'),
|
||||
'MCHAT_EDIT_DELETE_IGNORE' => $this->settings->cfg('mchat_edit_delete_limit') && $this->auth->acl_get('m_'),
|
||||
'MCHAT_RELATIVE_TIME' => $this->settings->cfg('mchat_relative_time'),
|
||||
'MCHAT_USER_TIMEOUT' => 1000 * $this->settings->cfg('mchat_timeout'),
|
||||
'S_MCHAT_AVATARS' => $this->display_avatars(),
|
||||
'EXT_URL' => generate_board_url() . '/ext/dmzx/mchat/',
|
||||
'STYLE_PATH' => generate_board_url() . '/styles/' . $this->user->style['style_path'],
|
||||
'STYLE_PATH' => generate_board_url() . '/styles/' . rawurlencode($this->user->style['style_path']),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -629,7 +650,7 @@ class mchat
|
||||
*/
|
||||
protected function display_avatars()
|
||||
{
|
||||
return $this->config['mchat_avatars'] && $this->user->optionget('viewavatars') && $this->user->data['user_mchat_avatars'];
|
||||
return $this->settings->cfg('mchat_avatars') && $this->user->optionget('viewavatars') && $this->settings->cfg('mchat_avatars');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -646,7 +667,7 @@ class mchat
|
||||
}
|
||||
|
||||
// Reverse the array if messages appear at the bottom
|
||||
if (!$this->config['mchat_message_top'])
|
||||
if (!$this->settings->cfg('mchat_message_top'))
|
||||
{
|
||||
$rows = array_reverse($rows);
|
||||
}
|
||||
@@ -681,8 +702,7 @@ class mchat
|
||||
continue;
|
||||
}
|
||||
|
||||
$message_edit = $row['message'];
|
||||
decode_message($message_edit, $row['bbcode_uid']);
|
||||
$message_for_edit = generate_text_for_edit($row['message'], $row['bbcode_uid'], $row['bbcode_options']);
|
||||
|
||||
if (in_array($row['user_id'], $foes))
|
||||
{
|
||||
@@ -699,31 +719,32 @@ class mchat
|
||||
|
||||
$message_age = time() - $row['message_time'];
|
||||
$minutes_ago = $this->get_minutes_ago($message_age, $page);
|
||||
$datetime = $this->user->format_date($row['message_time'], $this->config['mchat_date']);
|
||||
$datetime = $this->user->format_date($row['message_time'], $this->settings->cfg('mchat_date'));
|
||||
|
||||
$is_poster = $row['user_id'] != ANONYMOUS && $this->user->data['user_id'] == $row['user_id'];
|
||||
|
||||
$this->template->assign_block_vars('mchatrow', array(
|
||||
'MCHAT_ALLOW_BAN' => $this->auth->acl_get('a_authusers'),
|
||||
'MCHAT_ALLOW_EDIT' => $this->auth_message('u_mchat_edit', $row['user_id'], $row['message_time']),
|
||||
'MCHAT_ALLOW_DEL' => $this->auth_message('u_mchat_delete', $row['user_id'], $row['message_time']),
|
||||
'MCHAT_USER_AVATAR' => $user_avatars[$row['user_id']],
|
||||
'U_VIEWPROFILE' => $row['user_id'] != ANONYMOUS ? append_sid("{$board_url}{$this->root_path}memberlist.{$this->php_ext}", 'mode=viewprofile&u=' . $row['user_id']) : '',
|
||||
'MCHAT_IS_POSTER' => $row['user_id'] != ANONYMOUS && $this->user->data['user_id'] == $row['user_id'],
|
||||
'MCHAT_PM' => $row['user_id'] != ANONYMOUS && $this->user->data['user_id'] != $row['user_id'] && $this->config['allow_privmsg'] && $this->auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_')) ? append_sid("{$board_url}{$this->root_path}ucp.{$this->php_ext}", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
||||
'MCHAT_MESSAGE_EDIT' => $message_edit,
|
||||
'MCHAT_MESSAGE_ID' => $row['message_id'],
|
||||
'MCHAT_USERNAME_FULL' => $username_full,
|
||||
'MCHAT_USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST')),
|
||||
'MCHAT_USERNAME_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST')),
|
||||
'MCHAT_WHOIS_USER' => $this->user->lang('MCHAT_WHOIS_USER', $row['user_ip']),
|
||||
'MCHAT_U_IP' => $this->helper->route('dmzx_mchat_page_controller', array('page' => 'whois', 'ip' => $row['user_ip'])),
|
||||
'MCHAT_U_BAN' => append_sid("{$board_url}{$this->root_path}adm/index.{$this->php_ext}" ,'i=permissions&mode=setting_user_global&user_id[0]=' . $row['user_id'], true, $this->user->session_id),
|
||||
'MCHAT_MESSAGE' => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']),
|
||||
'MCHAT_TIME' => $minutes_ago === -1 ? $datetime : $this->user->lang('MCHAT_MINUTES_AGO', $minutes_ago),
|
||||
'MCHAT_DATETIME' => $datetime,
|
||||
'MCHAT_MINUTES_AGO' => $minutes_ago,
|
||||
'MCHAT_RELATIVE_UPDATE' => 60 - $message_age % 60,
|
||||
'MCHAT_MESSAGE_TIME' => $row['message_time'],
|
||||
'MCHAT_EDIT_TIME' => $row['edit_time'],
|
||||
'MCHAT_ALLOW_EDIT' => $this->auth_message('u_mchat_edit', $row['user_id'], $row['message_time']),
|
||||
'MCHAT_ALLOW_DEL' => $this->auth_message('u_mchat_delete', $row['user_id'], $row['message_time']),
|
||||
'MCHAT_USER_AVATAR' => $user_avatars[$row['user_id']],
|
||||
'U_VIEWPROFILE' => $row['user_id'] != ANONYMOUS ? append_sid("{$board_url}{$this->root_path}memberlist.{$this->php_ext}", 'mode=viewprofile&u=' . $row['user_id']) : '',
|
||||
'MCHAT_IS_POSTER' => $is_poster,
|
||||
'MCHAT_PM' => !$is_poster && $this->settings->cfg('allow_privmsg') && $this->auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $this->auth->acl_gets('a_', 'm_') || $this->auth->acl_getf_global('m_')) ? append_sid("{$board_url}{$this->root_path}ucp.{$this->php_ext}", 'i=pm&mode=compose&u=' . $row['user_id']) : '',
|
||||
'MCHAT_MESSAGE_EDIT' => $message_for_edit['text'],
|
||||
'MCHAT_MESSAGE_ID' => $row['message_id'],
|
||||
'MCHAT_USERNAME_FULL' => $username_full,
|
||||
'MCHAT_USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST')),
|
||||
'MCHAT_USERNAME_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang('GUEST')),
|
||||
'MCHAT_WHOIS_USER' => $this->user->lang('MCHAT_WHOIS_USER', $row['user_ip']),
|
||||
'MCHAT_U_IP' => $this->helper->route('dmzx_mchat_page_controller', array('page' => 'whois', 'ip' => $row['user_ip'])),
|
||||
'MCHAT_U_PERMISSIONS' => append_sid("{$board_url}{$this->root_path}adm/index.{$this->php_ext}" ,'i=permissions&mode=setting_user_global&user_id[0]=' . $row['user_id'], true, $this->user->session_id),
|
||||
'MCHAT_MESSAGE' => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']),
|
||||
'MCHAT_TIME' => $minutes_ago === -1 ? $datetime : $this->user->lang('MCHAT_MINUTES_AGO', $minutes_ago),
|
||||
'MCHAT_DATETIME' => $datetime,
|
||||
'MCHAT_MINUTES_AGO' => $minutes_ago,
|
||||
'MCHAT_RELATIVE_UPDATE' => 60 - $message_age % 60,
|
||||
'MCHAT_MESSAGE_TIME' => $row['message_time'],
|
||||
'MCHAT_EDIT_TIME' => $row['edit_time'],
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -738,7 +759,7 @@ class mchat
|
||||
*/
|
||||
protected function get_minutes_ago($message_age, $page)
|
||||
{
|
||||
if ($this->config['mchat_relative_time'] && $page != 'archive')
|
||||
if ($this->settings->cfg('mchat_relative_time') && $page != 'archive')
|
||||
{
|
||||
$minutes_ago = floor($message_age / 60);
|
||||
if ($minutes_ago < $this->get_relative_minutes_limit())
|
||||
@@ -759,11 +780,11 @@ class mchat
|
||||
*/
|
||||
protected function get_relative_minutes_limit()
|
||||
{
|
||||
$timeout = $this->config['session_length'];
|
||||
$timeout = $this->settings->cfg('session_length');
|
||||
|
||||
if ($this->config['mchat_timeout'])
|
||||
if ($this->settings->cfg('mchat_timeout'))
|
||||
{
|
||||
$timeout = $this->config['mchat_timeout'];
|
||||
$timeout = $this->settings->cfg('mchat_timeout');
|
||||
}
|
||||
|
||||
return min(max((int) ceil($timeout / 60), 1), 60);
|
||||
@@ -775,7 +796,7 @@ class mchat
|
||||
protected function assign_bbcodes_smilies()
|
||||
{
|
||||
// Display BBCodes
|
||||
if ($this->config['allow_bbcode'] && $this->auth->acl_get('u_mchat_bbcode'))
|
||||
if ($this->settings->cfg('allow_bbcode') && $this->auth->acl_get('u_mchat_bbcode'))
|
||||
{
|
||||
$bbcode_template_vars = array(
|
||||
'quote' => array(
|
||||
@@ -787,22 +808,22 @@ class mchat
|
||||
'template_var' => 'S_BBCODE_IMG',
|
||||
),
|
||||
'url' => array(
|
||||
'allow' => $this->config['allow_post_links'],
|
||||
'allow' => $this->settings->cfg('allow_post_links'),
|
||||
'template_var' => 'S_LINKS_ALLOWED',
|
||||
),
|
||||
'flash' => array(
|
||||
'allow' => $this->config['allow_post_flash'],
|
||||
'allow' => $this->settings->cfg('allow_post_flash'),
|
||||
'template_var' => 'S_BBCODE_FLASH',
|
||||
),
|
||||
);
|
||||
|
||||
foreach ($bbcode_template_vars as $bbcode => $option)
|
||||
{
|
||||
$is_disallowed = preg_match('#(^|\|)' . $bbcode . '($|\|)#Usi', $this->config['mchat_bbcode_disallowed']) || !$option['allow'];
|
||||
$is_disallowed = preg_match('#(^|\|)' . $bbcode . '($|\|)#Usi', $this->settings->cfg('mchat_bbcode_disallowed')) || !$option['allow'];
|
||||
$this->template->assign_var($option['template_var'], !$is_disallowed);
|
||||
}
|
||||
|
||||
$this->template->assign_var('S_DISALLOWED_BBCODES', str_replace('=', '-', $this->config['mchat_bbcode_disallowed']));
|
||||
$this->template->assign_var('MCHAT_DISALLOWED_BBCODES', addslashes(str_replace('=', '-', $this->settings->cfg('mchat_bbcode_disallowed'))));
|
||||
|
||||
if (!function_exists('display_custom_bbcodes'))
|
||||
{
|
||||
@@ -814,7 +835,7 @@ class mchat
|
||||
}
|
||||
|
||||
// Display smilies
|
||||
if ($this->config['allow_smilies'] && $this->auth->acl_get('u_mchat_smilies'))
|
||||
if ($this->settings->cfg('allow_smilies') && $this->auth->acl_get('u_mchat_smilies'))
|
||||
{
|
||||
if (!function_exists('generate_smilies'))
|
||||
{
|
||||
@@ -842,16 +863,26 @@ class mchat
|
||||
return $sql_ary;
|
||||
}
|
||||
|
||||
/** Inserts a message with posting information into the database
|
||||
*
|
||||
* @param string $mode One of post|quote|edit|reply
|
||||
* @param $data The post data
|
||||
*/
|
||||
public function insert_posting($mode, $data)
|
||||
{
|
||||
$this->functions->mchat_insert_posting($mode, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Assigns whois and stats at the bottom of the index page
|
||||
*/
|
||||
protected function assign_whois()
|
||||
{
|
||||
if ($this->config['mchat_whois'] || $this->config['mchat_stats_index'] && $this->user->data['user_mchat_stats_index'])
|
||||
if ($this->settings->cfg('mchat_whois') || $this->settings->cfg('mchat_stats_index') && $this->settings->cfg('mchat_stats_index'))
|
||||
{
|
||||
$mchat_stats = $this->functions->mchat_active_users();
|
||||
$this->template->assign_vars(array(
|
||||
'MCHAT_INDEX_STATS' => $this->config['mchat_stats_index'] && $this->user->data['user_mchat_stats_index'],
|
||||
'MCHAT_STATS_INDEX' => $this->settings->cfg('mchat_stats_index') && $this->settings->cfg('mchat_stats_index'),
|
||||
'MCHAT_USERS_COUNT' => $mchat_stats['mchat_users_count'],
|
||||
'MCHAT_USERS_LIST' => $mchat_stats['online_userlist'] ?: '',
|
||||
'MCHAT_ONLINE_EXPLAIN' => $mchat_stats['refresh_message'],
|
||||
@@ -879,7 +910,7 @@ class mchat
|
||||
return true;
|
||||
}
|
||||
|
||||
$can_edit_delete = $this->config['mchat_edit_delete_limit'] == 0 || $message_time >= time() - $this->config['mchat_edit_delete_limit'];
|
||||
$can_edit_delete = $this->settings->cfg('mchat_edit_delete_limit') == 0 || $message_time >= time() - $this->settings->cfg('mchat_edit_delete_limit');
|
||||
return $can_edit_delete && $this->user->data['user_id'] == $author_id && $this->user->data['is_registered'];
|
||||
}
|
||||
|
||||
@@ -900,33 +931,33 @@ class mchat
|
||||
throw new \phpbb\exception\http_exception(501, 'MCHAT_NOACCESS');
|
||||
}
|
||||
|
||||
// Must not exceed character limit, excluding whitespaces
|
||||
if ($this->config['mchat_max_message_lngth'])
|
||||
// Must not exceed character limit
|
||||
if ($this->settings->cfg('mchat_max_message_lngth'))
|
||||
{
|
||||
$message_chars = preg_replace('#\s#m', '', $message);
|
||||
if (utf8_strlen($message_chars) > $this->config['mchat_max_message_lngth'])
|
||||
if (utf8_strlen($message_chars) > $this->settings->cfg('mchat_max_message_lngth'))
|
||||
{
|
||||
throw new \phpbb\exception\http_exception(413, 'MCHAT_MESS_LONG', array($this->config['mchat_max_message_lngth']));
|
||||
throw new \phpbb\exception\http_exception(413, 'MCHAT_MESS_LONG', array($this->settings->cfg('mchat_max_message_lngth')));
|
||||
}
|
||||
}
|
||||
|
||||
// We override the $this->config['min_post_chars'] entry?
|
||||
if ($this->config['mchat_override_min_post_chars'])
|
||||
$cfg_min_post_chars = $this->settings->cfg('min_post_chars');
|
||||
$cfg_max_post_smilies = $this->settings->cfg('max_post_smilies');
|
||||
|
||||
// We override the $this->settings->cfg('min_post_chars') entry?
|
||||
if ($this->settings->cfg('mchat_override_min_post_chars'))
|
||||
{
|
||||
$old_cfg['min_post_chars'] = $this->config['min_post_chars'];
|
||||
$this->config['min_post_chars'] = 0;
|
||||
$this->settings->set_cfg('min_post_chars', 0);
|
||||
}
|
||||
|
||||
// We do the same for the max number of smilies?
|
||||
if ($this->config['mchat_override_smilie_limit'])
|
||||
if ($this->settings->cfg('mchat_override_smilie_limit'))
|
||||
{
|
||||
$old_cfg['max_post_smilies'] = $this->config['max_post_smilies'];
|
||||
$this->config['max_post_smilies'] = 0;
|
||||
$this->settings->cfg('max_post_smilies', 0);
|
||||
}
|
||||
|
||||
$mchat_bbcode = $this->config['allow_bbcode'] && $this->auth->acl_get('u_mchat_bbcode');
|
||||
$mchat_urls = $this->config['allow_post_links'] && $this->auth->acl_get('u_mchat_urls');
|
||||
$mchat_smilies = $this->config['allow_smilies'] && $this->auth->acl_get('u_mchat_smilies');
|
||||
$mchat_bbcode = $this->settings->cfg('allow_bbcode') && $this->auth->acl_get('u_mchat_bbcode');
|
||||
$mchat_urls = $this->settings->cfg('allow_post_links') && $this->auth->acl_get('u_mchat_urls');
|
||||
$mchat_smilies = $this->settings->cfg('allow_smilies') && $this->auth->acl_get('u_mchat_smilies');
|
||||
|
||||
// Add function part code from http://wiki.phpbb.com/Parsing_text
|
||||
$uid = $bitfield = $options = '';
|
||||
@@ -939,26 +970,19 @@ class mchat
|
||||
}
|
||||
|
||||
// Disallowed bbcodes
|
||||
if ($this->config['mchat_bbcode_disallowed'])
|
||||
if ($this->settings->cfg('mchat_bbcode_disallowed'))
|
||||
{
|
||||
$bbcode_replace = array(
|
||||
'#\[(' . $this->config['mchat_bbcode_disallowed'] . ')[^\[\]]+\]#Usi',
|
||||
'#\[/(' . $this->config['mchat_bbcode_disallowed'] . ')[^\[\]]+\]#Usi',
|
||||
'#\[(' . $this->settings->cfg('mchat_bbcode_disallowed') . ')[^\[\]]+\]#Usi',
|
||||
'#\[/(' . $this->settings->cfg('mchat_bbcode_disallowed') . ')[^\[\]]+\]#Usi',
|
||||
);
|
||||
|
||||
$message = preg_replace($bbcode_replace, '', $message);
|
||||
}
|
||||
|
||||
// Reset the config settings
|
||||
if (isset($old_cfg['min_post_chars']))
|
||||
{
|
||||
$this->config['min_post_chars'] = $old_cfg['min_post_chars'];
|
||||
}
|
||||
|
||||
if (isset($old_cfg['max_post_smilies']))
|
||||
{
|
||||
$this->config['max_post_smilies'] = $old_cfg['max_post_smilies'];
|
||||
}
|
||||
$this->settings->set_cfg('min_post_chars', $cfg_min_post_chars);
|
||||
$this->settings->set_cfg('max_post_smilies', $cfg_max_post_smilies);
|
||||
|
||||
return array_merge($merge_ary, array(
|
||||
'message' => str_replace("'", ''', $message),
|
||||
|
||||
159
core/settings.php
Normal file
@@ -0,0 +1,159 @@
|
||||
<?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\core;
|
||||
|
||||
class settings
|
||||
{
|
||||
const VALIDATE_TYPE = 0;
|
||||
const VALIDATE_IS_OPTIONAL = 1;
|
||||
const VALIDATE_MIN_VALUE = 2;
|
||||
const VALIDATE_MAX_VALUE = 3;
|
||||
|
||||
/** @var \phpbb\user */
|
||||
protected $user;
|
||||
|
||||
/** @var \phpbb\config\config */
|
||||
protected $config;
|
||||
|
||||
/** @var \phpbb\auth\auth */
|
||||
protected $auth;
|
||||
|
||||
/** @var array */
|
||||
public $global;
|
||||
|
||||
/** @var array */
|
||||
public $ucp;
|
||||
|
||||
/** @var bool */
|
||||
public $is_phpbb31;
|
||||
|
||||
/** @var bool */
|
||||
public $is_phpbb32;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \phpbb\user $user
|
||||
* @param \phpbb\config\config $config
|
||||
* @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)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->config = $config;
|
||||
$this->auth = $auth;
|
||||
$this->global = $global;
|
||||
$this->ucp = $ucp;
|
||||
|
||||
$this->is_phpbb31 = phpbb_version_compare($config['version'], '3.1.0@dev', '>=') && phpbb_version_compare($config['version'], '3.2.0@dev', '<');
|
||||
$this->is_phpbb32 = phpbb_version_compare($config['version'], '3.2.0@dev', '>=') && phpbb_version_compare($config['version'], '3.3.0@dev', '<');
|
||||
|
||||
$this->inject_core_config_values();
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes phpBB config values into the mChat config for validating input data
|
||||
*/
|
||||
protected function inject_core_config_values()
|
||||
{
|
||||
// Limit mChat session timeout to phpBB session length
|
||||
$this->global['mchat_timeout']['validation'][self::VALIDATE_MAX_VALUE] = (int) $this->cfg('session_length');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $config
|
||||
* @param bool $force_global
|
||||
* @return string
|
||||
*/
|
||||
public function cfg($config, $force_global = false)
|
||||
{
|
||||
return $this->cfg_user($config, $this->user->data, $this->auth, $force_global);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $config
|
||||
* @param array $user_data
|
||||
* @param \phpbb\auth\auth $auth
|
||||
* @param bool $force_global
|
||||
* @return string
|
||||
*/
|
||||
public function cfg_user($config, $user_data, $auth, $force_global = false)
|
||||
{
|
||||
if (!$force_global && isset($this->ucp[$config]) && $auth->acl_get('u_' . $config))
|
||||
{
|
||||
return $user_data['user_' . $config];
|
||||
}
|
||||
|
||||
return $this->config[$config];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $config
|
||||
* @param $value
|
||||
*/
|
||||
public function set_cfg($config, $value)
|
||||
{
|
||||
$this->config->set($config, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $selected
|
||||
* @return array
|
||||
*/
|
||||
public function get_date_template_data($selected)
|
||||
{
|
||||
$dateformat_options = '';
|
||||
|
||||
foreach ($this->user->lang['dateformats'] as $format => $null)
|
||||
{
|
||||
$dateformat_options .= '<option value="' . $format . '"' . (($format == $selected) ? ' selected="selected"' : '') . '>';
|
||||
$dateformat_options .= $this->user->format_date(time(), $format, false) . ((strpos($format, '|') !== false) ? $this->user->lang('VARIANT_DATE_SEPARATOR') . $this->user->format_date(time(), $format, true) : '');
|
||||
$dateformat_options .= '</option>';
|
||||
}
|
||||
|
||||
$s_custom = false;
|
||||
|
||||
$dateformat_options .= '<option value="custom"';
|
||||
if (!isset($this->user->lang['dateformats'][$selected]))
|
||||
{
|
||||
$dateformat_options .= ' selected="selected"';
|
||||
$s_custom = true;
|
||||
}
|
||||
$dateformat_options .= '>' . $this->user->lang('MCHAT_CUSTOM_DATEFORMAT') . '</option>';
|
||||
|
||||
return array(
|
||||
'S_MCHAT_DATEFORMAT_OPTIONS' => $dateformat_options,
|
||||
'A_MCHAT_DEFAULT_DATEFORMAT' => addslashes($this->ucp['mchat_date']['default']),
|
||||
'S_MCHAT_CUSTOM_DATEFORMAT' => $s_custom,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function get_enabled_post_notifications_lang()
|
||||
{
|
||||
$enabled_notifications_lang = array();
|
||||
|
||||
foreach (array('topic', 'reply', 'quote', 'edit') as $notification)
|
||||
{
|
||||
if ($this->cfg('mchat_posts_' . $notification))
|
||||
{
|
||||
$enabled_notifications_lang[] = $this->user->lang('MCHAT_POSTS_' . strtoupper($notification));
|
||||
}
|
||||
}
|
||||
|
||||
return implode($this->user->lang('COMMA_SEPARATOR'), $enabled_notifications_lang);
|
||||
}
|
||||
}
|
||||
@@ -24,23 +24,33 @@ class acp_listener implements EventSubscriberInterface
|
||||
/** @var \phpbb\user */
|
||||
protected $user;
|
||||
|
||||
/** @var array */
|
||||
protected $user_config_keys;
|
||||
/** @var \dmzx\mchat\core\settings */
|
||||
protected $settings;
|
||||
|
||||
/** @var string */
|
||||
protected $root_path;
|
||||
|
||||
/** @var string */
|
||||
protected $php_ext;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \phpbb\template\template $template
|
||||
* @param \phpbb\request\request $request
|
||||
* @param \phpbb\user $user
|
||||
* @param array $user_config_keys
|
||||
* @param \phpbb\template\template $template
|
||||
* @param \phpbb\request\request $request
|
||||
* @param \phpbb\user $user
|
||||
* @param \dmzx\mchat\core\settings $settings
|
||||
* @param string $root_path
|
||||
* @param string $php_ext
|
||||
*/
|
||||
public function __construct(\phpbb\template\template $template, \phpbb\request\request $request, \phpbb\user $user, $user_config_keys)
|
||||
public function __construct(\phpbb\template\template $template, \phpbb\request\request $request, \phpbb\user $user, \dmzx\mchat\core\settings $settings, $root_path, $php_ext)
|
||||
{
|
||||
$this->template = $template;
|
||||
$this->request = $request;
|
||||
$this->user = $user;
|
||||
$this->user_config_keys = $user_config_keys;
|
||||
$this->template = $template;
|
||||
$this->request = $request;
|
||||
$this->user = $user;
|
||||
$this->settings = $settings;
|
||||
$this->root_path = $root_path;
|
||||
$this->php_ext = $php_ext;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,7 +60,6 @@ class acp_listener implements EventSubscriberInterface
|
||||
{
|
||||
return array(
|
||||
'core.permissions' => 'permissions',
|
||||
'core.acp_users_prefs_modify_data' => 'acp_users_prefs_modify_data',
|
||||
'core.acp_users_prefs_modify_sql' => 'acp_users_prefs_modify_sql',
|
||||
'core.acp_users_prefs_modify_template_data' => 'acp_users_prefs_modify_template_data',
|
||||
);
|
||||
@@ -61,83 +70,83 @@ class acp_listener implements EventSubscriberInterface
|
||||
*/
|
||||
public function permissions($event)
|
||||
{
|
||||
$event['permissions'] = array_merge($event['permissions'], array(
|
||||
'u_mchat_use' => array(
|
||||
'lang' => 'ACL_U_MCHAT_USE',
|
||||
'cat' => 'mChat'
|
||||
$mchat_permissions = array();
|
||||
|
||||
$permission_categories = array(
|
||||
'mchat' => array(
|
||||
'u_mchat_use',
|
||||
'u_mchat_view',
|
||||
'u_mchat_edit',
|
||||
'u_mchat_delete',
|
||||
'u_mchat_ip',
|
||||
'u_mchat_pm',
|
||||
'u_mchat_like',
|
||||
'u_mchat_quote',
|
||||
'u_mchat_flood_ignore',
|
||||
'u_mchat_archive',
|
||||
'u_mchat_bbcode',
|
||||
'u_mchat_smilies',
|
||||
'u_mchat_urls',
|
||||
'a_mchat',
|
||||
),
|
||||
'u_mchat_view' => array(
|
||||
'lang' => 'ACL_U_MCHAT_VIEW',
|
||||
'cat' => 'mChat'
|
||||
),
|
||||
'u_mchat_edit' => array(
|
||||
'lang' => 'ACL_U_MCHAT_EDIT',
|
||||
'cat' => 'mChat'
|
||||
),
|
||||
'u_mchat_delete' => array(
|
||||
'lang' => 'ACL_U_MCHAT_DELETE',
|
||||
'cat' => 'mChat'
|
||||
),
|
||||
'u_mchat_ip' => array(
|
||||
'lang' => 'ACL_U_MCHAT_IP',
|
||||
'cat' => 'mChat'
|
||||
),
|
||||
'u_mchat_pm' => array(
|
||||
'lang' => 'ACL_U_MCHAT_PM',
|
||||
'cat' => 'mChat'
|
||||
),
|
||||
'u_mchat_like' => array(
|
||||
'lang' => 'ACL_U_MCHAT_LIKE',
|
||||
'cat' => 'mChat'
|
||||
),
|
||||
'u_mchat_quote' => array(
|
||||
'lang' => 'ACL_U_MCHAT_QUOTE',
|
||||
'cat' => 'mChat'
|
||||
),
|
||||
'u_mchat_flood_ignore' => array(
|
||||
'lang' => 'ACL_U_MCHAT_FLOOD_IGNORE',
|
||||
'cat' => 'mChat'
|
||||
),
|
||||
'u_mchat_archive' => array(
|
||||
'lang' => 'ACL_U_MCHAT_ARCHIVE',
|
||||
'cat' => 'mChat'
|
||||
),
|
||||
'u_mchat_bbcode' => array(
|
||||
'lang' => 'ACL_U_MCHAT_BBCODE',
|
||||
'cat' => 'mChat'
|
||||
),
|
||||
'u_mchat_smilies' => array(
|
||||
'lang' => 'ACL_U_MCHAT_SMILIES',
|
||||
'cat' => 'mChat'
|
||||
),
|
||||
'u_mchat_urls' => array(
|
||||
'lang' => 'ACL_U_MCHAT_URLS',
|
||||
'cat' => 'mChat'
|
||||
),
|
||||
'a_mchat' => array(
|
||||
'lang' => 'ACL_A_MCHAT',
|
||||
'cat' => 'mChat'
|
||||
),
|
||||
));
|
||||
'mchat_user_config' => array_map(function($key) { return 'u_' . $key; }, array_keys($this->settings->ucp)),
|
||||
);
|
||||
|
||||
foreach ($permission_categories as $cat => $permissions)
|
||||
{
|
||||
foreach ($permissions as $permission)
|
||||
{
|
||||
$mchat_permissions[$permission] = array(
|
||||
'lang' => 'ACL_' . strtoupper($permission),
|
||||
'cat' => $cat,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$event['permissions'] = array_merge($event['permissions'], $mchat_permissions);
|
||||
|
||||
$event['categories'] = array_merge($event['categories'], array(
|
||||
'mChat' => 'ACP_CAT_MCHAT',
|
||||
'mchat' => 'ACP_CAT_MCHAT',
|
||||
'mchat_user_config' => 'ACP_CAT_MCHAT_USER_CONFIG'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object $event The event object
|
||||
*/
|
||||
public function acp_users_prefs_modify_data($event)
|
||||
public function acp_users_prefs_modify_sql($event)
|
||||
{
|
||||
$data = $event['data'];
|
||||
$sql_ary = array();
|
||||
$validation = array();
|
||||
|
||||
foreach ($this->user_config_keys as $config_key)
|
||||
$user_id = $event['user_row']['user_id'];
|
||||
|
||||
$auth = new \phpbb\auth\auth();
|
||||
$userdata = $auth->obtain_user_data($user_id);
|
||||
$auth->acl($userdata);
|
||||
|
||||
foreach ($this->settings->ucp as $config_name => $config_data)
|
||||
{
|
||||
$data[$config_key] = $this->request->variable($config_key, (int) $event['user_row'][$config_key]);
|
||||
if ($auth->acl_get('u_' . $config_name))
|
||||
{
|
||||
$default = $event['user_row']['user_' . $config_name];
|
||||
settype($default, gettype($config_data['default']));
|
||||
$sql_ary['user_' . $config_name] = $this->request->variable('user_' . $config_name, $default, is_string($default));
|
||||
|
||||
if (isset($config_data['validation']))
|
||||
{
|
||||
$validation['user_' . $config_name] = $config_data['validation'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$event['data'] = $data;
|
||||
if (!function_exists('validate_data'))
|
||||
{
|
||||
include($this->root_path . 'includes/functions_user.' . $this->php_ext);
|
||||
}
|
||||
|
||||
$event['error'] = array_merge($event['error'], validate_data($sql_ary, $validation));
|
||||
$event['sql_ary'] = array_merge($event['sql_ary'], $sql_ary);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -147,24 +156,26 @@ class acp_listener implements EventSubscriberInterface
|
||||
{
|
||||
$this->user->add_lang_ext('dmzx/mchat', 'mchat_ucp');
|
||||
|
||||
foreach ($this->user_config_keys as $config_key)
|
||||
$user_id = $event['user_row']['user_id'];
|
||||
|
||||
$auth = new \phpbb\auth\auth();
|
||||
$userdata = $auth->obtain_user_data($user_id);
|
||||
$auth->acl($userdata);
|
||||
|
||||
$selected = $this->settings->cfg_user('mchat_date', $event['user_row'], $auth);
|
||||
$date_template_data = $this->settings->get_date_template_data($selected);
|
||||
$this->template->assign_vars($date_template_data);
|
||||
|
||||
$notifications_template_data = $this->settings->get_enabled_post_notifications_lang();
|
||||
$this->template->assign_var('MCHAT_POSTS_ENABLED_LANG', $notifications_template_data);
|
||||
|
||||
foreach (array_keys($this->settings->ucp) as $config_name)
|
||||
{
|
||||
$this->template->assign_var(strtoupper($config_key), $event['data'][$config_key]);
|
||||
$upper = strtoupper($config_name);
|
||||
$this->template->assign_vars(array(
|
||||
$upper => $this->settings->cfg_user($config_name, $event['user_row'], $auth),
|
||||
$upper . '_NOAUTH' => !$auth->acl_get('u_' . $config_name, $user_id),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param object $event The event object
|
||||
*/
|
||||
public function acp_users_prefs_modify_sql($event)
|
||||
{
|
||||
$sql_ary = $event['sql_ary'];
|
||||
|
||||
foreach ($this->user_config_keys as $config_key)
|
||||
{
|
||||
$sql_ary[$config_key] = $event['data'][$config_key];
|
||||
}
|
||||
|
||||
$event['sql_ary'] = $sql_ary;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,9 +15,6 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
|
||||
class main_listener implements EventSubscriberInterface
|
||||
{
|
||||
/** @var \dmzx\mchat\core\functions */
|
||||
protected $functions;
|
||||
|
||||
/** @var \dmzx\mchat\core\mchat */
|
||||
protected $mchat;
|
||||
|
||||
@@ -31,17 +28,15 @@ class main_listener implements EventSubscriberInterface
|
||||
protected $php_ext;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param \dmzx\mchat\core\functions $functions
|
||||
* @param \dmzx\mchat\core\mchat $mchat
|
||||
* @param \phpbb\controller\helper $helper
|
||||
* @param \phpbb\user $user
|
||||
* @param string $php_ext
|
||||
*/
|
||||
public function __construct(\dmzx\mchat\core\functions $functions, \dmzx\mchat\core\mchat $mchat, \phpbb\controller\helper $helper, \phpbb\user $user, $php_ext)
|
||||
* Constructor
|
||||
*
|
||||
* @param \dmzx\mchat\core\mchat $mchat
|
||||
* @param \phpbb\controller\helper $helper
|
||||
* @param \phpbb\user $user
|
||||
* @param string $php_ext
|
||||
*/
|
||||
public function __construct(\dmzx\mchat\core\mchat $mchat, \phpbb\controller\helper $helper, \phpbb\user $user, $php_ext)
|
||||
{
|
||||
$this->functions = $functions;
|
||||
$this->mchat = $mchat;
|
||||
$this->helper = $helper;
|
||||
$this->user = $user;
|
||||
@@ -113,7 +108,7 @@ class main_listener implements EventSubscriberInterface
|
||||
*/
|
||||
public function posting_modify_submit_post_after($event)
|
||||
{
|
||||
$this->functions->mchat_insert_posting($event['mode'], array(
|
||||
$this->mchat->insert_posting($event['mode'], array(
|
||||
'forum_id' => $event['forum_id'],
|
||||
'forum_name' => $event['post_data']['forum_name'],
|
||||
'post_id' => $event['data']['post_id'],
|
||||
|
||||
27
ext.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?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;
|
||||
|
||||
class ext extends \phpbb\extension\base
|
||||
{
|
||||
/**
|
||||
* Requires phpBB 3.1.7-PL1 due to usage of \phpbb\session:update_session_infos()
|
||||
*
|
||||
* @return bool
|
||||
* @access public
|
||||
*/
|
||||
public function is_enableable()
|
||||
{
|
||||
$config = $this->container->get('config');
|
||||
return phpbb_version_compare($config['version'], '3.1.7-PL1', '>=');
|
||||
}
|
||||
}
|
||||
@@ -59,9 +59,8 @@ $lang = array_merge($lang, array(
|
||||
),
|
||||
|
||||
// Post notification messages (%1$s is replaced with a link to the new/edited post, %2$s is replaced with a link to the forum)
|
||||
'MCHAT_NEW_POST' => 'Posted a new topic: %1$s in %2$s',
|
||||
'MCHAT_NEW_REPLY' => 'Posted a reply: %1$s in %2$s',
|
||||
'MCHAT_NEW_QUOTE' => 'Replied with a quote: %1$s in %2$s',
|
||||
'MCHAT_NEW_EDIT' => 'Edited a post: %1$s in %2$s',
|
||||
|
||||
'MCHAT_NEW_POST' => 'posted a new topic: %1$s in %2$s',
|
||||
'MCHAT_NEW_REPLY' => 'posted a reply: %1$s in %2$s',
|
||||
'MCHAT_NEW_QUOTE' => 'replied with a quote: %1$s in %2$s',
|
||||
'MCHAT_NEW_EDIT' => 'edited a post: %1$s in %2$s',
|
||||
));
|
||||
|
||||
@@ -37,7 +37,11 @@ if (empty($lang) || !is_array($lang))
|
||||
$lang = array_merge($lang, array(
|
||||
// Module titles
|
||||
'ACP_CAT_MCHAT' => 'mChat',
|
||||
'ACP_MCHAT_CONFIG' => 'Configuration',
|
||||
'ACP_CAT_MCHAT_USER_CONFIG' => 'mChat in UCP',
|
||||
'ACP_MCHAT_GLOBALSETTINGS' => 'Global settings',
|
||||
'ACP_MCHAT_GLOBALUSERSETTINGS' => 'Global user settings',
|
||||
|
||||
'MCHAT_ACP_USER_PREFS_EXPLAIN' => 'Below are listed all mChat preferences of the selected user. Settings for which the selected user does not have permission to customise are disabled. These settings can be changed in the <em>Global user settings</em> mChat configuration section.',
|
||||
|
||||
// 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',
|
||||
|
||||
@@ -46,7 +46,7 @@ $lang = array_merge($lang, array(
|
||||
'MCHAT_NEW_CHAT' => 'New chat message!',
|
||||
'MCHAT_SEND_PM' => 'Send private message',
|
||||
'MCHAT_LIKE' => 'Like this post',
|
||||
'MCHAT_LIKES' => 'Likes this post',
|
||||
'MCHAT_LIKES' => 'likes this post',
|
||||
'MCHAT_FLOOD' => 'You can not post another message so soon after your last',
|
||||
'MCHAT_FOE' => 'This message was made by <strong>%1$s</strong> who is currently on your ignore list.',
|
||||
'MCHAT_RULES' => 'Rules',
|
||||
@@ -67,11 +67,11 @@ $lang = array_merge($lang, array(
|
||||
'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_SESSION_ENDS' => 'Chat session ends in',
|
||||
'MCHAT_SMILES' => 'Smilies',
|
||||
'MCHAT_TOTALMESSAGES' => 'Total messages: <strong>%1$d</strong>',
|
||||
'MCHAT_USESOUND' => 'Use sound',
|
||||
'MCHAT_USESOUND' => 'Play sound',
|
||||
'MCHAT_WHO_IS_REFRESH_EXPLAIN' => 'Refreshes every <strong>%1$d</strong> seconds',
|
||||
'MCHAT_MINUTES_AGO' => array(
|
||||
0 => 'just now',
|
||||
@@ -79,6 +79,11 @@ $lang = array_merge($lang, array(
|
||||
2 => '%1$d minutes ago',
|
||||
),
|
||||
|
||||
// These messages are formatted with JavaScript, hence {} and no $d
|
||||
'MCHAT_CHARACTER_COUNT' => '<strong>{current}</strong> characters',
|
||||
'MCHAT_CHARACTER_COUNT_LIMIT' => '<strong>{current}</strong> out of {max} characters',
|
||||
'MCHAT_SESSION_ENDS_JS' => 'Chat session ends in {timeleft}',
|
||||
|
||||
// Custom translations for administrators
|
||||
'MCHAT_RULES_MESSAGE' => '',
|
||||
'MCHAT_STATIC_MESSAGE' => '',
|
||||
|
||||
@@ -35,7 +35,7 @@ if (empty($lang) || !is_array($lang))
|
||||
// ’ » “ ” …
|
||||
|
||||
$lang = array_merge($lang, array(
|
||||
// ACP configuration sections
|
||||
// ACP Configuration sections
|
||||
'MCHAT_SETTINGS_INDEX' => 'Index page settings',
|
||||
'MCHAT_SETTINGS_CUSTOM' => 'Custom page settings',
|
||||
'MCHAT_SETTINGS_ARCHIVE' => 'Archive page settings',
|
||||
@@ -44,85 +44,65 @@ $lang = array_merge($lang, array(
|
||||
'MCHAT_SETTINGS_PRUNE' => 'Pruning settings',
|
||||
'MCHAT_SETTINGS_STATS' => 'Who is chatting settings',
|
||||
|
||||
'MCHAT_GLOBALUSERSETTINGS_EXPLAIN' => 'Settings for which a user does <strong>not</strong> have permission to customise are applied as configured below.<br />Go to the <em>mChat UCP</em> tab of the user permissions section to adjust customisation permissions.<br />Go to the <em>Preferences</em> form in the <em>user management</em> section to see the status of each user’s settings.',
|
||||
|
||||
// ACP settings
|
||||
'MCHAT_ACP_TITLE' => 'mChat Configuration',
|
||||
'MCHAT_ACP_GLOBALSETTINGS_TITLE' => 'mChat Global settings',
|
||||
'MCHAT_ACP_GLOBALUSERSETTINGS_TITLE' => 'mChat Global user settings',
|
||||
'MCHAT_VERSION' => 'Version',
|
||||
'MCHAT_RULES' => 'Rules',
|
||||
'MCHAT_RULES_EXPLAIN' => 'Enter the rules of the forum here. HTML code is allowed. <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/common.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_AVATARS' => 'Display avatars',
|
||||
'MCHAT_AVATARS_EXPLAIN' => 'If set to yes, resized user avatars will be displayed',
|
||||
'MCHAT_ON_INDEX' => 'Display mChat on the index page',
|
||||
'MCHAT_INDEX' => 'Display mChat on the index page',
|
||||
'MCHAT_INDEX_HEIGHT' => 'Index page height',
|
||||
'MCHAT_INDEX_HEIGHT_EXPLAIN' => 'The height of the chat box in pixels on the index page.<br /><em>You are limited from 50 to 1000.</em>',
|
||||
'MCHAT_LOCATION' => 'Location of mChat on the index page',
|
||||
'MCHAT_INDEX_HEIGHT_EXPLAIN' => 'The height of the chat box in pixels on the index page.<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.</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_EXPLAIN' => 'When a user edits or deletes messages, the changes are updated live for all others, without them having to refresh the page. Disable this if you experience performance issues.',
|
||||
'MCHAT_PRUNE' => 'Enable message pruning',
|
||||
'MCHAT_PRUNE_EXPLAIN' => 'Only occurs if a user views the custom or archive pages.',
|
||||
'MCHAT_PRUNE_NUM' => 'Number of messages to retain when pruning',
|
||||
'MCHAT_MESSAGE_LIMIT' => 'Initial number of messages to display on the custom page',
|
||||
'MCHAT_MESSAGE_LIMIT_EXPLAIN' => '<em>Recommended from 10 to 30.</em>',
|
||||
'MCHAT_MESSAGE_NUM' => 'Initial number of messages to display on the index page',
|
||||
'MCHAT_MESSAGE_NUM_EXPLAIN' => '<em>Recommended from 10 to 50.</em>',
|
||||
'MCHAT_NAVBAR_LINK' => 'Display link to the custom page in the navbar',
|
||||
'MCHAT_ARCHIVE_LIMIT' => 'Number of messages to display on the archive page',
|
||||
'MCHAT_ARCHIVE_LIMIT_EXPLAIN' => 'The maximum number of messages to show per page on the archive page.<br /><em>Recommended from 25 to 50.</em>',
|
||||
'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>Recommended 5 to 30, set to 0 to disable.</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_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>Recommended from 100 to 500, set to 0 to disable.</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_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.</em>',
|
||||
'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_CUSTOM_DATEFORMAT' => 'Custom…',
|
||||
'MCHAT_RELATIVE_TIME' => 'Display relative time for new messages',
|
||||
'MCHAT_RELATIVE_TIME_EXPLAIN' => 'Displays "just now", "1 minute ago" and so on for each message. Displays the full date for messages older than the current session length but limited to 60 minutes.<br />Set to <em>No</em> to always display the full date.',
|
||||
'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/common.php.',
|
||||
'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_NEW_POSTS_TOPIC' => 'Display new topics',
|
||||
'MCHAT_NEW_POSTS_TOPIC_EXPLAIN' => 'Allow topics from the forum to be posted in the chat.',
|
||||
'MCHAT_NEW_POSTS_REPLY' => 'Display new replies',
|
||||
'MCHAT_NEW_POSTS_REPLY_EXPLAIN' => 'Allow replies from the forum to be posted in the chat.',
|
||||
'MCHAT_NEW_POSTS_EDIT' => 'Display edited posts',
|
||||
'MCHAT_NEW_POSTS_EDIT_EXPLAIN' => 'Allow edited posts from the forum to be posted in the chat.',
|
||||
'MCHAT_NEW_POSTS_QUOTE' => 'Display quoted posts',
|
||||
'MCHAT_NEW_POSTS_QUOTE_EXPLAIN' => 'Allow quoted posts from the forum to be posted in the chat.',
|
||||
'MCHAT_WHOIS' => 'Display <em>Who is chatting</em> below the chat',
|
||||
'MCHAT_STATS_INDEX' => 'Display <em>Who is chatting</em> in the stats section',
|
||||
'MCHAT_STATS_INDEX_EXPLAIN' => 'Displays who is chatting below the <em>Who is online</em> section on the index page',
|
||||
|
||||
'MCHAT_WHOIS_REFRESH' => 'Who is chatting refresh interval',
|
||||
'MCHAT_WHOIS_REFRESH_EXPLAIN' => 'Number of seconds before who is chatting refreshes.<br /><em>You are limited from 30 to 300 seconds.</em>',
|
||||
'MCHAT_MESSAGE_TOP' => 'Location of new chat messages',
|
||||
'MCHAT_MESSAGE_TOP_EXPLAIN' => 'New messages will appear at the top or at the bottom in the chat.',
|
||||
'MCHAT_BOTTOM' => 'Bottom',
|
||||
'MCHAT_TOP' => 'Top',
|
||||
'MCHAT_PAUSE_ON_INPUT' => 'Pause on input',
|
||||
'MCHAT_PAUSE_ON_INPUT_EXPLAIN' => 'Do not autoupdate upon a user entering a message in the input area',
|
||||
'MCHAT_WHOIS_REFRESH_EXPLAIN' => 'Number of seconds before who is chatting refreshes.<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_SMALL_MCHAT_ARCHIVE_LIMIT' => 'The archive limit value is too small.',
|
||||
'TOO_LARGE_MCHAT_ARCHIVE_LIMIT' => 'The archive limit value is too large.',
|
||||
'TOO_LONG_MCHAT_BBCODE_DISALLOWED' => 'The disallowed bbcodes value is too long.',
|
||||
'TOO_SMALL_MCHAT_CUSTOM_HEIGHT' => 'The custom height value is too small.',
|
||||
'TOO_LARGE_MCHAT_CUSTOM_HEIGHT' => 'The custom height value is too large.',
|
||||
@@ -134,10 +114,12 @@ $lang = array_merge($lang, array(
|
||||
'TOO_LARGE_MCHAT_INDEX_HEIGHT' => 'The index height value is too large.',
|
||||
'TOO_SMALL_MCHAT_MAX_MESSAGE_LNGTH' => 'The max message length value is too small.',
|
||||
'TOO_LARGE_MCHAT_MAX_MESSAGE_LNGTH' => 'The max message length value is too large.',
|
||||
'TOO_SMALL_MCHAT_MESSAGE_LIMIT' => 'The message limit value is too small.',
|
||||
'TOO_LARGE_MCHAT_MESSAGE_LIMIT' => 'The message limit value is too large.',
|
||||
'TOO_SMALL_MCHAT_MESSAGE_NUM' => 'The number of messages to display on the index page is too small.',
|
||||
'TOO_LARGE_MCHAT_MESSAGE_NUM' => 'The number of messages to display on the index page is too large.',
|
||||
'TOO_SMALL_MCHAT_MESSAGE_NUM_CUSTOM' => 'The number of message to display on the custom page is too small.',
|
||||
'TOO_LARGE_MCHAT_MESSAGE_NUM_CUSTOM' => 'The number of message to display on the custom page is too large.',
|
||||
'TOO_SMALL_MCHAT_MESSAGE_NUM_INDEX' => 'The number of messages to display on the index page is too small.',
|
||||
'TOO_LARGE_MCHAT_MESSAGE_NUM_INDEX' => 'The number of messages to display on the index page is too large.',
|
||||
'TOO_SMALL_MCHAT_MESSAGE_NUM_ARCHIVE' => 'The number of message to display on the archive page is too small.',
|
||||
'TOO_LARGE_MCHAT_MESSAGE_NUM_ARCHIVE' => 'The number of message to display on the archive page is too large.',
|
||||
'TOO_SMALL_MCHAT_REFRESH' => 'The refresh value is too small.',
|
||||
'TOO_LARGE_MCHAT_REFRESH' => 'The refresh value is too large.',
|
||||
'TOO_LONG_MCHAT_STATIC_MESSAGE' => 'The static message value is too long.',
|
||||
|
||||
@@ -36,15 +36,36 @@ if (empty($lang) || !is_array($lang))
|
||||
|
||||
$lang = array_merge($lang, array(
|
||||
'MCHAT_PREFERENCES' => 'mChat preferences',
|
||||
'MCHAT_NO_SETTINGS' => 'You are not authorised to customise any settings.',
|
||||
|
||||
'MCHAT_DISPLAY' => 'Display on index',
|
||||
'MCHAT_INDEX' => 'Display on the index page',
|
||||
'MCHAT_SOUND' => 'Enable sound',
|
||||
'MCHAT_DISPLAY_STATS_INDEX' => 'Display who is chatting on index',
|
||||
'MCHAT_DISPLAY_NEW_TOPICS' => 'Display new topics in the chat',
|
||||
'MCHAT_DISPLAY_AVATARS' => 'Display avatars in the chat',
|
||||
'MCHAT_WHOIS_INDEX' => 'Display <em>Who is chatting</em> below the chat',
|
||||
'MCHAT_STATS_INDEX' => 'Display <em>Who is chatting</em> in the stats section',
|
||||
'MCHAT_STATS_INDEX_EXPLAIN' => 'Displays who is chatting below the <em>Who is online</em> section on the index page.',
|
||||
'MCHAT_AVATARS' => 'Display avatars',
|
||||
'MCHAT_CAPITAL_LETTER' => 'Capital first letter in your messages',
|
||||
'MCHAT_CHAT_AREA' => 'Input type',
|
||||
'MCHAT_CHAT_AREA_EXPLAIN' => 'The type of area to use for writing messages',
|
||||
'MCHAT_INPUT_AREA' => 'Input area',
|
||||
'MCHAT_INPUT_AREA' => 'Input field',
|
||||
'MCHAT_TEXT_AREA' => 'Text area',
|
||||
'MCHAT_POSTS' => 'Display new posts (currently all disabled, can be enabled in the mChat Global Settings section in the ACP)',
|
||||
'MCHAT_CHARACTER_COUNT' => 'Display number of characters when typing a message',
|
||||
'MCHAT_RELATIVE_TIME' => 'Display relative time for new messages',
|
||||
'MCHAT_RELATIVE_TIME_EXPLAIN' => 'Displays "just now", "1 minute ago" and so on for each message. Set to <em>No</em> to always display the full date.',
|
||||
'MCHAT_PAUSE_ON_INPUT' => 'Pause on input',
|
||||
'MCHAT_PAUSE_ON_INPUT_EXPLAIN' => 'Do not update mChat upon entering a message',
|
||||
'MCHAT_MESSAGE_TOP' => 'Location of new chat messages',
|
||||
'MCHAT_MESSAGE_TOP_EXPLAIN' => 'New messages will appear at the top or at the bottom in the chat.',
|
||||
'MCHAT_LOCATION' => 'Location on the index page',
|
||||
'MCHAT_BOTTOM' => 'Bottom',
|
||||
'MCHAT_TOP' => 'Top',
|
||||
|
||||
'MCHAT_POSTS_TOPIC' => 'Display new topics',
|
||||
'MCHAT_POSTS_REPLY' => 'Display new replies',
|
||||
'MCHAT_POSTS_EDIT' => 'Display edited posts',
|
||||
'MCHAT_POSTS_QUOTE' => 'Display quoted posts',
|
||||
|
||||
'MCHAT_DATE_FORMAT' => 'Date format',
|
||||
'MCHAT_DATE_FORMAT_EXPLAIN' => 'The syntax used is identical to the PHP <a href="http://www.php.net/date">date()</a> function.',
|
||||
'MCHAT_CUSTOM_DATEFORMAT' => 'Custom…',
|
||||
));
|
||||
|
||||
@@ -45,9 +45,24 @@ $lang = array_merge($lang, array(
|
||||
'ACL_U_MCHAT_QUOTE' => 'Can quote messages',
|
||||
'ACL_U_MCHAT_FLOOD_IGNORE' => 'Can ignore flood limit',
|
||||
'ACL_U_MCHAT_ARCHIVE' => 'Can view the archive',
|
||||
'ACL_U_MCHAT_BBCODE' => 'Can use bbcodes',
|
||||
'ACL_U_MCHAT_BBCODE' => 'Can use BBCodes',
|
||||
'ACL_U_MCHAT_SMILIES' => 'Can use smilies',
|
||||
'ACL_U_MCHAT_URLS' => 'Can post URLs',
|
||||
|
||||
'ACL_U_MCHAT_AVATARS' => 'Can customise <em>Display avatars</em>',
|
||||
'ACL_U_MCHAT_CAPITAL_LETTER' => 'Can customise <em>Capital first letter</em>',
|
||||
'ACL_U_MCHAT_CHARACTER_COUNT' => 'Can customise <em>Display number of characters</em>',
|
||||
'ACL_U_MCHAT_DATE' => 'Can customise <em>Date format</em>',
|
||||
'ACL_U_MCHAT_INDEX' => 'Can customise <em>Display on index</em>',
|
||||
'ACL_U_MCHAT_INPUT_AREA' => 'Can customise <em>Input type</em>',
|
||||
'ACL_U_MCHAT_LOCATION' => 'Can customise <em>Location of mChat on the index page</em>',
|
||||
'ACL_U_MCHAT_MESSAGE_TOP' => 'Can customise <em>Location of new chat messages</em>',
|
||||
'ACL_U_MCHAT_PAUSE_ON_INPUT' => 'Can customise <em>Pause on input</em>',
|
||||
'ACL_U_MCHAT_POSTS' => 'Can customise <em>Display new post</em>',
|
||||
'ACL_U_MCHAT_RELATIVE_TIME' => 'Can customise <em>Display relative time</em>',
|
||||
'ACL_U_MCHAT_SOUND' => 'Can customise <em>Play sounds</em>',
|
||||
'ACL_U_MCHAT_WHOIS_INDEX' => 'Can customise <em>Display who is chatting below the chat</em>',
|
||||
'ACL_U_MCHAT_STATS_INDEX' => 'Can customise <em>Display who is chatting in the stats section</em>',
|
||||
|
||||
'ACL_A_MCHAT' => 'Can manage mChat settings',
|
||||
));
|
||||
|
||||
@@ -11,59 +11,60 @@
|
||||
|
||||
namespace dmzx\mchat\migrations;
|
||||
|
||||
class install_mchat extends \phpbb\db\migration\migration
|
||||
class mchat_2_0_0_rc3 extends \phpbb\db\migration\migration
|
||||
{
|
||||
public function effectively_installed()
|
||||
{
|
||||
return isset($this->config['mchat_version']) && version_compare($this->config['mchat_version'], '1.0.0-RC2', '>=');
|
||||
}
|
||||
/** @const string */
|
||||
const MCHAT_VERSION = '2.0.0-RC3';
|
||||
|
||||
/** @var array */
|
||||
protected $mchat_config = null;
|
||||
|
||||
static public function depends_on()
|
||||
{
|
||||
return array('\phpbb\db\migration\data\v31x\v311');
|
||||
return array('\phpbb\db\migration\data\v31x\v317pl1');
|
||||
}
|
||||
|
||||
public function effectively_installed()
|
||||
{
|
||||
return isset($this->config['mchat_version']) && version_compare($this->config['mchat_version'], self::MCHAT_VERSION, '>=');
|
||||
}
|
||||
|
||||
protected function get_config()
|
||||
{
|
||||
if ($this->mchat_config == null)
|
||||
{
|
||||
$yml_config_file = $this->phpbb_root_path . '/ext/dmzx/mchat/config/config_2_0_0.yml';
|
||||
$yml_data = \Symfony\Component\Yaml\Yaml::parse($yml_config_file);
|
||||
$this->mchat_config = $yml_data['parameters'];
|
||||
}
|
||||
|
||||
return $this->mchat_config;
|
||||
}
|
||||
|
||||
public function update_data()
|
||||
{
|
||||
return array(
|
||||
// Add configs
|
||||
array('config.add', array('mchat_version', '1.0.0-RC2')),
|
||||
array('config.add', array('mchat_archive_limit', 25)),
|
||||
array('config.add', array('mchat_avatars', 1)),
|
||||
array('config.add', array('mchat_bbcode_disallowed', '')),
|
||||
array('config.add', array('mchat_custom_height', 350)),
|
||||
array('config.add', array('mchat_custom_page', 1)),
|
||||
array('config.add', array('mchat_relative_time', 1)),
|
||||
array('config.add', array('mchat_date', 'D M d, Y g:i a')),
|
||||
array('config.add', array('mchat_edit_delete_limit', 0)),
|
||||
array('config.add', array('mchat_flood_time', 0)),
|
||||
array('config.add', array('mchat_index_height', 250)),
|
||||
array('config.add', array('mchat_live_updates', 1)),
|
||||
array('config.add', array('mchat_location', 0)),
|
||||
array('config.add', array('mchat_max_message_lngth', 500)),
|
||||
array('config.add', array('mchat_message_limit', 10)),
|
||||
array('config.add', array('mchat_message_num', 10)),
|
||||
array('config.add', array('mchat_navbar_link', 1)),
|
||||
array('config.add', array('mchat_message_top', 1)),
|
||||
array('config.add', array('mchat_new_posts_edit', 0)),
|
||||
array('config.add', array('mchat_new_posts_quote', 0)),
|
||||
array('config.add', array('mchat_new_posts_reply', 0)),
|
||||
array('config.add', array('mchat_new_posts_topic', 0)),
|
||||
array('config.add', array('mchat_on_index', 1)),
|
||||
array('config.add', array('mchat_override_min_post_chars', 0)),
|
||||
array('config.add', array('mchat_override_smilie_limit', 0)),
|
||||
array('config.add', array('mchat_pause_on_input', 0)),
|
||||
array('config.add', array('mchat_prune', 0)),
|
||||
array('config.add', array('mchat_prune_num', 0)),
|
||||
array('config.add', array('mchat_refresh', 10)),
|
||||
array('config.add', array('mchat_rules', '')),
|
||||
array('config.add', array('mchat_static_message', '')),
|
||||
array('config.add', array('mchat_stats_index', 0)),
|
||||
array('config.add', array('mchat_timeout', 0)),
|
||||
array('config.add', array('mchat_whois', 1)),
|
||||
array('config.add', array('mchat_whois_refresh', 60)),
|
||||
$config = $this->get_config();
|
||||
$update_data = array();
|
||||
|
||||
// Add permissions
|
||||
// Add configs
|
||||
foreach (array('dmzx.mchat.config_global', 'dmzx.mchat.config_ucp') as $section)
|
||||
{
|
||||
foreach ($config[$section] as $key => $value)
|
||||
{
|
||||
$update_data[] = array('config.add', array($key, $value['default']));
|
||||
}
|
||||
}
|
||||
|
||||
// Add user permissions for customizing config values
|
||||
foreach ($config['dmzx.mchat.config_ucp'] as $key => $value)
|
||||
{
|
||||
$update_data[] = array('permission.add', array('u_' . $key, true));
|
||||
}
|
||||
|
||||
return array_merge($update_data, array(
|
||||
array('config.add', array('mchat_version', self::MCHAT_VERSION)),
|
||||
|
||||
// Add user permissions
|
||||
array('permission.add', array('u_mchat_use', true)),
|
||||
array('permission.add', array('u_mchat_view', true)),
|
||||
array('permission.add', array('u_mchat_edit', true)),
|
||||
@@ -77,23 +78,17 @@ class install_mchat extends \phpbb\db\migration\migration
|
||||
array('permission.add', array('u_mchat_bbcode', true)),
|
||||
array('permission.add', array('u_mchat_smilies', true)),
|
||||
array('permission.add', array('u_mchat_urls', true)),
|
||||
|
||||
// Add admin permissions
|
||||
array('permission.add', array('a_mchat', true)),
|
||||
|
||||
// Set permissions
|
||||
array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_use', 'group')),
|
||||
array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_view', 'group')),
|
||||
array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_edit', 'group')),
|
||||
array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_delete', 'group')),
|
||||
array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_ip', 'group')),
|
||||
array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_pm', 'group')),
|
||||
array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_like', 'group')),
|
||||
array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_quote', 'group')),
|
||||
array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_flood_ignore', 'group')),
|
||||
array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_archive', 'group')),
|
||||
array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_bbcode', 'group')),
|
||||
array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_smilies', 'group')),
|
||||
array('permission.permission_set', array('ADMINISTRATORS', 'u_mchat_urls', 'group')),
|
||||
array('permission.permission_set', array('ADMINISTRATORS', 'a_mchat', 'group')),
|
||||
|
||||
array('permission.permission_set', array('REGISTERED', 'u_mchat_use', 'group')),
|
||||
array('permission.permission_set', array('REGISTERED', 'u_mchat_view', 'group')),
|
||||
array('permission.permission_set', array('REGISTERED', 'u_mchat_pm', 'group')),
|
||||
@@ -104,6 +99,17 @@ class install_mchat extends \phpbb\db\migration\migration
|
||||
array('permission.permission_set', array('REGISTERED', 'u_mchat_smilies', 'group')),
|
||||
array('permission.permission_set', array('REGISTERED', 'u_mchat_urls', 'group')),
|
||||
|
||||
array('permission.permission_set', array('REGISTERED', 'u_mchat_avatars', 'group')),
|
||||
array('permission.permission_set', array('REGISTERED', 'u_mchat_capital_letter', 'group')),
|
||||
array('permission.permission_set', array('REGISTERED', 'u_mchat_character_count', 'group')),
|
||||
array('permission.permission_set', array('REGISTERED', 'u_mchat_index', 'group')),
|
||||
array('permission.permission_set', array('REGISTERED', 'u_mchat_input_area', 'group')),
|
||||
array('permission.permission_set', array('REGISTERED', 'u_mchat_location', 'group')),
|
||||
array('permission.permission_set', array('REGISTERED', 'u_mchat_message_top', 'group')),
|
||||
array('permission.permission_set', array('REGISTERED', 'u_mchat_posts', 'group')),
|
||||
array('permission.permission_set', array('REGISTERED', 'u_mchat_relative_time', 'group')),
|
||||
array('permission.permission_set', array('REGISTERED', 'u_mchat_sound', 'group')),
|
||||
|
||||
// Add ACP extension category
|
||||
array('module.add', array(
|
||||
'acp',
|
||||
@@ -115,17 +121,13 @@ class install_mchat extends \phpbb\db\migration\migration
|
||||
array('module.add', array(
|
||||
'acp',
|
||||
'ACP_CAT_MCHAT',
|
||||
array(
|
||||
'module_basename' => '\dmzx\mchat\acp\acp_mchat_module',
|
||||
'modes' => array('configuration'),
|
||||
'module_auth' => 'acl_a_mchat',
|
||||
),
|
||||
array('module_basename' => '\dmzx\mchat\acp\acp_mchat_module'),
|
||||
)),
|
||||
|
||||
// Add UCP category
|
||||
array('module.add', array(
|
||||
'ucp',
|
||||
false,
|
||||
0,
|
||||
'UCP_MCHAT_CONFIG'
|
||||
)),
|
||||
|
||||
@@ -133,17 +135,21 @@ class install_mchat extends \phpbb\db\migration\migration
|
||||
array('module.add', array(
|
||||
'ucp',
|
||||
'UCP_MCHAT_CONFIG',
|
||||
array(
|
||||
'module_basename' => '\dmzx\mchat\ucp\ucp_mchat_module',
|
||||
'modes' => array('configuration'),
|
||||
'auth' => 'acl_u_mchat_use',
|
||||
),
|
||||
array('module_basename' => '\dmzx\mchat\ucp\ucp_mchat_module'),
|
||||
)),
|
||||
);
|
||||
));
|
||||
}
|
||||
|
||||
public function update_schema()
|
||||
{
|
||||
$config = $this->get_config();
|
||||
$user_columns = array();
|
||||
|
||||
foreach ($config['dmzx.mchat.config_ucp'] as $key => $value)
|
||||
{
|
||||
$user_columns['user_' . $key] = array($value['type'], $value['default']);
|
||||
}
|
||||
|
||||
return array(
|
||||
'add_tables' => array(
|
||||
$this->table_prefix . 'mchat' => array(
|
||||
@@ -181,21 +187,21 @@ class install_mchat extends \phpbb\db\migration\migration
|
||||
),
|
||||
|
||||
'add_columns' => array(
|
||||
$this->table_prefix . 'users' => array(
|
||||
'user_mchat_index' => array('BOOL', '1'),
|
||||
'user_mchat_sound' => array('BOOL', '1'),
|
||||
'user_mchat_stats_index' => array('BOOL', '1'),
|
||||
'user_mchat_topics' => array('BOOL', '1'),
|
||||
'user_mchat_avatars' => array('BOOL', '1'),
|
||||
'user_mchat_capital_letter' => array('BOOL', '1'),
|
||||
'user_mchat_input_area' => array('BOOL', '1'),
|
||||
),
|
||||
$this->table_prefix . 'users' => $user_columns,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
public function revert_schema()
|
||||
{
|
||||
$config = $this->get_config();
|
||||
$user_columns = array();
|
||||
|
||||
foreach (array_keys($config['dmzx.mchat.config_ucp']) as $key)
|
||||
{
|
||||
$user_columns[] = 'user_' . $key;
|
||||
}
|
||||
|
||||
return array(
|
||||
'drop_tables' => array(
|
||||
$this->table_prefix . 'mchat',
|
||||
@@ -204,14 +210,7 @@ class install_mchat extends \phpbb\db\migration\migration
|
||||
),
|
||||
|
||||
'drop_columns' => array(
|
||||
$this->table_prefix . 'users' => array(
|
||||
'user_mchat_index',
|
||||
'user_mchat_sound',
|
||||
'user_mchat_stats_index',
|
||||
'user_mchat_topics',
|
||||
'user_mchat_avatars',
|
||||
'user_mchat_input_area',
|
||||
),
|
||||
$this->table_prefix . 'users' => $user_columns,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
<!-- IF MCHAT_INDEX_STATS -->
|
||||
<h3><a href="<!-- IF S_MCHAT_CUSTOM_PAGE and not S_MCHAT_ON_INDEX -->{U_MCHAT}<!-- ENDIF -->#mChat">{L_MCHAT_WHO_IS_CHATTING}</a></h3>
|
||||
<p>{MCHAT_USERS_COUNT} {MCHAT_ONLINE_EXPLAIN}<br />{MCHAT_USERS_LIST}</p>
|
||||
<!-- ENDIF -->
|
||||
@@ -1 +0,0 @@
|
||||
<!-- IF S_MCHAT_ON_INDEX and not S_MCHAT_LOCATION --><!-- INCLUDE mchat_body.html --><!-- ENDIF -->
|
||||
@@ -1 +0,0 @@
|
||||
<!-- IF S_MCHAT_ON_INDEX and S_MCHAT_LOCATION --><!-- INCLUDE mchat_body.html --><!-- ENDIF -->
|
||||
@@ -1,9 +0,0 @@
|
||||
<!-- IF S_MCHAT_ON_INDEX or MCHAT_ARCHIVE_PAGE or MCHAT_CUSTOM_PAGE -->
|
||||
<br />
|
||||
{META_DISPLAY_NAME} © {L_POST_BY_AUTHOR}
|
||||
<ul id="mchat-copyright-footer">
|
||||
<!-- BEGIN meta_authors -->
|
||||
<li><a href="{meta_authors.AUTHOR_HOMEPAGE}" title="{meta_authors.AUTHOR_NAME}">{meta_authors.AUTHOR_NAME}</a></li>
|
||||
<!-- END meta_authors -->
|
||||
</ul>
|
||||
<!-- ENDIF -->
|
||||
@@ -1,3 +0,0 @@
|
||||
<!-- IF S_MCHAT_CUSTOM_PAGE and MCHAT_NAVBAR_LINK and MCHAT_ALLOW_VIEW -->
|
||||
<!-- INCLUDE mchat_navlink.html -->
|
||||
<!-- ENDIF -->
|
||||
@@ -16,17 +16,35 @@ if (typeof document.hasFocus === 'undefined') {
|
||||
};
|
||||
}
|
||||
|
||||
Array.prototype.max = function() {
|
||||
return Math.max.apply(null, this);
|
||||
};
|
||||
if (!Array.prototype.max) {
|
||||
Array.prototype.max = function() {
|
||||
return Math.max.apply(null, this);
|
||||
};
|
||||
}
|
||||
|
||||
Array.prototype.min = function() {
|
||||
return Math.min.apply(null, this);
|
||||
};
|
||||
if (!Array.prototype.min) {
|
||||
Array.prototype.min = function() {
|
||||
return Math.min.apply(null, this);
|
||||
};
|
||||
}
|
||||
|
||||
if (!String.prototype.format) {
|
||||
String.prototype.format = function() {
|
||||
var str = this.toString();
|
||||
if (!arguments.length) {
|
||||
return str;
|
||||
}
|
||||
var type = typeof arguments[0];
|
||||
var args = 'string' == type || 'number' == type ? arguments : arguments[0];
|
||||
jQuery.each(args, function(arg, value) {
|
||||
str = str.replace(RegExp('\\{' + arg + '\\}', 'gi'), value);
|
||||
});
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
jQuery.fn.reverse = function(reverse) {
|
||||
reverse = typeof reverse === 'undefined' ? true : reverse;
|
||||
return reverse ? jQuery(this.toArray().reverse()) : this;
|
||||
return reverse === 'undefined' || reverse ? jQuery(this.toArray().reverse()) : this;
|
||||
};
|
||||
|
||||
jQuery(function($) {
|
||||
@@ -37,7 +55,7 @@ jQuery(function($) {
|
||||
}
|
||||
$.ajax({
|
||||
url: mChat.actionUrls[mode],
|
||||
timeout: 5000,
|
||||
timeout: Math.min(mChat.refreshTime, 10000),
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: data
|
||||
@@ -45,27 +63,29 @@ jQuery(function($) {
|
||||
if (json[mode]) {
|
||||
deferred.resolve(json, status, xhr);
|
||||
} else {
|
||||
deferred.reject(xhr, status, xhr.responseJSON ? 'session' : 'format');
|
||||
deferred.reject(xhr, status, xhr.responseJSON ? 'session' : 'unexpected format');
|
||||
}
|
||||
}).fail(function(xhr, status, error) {
|
||||
deferred.reject(xhr, status, error);
|
||||
});
|
||||
return deferred.promise().fail(function(xhr, textStatus, errorThrown) {
|
||||
mChat.sound('error');
|
||||
mChat.cached('refresh-load', 'refresh-ok', 'refresh-paused').hide();
|
||||
mChat.cached('refresh-error').show();
|
||||
if (errorThrown == 'format') {
|
||||
// Unexpected format
|
||||
} else if (errorThrown == 'session') {
|
||||
mChat.cached('status-load', 'status-ok', 'status-paused').hide();
|
||||
mChat.cached('status-error').show();
|
||||
if (errorThrown == 'session') {
|
||||
mChat.endSession(true);
|
||||
alert(mChat.sessOut);
|
||||
} else if (xhr.status == 400) {
|
||||
mChat.resetSession();
|
||||
alert(mChat.flood);
|
||||
} else if (xhr.status == 403) {
|
||||
mChat.endSession(true);
|
||||
alert(mChat.noAccess);
|
||||
} else if (xhr.status == 413) {
|
||||
mChat.resetSession();
|
||||
alert(mChat.mssgLngthLong);
|
||||
} else if (xhr.status == 501) {
|
||||
mChat.resetSession();
|
||||
alert(mChat.noMessageInput);
|
||||
} else if (typeof console !== 'undefined' && console.log) {
|
||||
console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown);
|
||||
@@ -78,7 +98,7 @@ jQuery(function($) {
|
||||
if (mChat.cached('input').val() !== '') {
|
||||
if (confirm(mChat.clearConfirm)) {
|
||||
mChat.resetSession();
|
||||
mChat.cached('input').val('');
|
||||
mChat.cached('input').val('').keyup().trigger('autogrow');
|
||||
}
|
||||
setTimeout(function() {
|
||||
mChat.cached('input').focus();
|
||||
@@ -115,23 +135,23 @@ jQuery(function($) {
|
||||
if (mChat.cached('add').prop('disabled')) {
|
||||
return;
|
||||
}
|
||||
var message = mChat.cached('input').val();
|
||||
if ($.trim(message) === '') {
|
||||
var messageLength = mChat.inputMessageLength();
|
||||
if (!messageLength) {
|
||||
alert(mChat.noMessageInput);
|
||||
return;
|
||||
}
|
||||
var messChars = message.replace(/\s/g, '');
|
||||
if (mChat.mssgLngth && messChars.length > mChat.mssgLngth) {
|
||||
if (mChat.mssgLngth && messageLength > mChat.mssgLngth) {
|
||||
alert(mChat.mssgLngthLong);
|
||||
return;
|
||||
}
|
||||
mChat.cached('add').prop('disabled', true);
|
||||
mChat.pauseSession();
|
||||
mChat.lastInputValue = message;
|
||||
mChat.cached('input').val('');
|
||||
mChat.refresh(message).done(function() {
|
||||
mChat.lastInputValue = mChat.cached('input').val();
|
||||
mChat.cached('input').val('').keyup().trigger('autogrow');
|
||||
mChat.refresh(mChat.lastInputValue).done(function() {
|
||||
mChat.resetSession();
|
||||
}).fail(function() {
|
||||
mChat.cached('input').val(mChat.lastInputValue);
|
||||
mChat.cached('input').val(mChat.lastInputValue).keyup().trigger('autogrow');
|
||||
}).always(function() {
|
||||
mChat.cached('add').prop('disabled', false);
|
||||
setTimeout(function() {
|
||||
@@ -147,7 +167,7 @@ jQuery(function($) {
|
||||
ajaxRequest('edit', true, {
|
||||
message_id: $container.data('mchat-id'),
|
||||
message: $message.val(),
|
||||
archive: mChat.archiveMode ? 1 : 0
|
||||
archive: mChat.archivePage ? 1 : 0
|
||||
}).done(function(json) {
|
||||
mChat.updateMessages($(json.edit));
|
||||
mChat.resetSession();
|
||||
@@ -188,14 +208,17 @@ jQuery(function($) {
|
||||
}
|
||||
});
|
||||
}
|
||||
mChat.cached('refresh-ok', 'refresh-error', 'refresh-paused').hide();
|
||||
mChat.cached('refresh-load').show();
|
||||
mChat.cached('status-ok', 'status-error', 'status-paused').hide();
|
||||
mChat.cached('status-load').show();
|
||||
return ajaxRequest(message ? 'add' : 'refresh', !!message, data).done(function(json) {
|
||||
if (json.add) {
|
||||
var $html = $(json.add);
|
||||
$('#mchat-no-messages').remove();
|
||||
$('.mchat-no-messages').remove();
|
||||
$html.reverse(mChat.messageTop).hide().each(function(i) {
|
||||
var $message = $(this);
|
||||
if ($.inArray($message.data('mchat-id'), mChat.messageIds) !== -1) {
|
||||
return;
|
||||
}
|
||||
mChat.messageIds.push($message.data('mchat-id'));
|
||||
setTimeout(function() {
|
||||
if (mChat.messageTop) {
|
||||
@@ -210,7 +233,7 @@ jQuery(function($) {
|
||||
var id = $message.prop('id');
|
||||
setTimeout(function() {
|
||||
$('#' + id).find('[data-mchat-action="edit"], [data-mchat-action="del"]').fadeOut(function() {
|
||||
$(this).remove();
|
||||
$(this).closest('li').remove();
|
||||
});
|
||||
}, mChat.editDeleteLimit);
|
||||
}
|
||||
@@ -229,8 +252,8 @@ jQuery(function($) {
|
||||
mChat.whois();
|
||||
}
|
||||
if (mChat.refreshInterval) {
|
||||
mChat.cached('refresh-load', 'refresh-error', 'refresh-paused').hide();
|
||||
mChat.cached('refresh-ok').show();
|
||||
mChat.cached('status-load', 'status-error', 'status-paused').hide();
|
||||
mChat.cached('status-ok').show();
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -320,7 +343,7 @@ jQuery(function($) {
|
||||
},
|
||||
countDown: function() {
|
||||
mChat.sessionTime -= 1;
|
||||
mChat.cached('session').html(mChat.sessEnds + ' ' + mChat.timeLeft(mChat.sessionTime));
|
||||
mChat.cached('session').html(mChat.sessEnds.format({timeleft: mChat.timeLeft(mChat.sessionTime)}));
|
||||
if (mChat.sessionTime < 1) {
|
||||
mChat.endSession();
|
||||
}
|
||||
@@ -335,13 +358,13 @@ jQuery(function($) {
|
||||
}
|
||||
},
|
||||
resetSession: function() {
|
||||
if (!mChat.archiveMode) {
|
||||
if (!mChat.archivePage) {
|
||||
clearInterval(mChat.refreshInterval);
|
||||
mChat.refreshInterval = setInterval(mChat.refresh, mChat.refreshTime);
|
||||
if (mChat.userTimeout) {
|
||||
mChat.sessionTime = mChat.userTimeout / 1000;
|
||||
clearInterval(mChat.sessionCountdown);
|
||||
mChat.cached('session').html(mChat.sessEnds + ' ' + mChat.timeLeft(mChat.sessionTime));
|
||||
mChat.cached('session').html(mChat.sessEnds.format({timeleft: mChat.timeLeft(mChat.sessionTime)}));
|
||||
mChat.sessionCountdown = setInterval(mChat.countDown, 1000);
|
||||
}
|
||||
if (mChat.whoisRefresh) {
|
||||
@@ -351,8 +374,8 @@ jQuery(function($) {
|
||||
if (mChat.pause) {
|
||||
mChat.cached('input').one('keypress', mChat.endSession);
|
||||
}
|
||||
mChat.cached('refresh-ok').show();
|
||||
mChat.cached('refresh-load', 'refresh-error', 'refresh-paused').hide();
|
||||
mChat.cached('status-ok').show();
|
||||
mChat.cached('status-load', 'status-error', 'status-paused').hide();
|
||||
mChat.cached('refresh-text').html(mChat.refreshYes);
|
||||
}
|
||||
},
|
||||
@@ -369,8 +392,8 @@ jQuery(function($) {
|
||||
mChat.whois();
|
||||
}
|
||||
}
|
||||
mChat.cached('refresh-load', 'refresh-ok', 'refresh-error').hide();
|
||||
mChat.cached('refresh-paused').show();
|
||||
mChat.cached('status-load', 'status-ok', 'status-error').hide();
|
||||
mChat.cached('status-paused').show();
|
||||
mChat.cached('refresh-text').html(mChat.refreshNo);
|
||||
},
|
||||
mention: function() {
|
||||
@@ -396,6 +419,9 @@ jQuery(function($) {
|
||||
var quote = mChat.entityDecode($container.data('mchat-message'));
|
||||
insert_text(mChat.likes + '[quote="' + username + '"] ' + quote + '[/quote]');
|
||||
},
|
||||
ip: function() {
|
||||
popup(this.href, 750, 500);
|
||||
},
|
||||
entityDecode: function(text) {
|
||||
var s = decodeURIComponent(text.toString().replace(/\+/g, ' '));
|
||||
s = s.replace(/</g, '<');
|
||||
@@ -406,6 +432,9 @@ jQuery(function($) {
|
||||
s = s.replace(/"/g, "'");
|
||||
return s;
|
||||
},
|
||||
inputMessageLength: function() {
|
||||
return $.trim(mChat.cached('input').val()).replace(/\[\/?[^\[\]]+\]/g, '').length;
|
||||
},
|
||||
cached: function() {
|
||||
return $($.map(arguments, function(name) {
|
||||
if (!mChat.cache[name]) {
|
||||
@@ -430,7 +459,7 @@ jQuery(function($) {
|
||||
mChat.hiddenFields[this.name] = this.value;
|
||||
});
|
||||
|
||||
if (!mChat.archiveMode) {
|
||||
if (!mChat.archivePage) {
|
||||
mChat.resetSession();
|
||||
|
||||
if (!mChat.messageTop) {
|
||||
@@ -441,9 +470,7 @@ jQuery(function($) {
|
||||
Cookies.set('mchat_no_sound', 'yes');
|
||||
}
|
||||
|
||||
mChat.cached('user-sound').prop('checked', mChat.playSound && !Cookies.get('mchat_no_sound'));
|
||||
|
||||
mChat.cached('user-sound').change(function() {
|
||||
mChat.cached('user-sound').prop('checked', mChat.playSound && !Cookies.get('mchat_no_sound')).change(function() {
|
||||
if (this.checked) {
|
||||
Cookies.remove('mchat_no_sound');
|
||||
} else {
|
||||
@@ -468,10 +495,22 @@ jQuery(function($) {
|
||||
mChat.startRelativeTimeUpdate(mChat.cached('messages'));
|
||||
|
||||
if (mChat.cached('input').is('input')) {
|
||||
$('#mchat-form').on('keypress', function(e) {
|
||||
$('#mchat-form').keypress(function(e) {
|
||||
if (e.which == 13) {
|
||||
mChat.add();
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (mChat.showCharCount) {
|
||||
$('#mchat-form').keyup(function(e) {
|
||||
var count = mChat.inputMessageLength();
|
||||
var $elem = mChat.cached('character-count');
|
||||
$elem.html(mChat.charCount.format({current: count, max: mChat.mssgLngth})).css('visibility', count > 0 ? 'visible' : 'hidden');
|
||||
if (mChat.mssgLngth) {
|
||||
$elem.toggleClass('error', count > mChat.mssgLngth);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,224 +0,0 @@
|
||||
<!-- IF MCHAT_ARCHIVE_PAGE or MCHAT_CUSTOM_PAGE -->
|
||||
<!-- INCLUDE overall_header.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF MCHAT_ARCHIVE_PAGE or not (MCHAT_ALLOW_USE and S_BBCODE_ALLOWED) -->
|
||||
<!-- 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_ARCHIVE_PAGE and (.pagination or MCHAT_TOTAL_MESSAGES) -->
|
||||
<div class="action-bar top">
|
||||
<div class="pagination">
|
||||
{MCHAT_TOTAL_MESSAGES}
|
||||
<!-- IF .pagination -->
|
||||
<!-- INCLUDE pagination.html -->
|
||||
<!-- ELSE -->
|
||||
• {PAGE_NUMBER}
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- EVENT dmzx_mchat_body_before -->
|
||||
<div class="forabg">
|
||||
<a id="mChat"></a>
|
||||
<div class="inner">
|
||||
<ul class="topiclist">
|
||||
<li class="header">
|
||||
<!-- INCLUDE mchat_header.html -->
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="mchat-body" class="postbody">
|
||||
<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 -->
|
||||
},
|
||||
extUrl : '{EXT_URL}',
|
||||
customPage : <!-- IF MCHAT_CUSTOM_PAGE -->true<!-- ELSE -->false<!-- ENDIF -->,
|
||||
pause : <!-- IF MCHAT_PAUSE_ON_INPUT -->true<!-- ELSE -->false<!-- ENDIF -->,
|
||||
playSound : <!-- IF S_MCHAT_SOUND_YES -->true<!-- ELSE -->false<!-- ENDIF -->,
|
||||
archiveMode : <!-- IF MCHAT_ARCHIVE_PAGE -->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 -->,
|
||||
|
||||
// Limits & timeouts
|
||||
refreshTime : {MCHAT_REFRESH_JS},
|
||||
whoisRefresh : {MCHAT_WHOIS_REFRESH},
|
||||
userTimeout : {MCHAT_USER_TIMEOUT},
|
||||
mssgLngth : {MCHAT_MESSAGE_LNGTH},
|
||||
editDeleteLimit : {MCHAT_EDIT_DELETE_LIMIT},
|
||||
removeBBCodes : '{S_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}',
|
||||
refreshYes : '{MCHAT_REFRESH_YES}',
|
||||
refreshNo : '{LA_MCHAT_REFRESH_NO}',
|
||||
mssgLngthLong : '{MCHAT_MESS_LONG}',
|
||||
likes : '{LA_MCHAT_LIKES}'
|
||||
};
|
||||
// ]]>
|
||||
</script>
|
||||
|
||||
<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-del" class="hidden" src="{EXT_URL}sounds/del.mp3" preload="auto"></audio>
|
||||
<audio id="mchat-sound-error" class="hidden" src="{EXT_URL}sounds/error.mp3" preload="auto"></audio>
|
||||
|
||||
<div id="mchat-confirm" class="hidden">
|
||||
<h3>{L_CONFIRM}</h3>
|
||||
<p></p>
|
||||
<textarea></textarea>
|
||||
<fieldset class="submit-buttons">
|
||||
<input type="button" name="confirm" value="{L_MCHAT_OK}" class="button2" />
|
||||
<input type="button" name="cancel" value="{L_CANCEL}" class="button2" />
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="mchat-main">
|
||||
<!-- IF MCHAT_STATIC_MESS and not MCHAT_ARCHIVE_PAGE -->
|
||||
<ul class="topiclist forums">
|
||||
<li class="row mchat-static">{MCHAT_STATIC_MESS}</li>
|
||||
</ul>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF not .mchatrow -->
|
||||
<ul id="mchat-no-messages" class="topiclist forums">
|
||||
<li class="row mchat-static">{L_MCHAT_NOMESSAGE}</li>
|
||||
</ul>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<ul id="mchat-messages" class="topiclist forums mchat-row-limit"<!-- IF not MCHAT_ARCHIVE_PAGE --> style="height:<!-- IF MCHAT_CUSTOM_PAGE -->{MCHAT_CUSTOM_HEIGHT}<!-- ELSE -->{MCHAT_INDEX_HEIGHT}<!-- ENDIF -->px"<!-- ENDIF -->>
|
||||
<!-- INCLUDE mchat_messages.html -->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="mchat-panel" class="panel cp-mini">
|
||||
<!-- IF not MCHAT_ARCHIVE_PAGE and not MCHAT_CUSTOM_PAGE and MCHAT_WHOIS_REFRESH -->
|
||||
<!-- INCLUDE mchat_whois.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<form id="mchat-form" name="postform" action="{U_MCHAT_CUSTOM_PAGE}" method="POST">
|
||||
{S_FORM_TOKEN}
|
||||
<!-- IF not MCHAT_ARCHIVE_PAGE -->
|
||||
<noscript><div class="error">{L_MCHAT_NOJAVASCRIPT}</div></noscript>
|
||||
<!-- IF MCHAT_ALLOW_USE -->
|
||||
<!-- IF MCHAT_INPUT_TYPE -->
|
||||
<input id="mchat-input" type="text" name="message" class="inputbox medium" />
|
||||
<!-- ELSE -->
|
||||
<textarea id="mchat-input" name="message" class="inputbox no-auto-resize" cols="32" rows="5"></textarea>
|
||||
<!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
<!-- EVENT dmzx_mchat_buttons_before -->
|
||||
<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 -->
|
||||
<!-- IF S_BBCODE_ALLOWED -->
|
||||
<input type="button" class="button2" data-mchat-toggle="bbcodes" value="{L_MCHAT_BBCODES}" />
|
||||
<!-- ENDIF -->
|
||||
<!-- IF MCHAT_RULES -->
|
||||
<input type="button" class="button2" onclick="popup('{U_MCHAT_RULES}', 450, 275); return false;" value="{L_MCHAT_RULES}" />
|
||||
<!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
<!-- EVENT dmzx_mchat_buttons_mid -->
|
||||
<!-- IF MCHAT_READ_ARCHIVE_BUTTON -->
|
||||
<input type="button" class="button2" onclick="window.location.href = '{MCHAT_ARCHIVE_URL}';" value="{L_MCHAT_ARCHIVE}" />
|
||||
<!-- ENDIF -->
|
||||
<!-- EVENT dmzx_mchat_buttons_after -->
|
||||
</div>
|
||||
<!-- IF MCHAT_ALLOW_USE and S_BBCODE_ALLOWED -->
|
||||
<div id="mchat-bbcodes">
|
||||
<!-- INCLUDE posting_buttons.html -->
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF MCHAT_ALLOW_USE and MCHAT_ALLOW_SMILES and .smiley -->
|
||||
<div id="mchat-smilies" class="hidden">
|
||||
<!-- BEGIN smiley -->
|
||||
<a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" /></a>
|
||||
<!-- END smiley -->
|
||||
<!-- IF S_SHOW_SMILEY_LINK -->
|
||||
<a href="{U_MORE_SMILIES}" onclick="popup(this.href, 300, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a>
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
<!-- EVENT dmzx_mchat_body_smiley_after -->
|
||||
<div id="mchat-status">
|
||||
<img src="{EXT_URL}styles/all/theme/images/load.gif" alt="{L_LOADING}" title="{L_LOADING}" id="mchat-refresh-load" />
|
||||
<img src="{EXT_URL}styles/all/theme/images/ok.gif" alt="{L_MCHAT_OK}" title="{L_MCHAT_OK}" id="mchat-refresh-ok" />
|
||||
<img src="{EXT_URL}styles/all/theme/images/paused.gif" alt="{L_MCHAT_PAUSE}" title="{L_MCHAT_PAUSE}" id="mchat-refresh-paused" />
|
||||
<img src="{EXT_URL}styles/all/theme/images/error.gif" alt="{L_ERROR}" title="{L_ERROR}" id="mchat-refresh-error" />
|
||||
<span id="mchat-refresh-text">{MCHAT_REFRESH_YES}</span>
|
||||
<!-- IF MCHAT_USER_TIMEOUT --> • <span id="mchat-session">{L_MCHAT_SESSION_ENDS} {MCHAT_USER_TIMEOUT_TIME}</span><!-- ENDIF --> • <label for="mchat-user-sound">{L_MCHAT_USESOUND} <input type="checkbox" id="mchat-user-sound"<!-- IF S_MCHAT_SOUND_YES --> checked="checked"<!-- ENDIF --> /></label>
|
||||
{L_MCHAT_COPYRIGHT}
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- IF MCHAT_ARCHIVE_PAGE -->
|
||||
<div class="action-bar bottom">
|
||||
<div class="pagination">
|
||||
{MCHAT_TOTAL_MESSAGES}
|
||||
<!-- IF .pagination -->
|
||||
<!-- INCLUDE pagination.html -->
|
||||
<!-- ELSE -->
|
||||
• {PAGE_NUMBER}
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF MCHAT_CUSTOM_PAGE and MCHAT_WHOIS_REFRESH -->
|
||||
<h3>{L_MCHAT_WHO_IS_CHATTING}</h3>
|
||||
<!-- INCLUDE mchat_whois.html -->
|
||||
<div id="mchat-refresh">
|
||||
<span id="mchat-refresh-explain">{MCHAT_WHOIS_REFRESH_EXPLAIN}</span>
|
||||
<span id="mchat-refresh-pending" class="hidden">{L_MCHAT_REFRESHING}</span>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF (MCHAT_CUSTOM_PAGE or MCHAT_ARCHIVE_PAGE) and LEGEND -->
|
||||
<div id="mchat-legend">
|
||||
<em>{L_LEGEND}{L_COLON} {LEGEND}</em>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF MCHAT_ARCHIVE_PAGE or MCHAT_CUSTOM_PAGE -->
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
<!-- ENDIF -->
|
||||
@@ -1,4 +0,0 @@
|
||||
<dl class="icon">
|
||||
<dt><!-- IF MCHAT_ARCHIVE_PAGE -->{L_MCHAT_ARCHIVE_PAGE}<!-- ELSEIF S_MCHAT_CUSTOM_PAGE --><a href="{U_MCHAT_CUSTOM_PAGE}" title="{L_MCHAT_TITLE}">{L_MCHAT_TITLE}</a><!-- ELSE -->{L_MCHAT_TITLE}<!-- ENDIF --></dt>
|
||||
<dd style="border:none"> </dd>
|
||||
</dl>
|
||||
@@ -1,27 +0,0 @@
|
||||
<!-- BEGIN mchatrow -->
|
||||
<li id="mchat-message-{mchatrow.MCHAT_MESSAGE_ID}" class="row mchat-message <!-- IF S_MCHAT_AVATARS -->mchat-message-avatar<!-- 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}" 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 -->>
|
||||
<!-- IF S_MCHAT_AVATARS -->
|
||||
<div class="mchat-avatar">
|
||||
<!-- IF mchatrow.U_VIEWPROFILE --><a href="{mchatrow.U_VIEWPROFILE}" title="{L_READ_PROFILE}"><!-- ENDIF -->
|
||||
<!-- IF mchatrow.MCHAT_USER_AVATAR -->{mchatrow.MCHAT_USER_AVATAR}<!-- ELSE --><img src="{STYLE_PATH}/theme/images/no_avatar.gif" class="mchat-avatar" alt="{L_READ_PROFILE}" /><!-- ENDIF -->
|
||||
<!-- IF mchatrow.U_VIEWPROFILE --></a><!-- ENDIF -->
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
<div class="mchat-message-wrapper">
|
||||
<div class="mchat-message-header">
|
||||
<!-- IF not MCHAT_ARCHIVE_PAGE --><span class="mchat-mention" data-mchat-action="mention" title="{L_MCHAT_RESPOND}" <!-- IF mchatrow.MCHAT_USERNAME_COLOR --> style="color:{mchatrow.MCHAT_USERNAME_COLOR}"<!-- ENDIF -->><strong>@</strong></span><!-- ENDIF -->
|
||||
{mchatrow.MCHAT_USERNAME_FULL} • <span class="mchat-time" title="{mchatrow.MCHAT_DATETIME}"<!-- IF mchatrow.MCHAT_MINUTES_AGO != -1 --> data-mchat-minutes-ago="{mchatrow.MCHAT_MINUTES_AGO}" data-mchat-relative-update="{mchatrow.MCHAT_RELATIVE_UPDATE}"<!-- ENDIF -->>{mchatrow.MCHAT_TIME}</span>
|
||||
</div>
|
||||
<div class="mchat-message-icons">
|
||||
<!-- IF MCHAT_ALLOW_PM and mchatrow.MCHAT_PM and mchatrow.U_VIEWPROFILE --><a href="{mchatrow.MCHAT_PM}" title="{L_MCHAT_SEND_PM}"><img src="{EXT_URL}styles/all/theme/images/message.gif" alt="{L_MCHAT_SEND_PM}" title="{L_MCHAT_SEND_PM}" /></a><!-- ENDIF -->
|
||||
<!-- IF MCHAT_ALLOW_LIKE and not MCHAT_ARCHIVE_PAGE and not mchatrow.MCHAT_IS_POSTER --><img src="{EXT_URL}styles/all/theme/images/like.png" alt="{L_MCHAT_LIKE}" title="{L_MCHAT_LIKE}" data-mchat-action="like" /><!-- ENDIF -->
|
||||
<!-- IF MCHAT_ALLOW_QUOTE and not MCHAT_ARCHIVE_PAGE and not mchatrow.MCHAT_IS_POSTER --><img src="{EXT_URL}styles/all/theme/images/quota.png" alt="{L_REPLY_WITH_QUOTE}" title="{L_REPLY_WITH_QUOTE}" data-mchat-action="quote" /><!-- ENDIF -->
|
||||
<!-- IF MCHAT_ALLOW_IP --><a href="{mchatrow.MCHAT_U_IP}" onclick="popup(this.href, 750, 500); return false;"><img src="{EXT_URL}styles/all/theme/images/ip.gif" alt="{mchatrow.MCHAT_WHOIS_USER}" title="{mchatrow.MCHAT_WHOIS_USER}" /></a><!-- ENDIF -->
|
||||
<!-- IF mchatrow.MCHAT_ALLOW_BAN --><a href="{mchatrow.MCHAT_U_BAN}"><img src="{EXT_URL}styles/all/theme/images/ban.gif" alt="{L_MCHAT_PERMISSIONS}" title="{L_MCHAT_PERMISSIONS}" /></a><!-- ENDIF -->
|
||||
<!-- IF mchatrow.MCHAT_ALLOW_EDIT --><img src="{EXT_URL}styles/all/theme/images/edit.gif" alt="{L_MCHAT_EDIT}" title="{L_MCHAT_EDIT}" data-mchat-action="edit" /><!-- ENDIF -->
|
||||
<!-- IF mchatrow.MCHAT_ALLOW_DEL --><img src="{EXT_URL}styles/all/theme/images/del.gif" alt="{L_DELETE}" title="{L_DELETE}" data-mchat-action="del" /><!-- ENDIF -->
|
||||
</div>
|
||||
<div class="mchat-text">{mchatrow.MCHAT_MESSAGE}</div>
|
||||
</div>
|
||||
</li>
|
||||
<!-- END mchatrow -->
|
||||
@@ -1 +0,0 @@
|
||||
<li class="small-icon icon-mchat"><a href="{U_MCHAT}" title="{L_MCHAT_TITLE}">{L_MCHAT_TITLE}</a></li>
|
||||
@@ -1,77 +0,0 @@
|
||||
<!-- INCLUDE ucp_header.html -->
|
||||
|
||||
<h2>{L_MCHAT_PREFERENCES}</h2>
|
||||
|
||||
<form id="ucp" method="post" action="{S_UCP_ACTION}">
|
||||
<div class="panel">
|
||||
<div class="inner">
|
||||
<fieldset>
|
||||
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
|
||||
<!-- IF S_MCHAT_INDEX -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_index">{L_MCHAT_DISPLAY}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_index" value="1"<!-- IF USER_MCHAT_INDEX --> id="user_mchat_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_index" value="0"<!-- IF not USER_MCHAT_INDEX --> id="user_mchat_index" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_sound">{L_MCHAT_SOUND}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_sound" value="1"<!-- IF USER_MCHAT_SOUND --> id="user_mchat_sound" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_sound" value="0"<!-- IF not USER_MCHAT_SOUND --> id="user_mchat_sound" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- IF S_MCHAT_INDEX_STATS -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_stats_index">{L_MCHAT_DISPLAY_STATS_INDEX}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_stats_index" value="1"<!-- IF USER_MCHAT_STATS_INDEX --> id="user_mchat_stats_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_stats_index" value="0"<!-- IF not USER_MCHAT_STATS_INDEX --> id="user_mchat_stats_index" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF S_MCHAT_TOPICS -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_topics">{L_MCHAT_DISPLAY_NEW_TOPICS}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_topics" value="1"<!-- IF USER_MCHAT_TOPICS --> id="user_mchat_topics" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_topics" value="0"<!-- IF not USER_MCHAT_TOPICS --> id="user_mchat_topics" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF S_MCHAT_AVATARS -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_avatars">{L_MCHAT_DISPLAY_AVATARS}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_avatars" value="1"<!-- IF USER_MCHAT_AVATARS --> id="user_mchat_avatars" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_avatars" value="0"<!-- IF not USER_MCHAT_AVATARS --> id="user_mchat_avatars" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_capital_letter">{L_MCHAT_CAPITAL_LETTER}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_capital_letter" value="1"<!-- IF USER_MCHAT_CAPITAL_LETTER --> id="user_mchat_capital_letter" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_capital_letter" value="0"<!-- IF not USER_MCHAT_CAPITAL_LETTER --> id="user_mchat_capital_letter" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt><label for="user_mchat_input_area">{L_MCHAT_CHAT_AREA}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_input_area" value="1"<!-- IF USER_MCHAT_INPUT_AREA --> id="user_mchat_input_area" checked="checked"<!-- ENDIF --> /> {L_MCHAT_INPUT_AREA}</label>
|
||||
<label><input type="radio" name="user_mchat_input_area" value="0"<!-- IF not USER_MCHAT_INPUT_AREA --> id="user_mchat_input_area" checked="checked"<!-- ENDIF --> /> {L_MCHAT_TEXT_AREA}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<fieldset class="submit-buttons">
|
||||
{S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />
|
||||
<input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
<!-- INCLUDE ucp_footer.html -->
|
||||
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 182 B |
|
Before Width: | Height: | Size: 928 B |
|
Before Width: | Height: | Size: 404 B |
|
Before Width: | Height: | Size: 941 B |
|
Before Width: | Height: | Size: 784 B |
|
Before Width: | Height: | Size: 576 B |
|
Before Width: | Height: | Size: 306 B |
BIN
styles/black/theme/images/message_icons.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
@@ -8,32 +8,32 @@
|
||||
*/
|
||||
|
||||
.icon-mchat {
|
||||
position: relative;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.icon-mchat:after {
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
width: 18px;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
height: 14px;
|
||||
margin-top: -7px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
vertical-align: baseline;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
text-indent: 0;
|
||||
pointer-events: none;
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
width: 18px;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
height: 14px;
|
||||
margin-top: -7px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
vertical-align: baseline;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
text-indent: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.navbar .nav-tabs .mchat .nav-link {
|
||||
position: relative;
|
||||
text-indent: 999px;
|
||||
text-indent: 999px;
|
||||
width: 15px;
|
||||
padding: 0 8px;
|
||||
overflow: hidden;
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
.navbar .nav-tabs .mchat .nav-link:after {
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
font-family: 'FontAwesome';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -7.5px;
|
||||
@@ -51,31 +51,21 @@
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
text-indent: 0;
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
left:8px
|
||||
}
|
||||
|
||||
.rtl .navbar .nav-tabs .mchat .nav-link {
|
||||
padding-left: 12px;
|
||||
padding-left: 12px;
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
.rtl .navbar .nav-tabs .mchat .nav-link:after {
|
||||
left: auto;
|
||||
left: auto;
|
||||
right: 8px;
|
||||
}
|
||||
|
||||
li.mchat-message {
|
||||
padding: 5px !important;
|
||||
}
|
||||
|
||||
li.mchat-message:first-child {
|
||||
border-top-width: 1px !important;
|
||||
padding-top: 5px !important;
|
||||
}
|
||||
|
||||
li.mchat-message:last-child {
|
||||
border-bottom-width: 1px !important;
|
||||
padding-bottom: 5px !important;
|
||||
.mchat-button:before {
|
||||
background-image: url("./images/message_icons.png");
|
||||
}
|
||||
|
||||
@@ -8,32 +8,32 @@
|
||||
*/
|
||||
|
||||
.icon-mchat {
|
||||
position: relative;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.icon-mchat:after {
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
width: 18px;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
height: 14px;
|
||||
margin-top: -7px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
vertical-align: baseline;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
text-indent: 0;
|
||||
pointer-events: none;
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
width: 18px;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
height: 14px;
|
||||
margin-top: -7px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
vertical-align: baseline;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
text-indent: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.navbar .nav-tabs .mchat .nav-link {
|
||||
position: relative;
|
||||
text-indent: 999px;
|
||||
text-indent: 999px;
|
||||
width: 15px;
|
||||
padding: 0 8px;
|
||||
overflow: hidden;
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
.navbar .nav-tabs .mchat .nav-link:after {
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
font-family: 'FontAwesome';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -7.5px;
|
||||
@@ -51,31 +51,17 @@
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
text-indent: 0;
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
left:8px
|
||||
}
|
||||
|
||||
.rtl .navbar .nav-tabs .mchat .nav-link {
|
||||
padding-left: 12px;
|
||||
padding-left: 12px;
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
.rtl .navbar .nav-tabs .mchat .nav-link:after {
|
||||
left: auto;
|
||||
left: auto;
|
||||
right: 8px;
|
||||
}
|
||||
|
||||
li.mchat-message {
|
||||
padding: 5px !important;
|
||||
}
|
||||
|
||||
li.mchat-message:first-child {
|
||||
border-top-width: 1px !important;
|
||||
padding-top: 5px !important;
|
||||
}
|
||||
|
||||
li.mchat-message:last-child {
|
||||
border-bottom-width: 1px !important;
|
||||
padding-bottom: 5px !important;
|
||||
}
|
||||
|
||||
@@ -8,32 +8,32 @@
|
||||
*/
|
||||
|
||||
.icon-mchat {
|
||||
position: relative;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.icon-mchat:after {
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
width: 18px;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
height: 14px;
|
||||
margin-top: -7px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
vertical-align: baseline;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
text-indent: 0;
|
||||
pointer-events: none;
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
width: 18px;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
height: 14px;
|
||||
margin-top: -7px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
vertical-align: baseline;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
text-indent: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.navbar .nav-tabs .mchat .nav-link {
|
||||
position: relative;
|
||||
text-indent: 999px;
|
||||
text-indent: 999px;
|
||||
width: 15px;
|
||||
padding: 0 8px;
|
||||
overflow: hidden;
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
.navbar .nav-tabs .mchat .nav-link:after {
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
font-family: 'FontAwesome';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -7.5px;
|
||||
@@ -51,31 +51,17 @@
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
text-indent: 0;
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
left:8px
|
||||
}
|
||||
|
||||
.rtl .navbar .nav-tabs .mchat .nav-link {
|
||||
padding-left: 12px;
|
||||
padding-left: 12px;
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
.rtl .navbar .nav-tabs .mchat .nav-link:after {
|
||||
left: auto;
|
||||
left: auto;
|
||||
right: 8px;
|
||||
}
|
||||
|
||||
li.mchat-message {
|
||||
padding: 5px !important;
|
||||
}
|
||||
|
||||
li.mchat-message:first-child {
|
||||
border-top-width: 1px !important;
|
||||
padding-top: 5px !important;
|
||||
}
|
||||
|
||||
li.mchat-message:last-child {
|
||||
border-bottom-width: 1px !important;
|
||||
padding-bottom: 5px !important;
|
||||
}
|
||||
|
||||
1
styles/metro_blue/template/mchat_navlink.html
Normal file
@@ -0,0 +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>
|
||||
1
styles/metro_blue/theme/images/tab-icon-mchat.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="-1100 -600 4000 4000"><path fill="#fff" d="M1408 768q0 139-94 257t-256.5 186.5-353.5 68.5q-86 0-176-16-124 88-278 128-36 9-86 16h-3q-11 0-20.5-8t-11.5-21q-1-3-1-6.5t.5-6.5 2-6l2.5-5 3.5-5.5 4-5 4.5-5 4-4.5q5-6 23-25t26-29.5 22.5-29 25-38.5 20.5-44q-124-72-195-177t-71-224q0-139 94-257t256.5-186.5 353.5-68.5 353.5 68.5 256.5 186.5 94 257zm384 256q0 120-71 224.5t-195 176.5q10 24 20.5 44t25 38.5 22.5 29 26 29.5 23 25q1 1 4 4.5t4.5 5 4 5 3.5 5.5l2.5 5 2 6 .5 6.5-1 6.5q-3 14-13 22t-22 7q-50-7-86-16-154-40-278-128-90 16-176 16-271 0-472-132 58 4 88 4 161 0 309-45t264-129q125-92 192-212t67-254q0-77-23-152 129 71 204 178t75 230z"/></svg>
|
||||
|
After Width: | Height: | Size: 725 B |
@@ -7,6 +7,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#mchat-panel {
|
||||
border-radius: 0;
|
||||
.page-header-metro .navbar .nav-main-metro-tabs li.icon-mchat > a {
|
||||
background-image: url("./images/tab-icon-mchat.svg");
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
<div class="collapse-box">
|
||||
<h2><!-- IF MCHAT_ARCHIVE_PAGE -->{L_MCHAT_ARCHIVE_PAGE}<!-- ELSEIF S_MCHAT_CUSTOM_PAGE --><a href="{U_MCHAT_CUSTOM_PAGE}" title="{L_MCHAT_TITLE}">{L_MCHAT_TITLE}</a><!-- ELSE -->{L_MCHAT_TITLE}<!-- ENDIF --></h2>
|
||||
<h2><!-- 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 --></h2>
|
||||
</div>
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
*/
|
||||
|
||||
.icon-mchat > a:before {
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
}
|
||||
|
||||
.cp-mini {
|
||||
#mchat-panel.cp-mini {
|
||||
background-color: #E5E4E3;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<div class="collapse-box">
|
||||
<h2><!-- IF MCHAT_ARCHIVE_PAGE -->{L_MCHAT_ARCHIVE_PAGE}<!-- ELSEIF S_MCHAT_CUSTOM_PAGE --><a href="{U_MCHAT_CUSTOM_PAGE}" title="{L_MCHAT_TITLE}">{L_MCHAT_TITLE}</a><!-- ELSE -->{L_MCHAT_TITLE}<!-- ENDIF --></h2>
|
||||
<h2><!-- 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 --></h2>
|
||||
</div>
|
||||
|
||||
BIN
styles/pbwow3/theme/images/message_icons.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
@@ -8,8 +8,8 @@
|
||||
*/
|
||||
|
||||
.icon-mchat > a:before {
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
}
|
||||
|
||||
#mChat + .forabg .collapse-box a {
|
||||
@@ -20,3 +20,7 @@
|
||||
content: '';
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.mchat-button:before {
|
||||
background-image: url("./images/message_icons.png");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<!-- IF MCHAT_STATS_INDEX -->
|
||||
</p>
|
||||
</div>
|
||||
<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>
|
||||
<p>{MCHAT_USERS_COUNT} {MCHAT_ONLINE_EXPLAIN}<br />{MCHAT_USERS_LIST}
|
||||
<!-- ENDIF -->
|
||||
@@ -0,0 +1 @@
|
||||
<!-- IF MCHAT_INDEX and not MCHAT_LOCATION --><!-- INCLUDE mchat_body.html --><!-- ENDIF -->
|
||||
@@ -0,0 +1 @@
|
||||
<!-- IF MCHAT_INDEX and MCHAT_LOCATION --><!-- INCLUDE mchat_body.html --><!-- ENDIF -->
|
||||
@@ -0,0 +1,3 @@
|
||||
<!-- IF MCHAT_IS_INDEX or MCHAT_IS_ARCHIVE_PAGE or MCHAT_IS_CUSTOM_PAGE -->
|
||||
<div>{MCHAT_DISPLAY_NAME} © {L_POST_BY_AUTHOR} {MCHAT_AUTHOR_HOMEPAGES}</div>
|
||||
<!-- ENDIF -->
|
||||
@@ -0,0 +1,3 @@
|
||||
<!-- IF MCHAT_CUSTOM_PAGE and MCHAT_NAVBAR_LINK and MCHAT_ALLOW_VIEW -->
|
||||
<!-- INCLUDE mchat_navlink.html -->
|
||||
<!-- ENDIF -->
|
||||
107
styles/prosilver/template/mchat_body.html
Normal file
@@ -0,0 +1,107 @@
|
||||
<!-- IF MCHAT_IS_ARCHIVE_PAGE or MCHAT_IS_CUSTOM_PAGE -->
|
||||
<!-- INCLUDE overall_header.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- 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.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) -->
|
||||
<div class="action-bar bar-top">
|
||||
<div class="pagination">
|
||||
{MCHAT_TOTAL_MESSAGES}
|
||||
<!-- IF .pagination -->
|
||||
<!-- INCLUDE pagination.html -->
|
||||
<!-- ELSE -->
|
||||
• {PAGE_NUMBER}
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- EVENT dmzx_mchat_body_before -->
|
||||
<div class="forabg">
|
||||
<a id="mChat"></a>
|
||||
<div class="inner">
|
||||
<ul class="topiclist">
|
||||
<li class="header">
|
||||
<!-- INCLUDE mchat_header.html -->
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="mchat-body" class="postbody">
|
||||
<!-- INCLUDE mchat_script_data.html -->
|
||||
|
||||
<!-- 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-edit" class="hidden" src="{EXT_URL}sounds/edit.mp3" preload="auto"></audio>
|
||||
<audio id="mchat-sound-del" class="hidden" src="{EXT_URL}sounds/del.mp3" preload="auto"></audio>
|
||||
<audio id="mchat-sound-error" class="hidden" src="{EXT_URL}sounds/error.mp3" preload="auto"></audio>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<div id="mchat-confirm" class="hidden">
|
||||
<h3>{L_CONFIRM}</h3>
|
||||
<p></p>
|
||||
<textarea></textarea>
|
||||
<fieldset class="submit-buttons">
|
||||
<input type="button" name="confirm" value="{L_MCHAT_OK}" class="button2" />
|
||||
<input type="button" name="cancel" value="{L_CANCEL}" class="button2" />
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div id="mchat-main">
|
||||
<!-- IF MCHAT_STATIC_MESS and not MCHAT_IS_ARCHIVE_PAGE -->
|
||||
<ul class="topiclist forums">
|
||||
<li class="row mchat-static">{MCHAT_STATIC_MESS}</li>
|
||||
</ul>
|
||||
<!-- 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 -->
|
||||
<!-- INCLUDE mchat_messages.html -->
|
||||
<!-- ELSE -->
|
||||
<li class="row mchat-static mchat-no-messages">{L_MCHAT_NOMESSAGE}</li>
|
||||
<!-- ENDIF -->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- INCLUDE mchat_panel.html -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- IF MCHAT_IS_ARCHIVE_PAGE -->
|
||||
<div class="action-bar bottom">
|
||||
<div class="pagination">
|
||||
{MCHAT_TOTAL_MESSAGES}
|
||||
<!-- IF .pagination -->
|
||||
<!-- INCLUDE pagination.html -->
|
||||
<!-- ELSE -->
|
||||
• {PAGE_NUMBER}
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF MCHAT_IS_CUSTOM_PAGE and MCHAT_WHOIS_REFRESH -->
|
||||
<h3>{L_MCHAT_WHO_IS_CHATTING}</h3>
|
||||
<!-- INCLUDE mchat_whois.html -->
|
||||
<div id="mchat-refresh">
|
||||
<span id="mchat-refresh-explain">{MCHAT_WHOIS_REFRESH_EXPLAIN}</span>
|
||||
<span id="mchat-refresh-pending" class="hidden">{L_MCHAT_REFRESHING}</span>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF (MCHAT_IS_CUSTOM_PAGE or MCHAT_IS_ARCHIVE_PAGE) and LEGEND -->
|
||||
<div id="mchat-legend">
|
||||
<em>{L_LEGEND}{L_COLON} {LEGEND}</em>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF MCHAT_IS_ARCHIVE_PAGE or MCHAT_IS_CUSTOM_PAGE -->
|
||||
<!-- INCLUDE overall_footer.html -->
|
||||
<!-- ENDIF -->
|
||||
4
styles/prosilver/template/mchat_header.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<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>
|
||||
<dd style="border:none"> </dd>
|
||||
</dl>
|
||||
16
styles/prosilver/template/mchat_messages.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!-- 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 -->>
|
||||
<!-- IF S_MCHAT_AVATARS -->
|
||||
<div class="mchat-avatar">
|
||||
<!-- IF mchatrow.U_VIEWPROFILE --><a href="{mchatrow.U_VIEWPROFILE}" title="{L_READ_PROFILE}"><!-- ENDIF -->
|
||||
<!-- IF mchatrow.MCHAT_USER_AVATAR -->{mchatrow.MCHAT_USER_AVATAR}<!-- ELSE --><img src="{STYLE_PATH}/theme/images/no_avatar.gif" class="mchat-avatar" alt="{L_READ_PROFILE}" /><!-- ENDIF -->
|
||||
<!-- IF mchatrow.U_VIEWPROFILE --></a><!-- ENDIF -->
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
<div class="mchat-message-wrapper">
|
||||
<!-- INCLUDE mchat_messages_icons.html -->
|
||||
<div class="mchat-message-header">{mchatrow.MCHAT_USERNAME_FULL} • <span class="mchat-time" title="{mchatrow.MCHAT_DATETIME}"<!-- IF mchatrow.MCHAT_MINUTES_AGO != -1 --> data-mchat-minutes-ago="{mchatrow.MCHAT_MINUTES_AGO}" data-mchat-relative-update="{mchatrow.MCHAT_RELATIVE_UPDATE}"<!-- ENDIF -->>{mchatrow.MCHAT_TIME}</span></div>
|
||||
<div class="mchat-text">{mchatrow.MCHAT_MESSAGE}</div>
|
||||
</div>
|
||||
</li>
|
||||
<!-- END mchatrow -->
|
||||
20
styles/prosilver/template/mchat_messages_icons.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!-- IF not S_IS_BOT -->
|
||||
<!-- DEFINE $MCHAT_ALLOW_MENTION = 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_LIKE = 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_EDIT = mchatrow.MCHAT_ALLOW_EDIT -->
|
||||
<!-- 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 -->
|
||||
<ul class="mchat-buttons">
|
||||
<!-- 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_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_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_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_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_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_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_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 -->
|
||||
</ul>
|
||||
<!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
5
styles/prosilver/template/mchat_navlink.html
Normal file
@@ -0,0 +1,5 @@
|
||||
<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">
|
||||
<i<!-- IF IS_PHPBB32 --> class="icon fa fa-weixin"<!-- ENDIF --> aria-hidden="true"></i><span>{L_MCHAT_TITLE}</span>
|
||||
</a>
|
||||
</li>
|
||||
74
styles/prosilver/template/mchat_panel.html
Normal file
@@ -0,0 +1,74 @@
|
||||
<div id="mchat-panel" class="panel cp-mini<!-- IF MCHAT_IS_ARCHIVE_PAGE --> hidden<!-- ENDIF -->">
|
||||
<!-- IF MCHAT_IS_INDEX and MCHAT_WHOIS_REFRESH and MCHAT_WHOIS_INDEX -->
|
||||
<!-- INCLUDE mchat_whois.html -->
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF MCHAT_CHARACTER_COUNT and not MCHAT_IS_ARCHIVE_PAGE -->
|
||||
<div id="mchat-character-count">{MCHAT_CHARACTER_COUNT}</div>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<form id="mchat-form" name="postform" action="{U_MCHAT_CUSTOM_PAGE}" method="POST">
|
||||
{S_FORM_TOKEN}
|
||||
<!-- IF not MCHAT_IS_ARCHIVE_PAGE -->
|
||||
<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" />
|
||||
<!-- ELSE -->
|
||||
<textarea id="mchat-input" name="message" class="inputbox no-auto-resize" cols="32" rows="5"></textarea>
|
||||
<!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
<!-- EVENT dmzx_mchat_buttons_before -->
|
||||
<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 -->
|
||||
<!-- IF S_BBCODE_ALLOWED -->
|
||||
<input type="button" class="button2" data-mchat-toggle="bbcodes" value="{L_MCHAT_BBCODES}" />
|
||||
<!-- ENDIF -->
|
||||
<!-- IF MCHAT_RULES -->
|
||||
<input type="button" class="button2" onclick="popup('{U_MCHAT_RULES}', 450, 275); return false;" value="{L_MCHAT_RULES}" />
|
||||
<!-- ENDIF -->
|
||||
<!-- ENDIF -->
|
||||
<!-- EVENT dmzx_mchat_buttons_mid -->
|
||||
<!-- IF MCHAT_ARCHIVE -->
|
||||
<input type="button" class="button2" onclick="window.location.href = '{U_MCHAT_ARCHIVE_URL}';" value="{L_MCHAT_ARCHIVE}" />
|
||||
<!-- ENDIF -->
|
||||
<!-- EVENT dmzx_mchat_buttons_after -->
|
||||
</div>
|
||||
<!-- IF MCHAT_ALLOW_USE and S_BBCODE_ALLOWED -->
|
||||
<div id="mchat-bbcodes">
|
||||
<!-- INCLUDE posting_buttons.html -->
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF MCHAT_ALLOW_USE and MCHAT_ALLOW_SMILES and .smiley -->
|
||||
<div id="mchat-smilies" class="hidden">
|
||||
<!-- BEGIN smiley -->
|
||||
<a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" /></a>
|
||||
<!-- END smiley -->
|
||||
<!-- IF S_SHOW_SMILEY_LINK -->
|
||||
<a href="{U_MORE_SMILIES}" onclick="popup(this.href, 300, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a>
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
<!-- EVENT dmzx_mchat_body_smiley_after -->
|
||||
<div id="mchat-status">
|
||||
<div id="mchat-status-icons">
|
||||
<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-ok" class="<!-- IF IS_PHPBB31 -->mchat-status-ok<!-- ELSEIF IS_PHPBB32 -->fa fa-check icon icon-green<!-- ENDIF -->" title="{L_MCHAT_OK}"></i>
|
||||
<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-error" class="<!-- IF IS_PHPBB31 -->mchat-status-error<!-- ELSEIF IS_PHPBB32 -->fa fa-times icon icon-red<!-- ENDIF -->" title="{L_ERROR}"></i>
|
||||
</div>
|
||||
<span id="mchat-refresh-text">{MCHAT_REFRESH_YES}</span>
|
||||
<!-- IF MCHAT_USER_TIMEOUT --> • <span id="mchat-session">{MCHAT_SESSION_TIMELEFT}</span><!-- ENDIF -->
|
||||
<!-- IF not MCHAT_SOUND_DISABLED --> • <label for="mchat-user-sound">{L_MCHAT_USESOUND} <input type="checkbox" id="mchat-user-sound"<!-- IF MCHAT_SOUND --> checked="checked"<!-- ENDIF --> /></label><!-- ENDIF -->
|
||||
<span class="mchat-copyright" title="{MCHAT_AUTHOR_NAMES}">©</span>
|
||||
</div>
|
||||
<!-- ENDIF -->
|
||||
</form>
|
||||
</div>
|
||||
53
styles/prosilver/template/mchat_script_data.html
Normal file
@@ -0,0 +1,53 @@
|
||||
<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>
|
||||
161
styles/prosilver/template/ucp_mchat.html
Normal file
@@ -0,0 +1,161 @@
|
||||
<!-- INCLUDE ucp_header.html -->
|
||||
|
||||
<h2>{L_MCHAT_PREFERENCES}</h2>
|
||||
|
||||
<form id="ucp" class="mchat-ucp" method="post" action="{S_UCP_ACTION}">
|
||||
<div class="panel">
|
||||
<div class="inner">
|
||||
|
||||
<!-- IF ERROR or MCHAT_AUTH_COUNT == 0 -->
|
||||
<fieldset>
|
||||
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
|
||||
<!-- IF MCHAT_AUTH_COUNT == 0 --><p class="error">{L_MCHAT_NO_SETTINGS}</p><!-- ENDIF -->
|
||||
</fieldset>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF MCHAT_AUTH_COUNT > 0 -->
|
||||
<fieldset>
|
||||
<!-- IF MCHAT_INDEX_AUTH -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_index">{L_MCHAT_INDEX}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_index" value="1"<!-- IF MCHAT_INDEX --> id="user_mchat_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_index" value="0"<!-- IF not MCHAT_INDEX --> id="user_mchat_index" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF MCHAT_WHOIS_INDEX_AUTH -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_whois_index">{L_MCHAT_WHOIS_INDEX}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_whois_index" value="1"<!-- IF MCHAT_WHOIS_INDEX --> id="user_mchat_whois_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_whois_index" value="0"<!-- IF not MCHAT_WHOIS_INDEX --> id="user_mchat_whois_index" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF MCHAT_STATS_INDEX_AUTH -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_stats_index">{L_MCHAT_STATS_INDEX}{L_COLON}</label><br /><span>{L_MCHAT_STATS_INDEX_EXPLAIN}</span></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_stats_index" value="1"<!-- IF MCHAT_STATS_INDEX --> id="user_mchat_stats_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_stats_index" value="0"<!-- IF not MCHAT_STATS_INDEX --> id="user_mchat_stats_index" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF MCHAT_LOCATION_AUTH -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_location">{L_MCHAT_LOCATION}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_location" value="1"<!-- IF MCHAT_LOCATION --> id="user_mchat_location" checked="checked"<!-- ENDIF --> /> {L_MCHAT_TOP}</label>
|
||||
<label><input type="radio" name="user_mchat_location" value="0"<!-- IF not MCHAT_LOCATION --> id="user_mchat_location" checked="checked"<!-- ENDIF --> /> {L_MCHAT_BOTTOM}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<hr />
|
||||
<!-- IF MCHAT_MESSAGE_TOP_AUTH -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_message_top">{L_MCHAT_MESSAGE_TOP}{L_COLON}</label><br /><span>{L_MCHAT_MESSAGE_TOP_EXPLAIN}</span></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_message_top" value="1"<!-- IF MCHAT_MESSAGE_TOP --> id="user_mchat_message_top" checked="checked"<!-- ENDIF --> /> {L_MCHAT_TOP}</label>
|
||||
<label><input type="radio" name="user_mchat_message_top" value="0"<!-- IF not MCHAT_MESSAGE_TOP --> id="user_mchat_message_top" checked="checked"<!-- ENDIF --> /> {L_MCHAT_BOTTOM}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF MCHAT_CAPITAL_LETTER_AUTH -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_capital_letter">{L_MCHAT_CAPITAL_LETTER}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_capital_letter" value="1"<!-- IF MCHAT_CAPITAL_LETTER --> id="user_mchat_capital_letter" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_capital_letter" value="0"<!-- IF not MCHAT_CAPITAL_LETTER --> id="user_mchat_capital_letter" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF MCHAT_SOUND_AUTH -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_sound">{L_MCHAT_SOUND}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_sound" value="1"<!-- IF MCHAT_SOUND --> id="user_mchat_sound" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_sound" value="0"<!-- IF not MCHAT_SOUND --> id="user_mchat_sound" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF MCHAT_AVATARS_AUTH -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_avatars">{L_MCHAT_AVATARS}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_avatars" value="1"<!-- IF MCHAT_AVATARS --> id="user_mchat_avatars" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_avatars" value="0"<!-- IF not MCHAT_AVATARS --> id="user_mchat_avatars" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF MCHAT_INPUT_AREA_AUTH -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_input_area">{L_MCHAT_CHAT_AREA}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_input_area" value="1"<!-- IF MCHAT_INPUT_AREA --> id="user_mchat_input_area" checked="checked"<!-- ENDIF --> /> {L_MCHAT_INPUT_AREA}</label>
|
||||
<label><input type="radio" name="user_mchat_input_area" value="0"<!-- IF not MCHAT_INPUT_AREA --> id="user_mchat_input_area" checked="checked"<!-- ENDIF --> /> {L_MCHAT_TEXT_AREA}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF MCHAT_CHARACTER_COUNT_AUTH -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_character_count">{L_MCHAT_CHARACTER_COUNT}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_character_count" value="1"<!-- IF MCHAT_CHARACTER_COUNT --> id="user_mchat_character_count" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_character_count" value="0"<!-- IF not MCHAT_CHARACTER_COUNT --> id="user_mchat_character_count" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF MCHAT_PAUSE_ON_INPUT_AUTH -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_pause_on_input">{L_MCHAT_PAUSE_ON_INPUT}{L_COLON}</label><br /><span>{L_MCHAT_PAUSE_ON_INPUT_EXPLAIN}</span></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_pause_on_input" value="1"<!-- IF MCHAT_PAUSE_ON_INPUT --> id="user_mchat_pause_on_input" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_pause_on_input" value="0"<!-- IF not MCHAT_PAUSE_ON_INPUT --> id="user_mchat_pause_on_input" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF MCHAT_DATE_AUTH -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_dateoptions">{L_MCHAT_DATE_FORMAT}{L_COLON}</label><br /><span>{L_MCHAT_DATE_FORMAT_EXPLAIN}</span></dt>
|
||||
<dd>
|
||||
<select name="user_mchat_dateoptions" id="user_mchat_dateoptions" onchange="phpbb.toggleDisplay('user_mchat_custom_date', this.value == 'custom' ? 1 : -1); document.getElementById('user_mchat_date').value = this.value == 'custom' ? '{A_MCHAT_DEFAULT_DATEFORMAT}' : this.value;">
|
||||
{S_MCHAT_DATEFORMAT_OPTIONS}
|
||||
</select>
|
||||
</dd>
|
||||
<dd><div id="user_mchat_custom_date"<!-- IF not S_MCHAT_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="user_mchat_date" id="user_mchat_date" value="{MCHAT_DATE}" maxlength="64" /></div></dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF MCHAT_RELATIVE_TIME_AUTH -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_relative_time">{L_MCHAT_RELATIVE_TIME}{L_COLON}</label><br /><span>{L_MCHAT_RELATIVE_TIME_EXPLAIN}</span></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_relative_time" value="1"<!-- IF MCHAT_RELATIVE_TIME --> id="user_mchat_relative_time" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_relative_time" value="0"<!-- IF not MCHAT_RELATIVE_TIME --> id="user_mchat_relative_time" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
<hr />
|
||||
<!-- IF MCHAT_POSTS_AUTH and MCHAT_POSTS_ENABLED_LANG -->
|
||||
<dl>
|
||||
<dt><label for="user_mchat_posts">{MCHAT_POSTS_ENABLED_LANG}{L_COLON}</label></dt>
|
||||
<dd>
|
||||
<label><input type="radio" name="user_mchat_posts" value="1"<!-- IF MCHAT_POSTS --> id="user_mchat_posts" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" name="user_mchat_posts" value="0"<!-- IF not MCHAT_POSTS --> id="user_mchat_posts" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
</fieldset>
|
||||
<!-- ENDIF -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- IF MCHAT_AUTH_COUNT > 0 -->
|
||||
<fieldset class="submit-buttons">
|
||||
{S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />
|
||||
<input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
<!-- ENDIF -->
|
||||
</form>
|
||||
|
||||
<!-- INCLUDE ucp_footer.html -->
|
||||
|
Before Width: | Height: | Size: 141 B After Width: | Height: | Size: 141 B |
|
Before Width: | Height: | Size: 651 B After Width: | Height: | Size: 651 B |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
BIN
styles/prosilver/theme/images/message_icons.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 96 B After Width: | Height: | Size: 96 B |
|
Before Width: | Height: | Size: 83 B After Width: | Height: | Size: 83 B |
@@ -13,13 +13,17 @@
|
||||
}
|
||||
|
||||
#mChat + .inner li.header dd {
|
||||
width: 0;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.icon-mchat {
|
||||
background-image: url("./images/icon_mchat.png");
|
||||
}
|
||||
|
||||
.mchat-ucp fieldset hr:first-child, .mchat-ucp fieldset hr:last-child, .mchat-ucp fieldset hr + hr {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#mchat-body {
|
||||
width: 100% !important;
|
||||
}
|
||||
@@ -29,7 +33,7 @@
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.mchat-row-limit {
|
||||
#mchat-messages {
|
||||
overflow: auto;
|
||||
width: 100%;
|
||||
}
|
||||
@@ -42,12 +46,8 @@
|
||||
float: left;
|
||||
}
|
||||
|
||||
.mchat-message-icons {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.mchat-message {
|
||||
padding: 5px;
|
||||
padding: 5px !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -58,23 +58,80 @@
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 700px), only screen and (max-device-width: 700px) {
|
||||
.mchat-avatar {
|
||||
display: none;
|
||||
|
||||
.mchat-buttons > li {
|
||||
padding: 0 8px !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.mchat-avatar a {
|
||||
unicode-bidi: normal;
|
||||
}
|
||||
|
||||
.mchat-avatar img {
|
||||
.mchat-avatar a, .mchat-avatar img {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.mchat-message .mchat-buttons li {
|
||||
opacity: .3;
|
||||
}
|
||||
|
||||
.mchat-message:hover .mchat-buttons li {
|
||||
opacity: .6;
|
||||
}
|
||||
|
||||
.mchat-message .mchat-buttons li:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.mchat-buttons {
|
||||
float: right;
|
||||
list-style: none;
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
.mchat-message-wrapper .mchat-buttons > li {
|
||||
float: left;
|
||||
margin: 0 3px;
|
||||
}
|
||||
|
||||
.mchat-button {
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.mchat-button.fa {
|
||||
font-size: 12pt;
|
||||
}
|
||||
|
||||
.mchat-button span {
|
||||
display: block;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
.mchat-icon:before {
|
||||
content: '';
|
||||
background-image: url("./images/message_icons.png");
|
||||
background-repeat: no-repeat;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
display: block;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.mchat-icon-mention:before { background-position: -2px -2px; }
|
||||
.mchat-icon-edit:before { background-position: -22px -2px; }
|
||||
.mchat-icon-pm:before { background-position: -42px -2px; }
|
||||
.mchat-icon-quote:before { background-position: -62px -2px; }
|
||||
.mchat-icon-like:before { background-position: -82px -2px; }
|
||||
.mchat-icon-delete:before { background-position: -102px -2px; }
|
||||
.mchat-icon-permissions:before { background-position: -122px -2px; }
|
||||
.mchat-icon-ip:before { background-position: -142px -2px; }
|
||||
|
||||
.mchat-text {
|
||||
clear: both;
|
||||
overflow: hidden;
|
||||
padding: 0 5px 2px;
|
||||
font-size: 1.1em;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.mchat-text li {
|
||||
@@ -104,6 +161,7 @@
|
||||
}
|
||||
|
||||
.mchat-text blockquote, .mchat-text .codebox, .mchat-text ul, .mchat-text ol {
|
||||
margin-top: 5px;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
@@ -111,21 +169,29 @@
|
||||
color: inherit !important;
|
||||
}
|
||||
|
||||
.mchat-mention, .mchat-message-icons > * {
|
||||
.mchat-mention {
|
||||
cursor: pointer;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
#mchat-no-message {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
#mchat-character-count {
|
||||
float: right;
|
||||
visibility: hidden;
|
||||
padding: 5px 0 0;
|
||||
}
|
||||
|
||||
#mchat-panel {
|
||||
text-align: center;
|
||||
max-height: initial;
|
||||
overflow-y: auto;
|
||||
padding: 0 5px 5px 5px;
|
||||
margin: 0;
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
#mchat-form {
|
||||
@@ -136,7 +202,7 @@
|
||||
cursor: text;
|
||||
width: 50%;
|
||||
font-size: 1.1em;
|
||||
padding: 5px;
|
||||
padding: 5px 5px 4px;
|
||||
margin: 5px 20px;
|
||||
}
|
||||
|
||||
@@ -150,11 +216,7 @@
|
||||
}
|
||||
|
||||
#mchat-bbcodes #format-buttons {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#mchat-bbcodes #format-buttons input, #mchat-bbcodes #format-buttons select {
|
||||
margin-bottom: 5px;
|
||||
margin: 0 0 5px;
|
||||
}
|
||||
|
||||
#mchat-bbcodes #colour_palette label {
|
||||
@@ -169,32 +231,73 @@
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#mchat-refresh-ok, #mchat-refresh-load, #mchat-refresh-error, #mchat-refresh-paused {
|
||||
vertical-align: middle;
|
||||
#mchat-status-icons {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
#mchat-refresh-ok, #mchat-refresh-load, #mchat-refresh-error {
|
||||
#mchat-status-icons i {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#mchat-status-icons i.fa {
|
||||
font-size: 12pt;
|
||||
}
|
||||
|
||||
#mchat-status-error {
|
||||
display: none;
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
#mchat-refresh-load {
|
||||
.mchat-status-error {
|
||||
background-image: url("./images/error.gif");
|
||||
}
|
||||
|
||||
#mchat-status-ok {
|
||||
display: none;
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
.mchat-status-ok {
|
||||
background-image: url("./images/ok.gif");
|
||||
}
|
||||
|
||||
#mchat-status-load {
|
||||
display: none;
|
||||
cursor: wait;
|
||||
}
|
||||
|
||||
#mchat-refresh-ok, #mchat-refresh-error, #mchat-refresh-paused {
|
||||
.mchat-status-load {
|
||||
background-image: url("./images/load.gif");
|
||||
}
|
||||
|
||||
#mchat-status-paused {
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
.mchat-status-paused {
|
||||
background-image: url("./images/paused.gif");
|
||||
}
|
||||
|
||||
#mchat-legend {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.mchat-static, #mchat-stats, #mchat-whois, #mchat-refresh, #mchat-legend {
|
||||
padding: 5px 0;
|
||||
padding: 5px 0 0;
|
||||
text-align: left;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
#mchat-panel > #mchat-whois {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.mchat-copyright {
|
||||
position: relative;
|
||||
top: 1px;
|
||||
@@ -203,22 +306,6 @@
|
||||
cursor: help;
|
||||
}
|
||||
|
||||
#mchat-copyright-footer {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#mchat-copyright-footer li {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#mchat-copyright-footer li:first-child:before{
|
||||
content: "";
|
||||
}
|
||||
|
||||
#mchat-copyright-footer li:before{
|
||||
content: "• ";
|
||||
}
|
||||
|
||||
.mchat-static {
|
||||
padding: 5px 5px 7px !important;
|
||||
}
|
||||
@@ -229,11 +316,11 @@
|
||||
|
||||
/* Compatibility with Advanced BBCode Box extension */
|
||||
|
||||
#abbc3_buttons {
|
||||
#mchat-panel #abbc3_buttons {
|
||||
margin: 0 !important;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
#abbc3_buttons .abbc3_buttons_row {
|
||||
#mchat-panel #abbc3_buttons .abbc3_buttons_row {
|
||||
margin: 0 auto !important;
|
||||
}
|
||||
@@ -8,32 +8,32 @@
|
||||
*/
|
||||
|
||||
.icon-mchat {
|
||||
position: relative;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.icon-mchat:after {
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
width: 18px;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
height: 14px;
|
||||
margin-top: -7px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
vertical-align: baseline;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
text-indent: 0;
|
||||
pointer-events: none;
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
width: 18px;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 0;
|
||||
height: 14px;
|
||||
margin-top: -7px;
|
||||
font-size: 12px;
|
||||
line-height: 14px;
|
||||
vertical-align: baseline;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
text-transform: none;
|
||||
text-indent: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.navbar .nav-tabs .mchat .nav-link {
|
||||
position: relative;
|
||||
text-indent: 999px;
|
||||
text-indent: 999px;
|
||||
width: 15px;
|
||||
padding: 0 8px;
|
||||
overflow: hidden;
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
.navbar .nav-tabs .mchat .nav-link:after {
|
||||
content: '\f086';
|
||||
font-family: 'FontAwesome';
|
||||
font-family: 'FontAwesome';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
margin-top: -7.5px;
|
||||
@@ -51,31 +51,17 @@
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
text-indent: 0;
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
left:8px
|
||||
}
|
||||
|
||||
.rtl .navbar .nav-tabs .mchat .nav-link {
|
||||
padding-left: 12px;
|
||||
padding-left: 12px;
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
.rtl .navbar .nav-tabs .mchat .nav-link:after {
|
||||
left: auto;
|
||||
left: auto;
|
||||
right: 8px;
|
||||
}
|
||||
|
||||
li.mchat-message {
|
||||
padding: 5px !important;
|
||||
}
|
||||
|
||||
li.mchat-message:first-child {
|
||||
border-top-width: 1px !important;
|
||||
padding-top: 5px !important;
|
||||
}
|
||||
|
||||
li.mchat-message:last-child {
|
||||
border-bottom-width: 1px !important;
|
||||
padding-bottom: 5px !important;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,6 @@ class ucp_mchat_module
|
||||
|
||||
// Get an instance of the UCP controller and display the options
|
||||
$controller = $phpbb_container->get('dmzx.mchat.ucp.controller');
|
||||
$controller->display_options($this->u_action);
|
||||
$controller->$mode($this->u_action);
|
||||
}
|
||||
}
|
||||
|
||||