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

phpBB mChat

remove mchat from index.php and add in custom login page - phpBB mChat

remove mchat from index.php and add in custom login page

by pmuppala » Tue Aug 03, 2010 1:10 am

I am wondering how to remove mchat from index.php, and add it in the custom login page. here is the code for custom pages

test.php

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

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

// To check if user is logged in

//if ($user->data['user_id'] == ANONYMOUS)
//{
//    login_box('', $user->lang['LOGIN']);
//}


// BEGIN mChat Mod
if(!defined('MCHAT_INCLUDE') && $config['mchat_on_index'] && $config['mchat_enable'] && $auth->acl_get('u_mchat_view'))
{
        define('MCHAT_INCLUDE', true);
        $mchat_include_index = true;
        include($phpbb_root_path.'mchat.'.$phpEx);
}
// END mChat Mod

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

make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>


test_body.html

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-gb" xml:lang="en-gb">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-language" content="en-gb" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta name="copyright" content="2000, 2002, 2005, 2007 phpBB Group" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

<script type="text/javascript" src="/frontend/styleswitcher.js"></script>
<script type="text/javascript" src="/frontend/forum_fn.js"></script>
<script type="text/javascript" src="/frontend/animatedcollapse.js"></script>
<link href="/frontend/stylesheet.css" rel="stylesheet" type="text/css" />
<link href="/frontend/coffee.css" rel="stylesheet" type="text/css" />

<!--[if lt IE 7]>
<link href="/frontend/fix_ie6.css" rel="stylesheet" type="text/css" media="screen, projection" />
<![endif]-->

<!-- IF S_MCHAT_ENABLE -->
<script type="text/javascript" src="/forums/mchat/jquery_core_mini.js"></script>
<script type="text/javascript" src="/forums/mchat/jquery_cookie_mini.js"></script>
<link rel="stylesheet" href="/forums/mchat/mchat_prosilver.css" type="text/css" />
<!-- ENDIF -->

</head>

<body id="phpbb" class="section-index1 ltr">
<div id="wrap">
<!--[if lte IE 6]>
<p style="color: red; font-weight: bold;">Your browser is causing web developers a lot of headaches. Please <a href="http://www.stopie6.com">upgrade</a>.
<![endif]-->
        <a id="top" name="top" accesskey="t"></a>
        <div id="page-header">
        <div id="header">
                <p class="skiplink"><a href="#start_here">Skip to content</a></p>
                        <ul>
                                <li class="inactive"><a href="/index.php" title="Home">Home</a></li>
                                <li class="inactive"><a href="/forums/index.php" title="Forums">Forum</a></li>
                                <li class="inactive"><a href="/forums/mchat.php" title="Chat">Chat</a></li>
                                <li class="inactive"><a href="/forums/livetv.php" title="Live TV">Live TV</a></li>
                                <li class="inactive"><a href="/forums/music.php" title="Music">Live Music</a></li>
                                <li class="inactive"><a href="/forums/tools.php" title="Tools">Tools</a></li>
                                <li class="inactive"><a href="/forums/disclaimer.php" title="Disclaimer">Disclaimer</a></li>
                                <li class="inactive"><a href="/forums/privacy.php" title="Privacy Policy">Policy</a></li>
                                <li class="inactive"><a href="/forums/contact.php" title="Contact">Contact US</a></li>
                        </ul>
               
                        <div id="site-description">
                                <p>A great website to cram, pleasure and unwind</p>

                                   </div>

                <table width="100%" align="center" border="1">
                <tr><td align="center">
                <div id="<!-- IF S_USER_LOGGED_IN -->nav_icons_login<!-- ELSE -->nav_icons_logout<!-- ENDIF -->">
                <!-- IF not S_IS_BOT and S_USER_LOGGED_IN -->
                <div id="icon_pms"><a href="/forums/ucp.php?i=174" title="Mail"><span class="gohst-space"></span>Mail</a></div>
                <div id="icon_ucpro"><a href="/forums/ucp.php?i=main&mode=front" title="Profile" accesskey="e"><span class="gohst-space"></span>Profile</a></div>
                <div id="icon_memberl"><a href="/forums/ucp.php?i=invite&mode=invite" title="Invite a Friend"><span class="gohst-space"></span>Invite a Friend</a></div
                <div id="icon_log"><a href="{U_LOGIN_LOGOUT}&redirect=/forums/main.php" title="{L_LOGIN_LOGOUT}" accesskey="l"><span class="gohst-space"></span>{L_LOGOUT}</a></div>
                <!-- ENDIF -->
                <!-- IF not S_IS_BOT -->
                <!-- IF not S_USER_LOGGED_IN -->
                <div id="icon_regist"><a href="/forums/ucp.php?mode=register" title="Register"><span class="gohst-space"></span>Register</a></div>
               
                <form action="./ucp.php?mode=login" method="post">
                        <table width="75%" align="center"><tr><td>
                        <label for="username" STYLE="color: #ffffff; font-family: Verdana; font-size: 12px;">Username:</label></td><td>
                        <input type="text" tabindex="1" name="username" size="25" value="" class="inputbox autowidth"/>
                        </td></tr>
                        <tr><td>
                        <label for="password" STYLE="color: #ffffff; font-family: Verdana; font-size: 12px;">Password:</label></td><td>
                        <input type="password" tabindex="1" name="password" size="25" value="" class="inputbox autowidth" />
                        <input type="submit" name="login" tabindex="6" value="Login" class="button1" />
                        </td></tr>
                        <tr><td></td><td>
                        <a href="./ucp.php?mode=sendpassword" STYLE="color: #ffffff; font-family: Verdana; font-size: 12px;">I forgot my password</a>
                        </td></tr>
                        <tr><td></td><td>
                        <label for="autologin" STYLE="color: #ffffff; font-family: Verdana; font-size: 12px;"><input type="checkbox" name="autologin" tabindex="4" /> Log me on automatically each visit</label>
                        </td></tr>
                        <tr><td></td><td>
                        <label for="viewonline" STYLE="color: #ffffff; font-family: Verdana; font-size: 12px;"><input type="checkbox" name="viewonline" tabindex="5" /> Hide my online status this session</label>
                        </td></tr>
                        <td><tr>
                        <input type="hidden" name="sid" value="a91ae8705567e38dec9996e691aab506" />
                        <input type="hidden" name="redirect" value="index.php" />
                        <input type="hidden" name="redirect" value="/forums/main.php">
                        </td></tr>
                        </td></tr>
                </form>
                <!-- ENDIF -->
                <!-- ENDIF -->
                </div>
        </tr></table>
                </div>
                </div>
        </div>
</div>

<table height="125" width="100%">
<tr>
<td> &nbsp </td>
</tr>
</table>

<div id="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a> &copy; 2000, 2002, 2005, 2007 phpBB Group.
                <br />Coffee Time - Free style by <a href="http://www.cosa-nostra-design.com/" title="Pimp your style phpBB3!">CoSa NoStrA DeSiGn</a> &bull; Original WebDesign by <a href="http://www.templateworld.com/index.html" title="Template World">Template World</a>
        </div>

</body>
</html>


Thanks in advance for your help.
pmuppala
Registered User
Posts: 46
Joined: Sat Jun 12, 2010 1:29 am
Contact:

Re: remove mchat from index.php and add in custom login page

by pmuppala » Tue Aug 03, 2010 10:29 am

I had some luck in removing mchat from forum index page.

I have removed the entries in the following pages

Code: Select all

 index.php, index_body.html, overall_header.html 


To add in the custom page, I have added the java scripts and entries in index.php to test.php and index_body.html and overall_header.html to test_body.html.

mchat did appear but its alignment is completely messed up and it is aligned to the left. Here is the code for test_body.html

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-gb" xml:lang="en-gb">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-language" content="en-gb" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta name="copyright" content="2000, 2002, 2005, 2007 phpBB Group" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

<script type="text/javascript" src="/frontend/styleswitcher.js"></script>
<script type="text/javascript" src="/frontend/forum_fn.js"></script>
<script type="text/javascript" src="/frontend/animatedcollapse.js"></script>
<link href="/frontend/stylesheet.css" rel="stylesheet" type="text/css" />
<link href="/frontend/coffee.css" rel="stylesheet" type="text/css" />

<!--[if lt IE 7]>
<link href="/frontend/fix_ie6.css" rel="stylesheet" type="text/css" media="screen, projection" />
<![endif]-->

<!-- IF S_MCHAT_ENABLE -->
<script type="text/javascript" src="/forums/mchat/jquery_core_mini.js"></script>
<script type="text/javascript" src="/forums/mchat/jquery_cookie_mini.js"></script>
<link rel="stylesheet" href="/forums/mchat/mchat_prosilver.css" type="text/css" />
<!-- ENDIF -->

</head>

<body id="phpbb" class="section-index1 ltr">
<div id="wrap">
<!--[if lte IE 6]>
<p style="color: red; font-weight: bold;">Your browser is causing web developers a lot of headaches. Please <a href="http://www.stopie6.com">upgrade</a>.
<![endif]-->
        <a id="top" name="top" accesskey="t"></a>
        <div id="page-header">
        <div id="header">
                <p class="skiplink"><a href="#start_here">Skip to content</a></p>
                        <ul>
                                <li class="inactive"><a href="/index.php" title="Home">Home</a></li>
                                <li class="inactive"><a href="/forums/index.php" title="Forums">Forum</a></li>
                                <li class="inactive"><a href="/forums/mchat.php" title="Chat">Chat</a></li>
                                <li class="inactive"><a href="/forums/livetv.php" title="Live TV">Live TV</a></li>
                                <li class="inactive"><a href="/forums/music.php" title="Music">Live Music</a></li>
                                <li class="inactive"><a href="/forums/tools.php" title="Tools">Tools</a></li>
                                <li class="inactive"><a href="/forums/disclaimer.php" title="Disclaimer">Disclaimer</a></li>
                                <li class="inactive"><a href="/forums/privacy.php" title="Privacy Policy">Policy</a></li>
                                <li class="inactive"><a href="/forums/contact.php" title="Contact">Contact US</a></li>
                        </ul>
               
                        <div id="site-description">
                                <p>A great website to cram, pleasure and unwind</p>

                                   </div>

                <table width="100%" align="center" border="1">
                <tr><td align="center">
                <div id="<!-- IF S_USER_LOGGED_IN -->nav_icons_login<!-- ELSE -->nav_icons_logout<!-- ENDIF -->">
                <!-- IF not S_IS_BOT and S_USER_LOGGED_IN -->
                <div id="icon_pms"><a href="/forums/ucp.php?i=174" title="Mail"><span class="gohst-space"></span>Mail</a></div>
                <div id="icon_ucpro"><a href="/forums/ucp.php?i=main&mode=front" title="Profile" accesskey="e"><span class="gohst-space"></span>Profile</a></div>
                <div id="icon_memberl"><a href="/forums/ucp.php?i=invite&mode=invite" title="Invite a Friend"><span class="gohst-space"></span>Invite a Friend</a></div
                <div id="icon_log"><a href="{U_LOGIN_LOGOUT}&redirect=/forums/main.php" title="{L_LOGIN_LOGOUT}" accesskey="l"><span class="gohst-space"></span>{L_LOGOUT}</a></div>
                <!-- ENDIF -->
                <!-- IF not S_IS_BOT -->
                <!-- IF not S_USER_LOGGED_IN -->
                <div id="icon_regist"><a href="/forums/ucp.php?mode=register" title="Register"><span class="gohst-space"></span>Register</a></div>
               
                <form action="./ucp.php?mode=login" method="post">
                        <table width="75%" align="center"><tr><td>
                        <label for="username" STYLE="color: #ffffff; font-family: Verdana; font-size: 12px;">Username:</label></td><td>
                        <input type="text" tabindex="1" name="username" size="25" value="" class="inputbox autowidth"/>
                        </td></tr>
                        <tr><td>
                        <label for="password" STYLE="color: #ffffff; font-family: Verdana; font-size: 12px;">Password:</label></td><td>
                        <input type="password" tabindex="1" name="password" size="25" value="" class="inputbox autowidth" />
                        <input type="submit" name="login" tabindex="6" value="Login" class="button1" />
                        </td></tr>
                        <tr><td></td><td>
                        <a href="./ucp.php?mode=sendpassword" STYLE="color: #ffffff; font-family: Verdana; font-size: 12px;">I forgot my password</a>
                        </td></tr>
                        <tr><td></td><td>
                        <label for="autologin" STYLE="color: #ffffff; font-family: Verdana; font-size: 12px;"><input type="checkbox" name="autologin" tabindex="4" /> Log me on automatically each visit</label>
                        </td></tr>
                        <tr><td></td><td>
                        <label for="viewonline" STYLE="color: #ffffff; font-family: Verdana; font-size: 12px;"><input type="checkbox" name="viewonline" tabindex="5" /> Hide my online status this session</label>
                        </td></tr>
                        <td><tr>
                        <input type="hidden" name="sid" value="a91ae8705567e38dec9996e691aab506" />
                        <input type="hidden" name="redirect" value="index.php" />
                        <input type="hidden" name="redirect" value="/forums/main.php">
                        </td></tr>
                        </td></tr>
                </form>
                <!-- ENDIF -->
                <!-- ENDIF -->
                </div>
        </tr></table>
                </div>
                </div>
        </div>
</div>

<table height="125" width="100%">
<tr>
<td> &nbsp </td>
</tr>
</table>

<!-- 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 -->

<div id="copyright">Powered by <a href="http://www.phpbb.com/">phpBB</a> &copy; 2000, 2002, 2005, 2007 phpBB Group.
                <br />Coffee Time - Free style by <a href="http://www.cosa-nostra-design.com/" title="Pimp your style phpBB3!">CoSa NoStrA DeSiGn</a> &bull; Original WebDesign by <a href="http://www.templateworld.com/index.html" title="Template World">Template World</a>
        </div>

</body>
</html>


I am using coffee_theme for the custom pages, here is the screen shot of the same.
Attachments
Screen shot 2010-08-03 at 7.26.31 AM.png
screen shot of alignment not correct
pmuppala
Registered User
Posts: 46
Joined: Sat Jun 12, 2010 1:29 am
Contact:

Re: remove mchat from index.php and add in custom login page

by RMcGirr83 » Tue Aug 03, 2010 1:00 pm

Your html file is a mess. You have misaligned divs, an unclosed div (<div) and it is extremely difficult to read.

You want to place the call to mchat_body.html within the <div id="wrap"> to get it to align properly.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21033
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: remove mchat from index.php and add in custom login page

by pmuppala » Tue Aug 03, 2010 4:07 pm

Sorry about the test_body.html. I was working on it and fixing it as I have uploaded to site. I have cleaned up pretty much most of the stuff out of it. Here is the simplified version.

test_body.html

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-gb" xml:lang="en-gb">
<head>
<meta name="google-site-verification" content="PbwMrRoKBtkuDBbizfog7Q15ctE2I5bIJ_MfI0oK0sI" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-language" content="en-gb" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta name="copyright" content="2000, 2002, 2005, 2007 phpBB Group" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

<title>www.lazyguyscafe.com</title>

<script type="text/javascript" src="http://lazyguyscafe.com/frontend/styleswitcher.js"></script>
<script type="text/javascript" src="http://lazyguyscafe.com/frontend/forum_fn.js"></script>
<script type="text/javascript" src="http://lazyguyscafe.com/frontend/animatedcollapse.js"></script>
<link href="http://lazyguyscafe.com/frontend/stylesheet.css" rel="stylesheet" type="text/css" />
<link href="http://lazyguyscafe.com/frontend/coffee.css" rel="stylesheet" type="text/css" />

<!--[if lt IE 7]>
<link href="http://lazyguyscafe.com/frontend/fix_ie6.css" rel="stylesheet" type="text/css" media="screen, projection" />
<![endif]-->

<!-- IF S_MCHAT_ENABLE -->
<script type="text/javascript" src="/forums/mchat/jquery_core_mini.js"></script>
<script type="text/javascript" src="/forums/mchat/jquery_cookie_mini.js"></script>
<link rel="stylesheet" href="/forums/mchat/mchat_prosilver.css" type="text/css" />
<!-- ENDIF -->

</head>

<body id="phpbb">
<div id="wrap">
   <a id="top" name="top" accesskey="t"></a>
   <div id="header">
      <p class="skiplink"><a href="#start_here">Skip to content</a></p>
         <ul>
            <li class="inactive"><a href="/index.php" title="Home">Home</a></li>
            <li class="inactive"><a href="/forums/index.php" title="Forums">Forum</a></li>
         </ul>
      
         <div id="site-description">
            <h1>lazyguyscafe</h1>
            <p>A great website to cram, pleasure and unwind</p>
         </div>
   </div>

</div>
<!-- INCLUDE mchat_body.html -->
</body>
</html>


mchat_body.html

Code: Select all

<!-- IF not MCHAT_READ_MODE -->
<div id="wrap">
<div class="forabg">
<div class="inner">
         <ul class="topiclist">
            <li class="header">
               <dl class="icon">
                  <dt><!-- IF MCHAT_ARCHIVE_MODE -->ARCHIVE<!-- ELSE -->CHAT<!-- ENDIF --></dt>
               </dl>
            </li>
         </ul>
</div></div></div>
<!-- ENDIF -->


I just want to display the top first correctly, so that I can extend the same to bottom, I am guessing something, I missed in css files.

screen shot of current
Attachments
untitled.PNG
right hand side, the lines are not matching even with id="wrap" in div tag
pmuppala
Registered User
Posts: 46
Joined: Sat Jun 12, 2010 1:29 am
Contact:

Re: remove mchat from index.php and add in custom login page

by RMcGirr83 » Tue Aug 03, 2010 5:21 pm

Code: Select all

   <!-- INCLUDE mchat_body.html -->
    </div>
    </body>
    </html>


You have to place the mchat_body.html within the wrap div
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21033
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: remove mchat from index.php and add in custom login page

by pmuppala » Tue Aug 03, 2010 6:09 pm

I have tried that, it did not work out.
Attachments
untitled.PNG
pmuppala
Registered User
Posts: 46
Joined: Sat Jun 12, 2010 1:29 am
Contact:

Re: remove mchat from index.php and add in custom login page

by pmuppala » Tue Aug 03, 2010 6:10 pm

Please do let me know, if you like to have coffee time theme zip file, I can try to upload it for you in here.
pmuppala
Registered User
Posts: 46
Joined: Sat Jun 12, 2010 1:29 am
Contact:

Re: remove mchat from index.php and add in custom login page

by Scottish2 » Sat Jan 12, 2019 2:13 pm

I think this is the same thing I am trying to do. Where did you have to upload the new files to? To the main PHPBB folder or the stles page where were the files uploaded to once completed?

Thanks
Scottish2
Registered User
Posts: 124
Joined: Sun Mar 04, 2007 3:00 pm