Warning: The author of this contribution does not provide support for it anymore.

phpBB mChat

Move mchat to homepage - phpBB mChat

Move mchat to homepage

by wayde » Sat Jan 19, 2013 11:32 am

I looked through the topics, but didn't find this.

Is it possible to show/move the shoutbox from my forum to my main website? Sort of to export it?
wayde
Registered User
Posts: 27
Joined: Sat Jan 19, 2013 7:52 am
Contact:

Re: Move mchat to homepage

by Noah Ivaldi » Sat Jan 19, 2013 10:04 pm

All phpBB modules (MODs) are installed on your forum. They are located in the database of your forum alone. If there is a way to have a part of your forum embedded on your main website, that's something that is up to you/your web designer/the capabilities of your website's software. It has nothing to do with mChat's capabilities or anything else of phpBB.
Noah Ivaldi
Registered User
Posts: 81
Joined: Thu Jun 09, 2011 3:00 pm
Contact:

Re: Move mchat to homepage

by RMcGirr83 » Sat Jan 19, 2013 10:32 pm

You can't "esport it" you can use a custom page though to include it

https://www.phpbb.com/kb/article/add-a- ... -to-phpbb/
Appreciate the extensions/mods/support then buy me a beerImage
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
User avatar
RMcGirr83
Former Team Member
Posts: 21490
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Move mchat to homepage

by wayde » Fri Feb 01, 2013 10:51 am

EDIT: Got it.

Thank you for your responses.

Im trying to edit the mchat_body.html so that it contains the chat window only.
The idea was to use iframe then for embedding the mchat.php in my website.

I successfully removed the footer, but there is a problem with the forum header. When I remove it all of the styling is lost. How to overcome this?
wayde
Registered User
Posts: 27
Joined: Sat Jan 19, 2013 7:52 am
Contact:

Re: Move mchat to homepage

by BioLogIn » Tue Feb 12, 2013 9:09 am

I hope something like this will help:

mchat_standalone.php

Code: Select all

<?php

 define('IN_PHPBB', true);

 $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './forum/';
 $phpEx = substr(strrchr(__FILE__, '.'), 1);

 include($phpbb_root_path . 'common.' . $phpEx);

 $user->session_begin();
 $auth->acl($user->data);
 $user->setup();

 $html='<html><head><link href="'.$phpbb_root_path.'/styles/prosilver_avalon/theme/mchat.css" rel="stylesheet" /></head><body>';
 $html.='<script type="text/javascript" src="'.$phpbb_root_path.'/styles/prosilver_avalon/template/editor.js"></script>';
 $html.='<script type="text/javascript" src="'.$phpbb_root_path.'/mchat/jquery-1.5.0.min.js"></script>';
 $html.='<script type="text/javascript" src="'.$phpbb_root_path.'/mchat/jquery_cookie_mini.js"></script>';
 $html.='<script type="text/javascript" src="'.$phpbb_root_path.'/mchat/mchat_ajax_mini.js"></script>';
 $html.='<script type="text/javascript">
// <![CDATA[
   var root_path = "'.$phpbb_root_path.'";
// ]]>   
  </script>';
  echo $html;

 $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);
   }   

   $user->add_lang('mods/mchat_lang');

   $template->assign_vars(array(
         'ROOT_PATH'   => $phpbb_root_path,   
   ));

   $template->set_filenames(array('body' => 'mchat_body.html'));

   $template->display('body');
 }

 echo '</body></html>';
?>
BioLogIn
Registered User
Posts: 172
Joined: Sun Jan 06, 2008 10:51 am
Contact:

Re: Move mchat to homepage

by wayde » Sat Feb 23, 2013 3:01 pm

Edit. Problem solved.
wayde
Registered User
Posts: 27
Joined: Sat Jan 19, 2013 7:52 am
Contact:

Re: Move mchat to homepage

by Jerzykk » Wed Jan 20, 2016 11:29 am

I want to move mchat to the homepage. I tried to do this this way:

Code: Select all

<iframe src="http://localhost/my_site/forum/app.php/mchat" width="500" height="300" style="border: none;"></iframe>

and it works, but not only the chat window is loaded to iframe but also the forum header and the footer.

So I tried to modify this code:
https://www.phpbb.com/customise/db/mod/ ... 66#p269266

and I created file mchat_standalone.php (in the forum subdirectory) containing this modified code:

Code: Select all

<?php

 define('IN_PHPBB', true);

 $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
 $phpEx = substr(strrchr(__FILE__, '.'), 1);

 include($phpbb_root_path . 'common.' . $phpEx);
 

 $user->session_begin();
 $auth->acl($user->data);
 $user->setup();

 $html='<html><head><link href="'.$phpbb_root_path.'ext/dmzx/mchat/styles/prosilver/theme/mchat.css" rel="stylesheet" /></head><body>';
 $html.='<script type="text/javascript" src="'.$phpbb_root_path.'assets/javascript/editor.js"></script>';
 $html.='<script type="text/javascript" src="'.$phpbb_root_path.'assets/javascript/jquery.min.js"></script>';
 $html.='<script type="text/javascript" src="'.$phpbb_root_path.'styles/prosilver/template/ajax.js"></script>';
 $html.='<script type="text/javascript">
// <![CDATA[
   var root_path = "'.$phpbb_root_path.'";
// ]]>   
  </script>';
  echo $html;

 $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 . 'ext/dmzx/mchat/controller/mchat.' . $phpEx);
   }   

   //$user->add_lang('mods/mchat_lang');

   $template->assign_vars(array(
         'ROOT_PATH'   => $phpbb_root_path,   
   ));

   $template->set_filenames(array('body' => 'ext/dmzx/mchat/styles/prosilver/template/mchat_body.html'));

   $template->display('body');
 }

 echo '</body></html>';
?>


but it doesn't work. What I do wrong?

PS I have installed phpBB 3.1.6 (in the forum subdirectory) and mChat 0.3.2 (in the forum/ext/dmzx/mchat subdirectory):
viewtopic.php?f=456&t=2281451
Jerzykk
Registered User
Posts: 13
Joined: Wed Oct 28, 2015 11:53 am
Contact:

Re: Move mchat to homepage

by RMcGirr83 » Wed Jan 20, 2016 11:39 am

You need to ask in the extension topic not in this one as it is for the validated modification.
Appreciate the extensions/mods/support then buy me a beerImage
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
User avatar
RMcGirr83
Former Team Member
Posts: 21490
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact: