พัฒนาโดย : Rich McGirr
Version : 1.3.5
phpBB Version(s) : phpBB 3.0 ขึ้นไป
ดาวน์โหลดได้ที่: https://www.phpbb.com/customise/db/mod/ ... w_version/
เปิดไฟล์: adm/style/acp_users.html
ค้นหา
โค้ด: เลือกทั้งหมด
<!-- INCLUDE permission_mask.html -->
โค้ด: เลือกทั้งหมด
<!-- ELSEIF S_MCHAT -->
<!-- INCLUDE acp_users_mchat.html -->
ค้นหา
โค้ด: เลือกทั้งหมด
// Output page
page_header($user->lang['INDEX']);
โค้ด: เลือกทั้งหมด
// BEGIN mChat Mod
$mchat_installed = (!empty($config['mchat_version']) && !empty($config['mchat_enable'])) ? true : false;
if ($mchat_installed && $auth->acl_get('u_mchat_view'))
{
if(!defined('MCHAT_INCLUDE') && $config['mchat_on_index'] && !empty($user->data['user_mchat_index']))
{
define('MCHAT_INCLUDE', true);
$mchat_include_index = true;
include($phpbb_root_path . 'mchat.' . $phpEx);
}
if (!empty($config['mchat_stats_index']) && !empty($user->data['user_mchat_stats_index']))
{
if (!function_exists('mchat_users'))
{
include($phpbb_root_path . 'includes/functions_mchat.' . $phpEx);
}
// Add lang file
$user->add_lang('mods/mchat_lang');
// stats display
$mchat_session_time = !empty($config_mchat['timeout']) ? $config_mchat['timeout'] : 3600;// you can change this number to a greater number for longer chat sessions
$mchat_stats = mchat_users($mchat_session_time);
$template->assign_vars(array(
'MCHAT_INDEX_STATS' => true,
'MCHAT_INDEX_USERS_COUNT' => $mchat_stats['mchat_users_count'],
'MCHAT_INDEX_USERS_LIST' => $mchat_stats['online_userlist'],
'L_MCHAT_ONLINE_EXPLAIN' => $mchat_stats['refresh_message'],
));
}
}
// END mChat Mod
ค้นหา
โค้ด: เลือกทั้งหมด
$module->set_display('main', 'subscribed', false);
}
โค้ด: เลือกทั้งหมด
// BEGIN mChat Mod
if (!$config['mchat_enable'])
{
$module->set_display('mchat', '', false);
}
// END mChat Mod
ค้นหา
โค้ด: เลือกทั้งหมด
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
break;
โค้ด: เลือกทั้งหมด
// BEGIN mChat Mod
case 'mchat':
$location = $user->lang['MCHAT_TITLE'];
$location_url = append_sid("{$phpbb_root_path}mchat.$phpEx");
break;
// END mChat Mod
ค้นหา
โค้ด: เลือกทั้งหมด
// Additional tables
โค้ด: เลือกทั้งหมด
// BEGIN mChat Mod
define('MCHAT_TABLE', $table_prefix . 'mchat');
define('MCHAT_CONFIG_TABLE', $table_prefix . 'mchat_config');
define('MCHAT_SESSIONS_TABLE', $table_prefix . 'mchat_sessions');
// END mChat Mod
ค้นหา
โค้ด: เลือกทั้งหมด
// The following assigns all _common_ variables that may be used at any point in a template.
โค้ด: เลือกทั้งหมด
// BEGIN mChat Mod
$mchat_custom_page = false;
if(!empty($config['mchat_version']) && !empty($config['mchat_enable']))
{
global $cache;
if (!function_exists('mchat_cache'))
{
include($phpbb_root_path . 'includes/functions_mchat.' . $phpEx);
}
if (($config_mchat = $cache->get('_mchat_config')) === false)
{
mchat_cache();
}
$config_mchat = $cache->get('_mchat_config');
$mchat_custom_page = $config_mchat['custom_page'];
}
//END mChat Mod
โค้ด: เลือกทั้งหมด
'U_FAQ' => append_sid("{$phpbb_root_path}faq.$phpEx"),
โค้ด: เลือกทั้งหมด
// BEGIN mChat Mod
'U_MCHAT' => $auth->acl_get('u_mchat_view') && $mchat_custom_page ? append_sid("{$phpbb_root_path}mchat.$phpEx") : '',
'S_MCHAT_ON_INDEX' => (!empty($config['mchat_on_index']) && !empty($user->data['user_mchat_index'])) ? true : false,
'S_MCHAT_ENABLE' => (!empty($config['mchat_enable']) && $auth->acl_get('u_mchat_view')) ? true : false,
// END mChat Mod
ค้นหา
โค้ด: เลือกทั้งหมด
// Before we begin, we will remove the reports the user issued.
โค้ด: เลือกทั้งหมด
// BEGIN mChat mod
if (!function_exists('mchat_user_fix'))
{
include($phpbb_root_path . 'includes/functions_mchat.' . $phpEx);
}
mchat_user_fix($user_id);
// END mChat mod
ค้นหา
โค้ด: เลือกทั้งหมด
}
// Assign general variables
โค้ด: เลือกทั้งหมด
//BEGIN mChat Mod
case 'mchat':
$user->add_lang('mods/mchat_lang');
$data = array(
'user_mchat_index' => request_var('user_mchat_index',(bool) $user_row['user_mchat_index']),
'user_mchat_sound' => request_var('user_mchat_sound', (bool) $user_row['user_mchat_sound']),
'user_mchat_stats_index' => request_var('user_mchat_stats_index', (bool) $user_row['user_mchat_stats_index']),
'user_mchat_topics' => request_var('user_mchat_topics', (bool) $user_row['user_mchat_topics']),
'user_mchat_avatars' => request_var('user_mchat_avatars', (bool) $user_row['user_mchat_avatars']),
);
if ($submit)
{
$error = array();
if (!check_form_key($form_name))
{
$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'],
);
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
WHERE user_id = $user_id";
$db->sql_query($sql);
trigger_error($user->lang['USER_MCHAT_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id));
}
// Replace "error" strings with their real, localised form
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
}
$template->assign_vars(array(
'S_MCHAT' => true,
'DISPLAY_MCHAT' => $data['user_mchat_index'],
'SOUND_MCHAT' => $data['user_mchat_sound'],
'STATS_MCHAT' => $data['user_mchat_stats_index'],
'TOPICS_MCHAT' => $data['user_mchat_topics'],
'AVATARS_MCHAT' => $data['user_mchat_avatars'],
));
break;
// END mChat Mod
ค้นหา
โค้ด: เลือกทั้งหมด
โค้ด: เลือกทั้งหมด
// BEGIN mChat Mod
$lang = array_merge($lang, array(
// Prune Feature
'LOG_MCHAT_TABLE_PRUNED' => 'mChat Table was pruned',
'ACP_USER_MCHAT' => 'mChat Settings',
));
// END mChat Mod
ค้นหา
โค้ด: เลือกทั้งหมด
โค้ด: เลือกทั้งหมด
// BEGIN mChat Mod
$lang = array_merge($lang, array(
'MCHAT_TITLE' => 'Mini-Chat',
));
// END mChat Mod
ค้นหา
โค้ด: เลือกทั้งหมด
โค้ด: เลือกทั้งหมด
// BEGIN mChat Mod
$lang = array_merge($lang, array(
'UCP_CAT_MCHAT' => 'mChat',
'UCP_MCHAT_CONFIG' => 'Preferences',
));
// END mChat Mod
ค้นหา
โค้ด: เลือกทั้งหมด
textarea.focus();
baseHeight = doc.selection.createRange().duplicate().boundingHeight;
โค้ด: เลือกทั้งหมด
/* === mChat focus fix Start === */
var mChatFocus = window.mChatFocusFix || false;
if(!mChatFocus)
{
textarea.focus();
}
baseHeight = doc.selection.createRange().duplicate().boundingHeight;
/* ==== mChat focus fix End ==== */
โค้ด: เลือกทั้งหมด
for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++)
โค้ด: เลือกทั้งหมด
try
{
โค้ด: เลือกทั้งหมด
caretPos.end = txtarea.sel_start;
โค้ด: เลือกทั้งหมด
}
catch(e)
{
}
ค้นหา
โค้ด: เลือกทั้งหมด
<!-- INCLUDE forumlist_body.html -->
โค้ด: เลือกทั้งหมด
<!-- IF S_MCHAT_ENABLE and S_MCHAT_ON_INDEX and S_MCHAT_LOCATION --><!-- INCLUDE mchat_body.html --><!-- ENDIF -->
โค้ด: เลือกทั้งหมด
<!-- IF S_MCHAT_ENABLE and S_MCHAT_ON_INDEX and not S_MCHAT_LOCATION --><!-- INCLUDE mchat_body.html --><!-- ENDIF -->
โค้ด: เลือกทั้งหมด
<!-- IF S_DISPLAY_BIRTHDAY_LIST and BIRTHDAY_LIST -->
โค้ด: เลือกทั้งหมด
<!-- INCLUDE mchat_stats.html -->
โค้ด: เลือกทั้งหมด
</head>
โค้ด: เลือกทั้งหมด
<!-- IF S_MCHAT_ENABLE and (S_MCHAT_ON_INDEX or U_MCHAT) -->
<script type="text/javascript" src="{ROOT_PATH}mchat/jquery-1.5.0.min.js"></script>
<script type="text/javascript" src="{ROOT_PATH}mchat/jquery_cookie_mini.js"></script>
<!-- ENDIF -->
โค้ด: เลือกทั้งหมด
<li class="icon-faq"><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}">{L_FAQ}</a></li>
โค้ด: เลือกทั้งหมด
<!-- IF S_MCHAT_ENABLE and U_MCHAT --><li class="icon-bump"><a href="{U_MCHAT}#mChat" title="{L_MCHAT_TITLE}">{L_MCHAT_TITLE}</a></li><!-- ENDIF -->
ค้นหา
โค้ด: เลือกทั้งหมด
@import url("colours.css");
โค้ด: เลือกทั้งหมด
@import url("mchat.css");
โค้ด: เลือกทั้งหมด
mchat_install.php