Scritto da Stoker
Mettere il mchat sulla pagina del portale è abbastanza facile. È necessario avere il mod mchat installato.
Iniziamo con le modifiche al template.
Apri styles/prosilver/template/simpleportal_body.html
Trova:
Codice: Seleziona tutto
<table cellpadding="0" cellspacing="0" border="0" width="100%">
Codice: Seleziona tutto
<!-- IF S_MCHAT_ENABLE and S_MCHAT_ON_INDEX and S_MCHAT_LOCATION --><!-- INCLUDE mchat_body.html --><!-- ENDIF -->
Codice: Seleziona tutto
</table>
Codice: Seleziona tutto
<!-- IF S_MCHAT_ENABLE and S_MCHAT_ON_INDEX and not S_MCHAT_LOCATION --><!-- INCLUDE mchat_body.html --><!-- ENDIF -->
Trova:
Codice: Seleziona tutto
page_header($user->lang['PORTAL_HEADLINE']);
Codice: Seleziona tutto
// 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
Se si utilizza quella, saltare la modifica portal.php e modificare il gancio invece.
Apri includes/hooks/hook_mchat.php
Trova:
Codice: Seleziona tutto
if($user->page['page'] == 'index.'.$phpEx)
Codice: Seleziona tutto
if(($user->page['page'] == 'index.'.$phpEx) || ($user->page['page'] == 'portal.'.$phpEx))