Integrating FlashChat with Simple Machines v. 1.0
Welcome! This tutorial describes how to integrate FlashChat with your Simple Machines system. After the integration is completed, FlashChat will draw information from your Simple Machines user's database, so that only registered users of your site will be able to access FlashChat. In addition, Simple Machines administrators will automatically become moderators of the chat.
Step 1: Edit /inc/common.php to use the Simple Machines integration class
Before uploading to your server, you should locate the "common.php" file, which is located in the "inc" folder of FlashChat. There is one small edit that you must make to this file. In the block of statements which relate to CMS systems, only the line relating to Simple Machines should be uncommented. In other words, all of the other CMS-related lines should have "//" before them, as shown below (red arrow):

Step 2: Upload Files & Set File Permissions
Your FlashChat download comes with a folder called "chat". You should rename this folder to "FlashChat" and upload it to your web server, in the Simple Machines root folder. Please note that Unix and Linux server are case-sensitive with regard to file and folder names.
Within the "FlashChat" folder, there is a sub-folder called "inc", and within that there is a file called "config.srv.php". This file must be writable. On Unix and Linux servers, that means CHMODing the file to a writable format, like 755 or 777. You must also ensure that the "appTime.txt" file, within the "appdata" folder, is also writable.

Step 3: Install FlashChat
Now, open your web browser to FlashChat's install2.php file. This file is located in FlashChat's root folder. If you did Steps #1 and #2 correctly, the values for Host, Login, Password, Database Name, and Table Prefix, should be automatically inputted for you. Thus, you only need to accept the default values. Your screen will probably look something like this (but with different values). Click on "Go!" with these values (of course, you may change the names of the rooms).

Step 4: Add the FlashChat link to the SMF Template
Go to 'Themes/default' directory in your SMF installation, as shown:

Open index.template.php, and find the following text:
else
echo '<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'],
'">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url']
. '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108]
. '" style="margin: 2px 0;" border="0" />' : $txt[108]), '</a>';
Replace it with:
else {
echo '<a href="', $GLOBALS['boardurl'], '/FlashChat/flashchat.php">',
($settings['use_image_buttons'] ? '<img src="' . $settings['images_url']
. '/chat_icon.gif" alt="FlashChat" style="margin: 2px 0;"
border="0" />' : "FlashChat"),'</a>';
echo '<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'],
'">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url']
. '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108]
. '" style="margin: 2px 0;" border="0" />' : $txt[108]),'</a>';
}
Then, save your changes and upload the file to your server. If you use other templates besides the default template, you may have to repeat this step for each template that you use.
FlashChat comes with a small GIF file called "chat_icon.gif". Upload this file from the FlashChat root folder to the default template's "images" folder, as shown below. If you get a broken image icon after uploading this, please check the "src=..." path in the template code (above) to ensure that you have the correct path set.
![]()
Step 5: Start Chatting!
Now, on the Simple Machines homepage, the new FlashChat icon will appear. Clicking on this link will open FlashChat in a new window (because of target="_blank" in the HTML that was added).
This should link to the "flashchat.php" file of FlashChat. When FlashChat loads, you should be automatically logged into the chatroom using your Simple Machines username. If you are an administrator of Simple Machines, then you will be logged into FlashChat as a moderator, which means that you can ban and boot other users.
Once you're logged into the chat, clicking on a user's "profile" option will load their Simple Machines profile page, as shown below.

Please note that if a user or administrator logs into FlashChat, then closes the chat window, then immediately attempts to re-login, they will not be able to (they'll get "Another user is logged in with this username..."). The user must wait about 5 minutes before re-logging into the chat.