';
exit();
}
}
function show_act($act) {
$act .= str_repeat('.', (75-strlen($act)));
echo ''.$act;
}
function show_result($type) {
switch($type) {
case 0:
echo 'ERROR ';
break;
case 1:
echo 'WARNING ';
break;
case 2:
echo 'OK ';
break;
case 3:
echo 'SKIPPED ';
break;
}
echo "\n";
}
/**
* Haults the script if XMB is already installed.
*
* @since 1.9.12.BETA.09
*/
function already_installed() {
global $database, $dbhost, $dbuser, $dbpw, $dbname, $pconnect, $tablepre;
if ('mysql' == $database and is_readable(ROOT.'db/mysql.php')) {
$link = @mysql_connect($dbhost, $dbuser, $dbpw);
if (FALSE !== $link) {
$result = mysql_select_db($dbname);
if (FALSE !== $result) {
$result = mysql_query("SHOW TABLES LIKE '{$tablepre}settings'", $link);
if (FALSE !== $result) {
if (1 == mysql_num_rows($result)) {
error('XMB Already Installed', 'An existing installation of XMB has been detected. Please click here to go to your forum. If you wish to overwrite this installation, please drop your settings table. To install another forum on the same database, enter a different table prefix in config.php.');
}
}
}
mysql_close($link);
}
}
}
function already_installedi() {
global $database, $dbhost, $dbuser, $dbpw, $dbname, $pconnect, $tablepre;
if ('mysql' == $database and is_readable(ROOT.'db/mysql.php')) {
$link = @mysql_connect($dbhost, $dbuser, $dbpw);
if (FALSE !== $link) {
$result = mysqli_select_db($dbname);
if (FALSE !== $result) {
$result = mysqli_query("SHOW TABLES LIKE '{$tablepre}settings'", $link);
if (FALSE !== $result) {
if (1 == mysqli_num_rows($result)) {
error('XMB Already Installed', 'An existing installation of XMB has been detected. Please click here to go to your forum. If you wish to overwrite this installation, please drop your settings table. To install another forum on the same database, enter a different table prefix in config.php.');
}
}
}
mysql_close($link);
}
}
}
error_reporting(E_ALL&~E_NOTICE);
if (isset($_REQUEST['step']) && $_REQUEST['step'] < 7 && $_REQUEST['step'] != 4) {
?>
XMB Installer
Welcome
Version Check
License Agreement
Configuration
Create Super Administrator Account
Install
Welcome to the XMB Installer
Welcome to the installer for XMB, the popular open-source lightweight message board software. Thank you for chosing XMB to foster your new community. The next steps will guide you through the installation of your XMB Powered Message Board.
Welcome
Version Check
License Agreement
Configuration
Create Super Administrator Account
Install
Version Check Information
This page displays your version of XMB, and the latest version available from XMB. If there is a later version, XMB strongly recommends you do not install this version, but choose the latest stable release.
Install This Version: XMB
Latest Available Version:
Welcome
Version Check
License Agreement
Configuration
Create Super Administrator Account
Install
XMB License Agreement
Please read over the agreement below, and if you agree to it select the button at the very bottom. By selecting the button, you agree to the terms below.
XMB Installer
XMB Configuration
Copy the following into to a new file, and call it "config.php". Upload it to the root of your XMB directory. Then, click to continue to the next steps.
XMB Installer
XMB Configuration
666 or select a different method', true);
}
// Write to file, then close file
fwrite($handle, $configuration);
fclose($handle);
// Continue to next step
echo 'Your XMB configuration has been created correctly on the server.';
?>
If you have not configured your config.php file, complete the form below and select "Configure XMB". If you have already configured config.php correctly, you may skip this process and select "Next Step" below. If you select "Configure XMB", a new window will pop up. When you return, select "Next Step" to continue the installation process.
'DB/NAME',
'dbuser' => 'DB/USER',
'dbpw' => 'DB/PW',
'dbhost' => 'DB_HOST',
'database' => 'DB_TYPE',
'tablepre' => 'TABLE/PRE',
'full_url' => 'FULLURL',
'ipcheck' => 'IPCHECK',
'allow_spec_q' => 'SPECQ',
'show_full_info' => 'SHOWFULLINFO',
'comment_output' => 'COMMENTOUTPUT'
);
foreach($config_array as $key => $value) {
if (${$key} === $value) {
error('Incorrect Configuration', 'XMB noticed that your config.php file is not fully configured. Please go back to the previous step and follow the instructions carefully. Be sure to click the button labeled "Configure" before proceeding.', TRUE);
}
}
$versionlong = '';
require ROOT.'include/debug.inc.php';
$array = parse_url($full_url);
if (!isset($array['path'])) {
$array['path'] = '/';
}
if (strpos($array['host'], '.') === FALSE || preg_match("/^([0-9]{1,3}\.){3}[0-9]{1,3}$/", $array['host'])) {
$array['host'] = '';
} elseif (substr($array['host'], 0, 4) === 'www.') {
$array['host'] = substr($array['host'], 3);
}
debugURLsettings(($array['scheme'] == 'https'), $array['host'], $array['path']);
unset($array);
?>
Welcome
Version Check
License Agreement
Configuration
Create Super Administrator Account
Install
Create Super Administrator Account
Please fill out the Username, Password, and E-Mail account for the first Super Administrator account for your message board. This will be the account you use to first login to your board
Welcome
Version Check
License Agreement
Configuration
Create Super Administrator Account
Install
Installing XMB
/images directory. Although this directory, and its contents are not vital to the functioning of XMB, we do recommend you upload it, so you can enjoy the full look and feel of each theme.', false);
show_act('Checking (remaining) Directory Structure');
} else {
show_result(X_INST_ERR);
error('Missing Directory', 'XMB could not locate the '.$dir.' directory. Please upload this directory for XMB to proceed with the installation.', true);
}
} else {
continue;
}
}
show_result(X_INST_OK);
show_act('Checking Required Files');
foreach($req['files'] as $file) {
if (!file_exists(ROOT.$file)) {
show_result(X_INST_ERR);
error('Missing File', 'XMB could not locate the file /'.$file.', this file is required for XMB to work properly. Please upload this file and restart installation.', true);
}
}
show_result(X_INST_OK);
// check db-connection.
require_once(ROOT.'config.php');
// double check all stuff here
show_act('Checking Database Files');
if (!file_exists(ROOT.'db/'.$database.'.php')) {
show_result(X_INST_ERR);
error('Database connection', 'XMB could not locate the /db/'.$database.'.php file, you have configured xmb to use this database-type. For it to work you will need to upload the file, or change the config.php file to reflect a different choice.', true);
}
show_result(X_INST_OK);
show_act('Checking Database API');
// let's check if the actual functionality exists...
$err = false;
switch($database) {
case 'mysql':
if (!defined('MYSQL_NUM')) {
show_result(X_INST_ERR);
$err = true;
}
break;
case 'mysqli':
if (!defined('MYSQLI_NUM')) {
show_result(X_INST_ERR);
$err = true;
}
break;
default:
show_result(X_INST_ERR);
error('Database Handler', 'Unknown handler provided', true);
break;
}
if ($err === true) {
error('Database Handler', 'XMB has determined that your php installation does not support the functions required to use '.$database.' to store all data.', true);
unset($err);
}
show_result(X_INST_OK);
// let's check the connection itself.
show_act('Checking Database Connection Security');
if ($dbuser == 'root') {
show_result(X_INST_WARN);
error('Security hazard', 'You have configured XMB to use root access to the database, this is a security hazard. If your server gets hacked, or php itself crashes, the config.php file might be available freely to anyone looking at it, and thus reveal your root username/password. Please consider making a new user for XMB to run as.', false);
} else {
show_result(X_INST_OK);
}
show_act('Checking Database Connection');
switch($database) {
case 'mysql':
$link = mysql_connect($dbhost, $dbuser, $dbpw);
if (!$link) {
show_result(X_INST_ERR);
error('Database Connection', 'XMB could not connect to the specified database. The database returned "error '.mysql_errno().': '.mysql_error(), true);
} else {
show_result(X_INST_OK);
}
$sqlver = mysql_get_server_info($link);
mysql_close($link);
show_act('Checking Database Version');
if (version_compare($sqlver, MYSQL_MIN_VER, '<')) {
show_result(X_INST_ERR);
error('Version mismatch', 'XMB requires MySQL version '.MYSQL_MIN_VER.' or higher to work properly. Version '.$sqlver.' is running.', true);
} else {
show_result(X_INST_OK);
}
break;
case 'mysqli':
$link = mysqli_connect($dbhost, $dbuser, $dbpw);
if (!$link) {
show_result(X_INST_ERR);
error('Database Connection', 'XMB could not connect to the specified database. The database returned "error '.mysqli_errno().': '.mysqli_error(), true);
} else {
show_result(X_INST_OK);
}
$sqlver = mysqli_get_server_info($link);
mysqli_close($link);
show_act('Checking Database Version');
if (version_compare($sqlver, MYSQL_MIN_VER, '<')) {
show_result(X_INST_ERR);
error('Version mismatch', 'XMB requires MySQL version '.MYSQL_MIN_VER.' or higher to work properly. Version '.$sqlver.' is running.', true);
} else {
show_result(X_INST_OK);
}
break;
default:
show_result(X_INST_SKIP);
break;
}
// throw in all stuff then :)
require './cinst.php';
?>
Installation Complete
The installation process completed successfully, and your new XMB Powered Forum is now ready for you to use. Please click here to go to your forum.