ajax im
before you begin...
Did you remember to:
- setup a database for ajax im?
- edit config.php to match your MySQL configuration?
0 && trim(substr(sprintf('%o', fileperms('./buddyicons/')), -4)) != 777) { echo '- CHMOD buddyicons/ to 0777, it is at: '. substr(sprintf('%o', fileperms('./buddyicons/')), -4) .'?
'; } ?>
installing...
\n";
$problem = true;
} else {
print("A MySQL error occured: (" . mysql_errno() . ") " . mysql_error() . "
\n");
$error = true;
}
} else {
mysql_query('ALTER TABLE `'.SQL_PREFIX.'messages` CHANGE `message` `message` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL');
print "Table '".SQL_PREFIX."messages' added successfully!
\n";
}
$table_users = 'CREATE TABLE `'.SQL_PREFIX.'users` ( `username` varchar(32), `password` varchar(32), `email` text, `is_online` int(11) default \'0\', `last_ping` text, `last_ip` varchar(15), `banned` tinyint(1) default \'0\', `admin` tinyint(1) default \'0\', `buddyicon` varchar(4) NOT NULL default \'none\', `profile` text, `id` bigint(20) unsigned NOT NULL auto_increment, UNIQUE KEY `id` (`id`), UNIQUE `username` (`username`) ) ;';
if(!mysql_query($table_users)) {
if(mysql_errno() == 1050) {
print "Table '".SQL_PREFIX."users' already exists! If you had a version of ajax im less than 3.2 installed on this database, please delete the table and then run this script again, otherwise ignore this error.
\n";
} else {
print("A MySQL error occured: (" . mysql_errno() . ") " . mysql_error() . "
\n");
$error = true;
}
} else {
print "Table '".SQL_PREFIX."users' added successfully!
\n";
}
$table_chats = 'CREATE TABLE `'.SQL_PREFIX.'chats` ( `room` text, `user` text, `id` bigint(20) unsigned NOT NULL auto_increment, UNIQUE KEY `id` (`id`) ) ;';
if(!mysql_query($table_chats)) {
if(mysql_errno() == 1050) {
print "Table '".SQL_PREFIX."chats' already exists! If you had a version of ajax im less than 3.0 installed on this database, please delete the table and then run this script again, otherwise ignore this error.
\n";
$problem = true;
} else {
print("A MySQL error occured: (" . mysql_errno() . ") " . mysql_error() . "
\n");
$error = true;
}
} else {
mysql_query('ALTER TABLE `'.SQL_PREFIX.'chats` CHANGE `room` `room` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL');
print "Table '".SQL_PREFIX."chats' added successfully!
\n";
}
$table_buddylists = 'CREATE TABLE `'.SQL_PREFIX.'buddylists` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `user` VARCHAR( 100 ) NOT NULL, `buddy` VARCHAR( 100 ) NOT NULL, `group` VARCHAR( 100 ) NOT NULL, INDEX ( `user` , `group` )) ENGINE = MYISAM ;';
if(!mysql_query($table_buddylists)) {
if(mysql_errno() == 1050) {
print "Table '".SQL_PREFIX."buddylists' already exists! If you had a version of ajax im less than 3.2 installed on this database, please delete the table and then run this script again, otherwise ignore this error.
\n";
$problem = true;
} else {
print("A MySQL error occured: (" . mysql_errno() . ") " . mysql_error() . "
\n");
$error = true;
}
} else {
print "Table '".SQL_PREFIX."buddylists' added successfully!
\n";
}
$table_blocklists = 'CREATE TABLE `'.SQL_PREFIX.'blocklists` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `user` VARCHAR( 100 ) NOT NULL, `buddy` VARCHAR( 100 ) NOT NULL, INDEX ( `user` , `buddy` )) ENGINE = MYISAM ;';
if(!mysql_query($table_blocklists)) {
if(mysql_errno() == 1050) {
print "Table '".SQL_PREFIX."blocklists' already exists! If you had a version of ajax im less than 3.2 installed on this database, please delete the table and then run this script again, otherwise ignore this error.
\n";
$problem = true;
} else {
print("A MySQL error occured: (" . mysql_errno() . ") " . mysql_error() . "
\n");
$error = true;
}
} else {
print "Table '".SQL_PREFIX."blocklists' added successfully!
\n";
}
$add_user = 'INSERT INTO `'.SQL_PREFIX.'users` (username, password, email, admin) VALUES (\'' . mysql_real_escape_string($_POST['username']) . '\', \'' . mysql_real_escape_string(md5($_POST['password'])) . '\', \'' . mysql_real_escape_string($_POST['email']) . '\', 1)';
if(!mysql_query($add_user)) {
print("A MySQL error occured: (" . mysql_errno() . ") " . mysql_error() . "
\n");
print "Unable to add the first user! This likely means there was some other issue during installation.
\n";
$error = true;
} else {
print "First/admin user registered!
\n";
}
if ($maxBuddyIconSize > 0) {
if (trim(substr(sprintf('%o', fileperms('./buddyicons/')), -4)) != 777) {
$error = true;
print "File permissions::
CHMOD buddyicons/ to 0777
";
} else {
print "You have change permissions of buddyicons/
";
}
}
mysql_close();
?>
status
here. Please be sure to delete install.php and update.php!';
?>