Installation as a PHPBB Mod
 To install X7 Chat you must have PHP Version 4+ and MySql Version 3+.
 After making sure that you have the correct versions of PHP and MySql
 please follow the following steps.
 
 1) Open the file config.php in a text editor.  Scroll down past the
    copyright.  There you will see 10 variables that need edited.  The
    variables are in the form $VARIABLENAME[SUBNAME] = "VALUE";  You
    will need to replace the current value of a variable with the 
    correct value for your server.  The $SERVER['AUTH'] variable must
    be set to "phpbb2".

    WARNING: X7 Chat MUST use the SAME database as PhpBB2.
    WARNING: DO NOT USE THE SAME PREFIX FOR X7 CHAT THAT YOU USED FOR PHPBB2
    
 2) After editing the file config.php with the correct variables
    upload all of the included files except the Docs directory to
    the server.  MAKE SURE YOU UPLOAD ALL FILES IN BINARY MODE!  If
    you do not upload all files in binary mode then X7 Chat will not
    work correctly.  After you upload all files CHMOD 777 the directory 
    Logs.  
	
    WARNING: The X7 Chat directory MUST be directly inside the PHPBB one.
    
 3) After uploading all the files to the server go to
    http://yoursite.com/phpbbdirectory/x7chatdirectory/install.php.  
	Make sure you replace yoursite.com with the correct domain name and
    x7chatdirectory with the directory that you uploaded X7 Chat to.
    After going to the install.php page you will be guided through
    setup.  The admin account you create in install must have the SAME username
	and password (for verification) as your admin account for PHPBB.
    
 4) After finishing the online setup delete the file install.php.  If
    you do not it will be possible for anyone to create an administrator
    account on your chat server.
	
 5) Do the following Find and Replace steps below, all replacements are done
    to PHPBB2 files not X7 Chat files:

		Open includes/page_header.php

		Find:
			'L_USERGROUPS' => $lang['Usergroups'],

		Add After:
			'L_CHATROOM' => "Chat",

		Find:
			'U_GROUP_CP' => append_sid('groupcp.'.$phpEx),

		Add After:
			'U_CHATROOM' => append_sid('chatroom.'.$phpEx),

		Open templates/subSilver/overall_header.tpl

		Find:
		<td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">&nbsp;<a href="{U_FAQ}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a></span><span class="mainmenu">&nbsp; &nbsp;<a href="{U_SEARCH}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a>&nbsp; &nbsp;<a href="{U_MEMBERLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" hspace="3" />{L_MEMBERLIST}</a>&nbsp; &nbsp;<a href="{U_GROUP_CP}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="{L_USERGROUPS}" hspace="3" />{L_USERGROUPS}</a>&nbsp; 

		Replace With:
		<td align="center" valign="top" nowrap="nowrap"><span class="mainmenu">&nbsp;<a href="{U_FAQ}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a></span><span class="mainmenu">&nbsp; &nbsp;<a href="{U_SEARCH}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a>&nbsp; &nbsp;<a href="{U_MEMBERLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" hspace="3" />{L_MEMBERLIST}</a>&nbsp; &nbsp;<a href="{U_GROUP_CP}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="{L_USERGROUPS}" hspace="3" />{L_USERGROUPS}</a>&nbsp; &nbsp;<a href="{U_CHATROOM}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_chat.gif" width="12" height="13" border="0" alt="{L_CHATROOM}" hspace="3" />{L_CHATROOM}</a> 

		Open: include/usercp_register.php

		Find:
		$sql = "INSERT INTO " . USERS_TABLE . "	(user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
						VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, ";
					if ( $board_config['require_activation'] == USER_ACTIVATION_SELF || $board_config['require_activation'] == USER_ACTIVATION_ADMIN || $coppa )
					{
						$user_actkey = gen_rand_string(true);
						$key_len = 54 - (strlen($server_url));
						$key_len = ( $key_len > 6 ) ? $key_len : 6;
						$user_actkey = substr($user_actkey, 0, $key_len);
						$sql .= "0, '" . str_replace("\'", "''", $user_actkey) . "')";
					}
					else
					{
						$sql .= "1, '')";
					}

					if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
					{
						message_die(GENERAL_ERROR, 'Could not insert data into users table', '', __LINE__, __FILE__, $sql);
					}

		Add After:
		$donotincluebase = 1;
					include("X7Chat/config.php");
					$sql = "INSERT INTO $SERVER[TBL_PREFIX]users VALUES('0','$username','','$email','1','','','','','','','','','14000,1000,1,1,0,3,1,0,0,1')";

					if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
					{
						message_die(GENERAL_ERROR, 'Could not insert data into chat table', '', __LINE__, __FILE__, $sql);
					}

		In the text that you just added find X7Chat and replace with the name
		of the X7Chat directory, this IS case sensitive.
		
		Now, open the file chat_body.tpl (included with X7 Chat) and find "X7Chat" and
		replace it with the name of your X7 Chat directory.

		* Copy icon_mini_chat.gif to templates/subSilver/images
		
		* Copy chatroom.php into your PHPBB2 root directory
		
		* Copy chat_body.tpl to /templates/subSilver
		
		Make sure you upload all this new files to the server or it won't work (duh!)

  6) All finished :)  Have fun chatting, you need help with the install check out
     the online forum at our website, http://forum.x7chat.com/.

  7) NOTES AND TIPS ON RUNNING X7 CHAT AS A PHPBB MOD:
      A) The User Manager in the X7 Chat admin panel will not work, use the one
	     included with PHPBB2.
		 
	  B) I STRONGLY recommend disabling registration since all registration MUST
	     take place through the PHPBB registration form or else X7 Chat will not
		 work correctly.
