Files
This commit is contained in:
dmzx
2015-03-12 14:12:59 +01:00
parent 930e9b4e83
commit 621aa7d9f9
60 changed files with 4656 additions and 17 deletions

17
.gitattributes vendored
View File

@@ -1,17 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

19
README.md Normal file
View File

@@ -0,0 +1,19 @@
# phpBB mChat Extension
## Install
1. Download the latest release.
2. Unzip the downloaded release, and change the name of the folder to `mchat`.
3. In the `ext` directory of your phpBB board, create a new directory named `dmzx` (if it does not already exist).
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` 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` 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
[GNU General Public License v2](http://opensource.org/licenses/GPL-2.0)

28
acp/acp_mchat_info.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\acp;
class acp_mchat_info
{
function module()
{
return array(
'filename' => '\dmzx\mchat\acp\acp_mchat_module',
'title' => 'ACP_CAT_MCHAT',
'modes' => array(
'configuration' => array(
'title' => 'ACP_MCHAT_CONFIG',
'auth' => 'ext_dmzx/mchat && acl_a_mchat',
'cat' => array('ACP_CAT_MCHAT')
),
),
);
}
}

257
acp/acp_mchat_module.php Normal file
View File

@@ -0,0 +1,257 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\acp;
class acp_mchat_module
{
/** @var \dmzx\mchat\core\functions_mchat */
protected $functions_mchat;
/** @var \phpbb\config\config */
protected $config;
/** @var \phpbb\config\db_text */
protected $config_text;
/** @var \phpbb\db\driver\driver_interface */
protected $db;
/** @var \phpbb\cache\service */
protected $cache;
/** @var \phpbb\log\log */
protected $log;
/** @var \phpbb\request\request */
protected $request;
/** @var \phpbb\template\template */
protected $template;
/** @var \phpbb\user */
protected $user;
/** @var ContainerInterface */
protected $phpbb_container;
/** @var string */
protected $phpbb_root_path;
/** @var string */
protected $php_ext;
/** @var string */
protected $table_prefix;
/** @var string */
public $u_action;
public function main($id, $mode)
{
global $config, $db, $cache, $request, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
global $phpbb_container;
$this->functions_mchat = $phpbb_container->get('dmzx.mchat.functions_mchat');
$this->config = $config;
$this->config_text = $phpbb_container->get('config_text');
$this->db = $db;
$this->request = $request;
$this->template = $template;
$this->user = $user;
$this->cache = $cache;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $phpEx;
$this->table_prefix = $phpbb_container->getParameter('core.table_prefix');
// Add the wpm ACP lang file
$user->add_lang_ext('dmzx/mchat', 'info_acp_mchat');
// Load a template from adm/style for our ACP page
$this->tpl_name = 'acp_mchat';
// Set the page title for our ACP page
$this->page_title = 'MCHAT_TITLE';
// Define the name of the form for use as a form key
$form_name = 'acp_mchat';
add_form_key($form_name);
// something was submitted
$submit = (isset($_POST['submit'])) ? true : false;
$mchat_row = array(
'location' => request_var('mchat_location', 0),
'refresh' => request_var('mchat_refresh', 0),
'message_limit' => request_var('mchat_message_limit', 0),
'message_num' => request_var('mchat_message_num', 0),
'archive_limit' => request_var('mchat_archive_limit', 0),
'flood_time' => request_var('mchat_flood_time', 0),
'max_message_lngth' => request_var('mchat_max_message_lngth', 0),
'custom_page' => request_var('mchat_custom_page', 0),
'date' => request_var('mchat_date', '', true),
'whois' => request_var('mchat_whois', 0),
'whois_refresh' => request_var('mchat_whois_refresh', 0),
'bbcode_disallowed' => utf8_normalize_nfc(request_var('mchat_bbcode_disallowed', '', true)),
'prune_enable' => request_var('mchat_prune_enable', 0),
'prune_num' => request_var('mchat_prune_num', 0),
'index_height' => request_var('mchat_index_height', 0),
'custom_height' => request_var('mchat_custom_height', 0),
'static_message' => utf8_normalize_nfc(request_var('mchat_static_message', '', true)),
'override_min_post_chars' => request_var('mchat_override_min_post_chars', 0),
'override_smilie_limit' => request_var('mchat_override_smilie_limit', 0),
'timeout' => request_var('mchat_timeout', 0),
'pause_on_input' => request_var('mchat_pause_on_input', 0),
'rules' => utf8_normalize_nfc(request_var('mchat_rules', '', true)),
'avatars' => request_var('mchat_avatars', 0),
);
if ($submit)
{
if (!function_exists('validate_data'))
{
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
}
// validate the entries...most of them anyway
$mchat_array = array(
'static_message' => array('string', false, 0, 255),
'index_height' => array('num', false, 50, 1000),
'custom_height' => array('num', false, 50, 1000),
'whois_refresh' => array('num', false, 30, 300),
'refresh' => array('num', false, 5, 60),
'message_limit' => array('num', false, 10, 30),
'message_num' => array('num', false, 10, 50),
'archive_limit' => array('num', false, 25, 50),
'flood_time' => array('num', false, 0, 30),
'max_message_lngth' => array('num', false, 0, 500),
'timeout' => array('num', false, 0, (int) $config['session_length']),
'rules' => array('string', false, 0, 255),
);
$error = validate_data($mchat_row, $mchat_array);
if (!check_form_key('acp_mchat'))
{
$error[] = 'FORM_INVALID';
}
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
if (!sizeof($error))
{
foreach ($mchat_row as $config_name => $config_value)
{
$sql = 'UPDATE ' . $this->table_prefix . \dmzx\mchat\core\functions_mchat::MCHAT_CONFIG_TABLE . "
SET config_value = '" . $db->sql_escape($config_value) . "'
WHERE config_name = '" . $db->sql_escape($config_name) . "'";
$db->sql_query($sql);
}
//update setting in config table for mod enabled or not
set_config('mchat_enable', request_var('mchat_enable', 0));
// update setting in config table for allowing on index or not
set_config('mchat_on_index', request_var('mchat_on_index', 0));
// update setting in config table to allow new posts to display or not
set_config('mchat_new_posts', request_var('mchat_new_posts', 0));
// update setting in config table for stats on index
set_config('mchat_stats_index', request_var('mchat_stats_index', 0));
// and an entry into the log table
add_log('admin', 'LOG_MCHAT_CONFIG_UPDATE');
// purge the cache
$this->cache->destroy('_mchat_config');
// rebuild the cache
$this->functions_mchat->mchat_cache();
trigger_error($user->lang['MCHAT_CONFIG_SAVED'] . adm_back_link($this->u_action));
}
}
// let's get it on
$sql = 'SELECT * FROM ' . $this->table_prefix . \dmzx\mchat\core\functions_mchat::MCHAT_CONFIG_TABLE;
$result = $db->sql_query($sql);
$mchat_config = array();
while ($row = $db->sql_fetchrow($result))
{
$mchat_config[$row['config_name']] = $row['config_value'];
}
$db->sql_freeresult($result);
$mchat_enable = isset($config['mchat_enable']) ? $config['mchat_enable'] : 0;
$mchat_on_index = isset($config['mchat_on_index']) ? $config['mchat_on_index'] : 0;
$mchat_version = isset($config['mchat_version']) ? $config['mchat_version'] : '';
$mchat_new_posts = isset($config['mchat_new_posts']) ? $config['mchat_new_posts'] : 0;
$mchat_stats_index = isset($config['mchat_stats_index']) ? $config['mchat_stats_index'] : 0;
$dateformat_options = '';
foreach ($user->lang['dateformats'] as $format => $null)
{
$dateformat_options .= '<option value="' . $format . '"' . (($format == $mchat_config['date']) ? ' selected="selected"' : '') . '>';
$dateformat_options .= $user->format_date(time(), $format, false) . ((strpos($format, '|') !== false) ? $user->lang['VARIANT_DATE_SEPARATOR'] . $user->format_date(time(), $format, true) : '');
$dateformat_options .= '</option>';
}
$s_custom = false;
$dateformat_options .= '<option value="custom"';
if (!isset($user->lang['dateformats'][$mchat_config['date']]))
{
$dateformat_options .= ' selected="selected"';
$s_custom = true;
}
$dateformat_options .= '>' . $user->lang['MCHAT_CUSTOM_DATEFORMAT'] . '</option>';
$template->assign_vars(array(
'MCHAT_ERROR' => isset($error) ? ((sizeof($error)) ? implode('<br />', $error) : '') : '',
'MCHAT_VERSION' => $mchat_version,
'MCHAT_PRUNE' => !empty($mchat_row['prune_enable']) ? $mchat_row['prune_enable'] : $mchat_config['prune_enable'],
'MCHAT_PRUNE_NUM' => !empty($mchat_row['prune_num']) ? $mchat_row['prune_num'] : $mchat_config['prune_num'],
'MCHAT_ENABLE' => ($mchat_enable) ? true : false,
'MCHAT_ON_INDEX' => ($mchat_on_index) ? true : false,
'MCHAT_LOCATION' => !empty($mchat_row['location']) ? $mchat_row['location'] : $mchat_config['location'],
'MCHAT_REFRESH' => !empty($mchat_row['refresh']) ? $mchat_row['refresh'] : $mchat_config['refresh'],
'MCHAT_WHOIS_REFRESH' => !empty($mchat_row['whois_refresh']) ? $mchat_row['whois_refresh'] : $mchat_config['whois_refresh'],
'MCHAT_MESSAGE_LIMIT' => !empty($mchat_row['message_limit']) ? $mchat_row['message_limit'] : $mchat_config['message_limit'],
'MCHAT_MESSAGE_NUM' => !empty($mchat_row['message_num']) ? $mchat_row['message_num'] : $mchat_config['message_num'],
'MCHAT_ARCHIVE_LIMIT' => !empty($mchat_row['archive_limit']) ? $mchat_row['archive_limit'] : $mchat_config['archive_limit'],
'MCHAT_AVATARS' => !empty($mchat_row['avatars']) ? $mchat_row['avatars'] : $mchat_config['avatars'],
'MCHAT_FLOOD_TIME' => !empty($mchat_row['flood_time']) ? $mchat_row['flood_time'] : $mchat_config['flood_time'],
'MCHAT_MAX_MESSAGE_LNGTH' => !empty($mchat_row['max_message_lngth']) ? $mchat_row['max_message_lngth'] : $mchat_config['max_message_lngth'],
'MCHAT_CUSTOM_PAGE' => !empty($mchat_row['custom_page']) ? $mchat_row['custom_page'] : $mchat_config['custom_page'],
'MCHAT_DATE' => !empty($mchat_row['date']) ? $mchat_row['date'] : $mchat_config['date'],
'MCHAT_DEFAULT_DATEFORMAT' => $config['default_dateformat'],
'MCHAT_RULES' => !empty($mchat_row['rules']) ? $mchat_row['rules'] : $mchat_config['rules'],
'MCHAT_WHOIS' => !empty($mchat_row['whois']) ? $mchat_row['whois'] : $mchat_config['whois'],
'MCHAT_STATS_INDEX' => ($mchat_stats_index) ? true : false,
'MCHAT_BBCODE_DISALLOWED' => !empty($mchat_row['bbcode_disallowed']) ? $mchat_row['bbcode_disallowed'] : $mchat_config['bbcode_disallowed'],
'MCHAT_STATIC_MESSAGE' => !empty($mchat_row['static_message']) ? $mchat_row['static_message'] : $mchat_config['static_message'],
'MCHAT_INDEX_HEIGHT' => !empty($mchat_row['index_height']) ? $mchat_row['index_height'] : $mchat_config['index_height'],
'MCHAT_CUSTOM_HEIGHT' => !empty($mchat_row['custom_height']) ? $mchat_row['custom_height'] : $mchat_config['custom_height'],
'MCHAT_OVERRIDE_SMILIE_LIMIT' => !empty($mchat_row['override_smilie_limit']) ? $mchat_row['override_smilie_limit'] : $mchat_config['override_smilie_limit'],
'MCHAT_OVERRIDE_MIN_POST_CHARS' => !empty($mchat_row['override_min_post_chars']) ? $mchat_row['override_min_post_chars'] : $mchat_config['override_min_post_chars'],
'MCHAT_TIMEOUT' => !empty($mchat_row['timeout']) ? $mchat_row['timeout'] : $mchat_config['timeout'],
'MCHAT_NEW_POSTS' => ($mchat_new_posts) ? true : false,
'MCHAT_PAUSE_ON_INPUT' => !empty($mchat_row['pause_on_input']) ? $mchat_row['pause_on_input'] : $mchat_config['pause_on_input'],
'L_MCHAT_BBCODES_DISALLOWED_EXPLAIN' => sprintf($user->lang['MCHAT_BBCODES_DISALLOWED_EXPLAIN'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=bbcodes', true, $user->session_id) . '">', '</a>'),
'L_MCHAT_TIMEOUT_EXPLAIN' => sprintf($user->lang['MCHAT_USER_TIMEOUT_EXPLAIN'],'<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=board&amp;mode=load', true, $user->session_id) . '">', '</a>', $config['session_length']),
'S_MCHAT_DATEFORMAT_OPTIONS' => $dateformat_options,
'S_CUSTOM_DATEFORMAT' => $s_custom,
'U_ACTION' => $this->u_action)
);
}
}

179
adm/style/acp_mchat.html Normal file
View File

@@ -0,0 +1,179 @@
<!-- INCLUDE overall_header.html -->
<h1>{L_MCHAT_TITLE}</h1>
<p>{L_MCHAT_VERSION} {MCHAT_VERSION}</p>
<!-- 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_MAIN}</legend>
<dl>
<dt><label for="mchat_enable">{L_MCHAT_ENABLE}{L_COLON}</label><br />
<span>{L_MCHAT_ENABLE_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="mchat_enable" value="1"<!-- IF MCHAT_ENABLE --> id="mchat_enable" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="mchat_enable" value="0"<!-- IF not MCHAT_ENABLE --> id="mchat_enable" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="mchat_new_posts">{L_MCHAT_NEW_POSTS}{L_COLON}</label><br />
<span>{L_MCHAT_NEW_POSTS_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="mchat_new_posts" value="1"<!-- IF MCHAT_NEW_POSTS --> id="mchat_new_posts" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="mchat_new_posts" value="0"<!-- IF not MCHAT_NEW_POSTS --> id="mchat_new_posts" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="mchat_static_message">{L_MCHAT_STATIC_MESSAGE}{L_COLON}</label><br />
<span>{L_MCHAT_STATIC_MESSAGE_EXPLAIN}</span></dt>
<dd><textarea name="mchat_static_message" id="mchat_static_message" rows="3" cols="40">{MCHAT_STATIC_MESSAGE}</textarea></dd>
</dl>
<dl>
<dt><label for="mchat_refresh">{L_MCHAT_REFRESH}{L_COLON}</label><br />
<span>{L_MCHAT_REFRESH_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_refresh" id="mchat_refresh" size="10" value="{MCHAT_REFRESH}" /></dd>
</dl>
<dl>
<dt><label for="mchat_timeout">{L_MCHAT_USER_TIMEOUT}{L_COLON}</label><br />
<span>{L_MCHAT_TIMEOUT_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_timeout" id="mchat_timeout" size="10" maxlength="4" value="{MCHAT_TIMEOUT}" /></dd>
</dl>
<dl>
<dt><label for="mchat_on_index">{L_MCHAT_ON_INDEX}{L_COLON}</label><br />
<span>{L_MCHAT_ON_INDEX_EXPLAIN}</span></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_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_index_height">{L_MCHAT_MESSAGE_NUM}{L_COLON}</label><br />
<span>{L_MCHAT_MESSAGE_NUM_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_message_num" size="10" maxlength="4" value="{MCHAT_MESSAGE_NUM}" /></dd>
</dl>
<dl>
<dt><label for="mchat_location">{L_MCHAT_LOCATION}{L_COLON}</label><br />
<span>{L_MCHAT_LOCATION_EXPLAIN}</span></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_custom_page">{L_MCHAT_CUSTOM_PAGE}{L_COLON}</label><br />
<span>{L_MCHAT_CUSTOM_PAGE_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="mchat_custom_page" value="1"<!-- IF MCHAT_CUSTOM_PAGE --> id="mchat_custom_page" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="mchat_custom_page" value="0"<!-- IF not MCHAT_CUSTOM_PAGE --> id="mchat_custom_page" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="mchat_custom_height">{L_MCHAT_CUSTOM_HEIGHT}{L_COLON}</label><br />
<span>{L_MCHAT_CUSTOM_HEIGHT_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_custom_height" id="mchat_custom_height" size="10" maxlength="4" value="{MCHAT_CUSTOM_HEIGHT}" /></dd>
</dl>
<dl>
<dt><label for="mchat_prune_enable">{L_MCHAT_PRUNE}{L_COLON}</label><br />
<span>{L_MCHAT_PRUNE_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="mchat_prune_enable" value="1"<!-- IF MCHAT_PRUNE --> id="mchat_prune_enable" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="mchat_prune_enable" value="0"<!-- IF not MCHAT_PRUNE --> id="mchat_prune_enable" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="mchat_prune_num">{L_MCHAT_PRUNE_NUM}{L_COLON}</label><br />
<span>{L_MCHAT_PRUNE_NUM_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_prune_num" size="10" id="mchat_prune_num" value="{MCHAT_PRUNE_NUM}" /></dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_MCHAT_MESSAGES}</legend>
<dl>
<dt><label for="mchat_flood_time">{L_MCHAT_FLOOD_TIME}{L_COLON}</label><br />
<span>{L_MCHAT_FLOOD_TIME_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_flood_time" id="mchat_flood_time" size="10" value="{MCHAT_FLOOD_TIME}" /></dd>
</dl>
<dl>
<dt><label for="mchat_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>
</dl>
<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>
</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_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_override_min_post_chars">{L_MCHAT_OVERRIDE_MIN_POST_CHARS}{L_COLON}</label><br />
<span>{L_MCHAT_OVERRIDE_MIN_POST_CHARS_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="mchat_override_min_post_chars" value="1"<!-- IF MCHAT_OVERRIDE_MIN_POST_CHARS --> id="mchat_override_min_post_chars" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="mchat_override_min_post_chars" value="0"<!-- IF not MCHAT_OVERRIDE_MIN_POST_CHARS --> id="mchat_override_min_post_chars" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="mchat_override_smilie_limit">{L_MCHAT_OVERRIDE_SMILIE_LIMIT}{L_COLON}</label><br />
<span>{L_MCHAT_OVERRIDE_SMILIE_LIMIT_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="mchat_override_smilie_limit" value="1"<!-- IF MCHAT_OVERRIDE_SMILIE_LIMIT --> id="mchat_override_smilie_limit" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="mchat_override_smilie_limit" value="0"<!-- IF not MCHAT_OVERRIDE_SMILIE_LIMIT --> id="mchat_override_smilie_limit" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
<dt><label for="mchat_max_message_lngth">{L_MCHAT_MAX_MESSAGE_LENGTH}{L_COLON}</label><br />
<span>{L_MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN}</span></dt>
<dd><input type="text" name="mchat_max_message_lngth" id="mchat_max_message_lngth" size="10" value="{MCHAT_MAX_MESSAGE_LNGTH}" /></dd>
</dl>
<dl>
<dt><label for="mchat_date">{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'){dE('custom_date',1);}else{dE('custom_date',-1);} if (this.value == 'custom') { document.getElementById('mchat_date').value = mchat_default_dateformat; } else { document.getElementById('mchat_date').value = this.value; }">
{S_MCHAT_DATEFORMAT_OPTIONS}
</select>
</dd>
<dd id="custom_date" style="display:none;"><input type="text" name="mchat_date" id="mchat_date" value="{MCHAT_DATE}" maxlength="30" class="inputbox narrow" style="margin-top: 3px;" /></dd>
</dl>
<dl>
<dt><label for="mchat_bbcode_disallowed">{L_MCHAT_BBCODES_DISALLOWED}{L_COLON}</label><br />
<span>{L_MCHAT_BBCODES_DISALLOWED_EXPLAIN}</span></dt>
<dd><textarea name="mchat_bbcode_disallowed" id="mchat_bbcode_disallowed" rows="3" cols="40">{MCHAT_BBCODE_DISALLOWED}</textarea></dd>
</dl>
<dl>
<dt><label for="mchat_rules">{L_ACP_MCHAT_RULES}{L_COLON}</label><br />
<span>{L_ACP_MCHAT_RULES_EXPLAIN}</span></dt>
<dd><textarea name="mchat_rules" id="mchat_rules" rows="8" cols="40">{MCHAT_RULES}</textarea></dd>
</dl>
</fieldset>
<fieldset>
<legend>{L_MCHAT_STATS}</legend>
<dl>
<dt><label for="mchat_whois">{L_MCHAT_WHOIS}{L_COLON}</label><br />
<span>{L_MCHAT_WHOIS_EXPLAIN}</span></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" size="10" value="{MCHAT_WHOIS_REFRESH}" /></dd>
</dl>
</fieldset>
<p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
{S_FORM_TOKEN}
</p>
</form>
<!-- INCLUDE overall_footer.html -->

View File

@@ -0,0 +1,51 @@
<form id="users_mchat" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_UCP_PROFILE_MCHAT}</legend>
<dl>
<dt><label for="mchat_index">{L_DISPLAY_MCHAT}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="user_mchat_index" value="1"<!-- IF DISPLAY_MCHAT --> id="mchat_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="user_mchat_index" value="0"<!-- IF not DISPLAY_MCHAT --> id="mchat_index" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
<dt><label for="mchat_sound">{L_SOUND_MCHAT}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="user_mchat_sound" value="1"<!-- IF SOUND_MCHAT --> id="mchat_sound" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="user_mchat_sound" value="0"<!-- IF not SOUND_MCHAT --> id="mchat_sound" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
<dt><label for="mchat_statsindex">{L_DISPLAY_STATS_INDEX}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="user_mchat_stats_index" value="1"<!-- IF STATS_MCHAT --> id="mchat_statsindex" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="user_mchat_stats_index" value="0"<!-- IF not STATS_MCHAT --> id="mchat_statsindex" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
<dt><label for="mchat_topics">{L_DISPLAY_NEW_TOPICS}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="user_mchat_topics" value="1"<!-- IF TOPICS_MCHAT --> id="mchat_topics" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="user_mchat_topics" value="0"<!-- IF not TOPICS_MCHAT --> id="mchat_topics" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
<dt><label for="mchat_avatars">{L_DISPLAY_AVATARS}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="user_mchat_avatars" value="1"<!-- IF AVATARS_MCHAT --> id="mchat_avatars" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="user_mchat_avatars" value="0"<!-- IF not AVATARS_MCHAT --> id="mchat_avatars" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<dl>
<dt><label for="mchat_input_type">{L_CHAT_AREA}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="user_mchat_input_area" value="1"<!-- IF INPUT_AREA --> id="mchat_input_type" checked="checked"<!-- ENDIF --> /> {L_INPUT_AREA}</label>
<label><input type="radio" name="user_mchat_input_area" value="0"<!-- IF not INPUT_AREA --> id=""mchat_input_type" checked="checked"<!-- ENDIF --> /> {L_TEXT_AREA}</label>
</dd>
</dl>
</fieldset>
<fieldset class="quick">
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
{S_FORM_TOKEN}
</fieldset>
</form>

32
composer.json Normal file
View File

@@ -0,0 +1,32 @@
{
"name": "dmzx/mchat",
"type": "phpbb-extension",
"description": "mChat Extension for phpbb 3.1.x",
"homepage": "http://www.dmzx-web.net",
"version": "0.0.1",
"time": "2015-03-10",
"keywords": ["phpbb", "extension", "mchat"],
"license": "GPL-2.0",
"authors": [
{
"name": "dmzx",
"homepage": "http://www.dmzx-web.net",
"email": "info@dmzx-web.net",
"role": "Extension Developer"
},
{
"name": "Rich McGirr",
"homepage": "http://rmcgirr83.org",
"role": "Author"
}
],
"require": {
"php": ">=5.3.3"
},
"extra": {
"display-name": "mChat Extension",
"soft-require": {
"phpbb/phpbb": "3.1.*"
}
}
}

3
config/routing.yml Normal file
View File

@@ -0,0 +1,3 @@
dmzx_mchat_controller:
path: /chat
defaults: { _controller: dmzx.mchat.controller:handle }

38
config/services.yml Normal file
View File

@@ -0,0 +1,38 @@
services:
dmzx.mchat.controller:
class: dmzx\mchat\controller\mchat
arguments:
- @dmzx.mchat.functions_mchat
- @config
- @controller.helper
- @template
- @user
- @auth
- @dbal.conn
- @cache
- @request
- %core.root_path%
- %core.php_ext%
- %core.table_prefix%
dmzx.mchat.functions_mchat:
class: dmzx\mchat\core\functions_mchat
arguments:
- @template
- @user
- @auth
- @dbal.conn
- @cache
- %core.table_prefix%
dmzx.mchat.listener:
class: dmzx\mchat\event\listener
arguments:
- @auth
- @config
- @template
- @user
- @dbal.conn
- @cache
- %core.root_path%
- %core.php_ext%
tags:
- { name: event.listener }

1054
controller/mchat.php Normal file

File diff suppressed because it is too large Load Diff

374
core/functions_mchat.php Normal file
View File

@@ -0,0 +1,374 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\core;
class functions_mchat
{
/**
* CONSTANTS SECTION
*
* To access them, you need to use the class.
*
*/
const MCHAT_CONFIG_TABLE = 'mchat_config';
const MCHAT_TABLE = 'mchat';
const MCHAT_SESSIONS_TABLE = 'mchat_sessions';
/**
* End of constants
*/
/** @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\cache\service */
protected $cache;
protected $table_prefix;
/**
* Constructor
*
* @param \phpbb\template\template $template
* @param \phpbb\user $user
* @param \phpbb\auth\auth $auth
* @param \phpbb\db\driver\driver_interface $db
* @param \phpbb\cache\service $cache
* @param $table_prefix
*/
public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $table_prefix)
{
$this->template = $template;
$this->user = $user;
$this->auth = $auth;
$this->db = $db;
$this->cache = $cache;
$this->table_prefix = $table_prefix;
}
// mchat_cache
/**
* builds the cache if it doesn't exist
*/
function mchat_cache()
{
// Grab the config entries in teh ACP...and cache em :P
if (($config_mchat = $this->cache->get('_mchat_config')) === false)
{
$sql = 'SELECT * FROM ' . $this->table_prefix . self::MCHAT_CONFIG_TABLE;
$result = $this->db->sql_query($sql);
$config_mchat = array();
while ($row = $this->db->sql_fetchrow($result))
{
$config_mchat[$row['config_name']] = $row['config_value'];
}
$this->db->sql_freeresult($result);
$this->cache->put('_mchat_config', $config_mchat);
}
}
// mchat_user_fix
/**
* @param $user_id the id of the user being deleted from the forum
*
*/
function mchat_user_fix($user_id)
{
$sql = 'UPDATE ' . $this->table_prefix . self::MCHAT_TABLE . '
SET user_id = ' . ANONYMOUS . '
WHERE user_id = ' . (int) $user_id;
$this->db->sql_query($sql);
return;
}
// mchat_session_time
/**
* @param $time the amount of time to display
*
*/
function mchat_session_time($time)
{
// fix the display of the time limit
// hours, minutes, seconds
$chat_session = '';
$chat_timeout = (int) $time;
$hours = $minutes = $seconds = 0;
if ($chat_timeout >= 3600)
{
$hours = floor($chat_timeout / 3600);
$chat_timeout = $chat_timeout - ($hours * 3600);
$chat_session .= $hours > 1 ? ($hours . '&nbsp;' . $this->user->lang['MCHAT_HOURS']) : ($hours . '&nbsp;' . $this->user->lang['MCHAT_HOUR']);
}
$minutes = floor($chat_timeout / 60);
if ($minutes)
{
$minutes = $minutes > 1 ? ($minutes . '&nbsp;' . $this->user->lang['MCHAT_MINUTES']) : ($minutes . '&nbsp;' . $this->user->lang['MCHAT_MINUTE']);
$chat_timeout = $chat_timeout - ($minutes * 60);
$chat_session .= $minutes;
}
$seconds = ceil($chat_timeout);
if ($seconds)
{
$seconds = $seconds > 1 ? ($seconds . '&nbsp;' . $this->user->lang['MCHAT_SECONDS']) : ($seconds . '&nbsp;' . $this->user->lang['MCHAT_SECOND']);
$chat_session .= $seconds;
}
return sprintf($this->user->lang['MCHAT_ONLINE_EXPLAIN'], $chat_session);
}
// mchat_users
/**
* @param $session_time amount of time before a users session times out
*/
function mchat_users($session_time, $on_page = false)
{
$check_time = time() - (int) $session_time;
$sql = 'DELETE FROM ' . $this->table_prefix . self::MCHAT_SESSIONS_TABLE . ' WHERE user_lastupdate < ' . $check_time;
$this->db->sql_query($sql);
// add the user into the sessions upon first visit
if($on_page && ($this->user->data['user_id'] != ANONYMOUS && !$this->user->data['is_bot']))
{
$this->mchat_sessions($session_time);
}
$mchat_user_count = 0;
$mchat_user_list = '';
$sql = 'SELECT m.user_id, u.username, u.user_type, u.user_allow_viewonline, u.user_colour
FROM ' . $this->table_prefix . self::MCHAT_SESSIONS_TABLE . ' m
LEFT JOIN ' . USERS_TABLE . ' u ON m.user_id = u.user_id
WHERE m.user_lastupdate > ' . $check_time . '
ORDER BY u.username ASC';
$result = $this->db->sql_query($sql);
$can_view_hidden = $this->auth->acl_get('u_viewonline');
while ($row = $this->db->sql_fetchrow($result))
{
if (!$row['user_allow_viewonline'])
{
if (!$can_view_hidden)
{
continue;
}
else
{
$row['username'] = '<em>' . $row['username'] . '</em>';
}
}
$mchat_user_count++;
$mchat_user_online_link = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $this->user->lang['GUEST']);
$mchat_user_list .= ($mchat_user_list != '') ? $this->user->lang['COMMA_SEPARATOR'] . $mchat_user_online_link : $mchat_user_online_link;
}
$this->db->sql_freeresult($result);
$refresh_message = $this->mchat_session_time($session_time);
if (!$mchat_user_count)
{
return array(
'online_userlist' => '',
'mchat_users_count' => $this->user->lang['MCHAT_NO_CHATTERS'],
'refresh_message' => $refresh_message,
);
}
else
{
return array(
'online_userlist' => $mchat_user_list,
'mchat_users_count' => $mchat_user_count > 1 ? sprintf($this->user->lang['MCHAT_ONLINE_USERS_TOTAL'], $mchat_user_count) : sprintf($this->user->lang['MCHAT_ONLINE_USER_TOTAL'], $mchat_user_count),
'refresh_message' => $refresh_message,
);
}
}
// mchat_sessions
/**
* @param mixed $session_time amount of time before a user is not shown as being in the chat
*/
function mchat_sessions($session_time)
{
$check_time = time() - (int) $session_time;
$sql = 'DELETE FROM ' . $this->table_prefix . self::MCHAT_SESSIONS_TABLE . ' WHERE user_lastupdate <' . $check_time;
$this->db->sql_query($sql);
// insert user into the mChat sessions table
if ($this->user->data['user_type'] == USER_FOUNDER || $this->user->data['user_type'] == USER_NORMAL)
{
$sql = 'SELECT * FROM ' . $this->table_prefix . self::MCHAT_SESSIONS_TABLE . ' WHERE user_id =' . (int) $this->user->data['user_id'];
$result = $this->db->sql_query($sql);
$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);
if (!$row)
{
$sql_ary = array(
'user_id' => $this->user->data['user_id'],
'user_lastupdate' => time(),
);
$sql = 'INSERT INTO ' . $this->table_prefix . self::MCHAT_SESSIONS_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
$this->db->sql_query($sql);
}
else
{
$sql_ary = array(
'user_lastupdate' => time(),
);
$sql = 'UPDATE ' . $this->table_prefix . self::MCHAT_SESSIONS_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id =' . (int) $this->user->data['user_id'];
$this->db->sql_query($sql);
}
}
return;
}
// mChat add-on Topic Notification
/**
* @param mixed $post_id limits deletion to a post_id in the forum
*/
function mchat_delete_topic($post_id)
{
if (!isset($post_id) || empty($post_id))
{
return;
}
$sql = 'DELETE FROM ' . $this->table_prefix . self::MCHAT_TABLE . ' WHERE post_id = ' . (int) $post_id;
$this->db->sql_query($sql);
return;
}
// mchat_prune
// AutoPrune Chats
/**
* @param mixed $mchat_prune_amount set from mchat config entry
*/
function mchat_prune($mchat_prune_amount)
{
// Run query to get the total message rows...
$sql = 'SELECT COUNT(message_id) AS total_messages FROM ' . $this->table_prefix . self::MCHAT_TABLE;
$result = $this->db->sql_query($sql);
$mchat_total_messages = (int) $this->db->sql_fetchfield('total_messages');
$this->db->sql_freeresult($result);
// count is below prune amount?
// do nothing
$prune = true;
if ($mchat_total_messages <= $mchat_prune_amount)
{
$prune = false;
}
if ($prune)
{
$result = $this->db->sql_query_limit('SELECT * FROM '. $this->table_prefix . self::MCHAT_TABLE . ' ORDER BY message_id ASC', 1);
$row = $this->db->sql_fetchrow($result);
$first_id = (int) $row['message_id'];
$this->db->sql_freeresult($result);
// compute the delete id
$delete_id = $mchat_total_messages - $mchat_prune_amount + $first_id;
// let's go delete them...if the message id is less than the delete id
$sql = 'DELETE FROM ' . $this->table_prefix . self::MCHAT_TABLE . '
WHERE message_id < ' . (int) $delete_id;
$this->db->sql_query($sql);
add_log('admin', 'LOG_MCHAT_TABLE_PRUNED');
}
// free up some memory...variable(s) are no longer needed.
unset($mchat_total_messages);
// return to what we were doing
return;
}
// display_mchat_bbcodes
// can't use the default phpBB one but
// most of code is from similar function
/**
* @param mixed $mchat_prune_amount set from mchat config entry
*/
function display_mchat_bbcodes()
{
// grab the bbcodes that aren't allowed
$config_mchat = $this->cache->get('_mchat_config');
$disallowed_bbcode_array = explode('|', strtoupper($config_mchat['bbcode_disallowed']));
preg_replace('#^(.*?)=#si','$1',$disallowed_bbcode_array);
$default_bbcodes = array('b','i','u','quote','code','list','img','url','size','color','email','flash');
// let's remove the default bbcodes
if (sizeof($disallowed_bbcode_array))
{
foreach ($default_bbcodes as $default_bbcode)
{
$default_bbcode = strtoupper($default_bbcode);
if (!in_array($default_bbcode, $disallowed_bbcode_array))
{
$this->template->assign_vars(array(
'S_MCHAT_BBCODE_'.$default_bbcode => true,
));
}
}
}
// now for the custom bbcodes
// Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing)
$num_predefined_bbcodes = 22;
$sql = 'SELECT bbcode_id, bbcode_tag, bbcode_helpline
FROM ' . BBCODES_TABLE . '
WHERE display_on_posting = 1
ORDER BY bbcode_tag';
$result = $this->db->sql_query($sql);
$i = 0;
while ($row = $this->db->sql_fetchrow($result))
{
$bbcode_tag_name = strtoupper($row['bbcode_tag']);
if (sizeof($disallowed_bbcode_array))
{
if (in_array($bbcode_tag_name, $disallowed_bbcode_array))
{
continue;
}
}
// If the helpline is defined within the language file, we will use the localised version, else just use the database entry...
if (isset($this->user->lang[strtoupper($row['bbcode_helpline'])]))
{
$row['bbcode_helpline'] = $this->user->lang[strtoupper($row['bbcode_helpline'])];
}
$this->template->assign_block_vars('custom_tags', array(
'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2),
'BBCODE_TAG' => $row['bbcode_tag'],
'BBCODE_HELPLINE' => $row['bbcode_helpline'],
'A_BBCODE_HELPLINE' => str_replace(array('&amp;', '&quot;', "'", '&lt;', '&gt;'), array('&', '"', "\'", '<', '>'), $row['bbcode_helpline']),
));
$i++;
}
$this->db->sql_freeresult($result);
}
}

59
event/listener.php Normal file
View File

@@ -0,0 +1,59 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\event;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class listener implements EventSubscriberInterface
{
protected $config;
protected $template;
protected $user;
protected $db;
protected $root_path;
protected $php_ext;
public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\template\template $template, \phpbb\user $user, \phpbb\db\driver\driver_interface $db, $root_path, $php_ext, $auth)
{
$this->config = $config;
$this->template = $template;
$this->user = $user;
$this->db = $db;
$this->root_path = $root_path;
$this->php_ext = $php_ext;
$this->auth = $auth;
}
static public function getSubscribedEvents()
{
return array(
'core.user_setup' => 'load_language_on_setup',
);
}
public function load_language_on_setup($event)
{
$lang_set_ext = $event['lang_set_ext'];
$lang_set_ext[] = array(
'ext_name' => 'dmzx/mchat',
'lang_set' => 'common',
);
$event['lang_set_ext'] = $lang_set_ext;
}
}

18
ext.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat;
/**
* @ignore
*/
class ext extends \phpbb\extension\base
{
}

235
language/en/common.php Normal file
View File

@@ -0,0 +1,235 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* DO NOT CHANGE!
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (empty($lang) || !is_array($lang))
{
$lang = array();
}
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
// Adding new category
$lang['permission_cat']['mchat'] = 'mChat';
// Adding the permissions
$lang = array_merge($lang, array(
'MCHAT_TITLE' => 'Mini-Chat',
'MCHAT_ADD' => 'Send',
'MCHAT_ANNOUNCEMENT' => 'Announcement',
'MCHAT_ARCHIVE' => 'Archive',
'MCHAT_ARCHIVE_PAGE' => 'Mini-Chat Archive',
'MCHAT_BBCODES' => 'BBCodes',
'MCHAT_CLEAN' => 'Purge',
'MCHAT_CLEANED' => 'All messages have been successfully removed',
'MCHAT_CLEAR_INPUT' => 'Reset',
'MCHAT_COPYRIGHT' => '<a href="http://rmcgirr83.org">RMcGirr83</a> &copy; <a href="http://www.dmzx-web.net" title="www.dmzx-web.net">dmzx</a>',
'MCHAT_CUSTOM_BBCODES' => 'Custom BBCodes',
'MCHAT_DELALLMESS' => 'Remove all messages?',
'MCHAT_DELCONFIRM' => 'Do you confirm removal?',
'MCHAT_DELITE' => 'Delete',
'MCHAT_EDIT' => 'Edit',
'MCHAT_EDITINFO' => 'Edit the message and click OK',
'MCHAT_ENABLE' => 'Sorry, the Mini-Chat is currently unavailable',
'MCHAT_ERROR' => 'Error',
'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_HELP' => 'mChat Rules',
'MCHAT_HIDE_LIST' => 'Hide List',
'MCHAT_HOUR' => 'hour ',
'MCHAT_HOURS' => 'hours',
'MCHAT_IP' => 'IP whois for',
'MCHAT_MINUTE' => 'minute ',
'MCHAT_MINUTES' => 'minutes ',
'MCHAT_MESS_LONG' => 'Your message is too long.\nPlease limit it to %s characters',
'MCHAT_NO_CUSTOM_PAGE' => 'The mChat custom page is not activated at this time!',
'MCHAT_NOACCESS' => 'You dont have permission to post in the mChat',
'MCHAT_NOACCESS_ARCHIVE' => 'You dont have permission to view the archive',
'MCHAT_NOJAVASCRIPT' => 'Your browser does not support JavaScript or JavaScript is disabled',
'MCHAT_NOMESSAGE' => 'No messages',
'MCHAT_NOMESSAGEINPUT' => 'You have not entered a message',
'MCHAT_NOSMILE' => 'Smilies not found',
'MCHAT_NOTINSTALLED_USER' => 'mChat is not installed. Please notify the board founder.',
'MCHAT_NOT_INSTALLED' => 'mChat database entries are missing.<br />Please run the %sinstaller%s to make the database changes for the modification.',
'MCHAT_OK' => 'OK',
'MCHAT_PAUSE' => 'Paused',
'MCHAT_LOAD' => 'Loading',
'MCHAT_PERMISSIONS' => 'Change users permissions',
'MCHAT_REFRESHING' => 'Refreshing...',
'MCHAT_REFRESH_NO' => 'Autoupdate is off',
'MCHAT_REFRESH_YES' => 'Autoupdate every <strong>%d</strong> seconds',
'MCHAT_RESPOND' => 'Respond to user',
'MCHAT_RESET_QUESTION' => 'Clear the input area?',
'MCHAT_SESSION_OUT' => 'Chat session has expired',
'MCHAT_SHOW_LIST' => 'Show List',
'MCHAT_SECOND' => 'second ',
'MCHAT_SECONDS' => 'seconds ',
'MCHAT_SESSION_ENDS' => 'Chat session ends in',
'MCHAT_SMILES' => 'Smilies',
'MCHAT_TOTALMESSAGES' => 'Total messages: <strong>%s</strong>',
'MCHAT_USESOUND' => 'Use sound?',
'MCHAT_ONLINE_USERS_TOTAL' => 'In total there are <strong>%d</strong> users chatting ',
'MCHAT_ONLINE_USER_TOTAL' => 'In total there is <strong>%d</strong> user chatting ',
'MCHAT_NO_CHATTERS' => 'No one is chatting',
'MCHAT_ONLINE_EXPLAIN' => 'based on users active over the past %s',
'WHO_IS_CHATTING' => 'Who is chatting',
'WHO_IS_REFRESH_EXPLAIN' => 'Refreshes every <strong>%d</strong> seconds',
'MCHAT_NEW_TOPIC' => '<strong>New Topic</strong>',
'MCHAT_NEW_REPLY' => '<strong>New Reply</strong>',
// UCP
'UCP_PROFILE_MCHAT' => 'mChat Preferences',
'DISPLAY_MCHAT' => 'Display mChat on Index',
'SOUND_MCHAT' => 'Enable mChat sound',
'DISPLAY_STATS_INDEX' => 'Display the Who is Chatting stats on index page',
'DISPLAY_NEW_TOPICS' => 'Display new topics in the chat',
'DISPLAY_AVATARS' => 'Display avatars in the chat',
'CHAT_AREA' => 'Input type',
'CHAT_AREA_EXPLAIN' => 'Choose which type of area to use to input a chat:<br />A text area or<br />an input area',
'INPUT_AREA' => 'Input area',
'TEXT_AREA' => 'Text area',
// ACP
'ACP_MCHAT_RULES_EXPLAIN' => 'Enter the rules of the forum here. Each rule on a new line.<br />You are limited to 255 characters.<br /><strong>This message can be translated.</strong> (you must edit the mchat_lang.php file and read the instructions).',
'LOG_MCHAT_CONFIG_UPDATE' => '<strong>Updated mChat config </strong>',
'MCHAT_CONFIG_SAVED' => 'Mini Chat configuration has been updated',
'MCHAT_TITLE' => 'Mini-Chat',
'MCHAT_VERSION' => 'Version:',
'MCHAT_ENABLE' => 'Enable mChat Extension',
'MCHAT_ENABLE_EXPLAIN' => 'Enable or disable the extension globally.',
'MCHAT_AVATARS' => 'Display avatars',
'MCHAT_AVATARS_EXPLAIN' => 'If set yes, resized user avatars will be displayed',
'MCHAT_ON_INDEX' => 'mChat On Index',
'MCHAT_ON_INDEX_EXPLAIN' => 'Allow the display of the 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 of the forum.<br /><em>You are limited from 50 to 1000</em>.',
'MCHAT_LOCATION' => 'Location on Forum',
'MCHAT_LOCATION_EXPLAIN' => 'Choose the location of the mChat on the index page.',
'MCHAT_TOP_OF_FORUM' => 'Top of Forum',
'MCHAT_BOTTOM_OF_FORUM' => 'Bottom of Forum',
'MCHAT_REFRESH' => 'Refresh',
'MCHAT_REFRESH_EXPLAIN' => 'Number of seconds before chat automatically refreshes.<br /><em>You are limited from 5 to 60 seconds</em>.',
'MCHAT_PRUNE' => 'Enable Prune',
'MCHAT_PRUNE_EXPLAIN' => 'Set to yes to enable the prune feature.<br /><em>Only occurs if a user views the custom or archive pages</em>.',
'MCHAT_PRUNE_NUM' => 'Prune Number',
'MCHAT_PRUNE_NUM_EXPLAIN' => 'The number of messages to retain in the chat.',
'MCHAT_MESSAGE_LIMIT' => 'Message limit',
'MCHAT_MESSAGE_LIMIT_EXPLAIN' => 'The maximum number of messages to show in the chat area.<br /><em>Recommended from 10 to 30</em>.',
'MCHAT_MESSAGE_NUM' => 'Index page message limit',
'MCHAT_MESSAGE_NUM_EXPLAIN' => 'The maximum number of messages to show in the chat area on the index page.<br /><em>Recommended from 10 to 50</em>.',
'MCHAT_ARCHIVE_LIMIT' => 'Archive limit',
'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_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_MAX_MESSAGE_LENGTH' => 'Max message length',
'MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN' => 'Max number of characters allowed per message posted.<br /><em>Recommended from 100 to 500, set to 0 to disable</em>.',
'MCHAT_CUSTOM_PAGE' => '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 seperate mChat 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_WHOIS' => 'Whois',
'MCHAT_WHOIS_EXPLAIN' => 'Allow a display of users who are chatting',
'MCHAT_WHOIS_REFRESH' => 'Whois refresh',
'MCHAT_WHOIS_REFRESH_EXPLAIN' => 'Number of seconds before whois stats refreshes.<br /><em>You are limited from 30 to 300 seconds</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 %scustom bbcode tag name%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. You are limited to 255 characters.<br /><strong>This message can be translated.</strong> (you must edit the mchat_lang.php file and read the instructions).',
'MCHAT_USER_TIMEOUT' => 'User Timeout',
'MCHAT_USER_TIMEOUT_EXPLAIN' => 'Set the amount of time, in seconds, until a users session in the chat ends. Set to 0 for no timeout.<br /><em>You are limited to the %sforum config setting for sessions%s which is currently set to %s 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' => 'Display New Posts',
'MCHAT_NEW_POSTS_EXPLAIN' => 'Set to yes to allow new posts from the forum to be posted into the chat message area<br /><strong>You must have the add-on for new post notifications installed</strong> (within the contrib directory of the extension download).',
'MCHAT_MAIN' => 'Main Configuration',
'MCHAT_STATS' => 'Whois Chatting',
'MCHAT_STATS_INDEX' => 'Stats on Index',
'MCHAT_STATS_INDEX_EXPLAIN' => 'Show who is chatting with in the stats section of the forum',
'MCHAT_MESSAGES' => 'Message Settings',
'MCHAT_PAUSE_ON_INPUT' => 'Pause on input',
'MCHAT_PAUSE_ON_INPUT_EXPLAIN' => 'If set Yes, then the chat will not autoupdate upon a user entering a message in the input area',
// error reporting
'MCHAT_NEEDS_UPDATING' => 'The mChat extension needs updating. Please have a forum founder visit this section to run the installer.',
'MCHAT_WRONG_VERSION' => 'The wrong version of the extension is installed. Please run the %sinstaller%s for the new version of the modification.',
'WARNING' => 'Warning',
'TOO_LONG_DATE' => 'The date format you entered is too long.',
'TOO_SHORT_DATE' => 'The date format you entered is too short.',
'TOO_SMALL_REFRESH' => 'The refresh value is too small.',
'TOO_LARGE_REFRESH' => 'The refresh value is too large.',
'TOO_SMALL_MESSAGE_LIMIT' => 'The message limit value is too small.',
'TOO_LARGE_MESSAGE_LIMIT' => 'The message limit value is too large.',
'TOO_SMALL_ARCHIVE_LIMIT' => 'The archive limit value is too small.',
'TOO_LARGE_ARCHIVE_LIMIT' => 'The archive limit value is too large.',
'TOO_SMALL_FLOOD_TIME' => 'The flood time value is too small.',
'TOO_LARGE_FLOOD_TIME' => 'The flood time value is too large.',
'TOO_SMALL_MAX_MESSAGE_LNGTH' => 'The max message length value is too small.',
'TOO_LARGE_MAX_MESSAGE_LNGTH' => 'The max message length value is too large.',
'TOO_SMALL_MAX_WORDS_LNGTH' => 'The max words length value is too small.',
'TOO_LARGE_MAX_WORDS_LNGTH' => 'The max words length value is too large.',
'TOO_SMALL_WHOIS_REFRESH' => 'The whois refresh value is too small.',
'TOO_LARGE_WHOIS_REFRESH' => 'The whois refresh value is too large.',
'TOO_SMALL_INDEX_HEIGHT' => 'The index height value is too small.',
'TOO_LARGE_INDEX_HEIGHT' => 'The index height value is too large.',
'TOO_SMALL_CUSTOM_HEIGHT' => 'The custom height value is too small.',
'TOO_LARGE_CUSTOM_HEIGHT' => 'The custom height value is too large.',
'TOO_SHORT_STATIC_MESSAGE' => 'The static message value is too short.',
'TOO_LONG_STATIC_MESSAGE' => 'The static message value is too long.',
'TOO_SMALL_TIMEOUT' => 'The user timeout value is too small.',
'TOO_LARGE_TIMEOUT' => 'The user timeout value is too large.',
'UCP_CAT_MCHAT' => 'mChat',
'UCP_MCHAT_CONFIG' => 'mChat', //Preferences
'LOG_MCHAT_TABLE_PRUNED' => 'mChat Table was pruned',
'ACP_USER_MCHAT' => 'mChat Settings',
'LOG_DELETED_MCHAT' => '<strong>Deleted mChat message</strong><br />» %1$s',
'LOG_EDITED_MCHAT' => '<strong>Edited mChat message</strong><br />» %1$s',
'MCHAT_MESSAGE_LNGTH_EXPLAIN' => 'Characters remaining: <span class="charsLeft error"><strong>%d</strong></span>',
'MCHAT_TOP_POSTERS' => 'Top Spammers',
'MCHAT_NEW_CHAT' => 'New Chat Message!',
'FONT_COLOR' => 'Font colour',
'FONT_COLOR_HIDE' => 'Hide font colour',
'FONT_HUGE' => 'Huge',
'FONT_LARGE' => 'Large',
'FONT_NORMAL' => 'Normal',
'FONT_SIZE' => 'Font size',
'FONT_SMALL' => 'Small',
'FONT_TINY' => 'Tiny',
'MCHAT_SEND_PM' => 'Send Private Message',
'MCHAT_PM' => '(PM)',
'MORE_SMILIES' => 'More Smilies',
));

View File

@@ -0,0 +1,159 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
if (!defined('IN_PHPBB'))
{
exit;
}
if (empty($lang) || !is_array($lang))
{
$lang = array();
}
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters for use
// » “ ” …
$lang = array_merge($lang, array(
// UMIL stuff
'ACP_MCHAT_CONFIG' => 'Configuration',
'ACP_CAT_MCHAT' => 'mChat',
'ACP_MCHAT_TITLE' => 'Mini-Chat',
'ACP_MCHAT_TITLE_EXPLAIN' => 'A mini chat (aka “shout box”) for your forum',
'MCHAT_TABLE_DELETED' => 'The mChat table was successfully deleted',
'MCHAT_TABLE_CREATED' => 'The mChat table was successfully created',
'MCHAT_TABLE_UPDATED' => 'The mChat table was successfully updated',
'MCHAT_NOTHING_TO_UPDATE' => 'Nothing to do....continuing',
'UCP_CAT_MCHAT' => 'mChat Prefs',
'UCP_MCHAT_CONFIG' => 'User mChat Prefs',
// ACP entries
'ACP_MCHAT_RULES' => 'Rules',
'ACP_MCHAT_RULES_EXPLAIN' => 'Enter the rules of the forum here. Each rule on a new line.<br />You are limited to 255 characters.<br /><strong>This message can be translated.</strong> (you must edit the mchat_lang.php file and read the instructions).',
'LOG_MCHAT_CONFIG_UPDATE' => '<strong>Updated mChat config </strong>',
'MCHAT_CONFIG_SAVED' => 'Mini Chat configuration has been updated',
'MCHAT_TITLE' => 'Mini-Chat',
'MCHAT_VERSION' => 'Version:',
'MCHAT_ENABLE' => 'Enable mChat Extension',
'MCHAT_ENABLE_EXPLAIN' => 'Enable or disable the extension globally.',
'MCHAT_AVATARS' => 'Display avatars',
'MCHAT_AVATARS_EXPLAIN' => 'If set yes, resized user avatars will be displayed',
'MCHAT_ON_INDEX' => 'mChat On Index',
'MCHAT_ON_INDEX_EXPLAIN' => 'Allow the display of the 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 of the forum.<br /><em>You are limited from 50 to 1000</em>.',
'MCHAT_LOCATION' => 'Location on Forum',
'MCHAT_LOCATION_EXPLAIN' => 'Choose the location of the mChat on the index page.',
'MCHAT_TOP_OF_FORUM' => 'Top of Forum',
'MCHAT_BOTTOM_OF_FORUM' => 'Bottom of Forum',
'MCHAT_REFRESH' => 'Refresh',
'MCHAT_REFRESH_EXPLAIN' => 'Number of seconds before chat automatically refreshes.<br /><em>You are limited from 5 to 60 seconds</em>.',
'MCHAT_PRUNE' => 'Enable Prune',
'MCHAT_PRUNE_EXPLAIN' => 'Set to yes to enable the prune feature.<br /><em>Only occurs if a user views the custom or archive pages</em>.',
'MCHAT_PRUNE_NUM' => 'Prune Number',
'MCHAT_PRUNE_NUM_EXPLAIN' => 'The number of messages to retain in the chat.',
'MCHAT_MESSAGE_LIMIT' => 'Message limit',
'MCHAT_MESSAGE_LIMIT_EXPLAIN' => 'The maximum number of messages to show in the chat area.<br /><em>Recommended from 10 to 30</em>.',
'MCHAT_MESSAGE_NUM' => 'Index page message limit',
'MCHAT_MESSAGE_NUM_EXPLAIN' => 'The maximum number of messages to show in the chat area on the index page.<br /><em>Recommended from 10 to 50</em>.',
'MCHAT_ARCHIVE_LIMIT' => 'Archive limit',
'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_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_MAX_MESSAGE_LENGTH' => 'Max message length',
'MCHAT_MAX_MESSAGE_LENGTH_EXPLAIN' => 'Max number of characters allowed per message posted.<br /><em>Recommended from 100 to 500, set to 0 to disable</em>.',
'MCHAT_CUSTOM_PAGE' => '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 seperate mChat 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_WHOIS' => 'Whois',
'MCHAT_WHOIS_EXPLAIN' => 'Allow a display of users who are chatting',
'MCHAT_WHOIS_REFRESH' => 'Whois refresh',
'MCHAT_WHOIS_REFRESH_EXPLAIN' => 'Number of seconds before whois stats refreshes.<br /><em>You are limited from 30 to 300 seconds</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 %scustom bbcode tag name%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. You are limited to 255 characters.<br /><strong>This message can be translated.</strong> (you must edit the mchat_lang.php file and read the instructions).',
'MCHAT_USER_TIMEOUT' => 'User Timeout',
'MCHAT_USER_TIMEOUT_EXPLAIN' => 'Set the amount of time, in seconds, until a users session in the chat ends. Set to 0 for no timeout.<br /><em>You are limited to the %sforum config setting for sessions%s which is currently set to %s 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' => 'Display New Posts',
'MCHAT_NEW_POSTS_EXPLAIN' => 'Set to yes to allow new posts from the forum to be posted into the chat message area<br /><strong>You must have the add-on for new post notifications installed</strong> (within the contrib directory of the extension download).',
'MCHAT_MAIN' => 'Main Configuration',
'MCHAT_STATS' => 'Whois Chatting',
'MCHAT_STATS_INDEX' => 'Stats on Index',
'MCHAT_STATS_INDEX_EXPLAIN' => 'Show who is chatting with in the stats section of the forum',
'MCHAT_MESSAGES' => 'Message Settings',
'MCHAT_PAUSE_ON_INPUT' => 'Pause on input',
'MCHAT_PAUSE_ON_INPUT_EXPLAIN' => 'If set Yes, then the chat will not autoupdate upon a user entering a message in the input area',
// error reporting
'MCHAT_NEEDS_UPDATING' => 'The mChat extension needs updating. Please have a forum founder visit this section to run the installer.',
'MCHAT_WRONG_VERSION' => 'The wrong version of the extension is installed. Please run the %sinstaller%s for the new version of the modification.',
'WARNING' => 'Warning',
'TOO_LONG_DATE' => 'The date format you entered is too long.',
'TOO_SHORT_DATE' => 'The date format you entered is too short.',
'TOO_SMALL_REFRESH' => 'The refresh value is too small.',
'TOO_LARGE_REFRESH' => 'The refresh value is too large.',
'TOO_SMALL_MESSAGE_LIMIT' => 'The message limit value is too small.',
'TOO_LARGE_MESSAGE_LIMIT' => 'The message limit value is too large.',
'TOO_SMALL_ARCHIVE_LIMIT' => 'The archive limit value is too small.',
'TOO_LARGE_ARCHIVE_LIMIT' => 'The archive limit value is too large.',
'TOO_SMALL_FLOOD_TIME' => 'The flood time value is too small.',
'TOO_LARGE_FLOOD_TIME' => 'The flood time value is too large.',
'TOO_SMALL_MAX_MESSAGE_LNGTH' => 'The max message length value is too small.',
'TOO_LARGE_MAX_MESSAGE_LNGTH' => 'The max message length value is too large.',
'TOO_SMALL_MAX_WORDS_LNGTH' => 'The max words length value is too small.',
'TOO_LARGE_MAX_WORDS_LNGTH' => 'The max words length value is too large.',
'TOO_SMALL_WHOIS_REFRESH' => 'The whois refresh value is too small.',
'TOO_LARGE_WHOIS_REFRESH' => 'The whois refresh value is too large.',
'TOO_SMALL_INDEX_HEIGHT' => 'The index height value is too small.',
'TOO_LARGE_INDEX_HEIGHT' => 'The index height value is too large.',
'TOO_SMALL_CUSTOM_HEIGHT' => 'The custom height value is too small.',
'TOO_LARGE_CUSTOM_HEIGHT' => 'The custom height value is too large.',
'TOO_SHORT_STATIC_MESSAGE' => 'The static message value is too short.',
'TOO_LONG_STATIC_MESSAGE' => 'The static message value is too long.',
'TOO_SMALL_TIMEOUT' => 'The user timeout value is too small.',
'TOO_LARGE_TIMEOUT' => 'The user timeout value is too large.',
// User perms
'ACL_U_MCHAT_USE' => 'Can use mChat mchat',
'ACL_U_MCHAT_VIEW' => 'Can view mChat mchat',
'ACL_U_MCHAT_EDIT' => 'Can edit mChat messages mchat',
'ACL_U_MCHAT_DELETE' => 'Can delete mChat messages mchat',
'ACL_U_MCHAT_IP' => 'Can use view mChat IP addresses mchat',
'ACL_U_MCHAT_FLOOD_IGNORE' => 'Can ignore mChat flood mchat',
'ACL_U_MCHAT_ARCHIVE' => 'Can view the Archive mchat',
'ACL_U_MCHAT_BBCODE' => 'Can use bbcode in mChat mchat',
'ACL_U_MCHAT_SMILIES' => 'Can use smilies in mChat mchat',
'ACL_U_MCHAT_URLS' => 'Can post urls in mChat mchat',
// Admin perms
'ACL_A_MCHAT' => array('lang' => 'Can manage mChat settings', 'cat' => 'permissions'), // Using a phpBB category here
));

339
license.txt Normal file
View File

@@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@@ -0,0 +1,29 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
class mchat_module extends \phpbb\db\migration\migration
{
public function update_data()
{
return array(
array('module.add', array('acp', 'ACP_CAT_DOT_MODS', 'ACP_CAT_MCHAT')),
array('module.add', array(
'acp', 'ACP_CAT_MCHAT', array(
'module_basename' => '\dmzx\mchat\acp\acp_mchat_module',
'modes' => array('configuration'),
'module_auth' => 'a_mchat',
),
)),
);
}
}

View File

@@ -0,0 +1,30 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
class mchat_module1 extends \phpbb\db\migration\migration
{
public function update_data()
{
return array(
array('module.add', array('ucp', 'UCP_MAIN', 'UCP_MCHAT_CONFIG')),
array('module.add', array(
'ucp', 'UCP_MCHAT_CONFIG', array(
'module_basename' => '\dmzx\mchat\ucp\ucp_mchat_module',
'modes' => array('configuration'),
'module_auth' => 'acl_u_mchat_use',
))),
);
}
}

View File

@@ -0,0 +1,84 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
class mchat_schema extends \phpbb\db\migration\migration
{
public function update_data()
{
return array(
// Add configs
array('config.add', array('mchat_enable', true)),
array('config.add', array('mchat_on_index', true)),
array('config.add', array('mchat_new_posts', false)),
array('config.add', array('mchat_stats_index', false)),
array('config.add', array('mchat_version','0.0.1')),
array('permission.add', array('u_mchat_use')),
array('permission.add', array('u_mchat_view')),
array('permission.add', array('u_mchat_edit')),
array('permission.add', array('u_mchat_delete')),
array('permission.add', array('u_mchat_ip')),
array('permission.add', array('u_mchat_flood_ignore')),
array('permission.add', array('u_mchat_archive')),
array('permission.add', array('u_mchat_bbcode')),
array('permission.add', array('u_mchat_smilies')),
array('permission.add', array('u_mchat_urls')),
array('permission.add', array('a_mchat')),
// 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_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_archive', 'group')),
array('permission.permission_set', array('REGISTERED', 'u_mchat_bbcode', 'group')),
array('permission.permission_set', array('REGISTERED', 'u_mchat_smilies', 'group')),
array('permission.permission_set', array('REGISTERED', 'u_mchat_urls', 'group')),
);
}
public function update_schema()
{
return array(
'add_tables' => array(
$this->table_prefix . 'mchat_config' => array(
'COLUMNS' => array(
'config_name' => array('VCHAR', ''),
'config_value' => array('VCHAR', ''),
),
'PRIMARY_KEY' => 'config_name',
),
),
);
}
public function revert_schema()
{
return array(
'drop_tables' => array(
$this->table_prefix . 'mchat_config',
),
);
}
}

View File

@@ -0,0 +1,52 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
class mchat_schema_2 extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\dmzx\mchat\migrations\mchat_schema',
);
}
public function update_schema()
{
return array(
'add_tables' => array(
$this->table_prefix . 'mchat' => array(
'COLUMNS' => array(
'message_id' => array('UINT', NULL, 'auto_increment'),
'user_id' => array('UINT', 0),
'user_ip' => array('VCHAR:40', ''),
'message' => array('MTEXT_UNI', ''),
'bbcode_bitfield' => array('VCHAR', ''),
'bbcode_uid' => array('VCHAR:8', ''),
'bbcode_options' => array('BOOL', '7'),
'message_time' => array('INT:11', 0),
'forum_id' => array('UINT', 0),
'post_id' => array('UINT', 0),
),
'PRIMARY_KEY' => 'message_id',
),
),
);
}
public function revert_schema()
{
return array(
'drop_tables' => array(
$this->table_prefix . 'mchat',
),
);
}
}

View File

@@ -0,0 +1,132 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
class mchat_schema_3 extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\dmzx\mchat\migrations\mchat_schema_2',
);
}
public function update_data()
{
return array(
array('custom', array(array($this, 'insert_sample_data'))),
);
}
public function insert_sample_data()
{
global $user;
// Define sample rule data
$sample_data = array(
array(
'config_name' => 'refresh',
'config_value' => '10',
),
array(
'config_name' => 'message_limit',
'config_value' => '10',
),
array(
'config_name' => 'archive_limit',
'config_value' => '25',
),
array(
'config_name' => 'flood_time',
'config_value' => '20',
),
array(
'config_name' => 'max_message_lngth',
'config_value' => '500',
),
array(
'config_name' => 'custom_page',
'config_value' => '1',
),
array(
'config_name' => 'date',
'config_value' => 'D M d, Y g:i a',
),
array(
'config_name' => 'whois',
'config_value' => '0',
),
array(
'config_name' => 'bbcode_disallowed',
'config_value' => '',
),
array(
'config_name' => 'prune_enable',
'config_value' => '0',
),
array(
'config_name' => 'prune_num',
'config_value' => '0',
),
array(
'config_name' => 'location',
'config_value' => '1',
),
array(
'config_name' => 'whois_refresh',
'config_value' => '30',
),
array(
'config_name' => 'static_message',
'config_value' => '',
),
array(
'config_name' => 'index_height',
'config_value' => '250',
),
array(
'config_name' => 'custom_height',
'config_value' => '350',
),
array(
'config_name' => 'override_min_post_chars',
'config_value' => '0',
),
array(
'config_name' => 'timeout',
'config_value' => '0',
),
array(
'config_name' => 'override_smilie_limit',
'config_value' => '0',
),
array(
'config_name' => 'pause_on_input',
'config_value' => '0',
),
array(
'config_name' => 'rules',
'config_value' => '',
),
array(
'config_name' => 'avatars',
'config_value' => '0',
),
array(
'config_name' => 'message_num',
'config_value' => '10',
),
);
// Insert sample PM data
$this->db->sql_multi_insert($this->table_prefix . 'mchat_config', $sample_data);
}
}

View File

@@ -0,0 +1,36 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
class mchat_schema_4 extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\dmzx\mchat\migrations\mchat_schema_3',
);
}
public function update_schema()
{
return array(
'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_input_area' => array('BOOL', '1'),
),
),
);
}
}

View File

@@ -0,0 +1,45 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
class mchat_schema_5 extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\dmzx\mchat\migrations\mchat_schema_4',
);
}
public function update_schema()
{
return array(
'add_tables' => array(
$this->table_prefix . 'mchat_sessions' => array(
'COLUMNS' => array(
'user_id' => array('UINT', 0),
'user_lastupdate' => array('TIMESTAMP', 0),
'user_ip' => array('VCHAR:40', ''),
),
'PRIMARY_KEY' => 'user_id',
),
),
);
}
public function revert_schema()
{
return array(
'drop_tables' => array(
$this->table_prefix . 'mchat_sessions',
),
);
}
}

View File

@@ -0,0 +1,47 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\migrations;
class mchat_schema_6 extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return array(
'\dmzx\mchat\migrations\mchat_schema_5',
);
}
public function update_data()
{
return array(
array('module.add', array('acp', 'ACP_CAT_USERS', array(
'module_basename' => 'users',
'module_enabled' => 1,
'module_display' => 0,
'module_langname' => 'ACP_USER_MCHAT',
'module_mode' => 'mchat',
'module_auth' => 'acl_a_user',
),
),
// First, lets add a new category named UCP_CAT_MCHAT
array('ucp', false, 'UCP_CAT_MCHAT'),
// next let's add our module
array('ucp', 'UCP_CAT_MCHAT', array(
'module_basename' => 'mchat',
'modes' => array('configuration'),
'module_auth' => 'u_mchat_use',
),
),
),
);
}
}

View File

@@ -0,0 +1,465 @@
/**
* bbCode control by subBlue design [ www.subBlue.com ]
* Includes unixsafe colour palette selector by SHS`
*/
// Startup variables
var imageTag = false;
var theSelection = false;
var bbcodeEnabled = true;
// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version
var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
var baseHeight;
/**
* Shows the help messages in the helpline window
*/
function helpline(help)
{
document.forms[form_name].helpbox.value = help_line[help];
}
/**
* Fix a bug involving the TextRange object. From
* http://www.frostjedi.com/terra/scripts/demo/caretBug.html
*/
function initInsertions()
{
var doc;
if (document.forms[form_name])
{
doc = document;
}
else
{
doc = opener.document;
}
var textarea = doc.forms[form_name].elements[text_name];
if (is_ie && typeof(baseHeight) != 'number')
{
/* === mChat focus fix Start === */
var mChatFocus = window.mChatFocusFix || false;
if(!mChatFocus)
{
textarea.focus();
}
baseHeight = doc.selection.createRange().duplicate().boundingHeight;
/* ==== mChat focus fix End ==== */
if (!document.forms[form_name])
{
document.body.focus();
}
}
}
/**
* bbstyle
*/
function bbstyle(bbnumber)
{
if (bbnumber != -1)
{
bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1]);
}
else
{
insert_text('[*]');
document.forms[form_name].elements[text_name].focus();
}
}
/**
* Apply bbcodes
*/
function bbfontstyle(bbopen, bbclose)
{
theSelection = false;
var textarea = document.forms[form_name].elements[text_name];
textarea.focus();
if ((clientVer >= 4) && is_ie && is_win)
{
// Get text selection
theSelection = document.selection.createRange().text;
if (theSelection)
{
// Add tags around selection
document.selection.createRange().text = bbopen + theSelection + bbclose;
document.forms[form_name].elements[text_name].focus();
theSelection = '';
return;
}
}
else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0))
{
mozWrap(document.forms[form_name].elements[text_name], bbopen, bbclose);
document.forms[form_name].elements[text_name].focus();
theSelection = '';
return;
}
//The new position for the cursor after adding the bbcode
var caret_pos = getCaretPosition(textarea).start;
var new_pos = caret_pos + bbopen.length;
// Open tag
insert_text(bbopen + bbclose);
// Center the cursor when we don't have a selection
// Gecko and proper browsers
if (!isNaN(textarea.selectionStart))
{
textarea.selectionStart = new_pos;
textarea.selectionEnd = new_pos;
}
// IE
else if (document.selection)
{
var range = textarea.createTextRange();
range.move("character", new_pos);
range.select();
storeCaret(textarea);
}
textarea.focus();
return;
}
/**
* Insert text at position
*/
function insert_text(text, spaces, popup)
{
var textarea;
if (!popup)
{
textarea = document.forms[form_name].elements[text_name];
}
else
{
textarea = opener.document.forms[form_name].elements[text_name];
}
if (spaces)
{
text = ' ' + text + ' ';
}
// Since IE9, IE also has textarea.selectionStart, but it still needs to be treated the old way.
// Therefore we simply add a !is_ie here until IE fixes the text-selection completely.
if (!isNaN(textarea.selectionStart) && !is_ie)
{
var sel_start = textarea.selectionStart;
var sel_end = textarea.selectionEnd;
mozWrap(textarea, text, '');
textarea.selectionStart = sel_start + text.length;
textarea.selectionEnd = sel_end + text.length;
}
else if (textarea.createTextRange && textarea.caretPos)
{
if (baseHeight != textarea.caretPos.boundingHeight)
{
textarea.focus();
storeCaret(textarea);
}
var caret_pos = textarea.caretPos;
caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
}
else
{
textarea.value = textarea.value + text;
}
if (!popup)
{
textarea.focus();
}
}
/**
* Add inline attachment at position
*/
function attach_inline(index, filename)
{
insert_text('[attachment=' + index + ']' + filename + '[/attachment]');
document.forms[form_name].elements[text_name].focus();
}
/**
* Add quote text to message
*/
function addquote(post_id, username, l_wrote)
{
var message_name = 'message_' + post_id;
var theSelection = '';
var divarea = false;
if (l_wrote === undefined)
{
// Backwards compatibility
l_wrote = 'wrote';
}
if (document.all)
{
divarea = document.all[message_name];
}
else
{
divarea = document.getElementById(message_name);
}
// Get text selection - not only the post content :(
// IE9 must use the document.selection method but has the *.getSelection so we just force no IE
if (window.getSelection && !is_ie && !window.opera)
{
theSelection = window.getSelection().toString();
}
else if (document.getSelection && !is_ie)
{
theSelection = document.getSelection();
}
else if (document.selection)
{
theSelection = document.selection.createRange().text;
}
if (theSelection == '' || typeof theSelection == 'undefined' || theSelection == null)
{
if (divarea.innerHTML)
{
theSelection = divarea.innerHTML.replace(/<br>/ig, '\n');
theSelection = theSelection.replace(/<br\/>/ig, '\n');
theSelection = theSelection.replace(/&lt\;/ig, '<');
theSelection = theSelection.replace(/&gt\;/ig, '>');
theSelection = theSelection.replace(/&amp\;/ig, '&');
theSelection = theSelection.replace(/&nbsp\;/ig, ' ');
}
else if (document.all)
{
theSelection = divarea.innerText;
}
else if (divarea.textContent)
{
theSelection = divarea.textContent;
}
else if (divarea.firstChild.nodeValue)
{
theSelection = divarea.firstChild.nodeValue;
}
}
if (theSelection)
{
if (bbcodeEnabled)
{
insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
}
else
{
insert_text(username + ' ' + l_wrote + ':' + '\n');
var lines = split_lines(theSelection);
for (i = 0; i < lines.length; i++)
{
insert_text('> ' + lines[i] + '\n');
}
}
}
return;
}
function split_lines(text)
{
var lines = text.split('\n');
var splitLines = new Array();
var j = 0;
for(i = 0; i < lines.length; i++)
{
if (lines[i].length <= 80)
{
splitLines[j] = lines[i];
j++;
}
else
{
var line = lines[i];
do
{
var splitAt = line.indexOf(' ', 80);
if (splitAt == -1)
{
splitLines[j] = line;
j++;
}
else
{
splitLines[j] = line.substring(0, splitAt);
line = line.substring(splitAt);
j++;
}
}
while(splitAt != -1);
}
}
return splitLines;
}
/**
* From http://www.massless.org/mozedit/
*/
function mozWrap(txtarea, open, close)
{
var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength;
var selStart = txtarea.selectionStart;
var selEnd = txtarea.selectionEnd;
var scrollTop = txtarea.scrollTop;
if (selEnd == 1 || selEnd == 2)
{
selEnd = selLength;
}
var s1 = (txtarea.value).substring(0,selStart);
var s2 = (txtarea.value).substring(selStart, selEnd);
var s3 = (txtarea.value).substring(selEnd, selLength);
txtarea.value = s1 + open + s2 + close + s3;
txtarea.selectionStart = selStart + open.length;
txtarea.selectionEnd = selEnd + open.length;
txtarea.focus();
txtarea.scrollTop = scrollTop;
return;
}
/**
* Insert at Caret position. Code from
* http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
*/
function storeCaret(textEl)
{
if (textEl.createTextRange)
{
textEl.caretPos = document.selection.createRange().duplicate();
}
}
/**
* Color pallette
*/
function colorPalette(dir, width, height)
{
var r = 0, g = 0, b = 0;
var numberList = new Array(6);
var color = '';
numberList[0] = '00';
numberList[1] = '40';
numberList[2] = '80';
numberList[3] = 'BF';
numberList[4] = 'FF';
document.writeln('<table cellspacing="1" cellpadding="0" border="0">');
for (r = 0; r < 5; r++)
{
if (dir == 'h')
{
document.writeln('<tr>');
}
for (g = 0; g < 5; g++)
{
if (dir == 'v')
{
document.writeln('<tr>');
}
for (b = 0; b < 5; b++)
{
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px;">');
document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
document.writeln('</td>');
}
if (dir == 'v')
{
document.writeln('</tr>');
}
}
if (dir == 'h')
{
document.writeln('</tr>');
}
}
document.writeln('</table>');
}
/**
* Caret Position object
*/
function caretPosition()
{
var start = null;
var end = null;
}
/**
* Get the caret position in an textarea
*/
function getCaretPosition(txtarea)
{
var caretPos = new caretPosition();
// simple Gecko/Opera way
if(txtarea.selectionStart || txtarea.selectionStart == 0)
{
caretPos.start = txtarea.selectionStart;
caretPos.end = txtarea.selectionEnd;
}
// dirty and slow IE way
else if(document.selection)
{
// get current selection
var range = document.selection.createRange();
// a new selection of the whole textarea
var range_all = document.body.createTextRange();
range_all.moveToElementText(txtarea);
// calculate selection start point by moving beginning of range_all to beginning of range
var sel_start;
for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++)
{
range_all.moveStart('character', 1);
}
txtarea.sel_start = sel_start;
// we ignore the end value for IE, this is already dirty enough and we don't need it
caretPos.start = txtarea.sel_start;
caretPos.end = txtarea.sel_start;
}
return caretPos;
}

View File

@@ -0,0 +1 @@
<!-- INCLUDE mchat_stats.html -->

View File

@@ -0,0 +1 @@
<!-- IF S_MCHAT_ENABLE and S_MCHAT_ON_INDEX and not S_MCHAT_LOCATION --><!-- INCLUDE mchat_body.html --><!-- ENDIF -->

View File

@@ -0,0 +1 @@
<!-- IF S_MCHAT_ENABLE and S_MCHAT_ON_INDEX and S_MCHAT_LOCATION --><!-- INCLUDE mchat_body.html --><!-- ENDIF -->

View File

@@ -0,0 +1,6 @@
<!-- INCLUDEJS editor.js -->
<!-- INCLUDEJS jquery.titlealert.min.js -->
<!-- INCLUDEJS jquery_cookie_mini.js -->
<!-- INCLUDEJS mchat_ajax_mini.js -->
<!-- INCLUDEJS jquery-1.8.3.min.js -->
<!-- INCLUDEJS jquery.maxlength.min.js -->

View File

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

View File

@@ -0,0 +1 @@
<li class="small-icon icon-bump"><a href="{ROOT_PATH}app.php/chat" title="{L_MCHAT_TITLE}">{L_MCHAT_TITLE}</a></li>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,13 @@
/*
@author: remy sharp / http://remysharp.com
@params:
feedback - the selector for the element that gives the user feedback. Note that this will be relative to the form the plugin is run against.
hardLimit - whether to stop the user being able to keep adding characters. Defaults to true.
useInput - whether to look for a hidden input named 'maxlength' instead of the maxlength attribute. Defaults to false.
words - limit by characters or words, set this to true to limit by words. Defaults to false.
@license: Creative Commons License - ShareAlike http://creativecommons.org/licenses/by-sa/3.0/
@version: 1.2
@changes: code tidy via Ariel Flesler and fix when pasting over limit and including \t or \n
*/
(function(a){a.fn.maxlength=function(b){function c(a){var c=a.value;if(b.words)c=a.value.length?c.split(/\s+/):{length:0};return c.length}if(typeof b=="string"){b={feedback:b}}b=a.extend({},a.fn.maxlength.defaults,b);return this.each(function(){function i(a){var d=c(this),e=d>=g,f=a.keyCode;if(!e)return;switch(f){case 8:case 9:case 17:case 36:case 35:case 37:case 38:case 39:case 40:case 46:case 65:return;default:return b.words&&f!=32&&f!=13&&d==g}}var d=this,e=a(d),f=a(d.form),g=b.useInput?f.find("input[name=maxlength]").val():e.attr("maxlength"),h=f.find(b.feedback);var j=function(){var e=c(d),f=g-e;h.html(f||"0");if(f<497){a("#charsreman").show()}else{a("#charsreman").hide()};if(f<499){a("#charsreman2").show()}else{a("#charsreman2").hide()};if(f<500){a("#charsreman3").show()}else{a("#charsreman3").hide()}if(b.hardLimit&&f<0){d.value=b.words?d.value.split(/(\s+)/,g*2-1).join(""):d.value.substr(0,g);j()}};e.keyup(j).change(j).focus(j);if(b.hardLimit){e.keydown(i)}j()})};a.fn.maxlength.defaults={useInput:false,hardLimit:true,feedback:".charsLeft",words:false}})(jQuery)

View File

@@ -0,0 +1,17 @@
/*!
* Title Alert 0.7
*
* Copyright (c) 2009 ESN | http://esn.me
* Jonatan Heyman | http://heyman.info
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*/
(function(a){a.titleAlert=function(e,c){if(a.titleAlert._running){a.titleAlert.stop()}a.titleAlert._settings=c=a.extend({},a.titleAlert.defaults,c);if(c.requireBlur&&a.titleAlert.hasFocus){return}c.originalTitleInterval=c.originalTitleInterval||c.interval;a.titleAlert._running=true;a.titleAlert._initialText=document.title;document.title=e;var b=true;var d=function(){if(!a.titleAlert._running){return}b=!b;document.title=(b?e:a.titleAlert._initialText);a.titleAlert._intervalToken=setTimeout(d,(b?c.interval:c.originalTitleInterval))};a.titleAlert._intervalToken=setTimeout(d,c.interval);if(c.stopOnMouseMove){a(document).mousemove(function(f){a(this).unbind(f);a.titleAlert.stop()})}if(c.duration>0){a.titleAlert._timeoutToken=setTimeout(function(){a.titleAlert.stop()},c.duration)}};a.titleAlert.defaults={interval:500,originalTitleInterval:null,duration:0,stopOnFocus:true,requireBlur:false,stopOnMouseMove:false};a.titleAlert.stop=function(){clearTimeout(a.titleAlert._intervalToken);clearTimeout(a.titleAlert._timeoutToken);document.title=a.titleAlert._initialText;a.titleAlert._timeoutToken=null;a.titleAlert._intervalToken=null;a.titleAlert._initialText=null;a.titleAlert._running=false;a.titleAlert._settings=null};a.titleAlert.hasFocus=true;a.titleAlert._running=false;a.titleAlert._intervalToken=null;a.titleAlert._timeoutToken=null;a.titleAlert._initialText=null;a.titleAlert._settings=null;a.titleAlert._focus=function(){a.titleAlert.hasFocus=true;if(a.titleAlert._running&&a.titleAlert._settings.stopOnFocus){var b=a.titleAlert._initialText;a.titleAlert.stop();setTimeout(function(){if(a.titleAlert._running){return}document.title=".";document.title=b},1000)}};a.titleAlert._blur=function(){a.titleAlert.hasFocus=false};a(window).bind("focus",a.titleAlert._focus);a(window).bind("blur",a.titleAlert._blur)})(jQuery);

View File

@@ -0,0 +1,8 @@
/*!
* jQuery Cookie Plugin v1.4.0
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2013 Klaus Hartl
* Released under the MIT license
*/
(function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else{factory(jQuery)}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s)}function decode(s){return config.raw?s:decodeURIComponent(s)}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\')}try{s=decodeURIComponent(s.replace(pluses,' '))}catch(e){return}try{return config.json?JSON.parse(s):s}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days)}return(document.cookie=[encode(key),'=',stringifyCookieValue(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''))}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split('; '):[];for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split('=');var name=decode(parts.shift());var cookie=parts.join('=');if(key&&key===name){result=read(cookie,value);break}if(!key&&(cookie=read(cookie))!==undefined){result[name]=cookie}}return result};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)!==undefined){$.cookie(key,'',$.extend({},options,{expires:-1}));return true}return false}}));

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
<!-- BEGIN mchatrow -->
<div id="mess{mchatrow.MCHAT_MESSAGE_ID}" class="mChatBG{mchatrow.MCHAT_CLASS} mChatHover">
<div class="mChatAvatars"><!-- 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="{T_THEME_PATH}/images/no_avatar.gif" width="40px;" height="40px;" alt="" /><!-- ENDIF --><!-- IF mchatrow.U_VIEWPROFILE --></a><!-- ENDIF -->
</div>
<div>
<span style="float:left;"><!-- IF not MCHAT_ARCHIVE_MODE and MCHAT_ADD_MESSAGE --><!-- IF MCHAT_ALLOW_BBCODES --><!-- IF mchatrow.MCHAT_USERNAME_COLOR --><a class="mChatScriptLink" href="#" onclick="insert_text('&#64;&nbsp;[b][color={mchatrow.MCHAT_USERNAME_COLOR}]{mchatrow.MCHAT_USERNAME}[/color][/b], ', false);return false;" title="{L_MCHAT_RESPOND}"><span style="color: {mchatrow.MCHAT_USERNAME_COLOR}"><strong>&#64;</strong></span></a><!-- ELSE --> <a href="#" class="mChatScriptLink" onclick="insert_text('&#64;&nbsp;[b]{mchatrow.MCHAT_USERNAME}[/b], ', false);return false;" title="{L_MCHAT_RESPOND}"><strong>&#64;</strong></a><!-- ENDIF --><!-- ELSE --> <a href="#" class="mChatScriptLink" onclick="insert_text('&#64;&nbsp;{mchatrow.MCHAT_USERNAME}, ', false);return false;" title="{L_MCHAT_RESPOND}">&#64;</a><!-- ENDIF -->&nbsp;<!-- ENDIF -->{mchatrow.MCHAT_USERNAME_FULL} <!-- IF mchatrow.U_USER_ID --> <span class="mchatrow{mchatrow.MCHAT_MESSAGE_ID}" style="display:none;"><a href="{mchatrow.U_USER_ID}" title="{L_MCHAT_SEND_PM}">{L_MCHAT_PM}</a></span><!-- ENDIF --> - {mchatrow.MCHAT_TIME}</span>
<span style="float:right;"><!-- IF MCHAT_ALLOW_IP --><a href="{mchatrow.MCHAT_U_WHOIS}" onclick="popup(this.href, 750, 500); return false;"><img src="{ROOT_PATH}ext/dmzx/mchat/styles/prosilver/theme/images/ip.gif" alt="{L_MCHAT_IP} {mchatrow.MCHAT_USER_IP}" title="{L_MCHAT_IP} {mchatrow.MCHAT_USER_IP}" class="mChatImage" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_BAN --> <a href="{mchatrow.MCHAT_U_BAN}"><img src="{ROOT_PATH}ext/dmzx/mchat/styles/prosilver/theme/images/ban.gif" alt="{L_MCHAT_PERMISSIONS}" title="{L_MCHAT_PERMISSIONS}" class="mChatImage" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_EDIT --> <a href="#" onclick="mChat.edit('{mchatrow.MCHAT_MESSAGE_ID}');return false;"><img src="{ROOT_PATH}ext/dmzx/mchat/styles/prosilver/theme/images/edit.gif" alt="{L_MCHAT_EDIT}" title="{L_MCHAT_EDIT}" class="mChatImage" /></a><!-- ENDIF --><input type="hidden" id="edit{mchatrow.MCHAT_MESSAGE_ID}" value="{mchatrow.MCHAT_MESSAGE_EDIT}" /><!-- IF mchatrow.MCHAT_ALLOW_DEL --> <a href="#" onclick="mChat.del('{mchatrow.MCHAT_MESSAGE_ID}');return false;"><img src="{ROOT_PATH}ext/dmzx/mchat/styles/prosilver/theme/images/del.gif" alt="{L_MCHAT_DELITE}" title="{L_MCHAT_DELITE}" class="mChatImage" /></a><!-- ENDIF --></span><br /><div class="avatarMessage mChatMessage">{mchatrow.MCHAT_MESSAGE}</div>
</div>
</div>
<!-- END mchatrow -->

View File

@@ -0,0 +1,94 @@
<div id="mChatBBCodes" style="padding: 5px; display: none;">
<fieldset class="fields1">
<script type="text/javascript">
// <![CDATA[
var form_name = 'postform';
var text_name = 'message';
// Define the bbCode tags
var bbcode = new Array();
var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);
// Helpline messages
var help_line = {
b: '{LA_BBCODE_B_HELP}',
i: '{LA_BBCODE_I_HELP}',
u: '{LA_BBCODE_U_HELP}',
q: '{LA_BBCODE_Q_HELP}',
c: '{LA_BBCODE_C_HELP}',
l: '{LA_BBCODE_L_HELP}',
o: '{LA_BBCODE_O_HELP}',
p: '{LA_BBCODE_P_HELP}',
w: '{LA_BBCODE_W_HELP}',
a: '{LA_BBCODE_A_HELP}',
s: '{LA_BBCODE_S_HELP}',
f: '{LA_BBCODE_F_HELP}',
e: '{LA_BBCODE_E_HELP}',
d: '{LA_BBCODE_D_HELP}',
tip: '{LA_STYLES_TIP}'
<!-- BEGIN custom_tags -->
,cb_{custom_tags.BBCODE_ID}: '{custom_tags.A_BBCODE_HELPLINE}'
<!-- END custom_tags -->
}
// ]]>
</script>
<!-- INCLUDE mchat_color.html -->
<!-- IF S_MCHAT_BBCODE_B -->
<input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" title="{L_BBCODE_B_HELP}" />
<!-- ENDIF -->
<!-- IF S_MCHAT_BBCODE_I -->
<input type="button" class="button2" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onclick="bbstyle(2)" title="{L_BBCODE_I_HELP}" />
<!-- ENDIF -->
<!-- IF S_MCHAT_BBCODE_U -->
<input type="button" class="button2" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onclick="bbstyle(4)" title="{L_BBCODE_U_HELP}" />
<!-- ENDIF -->
<!-- IF S_MCHAT_BBCODE_QUOTE -->
<input type="button" class="button2" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" title="{L_BBCODE_Q_HELP}" />
<!-- ENDIF -->
<!-- IF S_MCHAT_BBCODE_CODE -->
<input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" title="{L_BBCODE_C_HELP}" />
<!-- ENDIF -->
<!-- IF S_MCHAT_BBCODE_LIST -->
<input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" title="{L_BBCODE_L_HELP}" />
<!-- ENDIF -->
<!-- IF S_MCHAT_BBCODE_LIST -->
<input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" title="{L_BBCODE_O_HELP}" />
<!-- ENDIF -->
<!-- IF S_MCHAT_BBCODE_LIST or S_MCHAT_LIST -->
<input type="button" class="button2" accesskey="t" name="addlitsitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" title="{L_BBCODE_LISTITEM_HELP}" />
<!-- ENDIF -->
<!-- IF S_MCHAT_BBCODE_IMG -->
<input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" title="{L_BBCODE_P_HELP}" />
<!-- ENDIF -->
<!-- IF S_MCHAT_BBCODE_URL -->
<input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" title="{L_BBCODE_W_HELP}" />
<!-- ENDIF -->
<!-- IF S_MCHAT_BBCODE_FLASH -->
<input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" title="{L_BBCODE_D_HELP}" />
<!-- ENDIF -->
<!-- IF S_MCHAT_BBCODE_SIZE -->
<select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" title="{L_BBCODE_F_HELP}">
<option value="50">{L_FONT_TINY}</option>
<option value="85">{L_FONT_SMALL}</option>
<option value="100" selected="selected">{L_FONT_NORMAL}</option>
<!-- IF not MAX_FONT_SIZE or MAX_FONT_SIZE >= 150 -->
<option value="150">{L_FONT_LARGE}</option>
<!-- IF not MAX_FONT_SIZE or MAX_FONT_SIZE >= 200 -->
<option value="200">{L_FONT_HUGE}</option>
<!-- ENDIF -->
<!-- ENDIF -->
</select>
<!-- ENDIF -->
<!-- IF S_MCHAT_BBCODE_COLOR -->
<input type="button" class="button2" name="bbpalette" id="bbpalette" value="{L_FONT_COLOR}" onclick="mChat.toggle('Colour');" title="{L_BBCODE_S_HELP}" />
<!-- ENDIF -->
<!-- IF .custom_tags -->
<select name="addbbcode_custom" onchange="bbstyle(this.form.addbbcode_custom.options[this.form.addbbcode_custom.selectedIndex].value*1);this.form.addbbcode_custom.selectedIndex = 0;">
<option value="#" selected="selected">{L_MCHAT_CUSTOM_BBCODES}</option>
<!-- BEGIN custom_tags -->
<option value="{custom_tags.BBCODE_ID}" title="{custom_tags.BBCODE_HELPLINE}">{custom_tags.BBCODE_TAG}</option>
<!-- END custom_tags -->
</select>
<!-- ENDIF -->
</fieldset>
</div>

View File

@@ -0,0 +1,181 @@
<!-- IF MCHAT_ARCHIVE_MODE or MCHAT_CUSTOM_PAGE -->
<!-- INCLUDE overall_header.html -->
<!-- ENDIF -->
<!-- IF MCHAT_ARCHIVE_MODE -->
<!--**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/-->
<ul class="linklist">
<li class="rightside pagination">{MCHAT_TOTAL_MESSAGES} &bull; <!-- IF MCHAT_PAGINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{MCHAT_PAGE_NUMBER}</a> &bull; <span>{MCHAT_PAGINATION}</span><!-- ELSE -->{MCHAT_PAGE_NUMBER}<!-- ENDIF --></li>
</ul>
<!-- ENDIF -->
<!-- IF not MCHAT_READ_MODE -->
<div class="forabg">
<div class="inner"><span class="corners-top"><span><a name="mChat"></a></span></span>
<ul class="topiclist">
<li class="header">
<dl class="icon">
<dt><!-- IF MCHAT_ARCHIVE_MODE -->{L_MCHAT_ARCHIVE_PAGE}<!-- ELSE -->{L_MCHAT_TITLE}<!-- ENDIF --></dt>
</dl>
</li>
</ul>
<div class="postbody mChatBodyFix">
<!-- ENDIF -->
<!-- IF MCHAT_ENABLE -->
<!-- IF not MCHAT_READ_MODE -->
<script type="text/javascript">
// <![CDATA[
// Define mChat setting
var mChatNoMessage = '{MCHAT_NOMESSAGE_MODE}';
var mChatFile = '{MCHAT_FILE_NAME}';
var mChatForumRoot = '{ROOT_PATH}';
var mChatCustomPage = '{MCHAT_CUSTOM_PAGE}';
<!-- IF not MCHAT_ARCHIVE_MODE -->
var mChatPause = '{MCHAT_PAUSE_ON_INPUT}';
var mChatRefresh = '{MCHAT_REFRESH_JS}';
<!-- ELSE -->
var mChatPause = false;
var mChatRefresh = false;
<!-- ENDIF -->
<!-- IF MCHAT_USER_TIMEOUT -->
var mChatUserTimeout = '{MCHAT_USER_TIMEOUT}';
<!-- ELSE -->
var mChatUserTimeout = false;
<!-- ENDIF -->
var mChatNoMessageInput = '{LA_MCHAT_NOMESSAGEINPUT}';
var mChatNoMessage = '{LA_MCHAT_NOMESSAGE}';
var mChatEditInfo = '{LA_MCHAT_EDITINFO}';
var mChatNoAccess = '{LA_MCHAT_NOACCESS}';
var mChatFlood = '{LA_MCHAT_FLOOD}';
var mChatDelConfirm = '{LA_MCHAT_DELCONFIRM}';
var mChatReset = '{LA_MCHAT_RESET_QUESTION}';
var mChatRefreshing = '{LA_MCHAT_REFRESHING}';
var mChatSessOut = '{LA_MCHAT_SESSION_OUT}';
var mChatSessEnds = '{LA_MCHAT_SESSION_ENDS}';
var mChatRefreshYes = '{MCHAT_REFRESH_YES}';
var mChatRefreshNo = '{LA_MCHAT_REFRESH_NO}';
var mChatMssgLngthLong = '{MCHAT_MESS_LONG}';
<!-- IF MCHAT_MESSAGE_LNGTH -->
var mChatMssgLngth = '{MCHAT_MESSAGE_LNGTH}';
<!-- ELSE -->
var mChatMssgLngth = false;
<!-- ENDIF -->
<!-- IF S_MCHAT_SOUND_YES -->
var mChatSound = true;
<!-- ELSE -->
var mChatSound = false;
<!-- ENDIF -->
<!-- IF MCHAT_WHOIS -->
var mChatWhois = true;
var mChatWhoisRefresh = '{MCHAT_WHOIS_REFRESH}';
<!-- ELSE -->
var mChatWhois = false;
var mChatWhoisRefresh = false;
<!-- ENDIF -->
<!-- IF MCHAT_ARCHIVE_MODE -->
var mChatArchiveMode = true;
<!-- ELSE -->
var mChatArchiveMode = false;
var form_name = 'postform';
var text_name = 'message';
var mChatFocusFix = true;
<!-- ENDIF -->
// ]]>
</script>
<!-- IF not MCHAT_ARCHIVE_MODE -->
<div id="mChatmain" <!-- IF MCHAT_CUSTOM_PAGE -->class="mChatRowLimitCustom" style="height: {MCHAT_CUSTOM_HEIGHT}px;"<!-- ELSE -->class="mChatRowLimit" style="height: {MCHAT_INDEX_HEIGHT}px;"<!-- ENDIF -->>
<!-- ENDIF -->
<div id="mChatData">
<!-- ENDIF -->
<!-- IF S_MCHAT_AVATARS -->
<!-- INCLUDE mchat_avatars.html -->
<!-- ELSE -->
<!-- INCLUDE mchat_no_avatars.html -->
<!-- ENDIF -->
<!-- IF not MCHAT_READ_MODE -->
<!-- IF MCHAT_NOMESSAGE_MODE --><div id="mChatNoMessage">{L_MCHAT_NOMESSAGE}</div><!-- ENDIF -->
</div>
<!-- IF not MCHAT_ARCHIVE_MODE -->
</div>
<!-- IF MCHAT_STATIC_MESS --><div class="mChatStatic"><strong>{L_MCHAT_ANNOUNCEMENT}:</strong> <span style="color:#990000;">{MCHAT_STATIC_MESS}</span></div><!-- ENDIF -->
<!-- IF not (MCHAT_ARCHIVE_MODE or MCHAT_CUSTOM_PAGE) and MCHAT_WHOIS and S_MCHAT_INDEX_STATS --><div class="mChatStats" id="mChatStats"><!-- IF MCHAT_USERS_LIST --><a href="#" onclick="mChat.toggle('UserList'); return false;">{MCHAT_USERS_COUNT}</a><!-- ELSE -->{MCHAT_USERS_COUNT}<!-- ENDIF -->&nbsp;{L_MCHAT_ONLINE_EXPLAIN}<br /><span id="mChatUserList">{MCHAT_USERS_LIST}</span></div><!-- ENDIF -->
<form method="post" action="javascript://" onsubmit="mChat.add();" id="postform">
<div class="mChatPanel">
<noscript><div class="mchat_alert">{L_MCHAT_NOJAVASCRIPT}</div></noscript>
<!-- IF MCHAT_ADD_MESSAGE -->
<input type="hidden" name="mode" value="add" />
<!-- IF MCHAT_INPUT_TYPE --><input type="text" name="message" class="inputbox medium mChatText" id="mChatMessage" /><!-- ELSE -->
<textarea name="message" class="inputbox mChatText" id="mChatMessage" onkeypress="mChat.key(event);" cols="32" rows="5" style="width: 50em;height: 6em;"></textarea><!-- ENDIF --><br />
<input id="submit_button" type="button" class="button2" onclick="mChat.add();" value="{L_MCHAT_ADD}" />
<input id="mChatClear" type="button" class="button2" onclick="mChat.clear();" value="{L_MCHAT_CLEAR_INPUT}" />
<!-- IF MCHAT_ALLOW_SMILES and .smiley -->
<input type="button" class="button2" onclick="mChat.toggle('Smiles');" value="{L_MCHAT_SMILES}" />
<!-- ENDIF -->
<!-- IF MCHAT_ALLOW_BBCODES -->
<input type="button" class="button2" onclick="mChat.toggle('BBCodes');" value="{L_MCHAT_BBCODES}" />
<!-- ENDIF -->
<!-- ENDIF -->
<!-- IF MCHAT_READ_ARCHIVE_BUTTON -->
<input type="button" class="button2" onclick="window.location.href = '{MCHAT_ARCHIVE_URL}';" value="{L_MCHAT_ARCHIVE}" />
<!-- ENDIF -->
<!-- IF MCHAT_FOUNDER -->
<input type="button" class="button2" onclick="window.location.href = '{MCHAT_CLEAN_URL}';" value="{L_MCHAT_CLEAN}" />
<!-- ENDIF -->
<!-- IF MCHAT_ADD_MESSAGE -->
<!-- IF MCHAT_RULES -->
<input type="button" class="button2" onclick="popup('{U_MCHAT_RULES}', 450, 275); return false;" value="{L_MCHAT_HELP}" />
<!-- ENDIF -->
<!-- IF MCHAT_ALLOW_BBCODES -->
<!-- INCLUDE mchat_bbcodes.html -->
<!-- ENDIF -->
<!-- ENDIF -->
{S_FORM_TOKEN}
<!-- IF MCHAT_ALLOW_SMILES and .smiley -->
<div id="mChatSmiles" style="padding: 5px; display: none;">
<!-- 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 -->
<a href="{U_MORE_SMILIES}" onclick="popup(this.href, 300, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a>
</div>
<!-- ENDIF -->
<div style="padding: 3px;">
<img src="{ROOT_PATH}ext/dmzx/mchat/styles/prosilver/theme/images/load.gif" alt="{L_MCHAT_LOAD}" title="{L_MCHAT_LOAD}" id="mChatLoadIMG" class="mChatImageLoad" />
<img src="{ROOT_PATH}ext/dmzx/mchat/styles/prosilver/theme/images/ok.gif" alt="{L_MCHAT_OK}" title="{L_MCHAT_OK}" id="mChatOkIMG" class="mChatImageOk" />
<img src="{ROOT_PATH}ext/dmzx/mchat/styles/prosilver/theme/images/error.gif" alt="{L_MCHAT_ERROR}" title="{L_MCHAT_ERROR}" id="mChatErrorIMG" class="mChatImageHideImg" />
<img src="{ROOT_PATH}ext/dmzx/mchat/styles/prosilver/theme/images/paused.gif" alt="{L_MCHAT_PAUSE}" title="{L_MCHAT_PAUSE}" id="mChatPauseIMG" class="mChatImageHideImg" />
<span id="mChatRefreshText">{MCHAT_REFRESH_YES}</span><!-- IF MCHAT_USER_TIMEOUT --> &bull; <span id="mChatSessMess">&nbsp;</span><!-- ENDIF --> &bull; <label for="mChatUseSound">{L_MCHAT_USESOUND} <input type="checkbox" id="mChatUseSound" <!-- IF S_MCHAT_SOUND_YES -->checked="checked"<!-- ENDIF --> /></label>
{L_MCHAT_COPYRIGHT}
</div>
</div>
</form>
<!-- ENDIF -->
<div id="mChatSound" class="mChatSound"></div>
<!-- ENDIF -->
<!-- ELSE -->
<div class="mchat_alert">{L_MCHAT_ENABLE}</div>
<!-- ENDIF -->
<!-- IF not MCHAT_READ_MODE -->
</div>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
<!-- IF MCHAT_ARCHIVE_MODE -->
<ul class="linklist">
<li class="rightside pagination">{MCHAT_TOTAL_MESSAGES} &bull; <!-- IF MCHAT_PAGINATION --><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{MCHAT_PAGE_NUMBER}</a> &bull; <span>{MCHAT_PAGINATION}</span><!-- ELSE -->{MCHAT_PAGE_NUMBER}<!-- ENDIF --></li>
</ul>
<!-- ENDIF -->
<!-- IF MCHAT_CUSTOM_PAGE and MCHAT_WHOIS -->
<h3>{L_WHO_IS_CHATTING}</h3>
<div class="mChatStats" id="mChatStats"><!-- IF MCHAT_USERS_LIST --><a href="#" onclick="mChat.toggle('UserList'); return false;">{MCHAT_USERS_COUNT}</a><!-- ELSE -->{MCHAT_USERS_COUNT}<!-- ENDIF -->&nbsp;{L_MCHAT_ONLINE_EXPLAIN}<br /><span id="mChatUserList">{MCHAT_USERS_LIST}</span></div>
<div class="mChatRefresh"><span id="mChatRefresh">{L_MCHAT_WHOIS_REFRESH_EXPLAIN}</span><span id="mChatRefreshN" style="display: none;">{L_MCHAT_REFRESHING}</span>
<!-- IF LEGEND --><br /><em>{L_LEGEND}: {LEGEND}</em><!-- ENDIF --></div>
<!-- ENDIF -->
<!-- IF MCHAT_ARCHIVE_MODE or MCHAT_CUSTOM_PAGE -->
<!-- INCLUDE overall_footer.html -->
<!-- ENDIF -->

View File

@@ -0,0 +1,13 @@
<div id="mChatColour" style="display: none; text-align: center">
<table width="50%" style="margin-left: auto; margin-right: auto;">
<tr align="center">
<td valign="top">
<!-- <script type="text/javascript">
// <![CDATA[
colorPalette('h', 15, 10);
// ]]>
</script> -->
</td>
</tr>
</table>
</div>

View File

@@ -0,0 +1,3 @@
<!-- BEGIN mchatrow -->
<div id="mess{mchatrow.MCHAT_MESSAGE_ID}" class="mChatBG{mchatrow.MCHAT_CLASS} mChatHover"><span style="float:left;"><!-- IF not MCHAT_ARCHIVE_MODE and MCHAT_ADD_MESSAGE --><!-- IF MCHAT_ALLOW_BBCODES --><!-- IF mchatrow.MCHAT_USERNAME_COLOR --><a class="mChatScriptLink" href="javascript://" onclick="insert_text('&#64;&nbsp;[b][color={mchatrow.MCHAT_USERNAME_COLOR}]{mchatrow.MCHAT_USERNAME}[/color][/b], ', false);" title="{L_MCHAT_RESPOND}"><span style="color: {mchatrow.MCHAT_USERNAME_COLOR}"><strong>&#64;</strong></span></a><!-- ELSE --> <a href="javascript://" class="mChatScriptLink" onclick="insert_text('&#64;&nbsp;[b]{mchatrow.MCHAT_USERNAME}[/b], ', false);" title="{L_MCHAT_RESPOND}"><strong>&#64;</strong></a><!-- ENDIF --><!-- ELSE --> <a href="javascript://" class="mChatScriptLink" onclick="insert_text('&#64;&nbsp;{mchatrow.MCHAT_USERNAME}, ', false);" title="{L_MCHAT_RESPOND}">&#64;</a><!-- ENDIF -->&nbsp;<!-- ENDIF -->{mchatrow.MCHAT_USERNAME_FULL} <!-- IF mchatrow.U_USER_ID --> <span class="mchatrow{mchatrow.MCHAT_MESSAGE_ID}" style="display:none;"><a href="{mchatrow.U_USER_ID}" title="{L_MCHAT_SEND_PM}">{L_MCHAT_PM}</a></span><!-- ENDIF --> - {mchatrow.MCHAT_TIME}</span><span style="float:right;"><!-- IF MCHAT_ALLOW_IP --><a href="{mchatrow.MCHAT_U_WHOIS}" onclick="popup(this.href, 750, 500); return false;"><img src="{ROOT_PATH}ext/dmzx/mchat/styles/prosilver/theme/images/ip.gif" alt="{L_MCHAT_IP} {mchatrow.MCHAT_USER_IP}" title="{L_MCHAT_IP} {mchatrow.MCHAT_USER_IP}" class="mChatImage" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_BAN --> <a href="{mchatrow.MCHAT_U_BAN}"><img src="{ROOT_PATH}ext/dmzx/mchat/styles/prosilver/theme/images/ban.gif" alt="{L_MCHAT_PERMISSIONS}" title="{L_MCHAT_PERMISSIONS}" class="mChatImage" /></a><!-- ENDIF --><!-- IF mchatrow.MCHAT_ALLOW_EDIT --> <a href="javascript://" onclick="mChat.edit('{mchatrow.MCHAT_MESSAGE_ID}');"><img src="{ROOT_PATH}ext/dmzx/mchat/styles/prosilver/theme/images/edit.gif" alt="{L_MCHAT_EDIT}" title="{L_MCHAT_EDIT}" class="mChatImage" /></a><!-- ENDIF --><input type="hidden" id="edit{mchatrow.MCHAT_MESSAGE_ID}" value="{mchatrow.MCHAT_MESSAGE_EDIT}" /><!-- IF mchatrow.MCHAT_ALLOW_DEL --> <a href="javascript://" onclick="mChat.del('{mchatrow.MCHAT_MESSAGE_ID}');"><img src="{ROOT_PATH}ext/dmzx/mchat/styles/prosilver/theme/images/del.gif" alt="{L_MCHAT_DELITE}" title="{L_MCHAT_DELITE}" class="mChatImage" /></a><!-- ENDIF --></span><br /><div class="mChatMessage">{mchatrow.MCHAT_MESSAGE}</div></div>
<!-- END mchatrow -->

View File

@@ -0,0 +1,22 @@
<!--**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/-->
<!-- INCLUDE simple_header.html -->
<h2>{L_MCHAT_HELP}</h2>
<div class="rules">
<div class="inner"><span class="corners-top"><span></span></span>
<!-- IF MCHAT_RULES and not .rule -->
{MCHAT_RULES}
<!-- ENDIF -->
<!-- BEGIN rule -->
{rule.MCHAT_RULE}<!-- IF !rule.S_LAST_ROW --><br /><!-- ENDIF -->
<!-- END rule -->
<span class="corners-bottom"><span></span></span></div>
</div>
<a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
<!-- INCLUDE simple_footer.html -->

View File

@@ -0,0 +1,4 @@
<!-- IF S_MCHAT_ENABLE and MCHAT_INDEX_STATS and U_MCHAT -->
<h3><a href="{U_MCHAT}#mChat">{L_WHO_IS_CHATTING}</a></h3>
<p>{MCHAT_INDEX_USERS_COUNT} {L_MCHAT_ONLINE_EXPLAIN}<br />{MCHAT_INDEX_USERS_LIST}</p>
<!-- ENDIF -->

View File

@@ -0,0 +1,72 @@
<!-- INCLUDE ucp_header.html -->
<form id="ucp" method="post" action="{S_UCP_ACTION}">
<h2>{L_TITLE}</h2>
<div class="panel">
<div class="inner">
<fieldset>
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
<!-- IF S_MCHAT_INDEX -->
<dl>
<dt><label for="mchat_index">{L_DISPLAY_MCHAT}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="user_mchat_index" value="1"<!-- IF S_DISPLAY_MCHAT --> id="mchat_index" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="user_mchat_index" value="0"<!-- IF not S_DISPLAY_MCHAT --> id="mchat_index" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="mchat_sound">{L_SOUND_MCHAT}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="user_mchat_sound" value="1"<!-- IF S_SOUND_MCHAT --> id="mchat_sound" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="user_mchat_sound" value="0"<!-- IF not S_SOUND_MCHAT --> id="mchat_sound" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<!-- IF S_MCHAT_INDEX -->
<dl>
<dt><label for="mchat_statsindex">{L_DISPLAY_STATS_INDEX}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="user_mchat_stats_index" value="1"<!-- IF S_STATS_MCHAT --> id="mchat_statsindex" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="user_mchat_stats_index" value="0"<!-- IF not S_STATS_MCHAT --> id="mchat_statsindex" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<!-- ENDIF -->
<!-- IF S_MCHAT_TOPICS -->
<dl>
<dt><label for="mchat_topics">{L_DISPLAY_NEW_TOPICS}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="user_mchat_topics" value="1"<!-- IF S_TOPICS_MCHAT --> id="mchat_topics" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="user_mchat_topics" value="0"<!-- IF not S_TOPICS_MCHAT --> id="mchat_topics" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<!-- ENDIF -->
<!-- IF S_MCHAT_AVATARS -->
<dl>
<dt><label for="mchat_avatars">{L_DISPLAY_AVATARS}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="user_mchat_avatars" value="1"<!-- IF S_AVATARS_MCHAT --> id="mchat_avatars" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" name="user_mchat_avatars" value="0"<!-- IF not S_AVATARS_MCHAT --> id="mchat_avatars" checked="checked"<!-- ENDIF --> /> {L_NO}</label>
</dd>
</dl>
<!-- ENDIF -->
<dl>
<dt><label for="mchat_input_type">{L_CHAT_AREA}{L_COLON}</label></dt>
<dd>
<label><input type="radio" name="user_mchat_input_area" value="1"<!-- IF S_INPUT_MCHAT --> id="mchat_input_type" checked="checked"<!-- ENDIF --> /> {L_INPUT_AREA}</label>
<label><input type="radio" name="user_mchat_input_area" value="0"<!-- IF not S_INPUT_MCHAT --> id=""mchat_input_type" checked="checked"<!-- ENDIF --> /> {L_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" />&nbsp;
<input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
{S_FORM_TOKEN}
</fieldset>
</form>
<!-- INCLUDE ucp_footer.html -->

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

View File

@@ -0,0 +1,277 @@
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/* mChat
------------ */
div.mChatBG1 {
background: -webkit-linear-gradient(#B6BFC4, #FFFFFF, #FFFFFF, #B6BFC4);
background: -o-linear-gradient(#B6BFC4, #FFFFFF, #FFFFFF, #B6BFC4);
background: -moz-linear-gradient(#B6BFC4, #FFFFFF, #FFFFFF, #B6BFC4);
background: linear-gradient(#B6BFC4, #FFFFFF, #FFFFFF, #B6BFC4);
border: 1px solid #999999;
-webkit-border-radius: 6px;
-o-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
padding: 5px;
color: #333333;
margin-right: 1px;
overflow: hidden;
}
div.mChatBG2 {
background: -webkit-linear-gradient(#B6BFC4, #FFFFFF, #FFFFFF, #B6BFC4);
background: -o-linear-gradient(#B6BFC4, #FFFFFF, #FFFFFF, #B6BFC4);
background: -moz-linear-gradient(#B6BFC4, #FFFFFF, #FFFFFF, #B6BFC4);
background: linear-gradient(#B6BFC4, #FFFFFF, #FFFFFF, #B6BFC4);
border: 1px solid #999999;
-webkit-border-radius: 6px;
-o-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
padding: 5px;
color: #444444;
margin-right: 1px;
text-align: left;
overflow: hidden;
}
div.mChatRowLimit {
overflow: auto;
width: 100%;
}
div.mChatRowLimitCustom {
overflow: auto;
width: 100%;
}
div.mChatPanel {
text-align: center;
padding: 3px;
clear: both;
}
input.mChatText {
cursor: text;
width: 50%;
background-color: #FFFFFF;
border: 1px solid #B4BAC0;
color: #333333;
padding: 5px 5px 3px 5px;
margin: 3px 0px 3px 5px;
}
input.mChatText:hover {
border-color: #11A3EA;
}
div.mChatHover:hover {
background-color: #F6F4D0;
}
div.mChatBodyFix {
width: 100% !important;
background-color: #E9F0F5 !important;
}
div.mChatStatic {
padding-left: 5px;
font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
text-align: left;
font-size: 1.1em;
}
div.mChatStats {
padding-left: 5px;
margin-top: 2px;
font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
text-align: left;
min-height: 1.3em;
font-size: 1.1em;
height: auto !important;
}
div.mChatRefresh {
padding-left: 5px;
font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
text-align: left;
font-size: 1.1em;
margin-top: 1.5em;
clear: both;
}
input.mChatColor {
width: 100%;
text-align: center;
background-color: #DEE3E7;
border-style: none;
}
div.mChatMessage {
padding: 3px;
font-size: 1.1em;
width: 98%;
}
a.mChatScriptLink {
text-decoration:none;
}
img.mChatImage{
vertical-align: middle;
}
img.mChatImageLoad {
vertical-align: middle;
cursor: wait;
display: none;
}
img.mChatImageOk {
vertical-align: middle;
cursor: help;
}
img.mChatImageHideImg {
vertical-align: middle;
cursor: help;
display: none;
}
div.mChatSound {
position: absolute;
left: -1000px;
top: -1000px;
}
.mchat_alert {
color: #7E2217;
padding: 10px;
}
#mChatUserList {
display: none;
float: left;
}
.mChatAvatars {
float: left;
padding-right: 5px;
}
div.avatarMessage {
margin-left: 50px;
width: 90%;
margin-right: 5px;
}
.appriseOverlay
{
position:fixed;
top:0;
left:0;
background:rgba(0, 0, 0, 0.3);
display:none;
}
.appriseOuter
{
background:#dcdee2;
border:1px solid #fff;
box-shadow:0px 3px 7px #333;
-moz-box-shadow:0px 3px 7px #333;
-webkit-box-shadow:0px 3px 7px #333;
-moz-border-radius:4px;
-webkit-border-radius:4px;
border-radius:4px;
-khtml-border-radius:4px;
position:absolute;
z-index:99999999;
min-width:200px;
min-height:50px;
max-width:75%;
position:fixed;
display:none;
}
.appriseInner
{
padding:20px;
color:#333;
text-shadow:0px 1px 0px #fff;
font-weight: bold;
}
.appriseInner button
{
border:1px solid #666666;
-moz-border-radius:3px;
-webkit-border-radius:3px;
border-radius:3px;
-khtml-border-radius:3px;
background: -moz-linear-gradient(100% 100% 90deg, #eee, #d5d5d5);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#eee), to(#d5d5d5));
background: -webkit-linear-gradient(#eee, #d5d5d5);
background: -o-linear-gradient(#eee, #d5d5d5);
color:#000000;
font-size:12px;
font-weight:bold;
padding:4px 10px;
margin:0 3px;
text-shadow:0px 1px 0px #fff;
cursor:pointer;
box-shadow:0px 1px 2px #ccc;
-moz-box-shadow:0px 1px 2px #ccc;
-webkit-box-shadow:0px 1px 2px #ccc;
}
.appriseInner button:hover
{
color:#d85054;
}
.aButtons, .aInput
{
margin:20px 10px 0px 10px;
text-align:center;
}
.aTextbox
{
border:1px solid #aaa;
-moz-border-radius:4px;
-webkit-border-radius:4px;
border-radius:4px;
-khtml-border-radius:4px;
box-shadow:0px 1px 0px #fff;
-moz-box-shadow:0px 1px 0px #fff;
-webkit-box-shadow:0px 1px 0px #fff;
width:180px;
font-size:12px;
font-weight:bold;
padding:5px 10px;
}
.no-rgba .appriseOverlay{
opacity: .30;
filter: alpha(opacity = 30) !important;
background: #000;
zoom: 1;
}
.no-borderradius .appriseOuter{
border:1px solid #888;
}
.appriseOverlay {
background-color:#222222;
border:medium none;
cursor:wait;
height:100%;
left:0;
margin:0;
padding:0;
position:fixed;
top:0;
width:100%;
z-index:1000;
filter:alpha(opacity=70);
opacity:0.70;
}

28
ucp/ucp_mchat_info.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\ucp;
class ucp_mchat_info
{
function module()
{
return array(
'filename' => '\dmzx\mchat\ucp\ucp_mchat_module',
'title' => 'UCP_MCHAT_CONFIG',
'version' => '1.3.8',
'modes' => array(
'configuration' => array(
'title' => 'UCP_MCHAT_CONFIG',
'auth' => 'ext_dmzx/mchat && acl_u_mchat_use',
'cat' => array('UCP_MCHAT_CONFIG')),
),
);
}
}

112
ucp/ucp_mchat_module.php Normal file
View File

@@ -0,0 +1,112 @@
<?php
/**
*
* @package phpBB Extension - mChat
* @copyright (c) 2015 dmzx - http://www.dmzx-web.net
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace dmzx\mchat\ucp;
class ucp_mchat_module
{
/** @var \dmzx\mchat\core\functions_mchat */
protected $functions_mchat;
function main($id, $mode)
{
global $cache, $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $request;
global $phpbb_container;
$this->functions_mchat = $phpbb_container->get('dmzx.mchat.functions_mchat');
// $user->add_lang('mods/mchat_lang');
$submit = (isset($_POST['submit'])) ? true : false;
$error = $data = array();
switch ($mode)
{
case 'configuration':
$data = array(
'user_mchat_index' => $request->variable('user_mchat_index', (bool) $user->data['user_mchat_index']),
'user_mchat_sound' => $request->variable('user_mchat_sound', (bool) $user->data['user_mchat_sound']),
'user_mchat_stats_index' => $request->variable('user_mchat_stats_index', (bool) $user->data['user_mchat_stats_index']),
'user_mchat_topics' => $request->variable('user_mchat_topics', (bool) $user->data['user_mchat_topics']),
'user_mchat_avatars' => $request->variable('user_mchat_avatars', (bool) $user->data['user_mchat_avatars']),
'user_mchat_input_area' => $request->variable('user_mchat_input_area', (bool) $user->data['user_mchat_input_area']),
);
add_form_key('ucp_mchat');
if ($submit)
{
if (!check_form_key('ucp_mchat'))
{
$error[] = 'FORM_INVALID';
}
if (!sizeof($error))
{
$sql_ary = array(
'user_mchat_index' => $data['user_mchat_index'],
'user_mchat_sound' => $data['user_mchat_sound'],
'user_mchat_stats_index' => $data['user_mchat_stats_index'],
'user_mchat_topics' => $data['user_mchat_topics'],
'user_mchat_avatars' => $data['user_mchat_avatars'],
'user_mchat_input_area' => $data['user_mchat_input_area'],
);
if (sizeof($sql_ary))
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . (int) $user->data['user_id'];
$db->sql_query($sql);
}
meta_refresh(3, $this->u_action);
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
trigger_error($message);
}
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
if (($mchat_cache = $cache->get('_mchat_config')) === false)
{
$this->functions_mchat->mchat_cache();
}
$mchat_cache = $cache->get('_mchat_config');
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'S_DISPLAY_MCHAT' => $data['user_mchat_index'],
'S_SOUND_MCHAT' => $data['user_mchat_sound'],
'S_STATS_MCHAT' => $data['user_mchat_stats_index'],
'S_TOPICS_MCHAT' => $data['user_mchat_topics'],
'S_AVATARS_MCHAT' => $data['user_mchat_avatars'],
'S_INPUT_MCHAT' => $data['user_mchat_input_area'],
'S_MCHAT_TOPICS' => $config['mchat_new_posts'],
'S_MCHAT_INDEX' => ($config['mchat_on_index'] || $config['mchat_stats_index']) ? true : false,
'S_MCHAT_AVATARS' => $mchat_cache['avatars'],
));
break;
}
$template->assign_vars(array(
'L_TITLE' => $user->lang['UCP_PROFILE_MCHAT'],
'S_UCP_ACTION' => $this->u_action
));
// Set desired template
$this->tpl_name = 'ucp_mchat';
$this->page_title = 'UCP_PROFILE_MCHAT';
}
// $this->page_title = 'UCP_PROFILE_MCHAT';
}