Integrating FlashChat with MyBB Forum Template

by Veronica Transa

Log into MyBB as the Administrator and open the Admin CP.

As shown below, scroll down to the Templates menu item and click on "Modify / Delete".

Under "Default Templates", click "Expand":

Choose the Header Template and click "Change Original", or "Edit" if you have recently made modifications:

You now have two alternatives for how the chat, and the "who's in the chat" window, will open...

Alternative 1:

Alternative 2:

Choose one of these two alternatives and replace the template with the corresponding code block below. You can at any time in the future change this code block again by following these instructions.

Replace the entire block of code with this code: (alternative 1)

<script language="Javascript" type="text/javascript">
var cookieDomain = "$settings[cookiedomain]";
var cookiePath = "$settings[cookiepath]";
var quickdelete_confirm = "$lang->quickdelete_confirm";
var newpm_prompt = "$lang->newpm_prompt";
var deleteevent_confirm = "$lang->deleteevent_confirm";
var removeattach_confirm = "$lang->removeattach_confirm";
</script>
<a name="top"></a>
<div id="container">
<div id="header">
<div class="logo"><a href="$settings[bburl]/index.php"><img src="$theme[logo]" alt="$settings[bbname]" border="0" /></a></div>
<div class="menu">
<ul>
<li><a href="$settings[bburl]/chat/flashchat.php" target="_blank"><img src="$theme[imgdir]/toplinks/memberlist.gif" border="0" alt="$lang->toplinks_chat" />$lang->toplinks_chat</a></li>
<li><a href="$settings[bburl]/chat/info.php" target="_blank"><img src="$theme[imgdir]/toplinks/memberlist.gif" border="0" alt="$lang->toplinks_whoinchat" />$lang->toplinks_whoinchat</a></li>
<li><a href="$settings[bburl]/search.php"><img src="$theme[imgdir]/toplinks/search.gif" border="0" alt="$lang->toplinks_search" />$lang->toplinks_search</a></li>
<li><a href="$settings[bburl]/memberlist.php"><img src="$theme[imgdir]/toplinks/memberlist.gif" border="0" alt="$lang->toplinks_memberlist" />$lang->toplinks_memberlist</a></li>
<li><a href="$settings[bburl]/calendar.php"><img src="$theme[imgdir]/toplinks/calendar.gif" border="0" alt="$lang->toplinks_calendar" />$lang->toplinks_calendar</a></li>
<li><a href="$settings[bburl]/misc.php?action=help"><img src="$theme[imgdir]/toplinks/help.gif" border="0" alt="$lang->toplinks_help" />$lang->toplinks_help</a></li>
</ul>
</div>
<hr class="hidden" />
<div id="panel">
$welcomeblock
</div>
</div>
<hr class="hidden" />
<br class="clear" />
<div id="content">
$bannedwarning
$bbclosedwarning
$unreadreports
<navigation>
<br class="clear" />

Replace the entire block of code with this code: (alternative 2)

<script language="Javascript" type="text/javascript">
var cookieDomain = "$settings[cookiedomain]";
var cookiePath = "$settings[cookiepath]";
var quickdelete_confirm = "$lang->quickdelete_confirm";
var newpm_prompt = "$lang->newpm_prompt";
var deleteevent_confirm = "$lang->deleteevent_confirm";
var removeattach_confirm = "$lang->removeattach_confirm";
</script>
<a name="top"></a>
<div id="container">
<div id="header">
<div class="logo"><a href="$settings[bburl]/index.php"><img src="$theme[logo]" alt="$settings[bbname]" border="0" /></a></div>
<div class="menu">
<ul>
<li><a href="$settings[bburl]/chat/flashchat.php" target="ChatWindow" onClick="window.open('','ChatWindow','height=650,width=900,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes');"><img src="$theme[imgdir]/toplinks/memberlist.gif" border="0" alt="$lang->toplinks_chat" />$lang->toplinks_chat</a></li>
<li><a href="$settings[bburl]/chat/info.php" target="InfoChatWindow" onClick="window.open('','InfoChatWindow','height=400,width=320,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes');"><img src="$theme[imgdir]/toplinks/memberlist.gif" border="0" alt="$lang->toplinks_whoinchat" />$lang->toplinks_whoinchat</a></li>
<li><a href="$settings[bburl]/search.php"><img src="$theme[imgdir]/toplinks/search.gif" border="0" alt="$lang->toplinks_search" />$lang->toplinks_search</a></li>
<li><a href="$settings[bburl]/memberlist.php"><img src="$theme[imgdir]/toplinks/memberlist.gif" border="0" alt="$lang->toplinks_memberlist" />$lang->toplinks_memberlist</a></li>
<li><a href="$settings[bburl]/calendar.php"><img src="$theme[imgdir]/toplinks/calendar.gif" border="0" alt="$lang->toplinks_calendar" />$lang->toplinks_calendar</a></li>
<li><a href="$settings[bburl]/misc.php?action=help"><img src="$theme[imgdir]/toplinks/help.gif" border="0" alt="$lang->toplinks_help" />$lang->toplinks_help</a></li>
</ul>
</div>
<hr class="hidden" />
<div id="panel">
$welcomeblock
</div>
</div>
<hr class="hidden" />
<br class="clear" />
<div id="content">
$bannedwarning
$bbclosedwarning
$unreadreports
<navigation>
<br class="clear" />

When you have pasted the new code in the Header Template box, click on "Update Template"

Now, you must add the nav bar text. To do this, add the two bolded lines to your MyBB directory /inc/languages/english/global.lang.php script file:

<?php
$l['redirect_width'] = "50%";
$l['lastvisit_never'] = "Never";

$l['toplinks_chat'] = "Chat";
$l['toplinks_whoinchat'] = "Who's in Chat";

$l['toplinks_memberlist'] = "Member List";
$l['toplinks_search'] = "Search";

You will now have the "Chat" and "Who's in Chat" links on your Main MyBB Page.

Logout from Admin CP and use the links on your main MyBB Page to login to your chat.