/install.php
PHP | 3008 lines | 2674 code | 218 blank | 116 comment | 151 complexity | 5e92b966425aa7114dddb578498bc45b MD5 | raw file
Possible License(s): GPL-2.0
Large files files are truncated, but you can click here to view the full file
- <?php
- /**
- * Copyright (C) 2008-2010 FluxBB
- * based on code by Rickard Andersson copyright (C) 2002-2008 PunBB
- * License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
- */
- // The FluxBB version this script installs
- define('FORUM_VERSION', '1.4.5');
- define('EVE_BB_VERSION', '1.1.14');
- define('FORUM_DB_REVISION', 12);
- define('FORUM_SI_REVISION', 2);
- define('FORUM_PARSER_REVISION', 2);
- define('MIN_PHP_VERSION', '4.4.0');
- define('MIN_MYSQL_VERSION', '4.1.2');
- define('MIN_PGSQL_VERSION', '7.0.0');
- define('PUN_SEARCH_MIN_WORD', 3);
- define('PUN_SEARCH_MAX_WORD', 20);
- // Define a few commonly used constants
- define('PUN_UNVERIFIED', 0);
- define('PUN_ADMIN', 1);
- define('PUN_MOD', 2);
- define('PUN_GUEST', 3);
- define('PUN_MEMBER', 4);
- //Functions for EvE-BB
- define('EVE_ENABLED', 1);
- define('PUN_ROOT', dirname(__FILE__).'/');
- //Determine if we can/should use cURL where possible.
- if (extension_loaded('curl') && $pun_config['o_use_fopen'] != '1') {
- define('EVEBB_CURL', 1);
- } //End if.
- require(PUN_ROOT.'include/request.php');
- $pun_request = new Request();
- // If we've been passed a default language, use it
- $install_lang = isset($_REQUEST['install_lang']) ? trim($_REQUEST['install_lang']) : 'English';
- // If such a language pack doesn't exist, or isn't up-to-date enough to translate this page, default to English
- if (!file_exists(PUN_ROOT.'lang/'.$install_lang.'/install.php'))
- $install_lang = 'English';
-
- require PUN_ROOT.'lang/'.$install_lang.'/install.php';
- if (file_exists(PUN_ROOT.'config.php'))
- {
- // Check to see whether FluxBB is already installed
- include PUN_ROOT.'config.php';
- // If we have the 1.3-legacy constant defined, define the proper 1.4 constant so we don't get an incorrect "need to install" message
- if (defined('FORUM'))
- define('PUN', FORUM);
- // If PUN is defined, config.php is probably valid and thus the software is installed
- if (defined('PUN'))
- exit($lang_install['Already installed']);
- }
- // Define PUN because email.php requires it
- define('PUN', 1);
- // If the cache directory is not specified, we use the default setting
- if (!defined('FORUM_CACHE_DIR'))
- define('FORUM_CACHE_DIR', PUN_ROOT.'cache/');
- // Make sure we are running at least MIN_PHP_VERSION
- if (!function_exists('version_compare') || version_compare(PHP_VERSION, MIN_PHP_VERSION, '<'))
- exit(sprintf($lang_install['You are running error'], 'PHP', PHP_VERSION, FORUM_VERSION, MIN_PHP_VERSION));
- // Load the functions script
- require PUN_ROOT.'include/functions.php';
- // Load the eve functions script
- require PUN_ROOT.'include/eve_functions.php';
- // Load UTF-8 functions
- require PUN_ROOT.'include/utf8/utf8.php';
- // Strip out "bad" UTF-8 characters
- forum_remove_bad_characters();
- // Reverse the effect of register_globals
- forum_unregister_globals();
- // Disable error reporting for uninitialized variables
- error_reporting(E_ALL);
- // Force POSIX locale (to prevent functions such as strtolower() from messing up UTF-8 strings)
- setlocale(LC_CTYPE, 'C');
- // Turn off magic_quotes_runtime
- if (get_magic_quotes_runtime())
- set_magic_quotes_runtime(0);
- // Strip slashes from GET/POST/COOKIE (if magic_quotes_gpc is enabled)
- if (get_magic_quotes_gpc())
- {
- function stripslashes_array($array)
- {
- return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);
- }
- $_GET = stripslashes_array($_GET);
- $_POST = stripslashes_array($_POST);
- $_COOKIE = stripslashes_array($_COOKIE);
- $_REQUEST = stripslashes_array($_REQUEST);
- }
- // Turn off PHP time limit
- @set_time_limit(0);
- //Make sure we have full scope for character data.
- $char_sheet;
- //
- // Generate output to be used for config.php
- //
- function generate_config_file()
- {
- global $db_type, $db_host, $db_name, $db_username, $db_password, $db_prefix, $cookie_name, $cookie_seed;
-
- return '<?php'."\n\n".'$db_type = \''.$db_type."';\n".'$db_host = \''.$db_host."';\n".'$db_name = \''.addslashes($db_name)."';\n".'$db_username = \''.addslashes($db_username)."';\n".'$db_password = \''.addslashes($db_password)."';\n".'$db_prefix = \''.addslashes($db_prefix)."';\n".'$p_connect = false;'."\n\n".'$cookie_name = '."'".$cookie_name."';\n".'$cookie_domain = '."'';\n".'$cookie_path = '."'/';\n".'$cookie_secure = 0;'."\n".'$cookie_seed = \''.random_key(16, false, true)."';\n\ndefine('PUN', 1);\n";
- }
- if (isset($_POST['generate_config']))
- {
- header('Content-Type: text/x-delimtext; name="config.php"');
- header('Content-disposition: attachment; filename=config.php');
- $db_type = $_POST['db_type'];
- $db_host = $_POST['db_host'];
- $db_name = $_POST['db_name'];
- $db_username = $_POST['db_username'];
- $db_password = $_POST['db_password'];
- $db_prefix = $_POST['db_prefix'];
- $cookie_name = $_POST['cookie_name'];
- $cookie_seed = $_POST['cookie_seed'];
- echo generate_config_file();
- exit;
- }
- if (!isset($_POST['form_sent']))
- {
- // Make an educated guess regarding base_url
- $base_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://'; // protocol
- $base_url .= preg_replace('/:(80|443)$/', '', $_SERVER['HTTP_HOST']); // host[:port]
- $base_url .= str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME'])); // path
- if (substr($base_url, -1) == '/')
- $base_url = substr($base_url, 0, -1);
- $db_type = $db_name = $db_username = $db_prefix = $username = $email = '';
- $db_prefix = 'evebb_';
- $api_user_id = $api_character_id = $api_key = '';
- $db_host = 'localhost';
- $title = $lang_install['My FluxBB Forum'];
- $description = '<p><span>'.$lang_install['Description'].'</span></p>';
- $default_lang = $install_lang;
- $default_style = 'evebbgray';
- }
- else
- {
- $db_type = $_POST['req_db_type'];
- $db_host = pun_trim($_POST['req_db_host']);
- $db_name = pun_trim($_POST['req_db_name']);
- $db_username = pun_trim($_POST['db_username']);
- $db_password = pun_trim($_POST['db_password']);
- $db_prefix = pun_trim($_POST['db_prefix']);
- //$username = pun_trim($_POST['req_username']);
- $email = strtolower(pun_trim($_POST['req_email']));
- $api_user_id = $_POST['api_user_id'];
- $api_character_id = $_POST['api_character_id'];
- $api_key = $_POST['api_key'];
- $password1 = pun_trim($_POST['req_password1']);
- $password2 = pun_trim($_POST['req_password2']);
- $title = pun_trim($_POST['req_title']);
- $description = pun_trim($_POST['desc']);
- $base_url = pun_trim($_POST['req_base_url']);
- $default_lang = pun_trim($_POST['req_default_lang']);
- $default_style = pun_trim($_POST['req_default_style']);
- $alerts = array();
- // Make sure base_url doesn't end with a slash
- if (substr($base_url, -1) == '/')
- $base_url = substr($base_url, 0, -1);
-
- /*---------- EVE-BB DATA CHECKS ---------*/
- //return;
- if (strlen($api_key) > 64 && strlen($api_key) < 20) {
- $alerts[] = 'Incorrect API Verification Code Lengt. Found '.strlen($api_key).', but expected between 20 and 64 inclusive.';
- } //End if.
-
- if (!is_numeric($api_user_id)) {
- $alerts[] = 'Incorrect API Key ID format.';
- } //End if.
-
- if (!is_numeric($api_character_id)) {
- $alerts[] = 'Incorrect API Character ID format.<br/> Please make sure you fetch your characters and select an active character from the list.';
- } //End if.
- /*---------- EVE-BB DATA CHECKS ---------*/
- if (pun_strlen($password1) < 4)
- $alerts[] = $lang_install['Short password'];
- else if ($password1 != $password2)
- $alerts[] = $lang_install['Passwords not match'];
- // Validate email
- require PUN_ROOT.'include/email.php';
- if (!is_valid_email($email))
- $alerts[] = $lang_install['Wrong email'];
- if ($title == '')
- $alerts[] = $lang_install['No board title'];
- $languages = forum_list_langs();
- if (!in_array($default_lang, $languages))
- $alerts[] = $lang_install['Error default language'];
- $styles = forum_list_styles();
- if (!in_array($default_style, $styles))
- $alerts[] = $lang_install['Error default style'];
-
- // Check if the cache directory is writable
- if (!@is_writable(FORUM_CACHE_DIR))
- $alerts[] = sprintf($lang_install['Alert cache'], FORUM_CACHE_DIR);
-
- // Check if default avatar directory is writable
- if (!@is_writable(PUN_ROOT.'img/avatars/'))
- $alerts[] = sprintf($lang_install['Alert avatar'], PUN_ROOT.'img/avatars/');
-
-
- /*---------- EVE-BB DATA CHECKS ---------*/
- //Now we get the character data.
- if (empty($alerts)) {
- //We need the escape feature of the DB, so it's been promoted!
- // Load the appropriate DB layer class
- // Validate prefix
- if (strlen($db_prefix) > 0 && (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $db_prefix) || strlen($db_prefix) > 40))
- error(sprintf($lang_install['Table prefix error'], $db->prefix));
-
- // Load the appropriate DB layer class
- switch ($db_type)
- {
- case 'mysql':
- require PUN_ROOT.'include/dblayer/mysql.php';
- break;
-
- case 'mysql_innodb':
- require PUN_ROOT.'include/dblayer/mysql_innodb.php';
- break;
-
- case 'mysqli':
- require PUN_ROOT.'include/dblayer/mysqli.php';
- break;
-
- case 'mysqli_innodb':
- require PUN_ROOT.'include/dblayer/mysqli_innodb.php';
- break;
-
- case 'pgsql':
- require PUN_ROOT.'include/dblayer/pgsql.php';
- break;
-
- case 'sqlite':
- require PUN_ROOT.'include/dblayer/sqlite.php';
- break;
-
- default:
- error(sprintf($lang_install['DB type not valid'], pun_htmlspecialchars($db_type)));
- }
-
- // Create the database object (and connect/select db)
- $db = new DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, false);
- $username = 'EveBB-User';
- // Do some DB type specific checks
- switch ($db_type)
- {
- case 'mysql':
- case 'mysqli':
- case 'mysql_innodb':
- case 'mysqli_innodb':
- $mysql_info = $db->get_version();
- if (version_compare($mysql_info['version'], MIN_MYSQL_VERSION, '<'))
- error(sprintf($lang_install['You are running error'], 'MySQL', $mysql_info['version'], FORUM_VERSION, MIN_MYSQL_VERSION));
- break;
-
- case 'pgsql':
- $pgsql_info = $db->get_version();
- if (version_compare($pgsql_info['version'], MIN_PGSQL_VERSION, '<'))
- error(sprintf($lang_install['You are running error'], 'PostgreSQL', $pgsql_info['version'], FORUM_VERSION, MIN_PGSQL_VERSION));
- break;
-
- case 'sqlite':
- if (strtolower($db_prefix) == 'sqlite_')
- error($lang_install['Prefix reserved']);
- break;
-
- default:
- error(sprintf($lang_install['DB type not valid'], pun_htmlspecialchars($db_type)));
- }
- //Lets validate the API info first.
- $cak = new CAK($api_user_id, $api_key, $api_character_id);
-
- if (($cak_err = $cak->validate(true)) != CAK_OK) {
- switch ($cak_err) {
- case(CAK_NOT_INIT):
- $alerts[] = "[$cak_err]: An internal error has occured while dealing with the API information. Well damn.";
- break;
- case(CAK_VCODE_LEN):
- $alerts[] = "[$cak_err]: Your API Verification Code does not meet security requirements.<br/> Please generate a vcode between 20 and 64 characters in length.";
- break;
- case(CAK_ID_NOT_NUM):
- $alerts[] = "[$cak_err]: Your API Key ID is not a valid ID.";
- break;
- case(CAK_BAD_VCODE):
- $alerts[] = "[$cak_err]: Your API Verification Code is not valid.";
- break;
- } //End switch().
- } else if (($cak_err = $cak->validate_mask()) != CAK_OK) {
- switch ($cak_err) {
- case(CAK_BAD_FETCH):
- $alerts[] = "[$cak_err]: Unable to fetch information from the API server. Please ensure the API server is currently operational.";
- break;
- case(CAK_BAD_KEY):
- $alerts[] = "[$cak_err]: Your API Detials are not correct, please ensure they are correct and try again.";
- break;
- case(CAK_BAD_MASK):
- $alerts[] = "[$cak_err]: Unable to locate a non-zero access mask for your CAK.";
- break;
- case(CAK_EXPIRE_SET):
- $alerts[] = "[$cak_err]: Your CAK is set to expire; EveBB does not support this option. (By choice)";
- break;
- case(CAK_BAD_TYPE):
- $alerts[] = "[$cak_err]: Your CAK type is not allowed by the administrators of this forum. If you are using character based CAK's, please try account based instead.";
- break;
- } //End switch().
- } //End if - else if.
-
- // Create the database object (and connect/select db)
- $db = new DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, false);
- if (empty($alerts)){
- if (!$char_sheet = fetch_character_api($cak)) {
- $alerts[] = "Unable to fetch character API information. Please insure that the API server is functioning.";
- } else {
- $username = substr(strip_special($char_sheet->name), 0, 25);
- } //End if - else.
- } //End if.
- } //End if.
- /*---------- EVE-BB DATA CHECKS ---------*/
- // Validate username and passwords
- if (pun_strlen($username) < 2)
- $alerts[] = $lang_install['Username 1'];
- else if (pun_strlen($username) > 25) // This usually doesn't happen since the form element only accepts 25 characters
- $alerts[] = $lang_install['Username 2'];
- else if (!strcasecmp($username, 'Guest'))
- $alerts[] = $lang_install['Username 3'];
- else if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $username) || preg_match('/((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))/', $username))
- $alerts[] = $lang_install['Username 4'];
- else if ((strpos($username, '[') !== false || strpos($username, ']') !== false) && strpos($username, '\'') !== false && strpos($username, '"') !== false)
- $alerts[] = $lang_install['Username 5'];
- else if (preg_match('/(?:\[\/?(?:b|u|i|h|colou?r|quote|code|img|url|email|list)\]|\[(?:code|quote|list)=)/i', $username))
- $alerts[] = $lang_install['Username 6'];
- }
- if (!isset($_POST['form_sent']) || !empty($alerts))
- {
- // Determine available database extensions
- $dual_mysql = false;
- $db_extensions = array();
- $mysql_innodb = false;
- if (function_exists('mysqli_connect'))
- {
- $db_extensions[] = array('mysqli', 'MySQL Improved');
- $db_extensions[] = array('mysqli_innodb', 'MySQL Improved (InnoDB)');
- $mysql_innodb = true;
- }
- if (function_exists('mysql_connect'))
- {
- $db_extensions[] = array('mysql', 'MySQL Standard');
- $db_extensions[] = array('mysql_innodb', 'MySQL Standard (InnoDB)');
- $mysql_innodb = true;
- if (count($db_extensions) > 2)
- $dual_mysql = true;
- }
- if (function_exists('sqlite_open'))
- $db_extensions[] = array('sqlite', 'SQLite');
- if (function_exists('pg_connect'))
- $db_extensions[] = array('pgsql', 'PostgreSQL');
- if (empty($db_extensions))
- error($lang_install['No DB extensions']);
-
- // Fetch a list of installed languages
- $languages = forum_list_langs();
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title><?php echo $lang_install['FluxBB Installation'] ?></title>
- <link rel="stylesheet" type="text/css" href="style/<?php echo $default_style ?>.css" />
- <script type="text/javascript" src="apiFetching.js"></script>
- <script type="text/javascript">
- /* <![CDATA[ */
- function process_form(the_form)
- {
- var element_names = {
- "req_db_type": "<?php echo $lang_install['Database type'] ?>",
- "req_db_host": "<?php echo $lang_install['Database server hostname'] ?>",
- "req_db_name": "<?php echo $lang_install['Database name'] ?>",
- "db_prefix": "<?php echo $lang_install['Table prefix'] ?>",
- "req_password1": "<?php echo $lang_install['Administrator password 1'] ?>",
- "req_password2": "<?php echo $lang_install['Administrator password 2'] ?>",
- "req_email": "<?php echo $lang_install['Administrator email'] ?>",
- "req_title": "<?php echo $lang_install['Board title'] ?>",
- "req_base_url": "<?php echo $lang_install['Base URL'] ?>"
- };
- if (document.all || document.getElementById)
- {
- for (var i = 0; i < the_form.length; ++i)
- {
- var elem = the_form.elements[i];
- if (elem.name && (/^req_/.test(elem.name)))
- {
- if (!elem.value && elem.type && (/^(?:text(?:area)?|password|file)$/i.test(elem.type)))
- {
- alert('"' + element_names[elem.name] + '" <?php echo $lang_install['Required field'] ?>');
- elem.focus();
- return false;
- }
- }
- }
- }
- return true;
- }
- /* ]]> */
- </script>
- </head>
- <body onload="document.getElementById('install').req_db_type.focus();document.getElementById('install').start.disabled=false;">
- <div id="puninstall" class="pun">
- <div class="top-box"><div><!-- Top Corners --></div></div>
- <div class="punwrap">
- <div id="brdheader" class="block">
- <div class="box">
- <div id="brdtitle" class="inbox">
- <h1><span><?php echo $lang_install['FluxBB Installation'] ?></span></h1>
- <div id="brddesc"><p><?php echo $lang_install['Install message'] ?></p><p><?php echo $lang_install['Welcome'] ?></p></div>
- </div>
- </div>
- </div>
- <div id="brdmain">
- <?php if (count($languages) > 1): ?><div class="blockform">
- <h2><span><?php echo $lang_install['Choose install language'] ?></span></h2>
- <div class="box">
- <form id="install" method="post" action="install.php">
- <div class="inform">
- <fieldset>
- <legend><?php echo $lang_install['Install language'] ?></legend>
- <div class="infldset">
- <p><?php echo $lang_install['Choose install language info'] ?></p>
- <label><strong><?php echo $lang_install['Install language'] ?></strong>
- <br /><select name="install_lang">
- <?php
- foreach ($languages as $temp)
- {
- if ($temp == $install_lang)
- echo "\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";
- else
- echo "\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";
- }
- ?>
- </select>
- <br /></label>
- </div>
- </fieldset>
- </div>
- <p class="buttons"><input type="submit" name="start" value="<?php echo $lang_install['Change language'] ?>" /></p>
- </form>
- </div>
- </div>
- <?php endif; ?>
- <div class="blockform">
- <h2><span><?php echo sprintf($lang_install['Install'], EVE_BB_VERSION) ?></span></h2>
- <div class="box">
- <form id="install" method="post" action="install.php" onsubmit="this.start.disabled=true;if(process_form(this)){return true;}else{this.start.disabled=false;return false;}">
- <div><input type="hidden" name="form_sent" value="1" /><input type="hidden" name="install_lang" value="<?php echo pun_htmlspecialchars($install_lang) ?>" /></div>
- <div class="inform">
- <?php if (!empty($alerts)): ?> <div class="forminfo error-info">
- <h3><?php echo $lang_install['Errors'] ?></h3>
- <ul class="error-list">
- <?php
- foreach ($alerts as $cur_alert)
- echo "\t\t\t\t\t\t".'<li><strong>'.$cur_alert.'</strong></li>'."\n";
- ?>
- </ul>
- </div>
- <?php endif; ?> </div>
- <div class="inform">
- <div class="forminfo">
- <h3><?php echo $lang_install['Database setup'] ?></h3>
- <p><?php echo $lang_install['Info 1'] ?></p>
- </div>
- <fieldset>
- <legend><?php echo $lang_install['Select database'] ?></legend>
- <div class="infldset">
- <p><?php echo $lang_install['Info 2'] ?></p>
- <?php if ($dual_mysql): ?> <p><?php echo $lang_install['Dual MySQL'] ?></p>
- <?php endif; ?><?php if ($mysql_innodb): ?> <p><?php echo $lang_install['InnoDB'] ?></p>
- <?php endif; ?> <label class="required"><strong><?php echo $lang_install['Database type'] ?> <span><?php echo $lang_install['Required'] ?></span></strong>
- <br /><select name="req_db_type">
- <?php
- foreach ($db_extensions as $temp)
- {
- if ($temp[0] == $db_type)
- echo "\t\t\t\t\t\t\t".'<option value="'.$temp[0].'" selected="selected">'.$temp[1].'</option>'."\n";
- else
- echo "\t\t\t\t\t\t\t".'<option value="'.$temp[0].'">'.$temp[1].'</option>'."\n";
- }
- ?>
- </select>
- <br /></label>
- </div>
- </fieldset>
- </div>
- <div class="inform">
- <fieldset>
- <legend><?php echo $lang_install['Database hostname'] ?></legend>
- <div class="infldset">
- <p><?php echo $lang_install['Info 3'] ?></p>
- <label class="required"><strong><?php echo $lang_install['Database server hostname'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input type="text" name="req_db_host" value="<?php echo pun_htmlspecialchars($db_host) ?>" size="50" /><br /></label>
- </div>
- </fieldset>
- </div>
- <div class="inform">
- <fieldset>
- <legend><?php echo $lang_install['Database enter name'] ?></legend>
- <div class="infldset">
- <p><?php echo $lang_install['Info 4'] ?></p>
- <label class="required"><strong><?php echo $lang_install['Database name'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input id="req_db_name" type="text" name="req_db_name" value="<?php echo pun_htmlspecialchars($db_name) ?>" size="30" /><br /></label>
- </div>
- </fieldset>
- </div>
- <div class="inform">
- <fieldset>
- <legend><?php echo $lang_install['Database enter informations'] ?></legend>
- <div class="infldset">
- <p><?php echo $lang_install['Info 5'] ?></p>
- <label class="conl"><?php echo $lang_install['Database username'] ?><br /><input type="text" name="db_username" value="<?php echo pun_htmlspecialchars($db_username) ?>" size="30" /><br /></label>
- <label class="conl"><?php echo $lang_install['Database password'] ?><br /><input type="password" name="db_password" size="30" /><br /></label>
- <div class="clearer"></div>
- </div>
- </fieldset>
- </div>
- <div class="inform">
- <fieldset>
- <legend><?php echo $lang_install['Database enter prefix'] ?></legend>
- <div class="infldset">
- <p><?php echo $lang_install['Info 6'] ?></p>
- <label><?php echo $lang_install['Table prefix'] ?><br /><input id="db_prefix" type="text" name="db_prefix" value="<?php echo pun_htmlspecialchars($db_prefix) ?>" size="20" maxlength="30" /><br /></label>
- </div>
- </fieldset>
- </div>
- <?php
- /* We're keeping this here for record. It is being replaced by the characters name.
- <div class="inform">
- <div class="forminfo">
- <h3><?php echo $lang_install['Administration setup'] ?></h3>
- <p><?php echo $lang_install['Info 7'] ?></p>
- </div>
- <fieldset>
- <legend><?php echo $lang_install['Admin enter username'] ?></legend>
- <div class="infldset">
- <p><?php echo $lang_install['Info 8'] ?></p>
- <label class="required"><strong><?php echo $lang_install['Administrator username'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input type="text" name="req_username" value="<?php echo pun_htmlspecialchars($username) ?>" size="25" maxlength="25" /><br /></label>
- </div>
- </fieldset>
- </div>
- */
- ?>
- <div class="inform">
- <fieldset>
- <legend><?php echo $lang_install['Admin enter password'] ?></legend>
- <div class="infldset">
- <p><?php echo $lang_install['Info 9'] ?></p>
- <label class="conl required"><strong><?php echo $lang_install['Password'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input id="req_password1" type="password" name="req_password1" size="16" /><br /></label>
- <label class="conl required"><strong><?php echo $lang_install['Confirm password'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input type="password" name="req_password2" size="16" /><br /></label>
- <div class="clearer"></div>
- </div>
- </fieldset>
- </div>
- <div class="inform">
- <fieldset>
- <legend><?php echo $lang_install['Admin enter email'] ?></legend>
- <div class="infldset">
- <p><?php echo $lang_install['Info 10'] ?></p>
- <label class="required"><strong><?php echo $lang_install['Administrator email'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input id="req_email" type="text" name="req_email" value="<?php echo pun_htmlspecialchars($email) ?>" size="50" maxlength="80" /><br /></label>
- </div>
- </fieldset>
- </div>
- <div class="inform">
- <fieldset>
- <legend><?php echo $lang_install['Evebb_admin_api_legend'] ?></legend>
- <div class="infldset">
- <p><?php echo $lang_install['Evebb_admin_api_info1'] ?></p>
- <label class="required"><strong><?php echo $lang_install['Evebb_admin_api_id'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input id="api_user_id" type="text" name="api_user_id" value="<?php echo pun_htmlspecialchars($api_user_id) ?>" size="50" maxlength="80" /><br /></label>
- <label class="required"><strong><?php echo $lang_install['Evebb_admin_api_key'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input id="api_key" type="text" name="api_key" value="<?php echo pun_htmlspecialchars($api_key) ?>" size="50" maxlength="80" /><br /></label><br/>
- <span id="api_holder"><a class="fetch_chars" href="index.php" onclick="fetchCharacters(); return false;"><span id="char_fetch_text"><?php echo $lang_install['Evebb_admin_api_fetch'] ?></span></a></span>
- <p><?php echo $lang_install['Evebb_admin_api_info2'] ?></p>
- <div class="clearer"></div>
- </div>
- </fieldset>
- </div>
- <div class="inform">
- <div class="forminfo">
- <h3><?php echo $lang_install['Board setup'] ?></h3>
- <p><?php echo $lang_install['Info 11'] ?></p>
- </div>
- <fieldset>
- <legend><?php echo $lang_install['Enter board title'] ?></legend>
- <div class="infldset">
- <p><?php echo $lang_install['Info 12'] ?></p>
- <label class="required"><strong><?php echo $lang_install['Board title'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input id="req_title" type="text" name="req_title" value="<?php echo pun_htmlspecialchars($title) ?>" size="60" maxlength="255" /><br /></label>
- </div>
- </fieldset>
- </div>
- <div class="inform">
- <fieldset>
- <legend><?php echo $lang_install['Enter board description'] ?></legend>
- <div class="infldset">
- <p><?php echo $lang_install['Info 13'] ?></p>
- <label><?php echo $lang_install['Board description'] ?><br /><input id="desc" type="text" name="desc" value="<?php echo pun_htmlspecialchars($description) ?>" size="60" maxlength="255" /><br /></label>
- </div>
- </fieldset>
- </div>
- <div class="inform">
- <fieldset>
- <legend><?php echo $lang_install['Enter base URL'] ?></legend>
- <div class="infldset">
- <p><?php echo $lang_install['Info 14'] ?></p>
- <label class="required"><strong><?php echo $lang_install['Base URL'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><input id="req_base_url" type="text" name="req_base_url" value="<?php echo pun_htmlspecialchars($base_url) ?>" size="60" maxlength="100" /><br /></label>
- </div>
- </fieldset>
- </div>
- <div class="inform">
- <fieldset>
- <legend><?php echo $lang_install['Choose the default language'] ?></legend>
- <div class="infldset">
- <p><?php echo $lang_install['Info 15'] ?></p>
- <label class="required"><strong><?php echo $lang_install['Default language'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><select id="req_default_lang" name="req_default_lang">
- <?php
- $languages = forum_list_langs();
- foreach ($languages as $temp)
- {
- if ($temp == $default_lang)
- echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.$temp.'</option>'."\n";
- else
- echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.$temp.'</option>'."\n";
- }
- ?>
- </select><br /></label>
- </div>
- </fieldset>
- </div>
- <div class="inform">
- <fieldset>
- <legend><?php echo $lang_install['Choose the default style'] ?></legend>
- <div class="infldset">
- <p><?php echo $lang_install['Info 16'] ?></p>
- <label class="required"><strong><?php echo $lang_install['Default style'] ?> <span><?php echo $lang_install['Required'] ?></span></strong><br /><select id="req_default_style" name="req_default_style">
- <?php
- $styles = forum_list_styles();
- foreach ($styles as $temp)
- {
- if ($temp == $default_style)
- echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'" selected="selected">'.str_replace('_', ' ', $temp).'</option>'."\n";
- else
- echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$temp.'">'.str_replace('_', ' ', $temp).'</option>'."\n";
- }
- ?>
- </select><br /></label>
- </div>
- </fieldset>
- </div>
- <p class="buttons"><input type="submit" name="start" value="<?php echo $lang_install['Start install'] ?>" /></p>
- </form>
- </div>
- </div>
- </div>
- </div>
- <div class="end-box"><div><!-- Bottom Corners --></div></div>
- </div>
- </body>
- </html>
- <?php
- }
- else
- {
- //We created the DB earlier, so the checks move to there.
- // Make sure FluxBB isn't already installed
- $result = $db->query('SELECT 1 FROM '.$db_prefix.'users WHERE id=1');
- if ($db->num_rows($result))
- error(sprintf($lang_install['Existing table error'], $db_prefix, $db_name));
-
- // Check if InnoDB is available
- if ($db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
- {
- $result = $db->query('SHOW VARIABLES LIKE \'have_innodb\'');
- list (, $result) = $db->fetch_row($result);
- if ((strtoupper($result) != 'YES'))
- error($lang_install['InnoDB off']);
- }
- // Start a transaction
- $db->start_transaction();
- // Create all tables
- $schema = array(
- 'FIELDS' => array(
- 'id' => array(
- 'datatype' => 'SERIAL',
- 'allow_null' => false
- ),
- 'username' => array(
- 'datatype' => 'VARCHAR(200)',
- 'allow_null' => true
- ),
- 'ip' => array(
- 'datatype' => 'VARCHAR(255)',
- 'allow_null' => true
- ),
- 'email' => array(
- 'datatype' => 'VARCHAR(80)',
- 'allow_null' => true
- ),
- 'message' => array(
- 'datatype' => 'VARCHAR(255)',
- 'allow_null' => true
- ),
- 'expire' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => true
- ),
- 'ban_creator' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- )
- ),
- 'PRIMARY KEY' => array('id'),
- 'INDEXES' => array(
- 'username_idx' => array('username')
- )
- );
- if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
- $schema['INDEXES']['username_idx'] = array('username(25)');
- $db->create_table('bans', $schema) or error('Unable to create bans table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'id' => array(
- 'datatype' => 'SERIAL',
- 'allow_null' => false
- ),
- 'cat_name' => array(
- 'datatype' => 'VARCHAR(80)',
- 'allow_null' => false,
- 'default' => '\'New Category\''
- ),
- 'disp_position' => array(
- 'datatype' => 'INT(10)',
- 'allow_null' => false,
- 'default' => '0'
- )
- ),
- 'PRIMARY KEY' => array('id')
- );
- $db->create_table('categories', $schema) or error('Unable to create categories table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'id' => array(
- 'datatype' => 'SERIAL',
- 'allow_null' => false
- ),
- 'search_for' => array(
- 'datatype' => 'VARCHAR(60)',
- 'allow_null' => false,
- 'default' => '\'\''
- ),
- 'replace_with' => array(
- 'datatype' => 'VARCHAR(60)',
- 'allow_null' => false,
- 'default' => '\'\''
- )
- ),
- 'PRIMARY KEY' => array('id')
- );
- $db->create_table('censoring', $schema) or error('Unable to create censoring table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'conf_name' => array(
- 'datatype' => 'VARCHAR(255)',
- 'allow_null' => false,
- 'default' => '\'\''
- ),
- 'conf_value' => array(
- 'datatype' => 'TEXT',
- 'allow_null' => true
- )
- ),
- 'PRIMARY KEY' => array('conf_name')
- );
- $db->create_table('config', $schema) or error('Unable to create config table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'group_id' => array(
- 'datatype' => 'INT(10)',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'forum_id' => array(
- 'datatype' => 'INT(10)',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'read_forum' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'post_replies' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'post_topics' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- )
- ),
- 'PRIMARY KEY' => array('group_id', 'forum_id')
- );
- $db->create_table('forum_perms', $schema) or error('Unable to create forum_perms table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'id' => array(
- 'datatype' => 'SERIAL',
- 'allow_null' => false
- ),
- 'forum_name' => array(
- 'datatype' => 'VARCHAR(80)',
- 'allow_null' => false,
- 'default' => '\'New forum\''
- ),
- 'forum_desc' => array(
- 'datatype' => 'TEXT',
- 'allow_null' => true
- ),
- 'redirect_url' => array(
- 'datatype' => 'VARCHAR(100)',
- 'allow_null' => true
- ),
- 'moderators' => array(
- 'datatype' => 'TEXT',
- 'allow_null' => true
- ),
- 'num_topics' => array(
- 'datatype' => 'MEDIUMINT(8) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'num_posts' => array(
- 'datatype' => 'MEDIUMINT(8) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'last_post' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => true
- ),
- 'last_post_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => true
- ),
- 'last_poster' => array(
- 'datatype' => 'VARCHAR(200)',
- 'allow_null' => true
- ),
- 'sort_by' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'disp_position' => array(
- 'datatype' => 'INT(10)',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'cat_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- )
- ),
- 'PRIMARY KEY' => array('id')
- );
- $db->create_table('forums', $schema) or error('Unable to create forums table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'g_id' => array(
- 'datatype' => 'SERIAL',
- 'allow_null' => false
- ),
- 'g_title' => array(
- 'datatype' => 'VARCHAR(50)',
- 'allow_null' => false,
- 'default' => '\'\''
- ),
- 'g_user_title' => array(
- 'datatype' => 'VARCHAR(50)',
- 'allow_null' => true
- ),
- 'g_moderator' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'g_mod_edit_users' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'g_mod_rename_users' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'g_mod_change_passwords' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'g_mod_ban_users' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'g_read_board' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'g_view_users' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'g_post_replies' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'g_post_topics' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'g_edit_posts' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'g_delete_posts' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'g_delete_topics' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'g_set_title' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'g_search' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'g_search_users' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'g_send_email' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'g_post_flood' => array(
- 'datatype' => 'SMALLINT(6)',
- 'allow_null' => false,
- 'default' => '30'
- ),
- 'g_search_flood' => array(
- 'datatype' => 'SMALLINT(6)',
- 'allow_null' => false,
- 'default' => '30'
- ),
- 'g_email_flood' => array(
- 'datatype' => 'SMALLINT(6)',
- 'allow_null' => false,
- 'default' => '60'
- ),
- 'g_locked' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '0'
- )
- ),
- 'PRIMARY KEY' => array('g_id')
- );
- $db->create_table('groups', $schema) or error('Unable to create groups table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'user_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'ident' => array(
- 'datatype' => 'VARCHAR(200)',
- 'allow_null' => false,
- 'default' => '\'\''
- ),
- 'logged' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'idle' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'last_post' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => true
- ),
- 'last_search' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => true
- ),
- ),
- 'UNIQUE KEYS' => array(
- 'user_id_ident_idx' => array('user_id', 'ident')
- ),
- 'INDEXES' => array(
- 'ident_idx' => array('ident'),
- 'logged_idx' => array('logged')
- ),
- 'ENGINE' => 'HEAP'
- );
- if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
- {
- $schema['UNIQUE KEYS']['user_id_ident_idx'] = array('user_id', 'ident(25)');
- $schema['INDEXES']['ident_idx'] = array('ident(25)');
- }
- if ($db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
- $schema['ENGINE'] = 'InnoDB';
- $db->create_table('online', $schema) or error('Unable to create online table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'id' => array(
- 'datatype' => 'SERIAL',
- 'allow_null' => false
- ),
- 'poster' => array(
- 'datatype' => 'VARCHAR(200)',
- 'allow_null' => false,
- 'default' => '\'\''
- ),
- 'poster_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'poster_ip' => array(
- 'datatype' => 'VARCHAR(39)',
- 'allow_null' => true
- ),
- 'poster_email' => array(
- 'datatype' => 'VARCHAR(80)',
- 'allow_null' => true
- ),
- 'message' => array(
- 'datatype' => 'MEDIUMTEXT',
- 'allow_null' => true
- ),
- 'hide_smilies' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'posted' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'edited' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => true
- ),
- 'edited_by' => array(
- 'datatype' => 'VARCHAR(200)',
- 'allow_null' => true
- ),
- 'topic_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- )
- ),
- 'PRIMARY KEY' => array('id'),
- 'INDEXES' => array(
- 'topic_id_idx' => array('topic_id'),
- 'multi_idx' => array('poster_id', 'topic_id')
- )
- );
- $db->create_table('posts', $schema) or error('Unable to create posts table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'id' => array(
- 'datatype' => 'SERIAL',
- 'allow_null' => false
- ),
- 'rank' => array(
- 'datatype' => 'VARCHAR(50)',
- 'allow_null' => false,
- 'default' => '\'\''
- ),
- 'min_posts' => array(
- 'datatype' => 'MEDIUMINT(8) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- )
- ),
- 'PRIMARY KEY' => array('id')
- );
- $db->create_table('ranks', $schema) or error('Unable to create ranks table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'id' => array(
- 'datatype' => 'SERIAL',
- 'allow_null' => false
- ),
- 'post_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'topic_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'forum_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'reported_by' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'created' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'message' => array(
- 'datatype' => 'TEXT',
- 'allow_null' => true
- ),
- 'zapped' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => true
- ),
- 'zapped_by' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => true
- )
- ),
- 'PRIMARY KEY' => array('id'),
- 'INDEXES' => array(
- 'zapped_idx' => array('zapped')
- )
- );
- $db->create_table('reports', $schema) or error('Unable to create reports table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'ident' => array(
- 'datatype' => 'VARCHAR(200)',
- 'allow_null' => false,
- 'default' => '\'\''
- ),
- 'search_data' => array(
- 'datatype' => 'MEDIUMTEXT',
- 'allow_null' => true
- )
- ),
- 'PRIMARY KEY' => array('id'),
- 'INDEXES' => array(
- 'ident_idx' => array('ident')
- )
- );
- if ($db_type == 'mysql' || $db_type == 'mysqli' || $db_type == 'mysql_innodb' || $db_type == 'mysqli_innodb')
- $schema['INDEXES']['ident_idx'] = array('ident(8)');
- $db->create_table('search_cache', $schema) or error('Unable to create search_cache table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'post_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'word_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'subject_match' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '0'
- )
- ),
- 'INDEXES' => array(
- 'word_id_idx' => array('word_id'),
- 'post_id_idx' => array('post_id')
- )
- );
- $db->create_table('search_matches', $schema) or error('Unable to create search_matches table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'id' => array(
- 'datatype' => 'SERIAL',
- 'allow_null' => false
- ),
- 'word' => array(
- 'datatype' => 'VARCHAR(20)',
- 'allow_null' => false,
- 'default' => '\'\'',
- 'collation' => 'bin'
- )
- ),
- 'PRIMARY KEY' => array('word'),
- 'INDEXES' => array(
- 'id_idx' => array('id')
- )
- );
- if ($db_type == 'sqlite')
- {
- $schema['PRIMARY KEY'] = array('id');
- $schema['UNIQUE KEYS'] = array('word_idx' => array('word'));
- }
- $db->create_table('search_words', $schema) or error('Unable to create search_words table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'user_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'topic_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- )
- ),
- 'PRIMARY KEY' => array('user_id', 'topic_id')
- );
- $db->create_table('topic_subscriptions', $schema) or error('Unable to create topic subscriptions table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'user_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'forum_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- )
- ),
- 'PRIMARY KEY' => array('user_id', 'forum_id')
- );
-
- $db->create_table('forum_subscriptions', $schema) or error('Unable to create forum subscriptions table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'id' => array(
- 'datatype' => 'SERIAL',
- 'allow_null' => false
- ),
- 'poster' => array(
- 'datatype' => 'VARCHAR(200)',
- 'allow_null' => false,
- 'default' => '\'\''
- ),
- 'subject' => array(
- 'datatype' => 'VARCHAR(255)',
- 'allow_null' => false,
- 'default' => '\'\''
- ),
- 'posted' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'first_post_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'last_post' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'last_post_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'last_poster' => array(
- 'datatype' => 'VARCHAR(200)',
- 'allow_null' => true
- ),
- 'num_views' => array(
- 'datatype' => 'MEDIUMINT(8) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'num_replies' => array(
- 'datatype' => 'MEDIUMINT(8) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'closed' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'sticky' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'moved_to' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => true
- ),
- 'forum_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '0'
- )
- ),
- 'PRIMARY KEY' => array('id'),
- 'INDEXES' => array(
- 'forum_id_idx' => array('forum_id'),
- 'moved_to_idx' => array('moved_to'),
- 'last_post_idx' => array('last_post'),
- 'first_post_id_idx' => array('first_post_id')
- )
- );
- $db->create_table('topics', $schema) or error('Unable to create topics table', __FILE__, __LINE__, $db->error());
- $schema = array(
- 'FIELDS' => array(
- 'id' => array(
- 'datatype' => 'SERIAL',
- 'allow_null' => false
- ),
- 'group_id' => array(
- 'datatype' => 'INT(10) UNSIGNED',
- 'allow_null' => false,
- 'default' => '3'
- ),
- 'username' => array(
- 'datatype' => 'VARCHAR(200)',
- 'allow_null' => false,
- 'default' => '\'\''
- ),
- 'password' => array(
- 'datatype' => 'VARCHAR(40)',
- 'allow_null' => false,
- 'default' => '\'\''
- ),
- 'email' => array(
- 'datatype' => 'VARCHAR(80)',
- 'allow_null' => false,
- 'default' => '\'\''
- ),
- 'title' => array(
- 'datatype' => 'VARCHAR(50)',
- 'allow_null' => true
- ),
- 'realname' => array(
- 'datatype' => 'VARCHAR(40)',
- 'allow_null' => true
- ),
- 'url' => array(
- 'datatype' => 'VARCHAR(100)',
- 'allow_null' => true
- ),
- 'jabber' => array(
- 'datatype' => 'VARCHAR(80)',
- 'allow_null' => true
- ),
- 'icq' => array(
- 'datatype' => 'VARCHAR(12)',
- 'allow_null' => true
- ),
- 'msn' => array(
- 'datatype' => 'VARCHAR(80)',
- 'allow_null' => true
- ),
- 'aim' => array(
- 'datatype' => 'VARCHAR(30)',
- 'allow_null' => true
- ),
- 'yahoo' => array(
- 'datatype' => 'VARCHAR(30)',
- 'allow_null' => true
- ),
- 'location' => array(
- 'datatype' => 'VARCHAR(30)',
- 'allow_null' => true
- ),
- 'signature' => array(
- 'datatype' => 'TEXT',
- 'allow_null' => true
- ),
- 'disp_topics' => array(
- 'datatype' => 'TINYINT(3) UNSIGNED',
- 'allow_null' => true
- ),
- 'disp_posts' => array(
- 'datatype' => 'TINYINT(3) UNSIGNED',
- 'allow_null' => true
- ),
- 'email_setting' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'notify_with_post' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'auto_notify' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '0'
- ),
- 'show_smilies' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'default' => '1'
- ),
- 'show_img' => array(
- 'datatype' => 'TINYINT(1)',
- 'allow_null' => false,
- 'defa…
Large files files are truncated, but you can click here to view the full file