Integrating FlashChat with WowBB v. 1.6.1
Welcome! This tutorial describes how to integrate FlashChat with your WowBB system. After the integration is completed, FlashChat will draw information from your WowBB user's database, so that only registered users of your site will be able to access FlashChat. In addition, WowBB administrators will automatically become moderators of the chat.
Step 1: Edit /inc/common.php to use the WowBB 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 WowBB 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 WowBB 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 install.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: lib.php change
Open the lib.php file, which is located in the WowBB root folder. In other words, you will need to download this file from your web server, to your desktop, then open it with a text editor. I strongly recommend that you do NOT use Windows Notepad or Wordpad to do your text editing. Instead, you should use a more advanced text editor, like TextPad (www.textpad.com).Within the lib.php file, located this text:
if (init()) { if ((!defined("NO_LANGUAGE_FILES")) and (USER_LANGUAGE != LANGUAGE)) require("languages/" . USER_LANGUAGE . "/lg_main.php"); $TEMPLATES = extract_templates("themes/" . USER_THEME . "/main_templates.txt"); }
... and replace it with this text:
if (init()) { if ((!defined("NO_LANGUAGE_FILES")) and (USER_LANGUAGE != LANGUAGE)) require("languages/" . USER_LANGUAGE . "/lg_main.php"); $TEMPLATES = extract_templates(dirname(__FILE__)."/themes/" . USER_THEME . "/main_templates.txt"); }
Here's what the lib.php file might look like after this edit is done:
Step 5: Edit the WowBB template
Open the main_templates.txt file, located in the "themes" directory on your web server, and find the following text:
<SPAN DIR="$text_direction">$logged_in_as - <A CLASS="nummessages" HREF="$base_dir/pm.php?folder_id=100">$num_messages</A> [<A CLASS="nummessages" HREF="$base_dir/login.php?out=1">%logout</A>]</SPAN>
Replace it with this text:
<SPAN DIR="$text_direction">$logged_in_as - <A CLASS="nummessages" HREF="$base_dir/pm.php?folder_id=100">$num_messages</A> <A target="_blank" LASS="nummessages" HREF="FlashChat/flashchat.php">FlashChat</A> [<A CLASS="nummessages" HREF="$base_dir/login.php?out=1">%logout</A>]</SPAN>
This will add the FlashChat link to your WowBB template. Please note that the target="_blank" attribute will cause FlashChat to open into a new browser window.
Now, repeat this process for EVERY template that you are using. If you only use the "default" template, then you only need to do this once. The templates are located in the "themes" folder, as shown below:
Here's what my main_templates.txt file looked like after making this edit:
Step 5: Start Chatting!
Now, on the WowBB homepage, a new link will appear with the text "FlashChat". This link will only be visible to users who are logged-in to your system. 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 WowBB username. If you are an administrator of WowBB, 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 WowBB 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.