Mchat on portal

Download and support for PhpBB3 Simple Portal
User avatar
neuropass
BBCoder IV
BBCoder IV
Posts: 173
Joined: 11 Apr 2010, 02:33

Mchat on portal

Post by neuropass »

Hey Stoker,

How do you get to display the new mchat to your portal? I used to use this code but it seems to be causing conflict.

Code: Select all

// BEGIN mChat Mod
$mchat_installed = (!empty($config['mchat_on_index']) && !empty($config['mchat_enable'])) ? true : false;
if(!defined('MCHAT_INCLUDE') && $mchat_installed && $auth->acl_get('u_mchat_view') && $user->data['user_mchat_index'])
{
	define('MCHAT_INCLUDE', true);
	$mchat_include_index = true;
	include($phpbb_root_path . 'mchat.' . $phpEx);
}
// END mChat Mod
Modd it up! TweakScene ;-) Support us! || Follow us ||

Image
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Mchat on portal

Post by Stoker »

This is the code mchat 1.3.5 is adding to index.php:

Code: Select all

// 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
Add it to portal.php and offcourse the html from index_body.html to the simpleportal_body.html
Board rules! No PM support
User avatar
martin123456
BBCoder VI
BBCoder VI
Posts: 765
Joined: 25 Jul 2011, 13:29
BBCodes: 34
Favourite MOD: Ban button
Location: Down south!
Contact:

Mchat on portal

Post by martin123456 »

I tried the above on premod but got this
mchat.png
any pointer's in the right direction ?
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Mchat on portal

Post by Stoker »

Yes, find the exact version of the mchat you are using and do the edits from index.php to portal.php and index_body.html to simpleportal_body.html
Board rules! No PM support
User avatar
martin123456
BBCoder VI
BBCoder VI
Posts: 765
Joined: 25 Jul 2011, 13:29
BBCodes: 34
Favourite MOD: Ban button
Location: Down south!
Contact:

Mchat on portal

Post by martin123456 »

Can you pls explain it in even more simple terms

i have mchat 135 installed here it what is on my index.php

Code: Select all

// 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
so we find edits on the index.php and copy them to portal.php and to the index_body.html and then to the simpleportal_body.html ?

am i reading it right ? is there an add after or add before for the portal.php,index_body.html,simpleportal_body.html or do we just place the mchat code where we want it to appear on the said files.
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Mchat on portal

Post by Stoker »

The index.php code goes BEFORE this in portal.php

The first index_body.html edit goes before this on simpleportal_body.html

Code: Select all

<table cellpadding="0" cellspacing="0" border="0" width="100%">
The second edit goes after

Code: Select all

</table>
Board rules! No PM support
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Mchat on portal

Post by Stoker »

BTW- Do you use the hook that Rich has created for the mchat?
Board rules! No PM support
User avatar
martin123456
BBCoder VI
BBCoder VI
Posts: 765
Joined: 25 Jul 2011, 13:29
BBCodes: 34
Favourite MOD: Ban button
Location: Down south!
Contact:

Mchat on portal

Post by martin123456 »

Off the top of my head no
User avatar
martin123456
BBCoder VI
BBCoder VI
Posts: 765
Joined: 25 Jul 2011, 13:29
BBCodes: 34
Favourite MOD: Ban button
Location: Down south!
Contact:

Mchat on portal

Post by martin123456 »

Open styles/prosilver/template/index_body.html
Find:

Code: Select all

<table cellpadding="0" cellspacing="0" border="0" width="100%">
No such code in my /STYLES prosilver/ or se_pro. or .se_square_left/template/index_body.html

i'm a premod user if that helps ?
User avatar
Stoker
Site Admin
Site Admin
Posts: 3536
Joined: 12 May 2008, 23:26
BBCodes: 239
Favourite BBCode: Anipro
Favourite MOD: PrettyPhoto
Location: Denmark
Contact:

Mchat on portal

Post by Stoker »

Sorry: Open styles/prosilver/template/simpleportal_body.html
Board rules! No PM support
Locked