/install.php
PHP | 4187 lines | 3291 code | 626 blank | 270 comment | 128 complexity | 36c35573c12d69144550e3ae783023ff MD5 | raw file
Large files files are truncated, but you can click here to view the full file
- <?php
- /*
- =====================================================
- ExpressionEngine - by EllisLab
- -----------------------------------------------------
- http://expressionengine.com/
- -----------------------------------------------------
- Copyright (c) 2003 - 2010 EllisLab, Inc.
- =====================================================
- THIS IS COPYRIGHTED SOFTWARE
- PLEASE READ THE LICENSE AGREEMENT
- http://expressionengine.com/docs/license.html
- =====================================================
- File: install.php
- -----------------------------------------------------
- Purpose: Installation file
- =====================================================
- */
- error_reporting(E_ALL);
- @set_magic_quotes_runtime(0);
- if (isset($_GET) AND count($_GET) > 0)
- {
- if ( ! isset($_GET['page']) OR ! is_numeric($_GET['page']) OR count($_GET) > 1)
- {
- exit("Disallowed GET request");
- }
- }
- $data = array(
- 'app_full_version' => 'Version 1.6.8',
- 'app_version' => '168',
- 'doc_url' => 'http://expressionengine.com/docs/',
- 'ext' => '.php',
- 'ip' => '',
- 'database' => 'mysql',
- 'db_conntype' => '0',
- 'system_dir' => 'system',
- 'db_hostname' => 'localhost',
- 'db_username' => '',
- 'db_password' => '',
- 'db_name' => '',
- 'db_prefix' => 'exp',
- 'encryption_type' => 'sha1',
- 'site_name' => '',
- 'site_url' => '',
- 'site_index' => '',
- 'cp_url' => '',
- 'cp_index' => 'index.php',
- 'username' => '',
- 'password' => '',
- 'screen_name' => '',
- 'email' => '',
- 'webmaster_email' => '',
- 'deft_lang' => 'english',
- 'template' => '01',
- 'server_timezone' => 'UTC',
- 'daylight_savings' => '',
- 'redirect_method' => 'redirect',
- 'upload_folder' => 'uploads/',
- 'image_path' => '../images/',
- 'cp_images' => 'cp_images/',
- 'avatar_path' => '../images/avatars/',
- 'avatar_url' => 'images/avatars/',
- 'photo_path' => '../images/member_photos/',
- 'photo_url' => 'images/member_photos/',
- 'signature_img_path' => '../images/signature_attachments/',
- 'signature_img_url' => 'images/signature_attachments/',
- 'pm_path' => '../images/pm_attachments',
- 'captcha_path' => '../images/captchas/',
- 'theme_folder_path' => '../themes/',
- );
- foreach ($_POST as $key => $val)
- {
- if ( ! get_magic_quotes_gpc())
- $val = addslashes($val);
- if (isset($data[$key]))
- {
- $data[$key] = trim($val);
- }
- }
- $data['site_url'] = rtrim($data['site_url'], '/').'/';
- $data['system_dir'] = str_replace("/", "", $data['system_dir']);
- define('EXT', $data['ext']);
- $page = (! isset($_GET['page']) || $_GET['page'] > 7) ? 1 : $_GET['page'];
- if (phpversion() < '4.1.0')
- {
- $page = 0;
- }
- // HTML HEADER
- page_head();
- // Unsupported version of PHP
- // --------------------------------------------------------------------
- // --------------------------------------------------------------------
- if ($page == 0)
- {
- ?>
- <div id='innercontent'>
- <div class="error">Error: Unsupported PHP version</div>
- <p><b>In order to install ExpressionEngine, your server must be running PHP version 4.1 or newer.</b></p>
- <p><br />Your server is currently running PHP version: <?php echo phpversion(); ?></p>
- <p><br />If you would like to switch to a host that provides more current software,
- please consider <a href="http://www.enginehosting.com/">EngineHosting</a></p>
- </div>
- <?php
- }
- // PAGE ONE
- // --------------------------------------------------------------------
- // --------------------------------------------------------------------
- if ($page == 1)
- {
- ?>
-
- <div id='innercontent'>
- <h1>ExpressionEngine Installation Wizard</h1>
- <div class="botBorder">
- <div class="pad">
- <p><b>Do you need assistance?</b> If you have questions or problems please visit our <a href="http://expressionengine.com/support/">Support Resources</a> page</p>
- </div>
- </div>
- <div class="botBorder">
- <p><br /><span class='red'><b>Important: </b> Use this installation wizard <b>ONLY</b> if you are installing ExpressionEngine for the first time.
- Do <b>NOT</b> run this installation routine if you are already using ExpressionEngine and are updating to a newer version. You'll find
- update instructions in the user guide.</span><br /> </p>
- </div>
- <div class="botBorder">
- <h4>Installation Instructions</h4>
- <p>Before proceeding please take a moment to read the
- <a href="http://expressionengine.com/docs/#install_docs" target="_blank">installation instructions</a> if you have not done so already.</p>
- <br />
- </div>
- <form method="post" action="install.php?page=2">
- <p class="center"><br />Are you ready to install ExpressionEngine?</p>
- <p class="center"><input type="submit" class="submit" value=" Click here to begin! " /></p>
- </form>
- </div>
- <?php
- }
- // PAGE TWO
- // --------------------------------------------------------------------
- // --------------------------------------------------------------------
- elseif ($page == 2)
- {
- license_agreement();
- }
- // PAGE THREE
- // --------------------------------------------------------------------
- // --------------------------------------------------------------------
- elseif ($page == 3)
- {
- if ( ! isset($_POST['agree']) OR $_POST['agree'] == 'no')
- {
- license_agreement();
- }
- else
- {
- system_folder_form();
- }
- }
- // PAGE FOUR
- // --------------------------------------------------------------------
- // --------------------------------------------------------------------
- elseif ($page == 4)
- {
- // Does the 'system' directory exist?
- // --------------------------------------------------------------------
- if ($data['system_dir'] == '' OR ! is_dir('./'.$data['system_dir']))
- {
- ?><div class='error'>Error: Unable to locate the directory you submitted.</div><?php
- system_folder_form();
- page_footer();
-
- exit;
- }
- // Are the various files and directories writable?
- // --------------------------------------------------------------------
-
- $system_path = './'.trim($data['system_dir']).'/';
-
- $writable_things = array(
- 'path.php',
- $system_path.'config.php',
- $system_path.'cache/'
- );
-
-
- $not_writable = array();
-
- foreach ($writable_things as $val)
- {
- if ( ! @is_writable($val))
- {
- $not_writable[] = $val;
- }
- }
-
- if ( ! @is_writable("./images/uploads"))
- {
- $not_writable[] = "images/uploads";
- }
-
- if ( ! @is_writable("./images/captchas"))
- {
- $not_writable[] = "images/captchas";
- }
-
-
- $i = count($not_writable);
-
- if ($i > 0)
- {
- echo "<div id='innercontent'>";
-
- $d = ($i > 1) ? 'Directories or Files' : 'Directory or File';
-
- echo "<div class='error'>Error: Incorrect Permissions for ".$d."</div>";
-
- $d = ($i > 1) ? 'directories or files' : 'directory or file';
- echo "<p>The following $d cannot be written to:</p>";
-
- foreach ($not_writable as $bad)
- {
- echo '<p> <strong>'.$bad.'</strong></p>';
- }
-
- $item = ($i > 1) ? 'items' : 'item';
- ?>
-
- <p>In order to run this installation, the file permissions on the above <?php echo $item; ?> must be set as indicated in the instructions.</p>
-
- <p>If you are not sure how to set permissions, <a href='http://expressionengine.com/knowledge_base/article/how_do_you_set_permissions_on_files_and_directories/' target='_blank'>click here</a>.</p>
-
- <p><b>Once you are done, please <a href='javascript:history.go(-1)'>run</a> this installation script again.</b></p>
-
- </div>
- <?php
-
- page_footer();
-
- exit;
- }
-
- if ( ! @file_exists($system_path.'config'.$data['ext']))
- {
- echo "<div class='error'><br />Error: Unable to locate your config.php file. Please make sure you have uploaded all components of this software.</div><br />";
-
- page_footer();
-
- exit;
- }
- else
- {
- require($system_path.'config'.$data['ext']);
- }
-
-
- if (isset($conf['install_lock']) AND $conf['install_lock'] == 1)
- {
- ?>
- <div id='innercontent'>
- <div class="error">Warning: Your installation lock is set</div>
-
- <p>There already appears to be an installed instance of ExpressionEngine</p>
-
- <p>If you absolutely want to install this program you must locate the file called <b>config.php</b> and delete its contents.</b>
-
- <p>Once you've done this, <a href="install.php?page=3">click here</a> to continue</p>
- </div>
- <?php
- }
- else
- {
- settings_form();
- }
- }
- // PAGE FIVE
- // --------------------------------------------------------------------
- // --------------------------------------------------------------------
- elseif ($page == 5)
- {
- if ($data['db_hostname'] == '' AND $data['db_username'] == '' AND $data['db_name'] == '')
- {
- echo "<p>An errror occured. <a href='install.php'>Click here</a> to return to the main page</a>";
- page_footer();
- exit;
- }
- $errors = array();
- $system_path = './'.trim($data['system_dir']).'/';
-
- if ( ! @file_exists($system_path.'config'.$data['ext']))
- {
- $errors[] = "Unable to locate the file called \"config.php\". Please make sure you have uploaded all components of this software.";
- }
- else
- {
- require($system_path.'config'.$data['ext']);
- }
-
-
- if (isset($conf['install_lock']) AND $conf['install_lock'] == 1)
- {
- $errors[] = "Your installation lock is set. Locate the file called <b>config.php</b> and delete its contents";
- }
-
- if (
- $data['db_hostname'] == '' ||
- $data['db_username'] == '' ||
- $data['db_name'] == '' ||
- $data['site_name'] == '' ||
- $data['username'] == '' ||
- $data['password'] == '' ||
- $data['email'] == ''
- )
- {
- $errors[] = "You left some form fields empty";
- }
- if (strlen($data['username']) < 4)
- {
- $errors[] = "Your username must be at least 4 characters in length";
- }
-
-
- if (strlen($data['password']) < 5)
- {
- $errors[] = "Your password must be at least 5 characters in length";
- }
- // Is password the same as username?
- $lc_user = strtolower($data['username']);
- $lc_pass = strtolower($data['password']);
- $nm_pass = strtr($lc_pass, 'elos', '3105');
- if ($lc_user == $lc_pass || $lc_user == strrev($lc_pass) || $lc_user == $nm_pass || $lc_user == strrev($nm_pass))
- {
- $errors[] = "Your password can not be based on the username";
- }
-
- if (strpos($data['db_password'], '$') !== FALSE)
- {
- $errors[] = "Your MySQL password can not contain a dollar sign (\$)";
- }
-
- if ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $data['email']))
- {
- $errors[] = "The email address you submitted is not valid";
- }
-
- if ($data['screen_name'] == '')
- {
- $data['screen_name'] = $data['username'];
- }
- // CONNECT TO DATABASE
- // --------------------------------------------------------------------
- $db_prefix = ($data['db_prefix'] == '') ? 'exp' : $data['db_prefix'];
-
- if ( ! @file_exists($system_path.'db/db.'.$data['database'].$data['ext']))
- {
- $errors[] = "Unable to locate the database file. Please make sure you have uploaded all components of this software.";
- }
- else
- {
- require($system_path.'db/db.'.$data['database'].$data['ext']);
-
- $db_config = array(
- 'hostname' => $data['db_hostname'],
- 'username' => $data['db_username'],
- 'password' => $data['db_password'],
- 'database' => $data['db_name'],
- 'conntype' => $data['db_conntype'],
- 'prefix' => $db_prefix,
- 'enable_cache' => FALSE
- );
-
- $DB = new DB($db_config);
-
- if ( ! $DB->db_connect(0))
- {
- $errors[] = "Unable to connect to your database server. ";
-
- if ($data['db_conntype'] == 1)
- {
- $errors[] = "Try switching to a non-persistent connection since some servers do not support persistent connections.";
- }
- }
-
- if ( ! $DB->select_db())
- {
- $errors[] = "Unable to select the database";
- }
-
- // Check for "strict mode", some queries used are incompatible
- if ($DB->conn_id !== FALSE && version_compare(mysql_get_server_info(), '4.1-alpha', '>=') !== FALSE)
- {
- $mode_query = $DB->query("SELECT CONCAT(@@global.sql_mode, @@session.sql_mode) AS sql_mode");
-
- if (strpos(strtoupper($mode_query->row['sql_mode']), 'STRICT') !== FALSE)
- {
- $errors[] = "ExpressionEngine will not run on a MySQL server operating in strict mode";
- }
- }
- }
-
- if ( ! file_exists($system_path.'language/'.$data['deft_lang'].'/email_data'.$data['ext']))
- {
- $errors[] = "Unable to locate the file containing your email templates. Make sure you have uploaded all components of this software.";
- }
- else
- {
- require($system_path.'language/'.$data['deft_lang'].'/email_data'.$data['ext']);
- }
- // DISPLAY ERRORS
- // --------------------------------------------------------------------
-
- if (count($errors) > 0)
- {
- $er = "<div class='error'>ERROR: The following Errors were encountered</div>";
- $er .= "<ol>";
-
- foreach ($errors as $doh)
- {
- $er .= "<li>".$doh."</li>";
- }
-
- $er .= "</ol>";
-
- $er .= "<div class='border'><p><b>Please correct the errors and resubmit the form</b><br /><br /></p></div>";
-
- settings_form($er);
- page_footer();
- exit;
- }
- // Existing Install?
- // --------------------------------------------------------------------
- // is the user trying to install to an existing installation?
- // This can happen if someone mistakenly copies over their config.php
- // during an update, and then trying to run the installer...
-
- $query = $DB->query("SHOW tables LIKE '".$DB->escape_str($db_prefix)."%'");
- if ($query->num_rows > 0 && ! isset($_POST['install_override']))
- {
- $fields = '';
-
- foreach($_POST as $key => $value)
- {
- if (get_magic_quotes_gpc())
- {
- $value = stripslashes($value);
- }
-
- $fields .= '<input type="hidden" name="'.str_replace("'", "'", htmlspecialchars($key)).'" value="'.str_replace("'", "'", htmlspecialchars($value)).'" />'."\n";
- }
-
-
- $er = '<div id="innercontent">
- <div class="error">Existing Installation Detected, Empty config.php File</div>
- <p>ExpressionEngine appears to be installed to your database, but your configuration file is empty.
- Continuing with this installation will destroy any information currently in your database.
- Are you sure you wish to perform a new installation?</p>
- <form action="install.php?page=5" method="post">
- '.$fields.'
- <input type="hidden" name="install_override" value="y" />
- <p><input type="submit" value="Continue Installation"></p>
- </form>
- <form action="install.php?page=6" method="post">
- '.$fields.'
- <input type="hidden" name="rebuild_config" value="y" />
- <p><input type="submit" value="Do NOT Install, Fix Configuration"></p>
- </form>
- </div>
- ';
- echo $er;
- page_footer();
- exit;
- }
-
-
- // Prep user submitted data for DB insertion
- // --------------------------------------------------------------------
- // --------------------------------------------------------------------
- /** -------------------------------------
- /** Get user's IP address
- /** -------------------------------------*/
-
- $CIP = ( ! isset($_SERVER['HTTP_CLIENT_IP'])) ? FALSE : $_SERVER['HTTP_CLIENT_IP'];
- $FOR = ( ! isset($_SERVER['HTTP_X_FORWARDED_FOR'])) ? FALSE : $_SERVER['HTTP_X_FORWARDED_FOR'];
- $RMT = ( ! isset($_SERVER['REMOTE_ADDR'])) ? FALSE : $_SERVER['REMOTE_ADDR'];
-
- if ($CIP)
- {
- $cip = explode('.', $CIP);
-
- $data['ip'] = ($cip['0'] != current(explode('.', $RMT))) ? implode('.', array_reverse($cip)) : $CIP;
- }
- elseif ($FOR)
- {
- $data['ip'] = (strstr($FOR, ',')) ? end(explode(',', $FOR)) : $FOR;
- }
- else
- $data['ip'] = $RMT;
- /** -------------------------------------
- /** Encrypt password and Unique ID
- /** -------------------------------------*/
-
- if (phpversion() >= 4.2)
- mt_srand();
- else
- mt_srand(hexdec(substr(md5(microtime()), -8)) & 0x7fffffff);
-
- $unique_id = uniqid(mt_rand());
-
- $password = stripslashes($data['password']);
-
-
- if ($data['encryption_type'] == 'sha1')
- {
- if ( ! function_exists('sha1'))
- {
- if ( ! function_exists('mhash'))
- {
- require './'.$data['system_dir'].'/core/core.sha1'.$data['ext'];
-
- $SH = new SHA;
-
- $unique_id = $SH->encode_hash($unique_id);
- $password = $SH->encode_hash($password);
- }
- else
- {
- $unique_id = bin2hex(mhash(MHASH_SHA1, $unique_id));
- $password = bin2hex(mhash(MHASH_SHA1, $password));
- }
- }
- else
- {
- $unique_id = sha1($unique_id);
- $password = sha1($password);
- }
- }
- else
- {
- $unique_id = md5($unique_id);
- $password = md5($password);
- }
-
-
- /** -------------------------------------
- /** Fetch current time as GMT
- /** -------------------------------------*/
-
- $time = time();
- $now = mktime(gmdate("H", $time), gmdate("i", $time), gmdate("s", $time), gmdate("m", $time), gmdate("d", $time), gmdate("Y", $time));
- $year = gmdate('Y', $now);
- $month = gmdate('m', $now);
- $day = gmdate('d', $now);
-
-
- // DEFINE DB TABLES
- // --------------------------------------------------------------------
- // --------------------------------------------------------------------
- // Sites
- $D[] = "exp_sites";
- $Q[] = "CREATE TABLE `exp_sites` (
- `site_id` int(5) unsigned NOT NULL auto_increment,
- `site_label` varchar(100) NOT NULL default '',
- `site_name` varchar(50) NOT NULL default '',
- `site_description` text NOT NULL,
- `site_system_preferences` TEXT NOT NULL ,
- `site_mailinglist_preferences` TEXT NOT NULL ,
- `site_member_preferences` TEXT NOT NULL ,
- `site_template_preferences` TEXT NOT NULL ,
- `site_weblog_preferences` TEXT NOT NULL ,
- PRIMARY KEY (`site_id`),
- KEY `site_name` (`site_name`))";
- // Session data
- $D[] = 'exp_sessions';
- $Q[] = "CREATE TABLE exp_sessions (
- session_id varchar(40) default '0' NOT NULL,
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- member_id int(10) default '0' NOT NULL,
- admin_sess tinyint(1) default '0' NOT NULL,
- ip_address varchar(16) default '0' NOT NULL,
- user_agent varchar(50) NOT NULL,
- last_activity int(10) unsigned DEFAULT '0' NOT NULL,
- PRIMARY KEY (session_id),
- KEY (`member_id`),
- KEY (`site_id`)
- )";
- // Throttle
- $D[] = 'exp_throttle';
- $Q[] = "CREATE TABLE exp_throttle (
- ip_address varchar(16) default '0' NOT NULL,
- last_activity int(10) unsigned DEFAULT '0' NOT NULL,
- hits int(10) unsigned NOT NULL,
- locked_out char(1) NOT NULL default 'n',
- KEY (ip_address),
- KEY (last_activity)
- )";
- // System stats
- $D[] = 'exp_stats';
- $Q[] = "CREATE TABLE exp_stats (
- weblog_id int(6) unsigned NOT NULL default '0',
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- total_members mediumint(7) NOT NULL default '0',
- recent_member_id int(10) default '0' NOT NULL,
- recent_member varchar(50) NOT NULL,
- total_entries mediumint(8) default '0' NOT NULL,
- total_forum_topics mediumint(8) default '0' NOT NULL,
- total_forum_posts mediumint(8) default '0' NOT NULL,
- total_comments mediumint(8) default '0' NOT NULL,
- total_trackbacks mediumint(8) default '0' NOT NULL,
- last_entry_date int(10) unsigned default '0' NOT NULL,
- last_forum_post_date int(10) unsigned default '0' NOT NULL,
- last_comment_date int(10) unsigned default '0' NOT NULL,
- last_trackback_date int(10) unsigned default '0' NOT NULL,
- last_visitor_date int(10) unsigned default '0' NOT NULL,
- most_visitors mediumint(7) NOT NULL default '0',
- most_visitor_date int(10) unsigned default '0' NOT NULL,
- last_cache_clear int(10) unsigned default '0' NOT NULL,
- KEY (weblog_id),
- KEY (site_id)
- )";
- // Online users
- $D[] = 'exp_online_users';
- $Q[] = "CREATE TABLE exp_online_users (
- weblog_id int(6) unsigned NOT NULL default '0',
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- member_id int(10) default '0' NOT NULL,
- in_forum char(1) NOT NULL default 'n',
- name varchar(50) default '0' NOT NULL,
- ip_address varchar(16) default '0' NOT NULL,
- date int(10) unsigned default '0' NOT NULL,
- anon char(1) NOT NULL,
- KEY (date),
- KEY (site_id)
- )";
- // Actions table
- // Actions are events that require processing. Used by modules class.
- $D[] = 'exp_actions';
- $Q[] = "CREATE TABLE exp_actions (
- action_id int(4) unsigned NOT NULL auto_increment,
- class varchar(50) NOT NULL,
- method varchar(50) NOT NULL,
- PRIMARY KEY (action_id)
- )";
- // Modules table
- // Contains a list of all installed modules
- $D[] = 'exp_modules';
- $Q[] = "CREATE TABLE exp_modules (
- module_id int(4) unsigned NOT NULL auto_increment,
- module_name varchar(50) NOT NULL,
- module_version varchar(12) NOT NULL,
- has_cp_backend char(1) NOT NULL default 'n',
- PRIMARY KEY (module_id)
- )";
- // Referrer tracking table
- $D[] = 'exp_referrers';
- $Q[] = "CREATE TABLE exp_referrers (
- ref_id int(10) unsigned NOT NULL auto_increment,
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- ref_from varchar(120) NOT NULL,
- ref_to varchar(120) NOT NULL,
- ref_ip varchar(16) default '0' NOT NULL,
- ref_date int(10) unsigned default '0' NOT NULL,
- ref_agent varchar(100) NOT NULL,
- user_blog varchar(40) NOT NULL,
- PRIMARY KEY (ref_id),
- KEY (site_id)
- )";
- // Security Hashes
- // Used to store hashes needed to process forms in 'secure mode'
- $D[] = 'exp_security_hashes';
- $Q[] = "CREATE TABLE exp_security_hashes (
- date int(10) unsigned NOT NULL,
- ip_address varchar(16) default '0' NOT NULL,
- hash varchar(40) NOT NULL,
- KEY (hash)
- )";
- // Captcha data
- $D[] = 'exp_captcha';
- $Q[] = "CREATE TABLE exp_captcha (
- captcha_id bigint(13) unsigned NOT NULL auto_increment,
- date int(10) unsigned NOT NULL,
- ip_address varchar(16) default '0' NOT NULL,
- word varchar(20) NOT NULL,
- PRIMARY KEY (captcha_id),
- KEY (word)
- )";
- // Password Lockout
- // If password lockout is enabled, a user only gets
- // four attempts to log-in within a specified period.
- // This table holds the a list of locked out users
- $D[] = 'exp_password_lockout';
- $Q[] = "CREATE TABLE exp_password_lockout (
- login_date int(10) unsigned NOT NULL,
- ip_address varchar(16) default '0' NOT NULL,
- user_agent varchar(50) NOT NULL,
- KEY (login_date),
- KEY (ip_address),
- KEY (user_agent)
- )";
- // Reset password
- // If a user looses their password, this table
- // holds the reset code.
- $D[] = 'exp_reset_password';
- $Q[] = "CREATE TABLE exp_reset_password (
- member_id int(10) unsigned NOT NULL,
- resetcode varchar(12) NOT NULL,
- date int(10) NOT NULL
- )";
- $D[] = 'exp_mailing_lists';
- $Q[] = "CREATE TABLE exp_mailing_lists (
- list_id int(7) unsigned NOT NULL auto_increment,
- list_name varchar(40) NOT NULL,
- list_title varchar(100) NOT NULL,
- list_template text NOT NULL,
- PRIMARY KEY (list_id),
- KEY (list_name)
- )";
- // Mailing list
- // Notes: "authcode" is a random hash assigned to each member
- // of the mailing list. We use this code in the "usubscribe" link
- // added to sent emails.
- $D[] = 'exp_mailing_list';
- $Q[] = "CREATE TABLE exp_mailing_list (
- user_id int(10) unsigned NOT NULL auto_increment,
- list_id int(7) unsigned default '0' NOT NULL,
- ip_address varchar(16) NOT NULL,
- authcode varchar(10) NOT NULL,
- email varchar(50) NOT NULL,
- KEY (list_id),
- KEY (user_id)
- )";
- // Mailing List Queue
- // When someone signs up for the mailing list, they are sent
- // a confirmation email. This prevents someone from signing
- // up another person. This table holds email addresses that
- // are pending activation.
- $D[] = 'exp_mailing_list_queue';
- $Q[] = "CREATE TABLE exp_mailing_list_queue (
- email varchar(50) NOT NULL,
- list_id int(7) unsigned default '0' NOT NULL,
- authcode varchar(10) NOT NULL,
- date int(10) NOT NULL
- )";
- // Email Cache
- // We store all email messages that are sent from the CP
- $D[] = 'exp_email_cache';
- $Q[] = "CREATE TABLE exp_email_cache (
- cache_id int(6) unsigned NOT NULL auto_increment,
- cache_date int(10) unsigned default '0' NOT NULL,
- total_sent int(6) unsigned NOT NULL,
- from_name varchar(70) NOT NULL,
- from_email varchar(70) NOT NULL,
- recipient text NOT NULL,
- cc text NOT NULL,
- bcc text NOT NULL,
- recipient_array mediumtext NOT NULL,
- subject varchar(120) NOT NULL,
- message mediumtext NOT NULL,
- `plaintext_alt` MEDIUMTEXT NOT NULL,
- mailinglist char(1) NOT NULL default 'n',
- mailtype varchar(6) NOT NULL,
- text_fmt varchar(40) NOT NULL,
- wordwrap char(1) NOT NULL default 'y',
- priority char(1) NOT NULL default '3',
- PRIMARY KEY (cache_id)
- )";
- // Cached Member Groups
- // We use this table to store the member group assignments
- // for each email that is sent. Since you can send email
- // to various combinations of members, we store the member
- // group numbers in this table, which is joined to the
- // table above when we need to re-send an email from cache.
- $D[] = 'exp_email_cache_mg';
- $Q[] = "CREATE TABLE exp_email_cache_mg (
- cache_id int(6) unsigned NOT NULL,
- group_id smallint(4) NOT NULL,
- KEY (cache_id)
- )";
- // We do the same with mailing lists
- $D[] = 'exp_email_cache_ml';
- $Q[] = "CREATE TABLE exp_email_cache_ml (
- cache_id int(6) unsigned NOT NULL,
- list_id smallint(4) NOT NULL,
- KEY (cache_id)
- )";
- // Email Console Cache
- // Emails sent from the member profile email console are saved here.
- $D[] = 'exp_email_console_cache';
- $Q[] = "CREATE TABLE exp_email_console_cache (
- cache_id int(6) unsigned NOT NULL auto_increment,
- cache_date int(10) unsigned default '0' NOT NULL,
- member_id int(10) unsigned NOT NULL,
- member_name varchar(50) NOT NULL,
- ip_address varchar(16) default '0' NOT NULL,
- recipient varchar(70) NOT NULL,
- recipient_name varchar(50) NOT NULL,
- subject varchar(120) NOT NULL,
- message mediumtext NOT NULL,
- PRIMARY KEY (cache_id)
- )";
- // Email Tracker
- // This table is used by the Email module for flood control.
- $D[] = 'exp_email_tracker';
- $Q[] = "CREATE TABLE exp_email_tracker (
- email_id int(10) unsigned NOT NULL auto_increment,
- email_date int(10) unsigned default '0' NOT NULL,
- sender_ip varchar(16) NOT NULL,
- sender_email varchar(75) NOT NULL ,
- sender_username varchar(50) NOT NULL ,
- number_recipients int(4) unsigned default '1' NOT NULL,
- PRIMARY KEY (email_id)
- )";
- // Member table
- // Contains the member info
- /*
- Note: The following fields are intended for use
- with the "user_blog" module.
- weblog_id int(6) unsigned NOT NULL default '0',
- template_id int(6) unsigned NOT NULL default '0',
- upload_id int(6) unsigned NOT NULL default '0',
- */
- $D[] = 'exp_members';
-
- $Q[] = "CREATE TABLE exp_members (
- member_id int(10) unsigned NOT NULL auto_increment,
- group_id smallint(4) NOT NULL default '0',
- weblog_id int(6) unsigned NOT NULL default '0',
- tmpl_group_id int(6) unsigned NOT NULL default '0',
- upload_id int(6) unsigned NOT NULL default '0',
- username varchar(50) NOT NULL,
- screen_name varchar(50) NOT NULL,
- password varchar(40) NOT NULL,
- unique_id varchar(40) NOT NULL,
- authcode varchar(10) NOT NULL,
- email varchar(50) NOT NULL,
- url varchar(75) NOT NULL,
- location varchar(50) NOT NULL,
- occupation varchar(80) NOT NULL,
- interests varchar(120) NOT NULL,
- bday_d int(2) NOT NULL,
- bday_m int(2) NOT NULL,
- bday_y int(4) NOT NULL,
- aol_im varchar(50) NOT NULL,
- yahoo_im varchar(50) NOT NULL,
- msn_im varchar(50) NOT NULL,
- icq varchar(50) NOT NULL,
- bio text NOT NULL,
- signature text NOT NULL,
- avatar_filename varchar(120) NOT NULL,
- avatar_width int(4) unsigned NOT NULL,
- avatar_height int(4) unsigned NOT NULL,
- photo_filename varchar(120) NOT NULL,
- photo_width int(4) unsigned NOT NULL,
- photo_height int(4) unsigned NOT NULL,
- sig_img_filename varchar(120) NOT NULL,
- sig_img_width int(4) unsigned NOT NULL,
- sig_img_height int(4) unsigned NOT NULL,
- ignore_list text NOT NULL,
- private_messages int(4) unsigned DEFAULT '0' NOT NULL,
- accept_messages char(1) NOT NULL default 'y',
- last_view_bulletins int(10) NOT NULL default 0,
- last_bulletin_date int(10) NOT NULL default 0,
- ip_address varchar(16) default '0' NOT NULL,
- join_date int(10) unsigned default '0' NOT NULL,
- last_visit int(10) unsigned default '0' NOT NULL,
- last_activity int(10) unsigned default '0' NOT NULL,
- total_entries smallint(5) unsigned NOT NULL default '0',
- total_comments smallint(5) unsigned NOT NULL default '0',
- total_forum_topics mediumint(8) default '0' NOT NULL,
- total_forum_posts mediumint(8) default '0' NOT NULL,
- last_entry_date int(10) unsigned default '0' NOT NULL,
- last_comment_date int(10) unsigned default '0' NOT NULL,
- last_forum_post_date int(10) unsigned default '0' NOT NULL,
- last_email_date int(10) unsigned default '0' NOT NULL,
- in_authorlist char(1) NOT NULL default 'n',
- accept_admin_email char(1) NOT NULL default 'y',
- accept_user_email char(1) NOT NULL default 'y',
- notify_by_default char(1) NOT NULL default 'y',
- notify_of_pm char(1) NOT NULL default 'y',
- display_avatars char(1) NOT NULL default 'y',
- display_signatures char(1) NOT NULL default 'y',
- smart_notifications char(1) NOT NULL default 'y',
- language varchar(50) NOT NULL,
- timezone varchar(8) NOT NULL,
- daylight_savings char(1) default 'n' NOT NULL,
- localization_is_site_default char(1) NOT NULL default 'n',
- time_format char(2) default 'us' NOT NULL,
- cp_theme varchar(32) NOT NULL,
- profile_theme varchar(32) NOT NULL,
- forum_theme varchar(32) NOT NULL,
- tracker text NOT NULL,
- template_size varchar(2) NOT NULL default '28',
- notepad text NOT NULL,
- notepad_size varchar(2) NOT NULL default '18',
- quick_links text NOT NULL,
- quick_tabs text NOT NULL,
- pmember_id int(10) NOT NULL default '0',
- PRIMARY KEY (member_id),
- KEY (`group_id`),
- KEY (`unique_id`),
- KEY (`password`)
- )";
- // CP homepage layout
- // Each member can have their own control panel layout.
- // We store their preferences here.
- $D[] = 'exp_member_homepage';
- $Q[] = "CREATE TABLE exp_member_homepage (
- member_id int(10) unsigned NOT NULL,
- recent_entries char(1) NOT NULL default 'l',
- recent_entries_order int(3) unsigned NOT NULL default '0',
- recent_comments char(1) NOT NULL default 'l',
- recent_comments_order int(3) unsigned NOT NULL default '0',
- recent_members char(1) NOT NULL default 'n',
- recent_members_order int(3) unsigned NOT NULL default '0',
- site_statistics char(1) NOT NULL default 'r',
- site_statistics_order int(3) unsigned NOT NULL default '0',
- member_search_form char(1) NOT NULL default 'n',
- member_search_form_order int(3) unsigned NOT NULL default '0',
- notepad char(1) NOT NULL default 'r',
- notepad_order int(3) unsigned NOT NULL default '0',
- bulletin_board char(1) NOT NULL default 'r',
- bulletin_board_order int(3) unsigned NOT NULL default '0',
- pmachine_news_feed char(1) NOT NULL default 'n',
- pmachine_news_feed_order int(3) unsigned NOT NULL default '0',
- KEY (member_id)
- )";
- // Member Groups table
- $D[] = 'exp_member_groups';
- $Q[] = "CREATE TABLE exp_member_groups (
- group_id smallint(4) unsigned NOT NULL,
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- group_title varchar(100) NOT NULL,
- group_description text NOT NULL,
- is_locked char(1) NOT NULL default 'y',
- can_view_offline_system char(1) NOT NULL default 'n',
- can_view_online_system char(1) NOT NULL default 'y',
- can_access_cp char(1) NOT NULL default 'y',
- can_access_publish char(1) NOT NULL default 'n',
- can_access_edit char(1) NOT NULL default 'n',
- can_access_design char(1) NOT NULL default 'n',
- can_access_comm char(1) NOT NULL default 'n',
- can_access_modules char(1) NOT NULL default 'n',
- can_access_admin char(1) NOT NULL default 'n',
- can_admin_weblogs char(1) NOT NULL default 'n',
- can_admin_members char(1) NOT NULL default 'n',
- can_delete_members char(1) NOT NULL default 'n',
- can_admin_mbr_groups char(1) NOT NULL default 'n',
- can_admin_mbr_templates char(1) NOT NULL default 'n',
- can_ban_users char(1) NOT NULL default 'n',
- can_admin_utilities char(1) NOT NULL default 'n',
- can_admin_preferences char(1) NOT NULL default 'n',
- can_admin_modules char(1) NOT NULL default 'n',
- can_admin_templates char(1) NOT NULL default 'n',
- can_edit_categories char(1) NOT NULL default 'n',
- can_delete_categories char(1) NOT NULL default 'n',
- can_view_other_entries char(1) NOT NULL default 'n',
- can_edit_other_entries char(1) NOT NULL default 'n',
- can_assign_post_authors char(1) NOT NULL default 'n',
- can_delete_self_entries char(1) NOT NULL default 'n',
- can_delete_all_entries char(1) NOT NULL default 'n',
- can_view_other_comments char(1) NOT NULL default 'n',
- can_edit_own_comments char(1) NOT NULL default 'n',
- can_delete_own_comments char(1) NOT NULL default 'n',
- can_edit_all_comments char(1) NOT NULL default 'n',
- can_delete_all_comments char(1) NOT NULL default 'n',
- can_moderate_comments char(1) NOT NULL default 'n',
- can_send_email char(1) NOT NULL default 'n',
- can_send_cached_email char(1) NOT NULL default 'n',
- can_email_member_groups char(1) NOT NULL default 'n',
- can_email_mailinglist char(1) NOT NULL default 'n',
- can_email_from_profile char(1) NOT NULL default 'n',
- can_view_profiles char(1) NOT NULL default 'n',
- can_delete_self char(1) NOT NULL default 'n',
- mbr_delete_notify_emails varchar(255) NOT NULL,
- can_post_comments char(1) NOT NULL default 'n',
- exclude_from_moderation char(1) NOT NULL default 'n',
- can_search char(1) NOT NULL default 'n',
- search_flood_control mediumint(5) unsigned NOT NULL,
- can_send_private_messages char(1) NOT NULL default 'n',
- prv_msg_send_limit smallint unsigned NOT NULL default '20',
- prv_msg_storage_limit smallint unsigned NOT NULL default '60',
- can_attach_in_private_messages char(1) NOT NULL default 'n',
- can_send_bulletins char(1) NOT NULL default 'n',
- include_in_authorlist char(1) NOT NULL default 'n',
- include_in_memberlist char(1) NOT NULL default 'y',
- include_in_mailinglists char(1) NOT NULL default 'y',
- KEY (group_id),
- KEY (site_id)
- )";
- // Weblog access privs
- // Member groups assignment for each weblog
- $D[] = 'exp_weblog_member_groups';
- $Q[] = "CREATE TABLE exp_weblog_member_groups (
- group_id smallint(4) unsigned NOT NULL,
- weblog_id int(6) unsigned NOT NULL,
- KEY (group_id)
- )";
- // Module access privs
- // Member Group assignment for each module
- $D[] = 'exp_module_member_groups';
- $Q[] = "CREATE TABLE exp_module_member_groups (
- group_id smallint(4) unsigned NOT NULL,
- module_id mediumint(5) unsigned NOT NULL,
- KEY (group_id)
- )";
- // Template Group access privs
- // Member group assignment for each template group
- $D[] = 'exp_template_member_groups';
- $Q[] = "CREATE TABLE exp_template_member_groups (
- group_id smallint(4) unsigned NOT NULL,
- template_group_id mediumint(5) unsigned NOT NULL,
- KEY (group_id)
- )";
- // Member Custom Fields
- // Stores the defenition of each field
- $D[] = 'exp_member_fields';
- $Q[] = "CREATE TABLE exp_member_fields (
- m_field_id int(4) unsigned NOT NULL auto_increment,
- m_field_name varchar(32) NOT NULL,
- m_field_label varchar(50) NOT NULL,
- m_field_description text NOT NULL,
- m_field_type varchar(12) NOT NULL default 'text',
- m_field_list_items text NOT NULL,
- m_field_ta_rows tinyint(2) default '8',
- m_field_maxl smallint(3) NOT NULL,
- m_field_width varchar(6) NOT NULL,
- m_field_search char(1) NOT NULL default 'y',
- m_field_required char(1) NOT NULL default 'n',
- m_field_public char(1) NOT NULL default 'y',
- m_field_reg char(1) NOT NULL default 'n',
- m_field_fmt char(5) NOT NULL default 'none',
- m_field_order int(3) unsigned NOT NULL,
- PRIMARY KEY (m_field_id)
- )";
- // Member Data
- // Stores the actual data
- $D[] = 'exp_member_data';
- $Q[] = "CREATE TABLE exp_member_data (
- member_id int(10) unsigned NOT NULL,
- KEY (member_id)
- )";
- // Weblog Table
- $D[] = 'exp_weblogs';
- // Note: The is_user_blog field indicates whether the blog is
- // assigned as a "user blogs" weblog
- $Q[] = "CREATE TABLE exp_weblogs (
- weblog_id int(6) unsigned NOT NULL auto_increment,
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- is_user_blog char(1) NOT NULL default 'n',
- blog_name varchar(40) NOT NULL,
- blog_title varchar(100) NOT NULL,
- blog_url varchar(100) NOT NULL,
- blog_description varchar(225) NOT NULL,
- blog_lang varchar(12) NOT NULL,
- blog_encoding varchar(12) NOT NULL,
- total_entries mediumint(8) default '0' NOT NULL,
- total_comments mediumint(8) default '0' NOT NULL,
- total_trackbacks mediumint(8) default '0' NOT NULL,
- last_entry_date int(10) unsigned default '0' NOT NULL,
- last_comment_date int(10) unsigned default '0' NOT NULL,
- last_trackback_date int(10) unsigned default '0' NOT NULL,
- cat_group varchar(255) NOT NULL,
- status_group int(4) unsigned NOT NULL,
- deft_status varchar(50) NOT NULL default 'open',
- field_group int(4) unsigned NOT NULL,
- search_excerpt int(4) unsigned NOT NULL,
- enable_trackbacks char(1) NOT NULL default 'n',
- trackback_use_url_title char(1) NOT NULL default 'n',
- trackback_max_hits int(2) unsigned NOT NULL default '5',
- trackback_field int(4) unsigned NOT NULL,
- deft_category varchar(60) NOT NULL,
- deft_comments char(1) NOT NULL default 'y',
- deft_trackbacks char(1) NOT NULL default 'y',
- weblog_require_membership char(1) NOT NULL default 'y',
- weblog_max_chars int(5) unsigned NOT NULL,
- weblog_html_formatting char(4) NOT NULL default 'all',
- weblog_allow_img_urls char(1) NOT NULL default 'y',
- weblog_auto_link_urls char(1) NOT NULL default 'y',
- weblog_notify char(1) NOT NULL default 'n',
- weblog_notify_emails varchar(255) NOT NULL,
- comment_url varchar(80) NOT NULL,
- comment_system_enabled char(1) NOT NULL default 'y',
- comment_require_membership char(1) NOT NULL default 'n',
- comment_use_captcha char(1) NOT NULL default 'n',
- comment_moderate char(1) NOT NULL default 'n',
- comment_max_chars int(5) unsigned NOT NULL,
- comment_timelock int(5) unsigned NOT NULL default '0',
- comment_require_email char(1) NOT NULL default 'y',
- comment_text_formatting char(5) NOT NULL default 'xhtml',
- comment_html_formatting char(4) NOT NULL default 'safe',
- comment_allow_img_urls char(1) NOT NULL default 'n',
- comment_auto_link_urls char(1) NOT NULL default 'y',
- comment_notify char(1) NOT NULL default 'n',
- comment_notify_authors char(1) NOT NULL default 'n',
- comment_notify_emails varchar(255) NOT NULL,
- comment_expiration int(4) unsigned NOT NULL default '0',
- search_results_url varchar(80) NOT NULL,
- tb_return_url varchar(80) NOT NULL,
- ping_return_url varchar(80) NOT NULL,
- show_url_title char(1) NOT NULL default 'y',
- trackback_system_enabled char(1) NOT NULL default 'n',
- show_trackback_field char(1) NOT NULL default 'y',
- trackback_use_captcha char(1) NOT NULL default 'n',
- show_ping_cluster char(1) NOT NULL default 'y',
- show_options_cluster char(1) NOT NULL default 'y',
- show_button_cluster char(1) NOT NULL default 'y',
- show_forum_cluster char(1) NOT NULL default 'y',
- show_pages_cluster CHAR(1) NOT NULL DEFAULT 'y',
- show_show_all_cluster CHAR(1) NOT NULL DEFAULT 'y',
- show_author_menu char(1) NOT NULL default 'y',
- show_status_menu char(1) NOT NULL default 'y',
- show_categories_menu char(1) NOT NULL default 'y',
- show_date_menu char(1) NOT NULL default 'y',
- rss_url varchar(80) NOT NULL,
- enable_versioning char(1) NOT NULL default 'n',
- enable_qucksave_versioning char(1) NOT NULL default 'n',
- max_revisions smallint(4) unsigned NOT NULL default 10,
- default_entry_title varchar(100) NOT NULL,
- url_title_prefix varchar(80) NOT NULL,
- live_look_template int(10) UNSIGNED NOT NULL default 0,
- PRIMARY KEY (weblog_id),
- KEY (cat_group),
- KEY (status_group),
- KEY (field_group),
- KEY (is_user_blog),
- KEY (site_id)
- )";
- // Weblog Titles
- // We store weblog titles separately from weblog data
- $D[] = 'exp_weblog_titles';
- $Q[] = "CREATE TABLE exp_weblog_titles (
- entry_id int(10) unsigned NOT NULL auto_increment,
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- weblog_id int(4) unsigned NOT NULL,
- author_id int(10) unsigned NOT NULL default '0',
- pentry_id int(10) NOT NULL default '0',
- forum_topic_id int(10) unsigned NOT NULL,
- ip_address varchar(16) NOT NULL,
- title varchar(100) NOT NULL,
- url_title varchar(75) NOT NULL,
- status varchar(50) NOT NULL,
- versioning_enabled char(1) NOT NULL default 'n',
- view_count_one int(10) unsigned NOT NULL default '0',
- view_count_two int(10) unsigned NOT NULL default '0',
- view_count_three int(10) unsigned NOT NULL default '0',
- view_count_four int(10) unsigned NOT NULL default '0',
- allow_comments varchar(1) NOT NULL default 'y',
- allow_trackbacks varchar(1) NOT NULL default 'n',
- sticky varchar(1) NOT NULL default 'n',
- entry_date int(10) NOT NULL,
- dst_enabled varchar(1) NOT NULL default 'n',
- year char(4) NOT NULL,
- month char(2) NOT NULL,
- day char(3) NOT NULL,
- expiration_date int(10) NOT NULL default '0',
- comment_expiration_date int(10) NOT NULL default '0',
- edit_date bigint(14),
- recent_comment_date int(10) NOT NULL,
- comment_total int(4) unsigned NOT NULL default '0',
- trackback_total int(4) unsigned NOT NULL default '0',
- sent_trackbacks text NOT NULL,
- recent_trackback_date int(10) NOT NULL,
- PRIMARY KEY (entry_id),
- KEY (weblog_id),
- KEY (author_id),
- KEY (url_title),
- KEY (status),
- KEY (entry_date),
- KEY (expiration_date),
- KEY (site_id)
- )";
- $D[] = 'exp_entry_versioning';
- $Q[] = "CREATE TABLE exp_entry_versioning (
- version_id int(10) unsigned NOT NULL auto_increment,
- entry_id int(10) unsigned NOT NULL,
- weblog_id int(4) unsigned NOT NULL,
- author_id int(10) unsigned NOT NULL,
- version_date int(10) NOT NULL,
- version_data mediumtext NOT NULL,
- PRIMARY KEY (version_id),
- KEY (entry_id)
- )";
- // Weblog Custom Field Groups
- $D[] = 'exp_field_groups';
- $Q[] = "CREATE TABLE exp_field_groups (
- group_id int(4) unsigned NOT NULL auto_increment,
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- group_name varchar(50) NOT NULL,
- PRIMARY KEY (group_id),
- KEY (site_id)
- )";
- // Weblog Custom Field Definitions
- $D[] = 'exp_weblog_fields';
- $Q[] = "CREATE TABLE exp_weblog_fields (
- field_id int(6) unsigned NOT NULL auto_increment,
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- group_id int(4) unsigned NOT NULL,
- field_name varchar(32) NOT NULL,
- field_label varchar(50) NOT NULL,
- field_instructions TEXT NOT NULL,
- field_type varchar(12) NOT NULL default 'text',
- field_list_items text NOT NULL,
- field_pre_populate char(1) NOT NULL default 'n',
- field_pre_blog_id int(6) unsigned NOT NULL,
- field_pre_field_id int(6) unsigned NOT NULL,
- field_related_to varchar(12) NOT NULL default 'blog',
- field_related_id int(6) unsigned NOT NULL,
- field_related_orderby varchar(12) NOT NULL default 'date',
- field_related_sort varchar(4) NOT NULL default 'desc',
- field_related_max smallint(4) NOT NULL,
- field_ta_rows tinyint(2) default '8',
- field_maxl smallint(3) NOT NULL,
- field_required char(1) NOT NULL default 'n',
- field_text_direction CHAR(3) NOT NULL default 'ltr',
- field_search char(1) NOT NULL default 'n',
- field_is_hidden char(1) NOT NULL default 'n',
- field_fmt varchar(40) NOT NULL default 'xhtml',
- field_show_fmt char(1) NOT NULL default 'y',
- field_order int(3) unsigned NOT NULL,
- PRIMARY KEY (field_id),
- KEY (group_id),
- KEY (site_id)
- )";
- // Relationships table
- $D[] = 'exp_relationships';
- $Q[] = "CREATE TABLE exp_relationships (
- rel_id int(6) unsigned NOT NULL auto_increment,
- rel_parent_id int(10) NOT NULL default '0',
- rel_child_id int(10) NOT NULL default '0',
- rel_type varchar(12) NOT NULL,
- rel_data mediumtext NOT NULL,
- reverse_rel_data mediumtext NOT NULL,
- PRIMARY KEY (rel_id),
- KEY (rel_parent_id),
- KEY (rel_child_id)
- )";
- // Field formatting definitions
- $D[] = 'exp_field_formatting';
- $Q[] = "CREATE TABLE exp_field_formatting (
- field_id int(10) unsigned NOT NULL,
- field_fmt varchar(40) NOT NULL,
- KEY (field_id)
- )";
- // Weblog data
- $D[] = 'exp_weblog_data';
- $Q[] = "CREATE TABLE exp_weblog_data (
- entry_id int(10) unsigned NOT NULL,
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- weblog_id int(4) unsigned NOT NULL,
- field_id_1 text NOT NULL,
- field_ft_1 tinytext NULL,
- field_id_2 text NOT NULL,
- field_ft_2 tinytext NULL,
- field_id_3 text NOT NULL,
- field_ft_3 tinytext NULL,
- KEY (entry_id),
- KEY (weblog_id),
- KEY (site_id)
- )";
- // Ping Status
- // This table saves the status of the xml-rpc ping buttons
- // that were selected when an entry was submitted. This
- // enables us to set the buttons to the same state when editing
- $D[] = 'exp_entry_ping_status';
- $Q[] = "CREATE TABLE exp_entry_ping_status (
- entry_id int(10) unsigned NOT NULL,
- ping_id int(10) unsigned NOT NULL
- )";
- // Comment table
- $D[] = 'exp_comments';
- $Q[] = "CREATE TABLE exp_comments (
- comment_id int(10) unsigned NOT NULL auto_increment,
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- entry_id int(10) unsigned NOT NULL default '0',
- weblog_id int(4) unsigned NOT NULL,
- author_id int(10) unsigned NOT NULL default '0',
- status char(1) NOT NULL default 'o',
- name varchar(50) NOT NULL,
- email varchar(50) NOT NULL,
- url varchar(75) NOT NULL,
- location varchar(50) NOT NULL,
- ip_address varchar(16) NOT NULL,
- comment_date int(10) NOT NULL,
- edit_date timestamp(14),
- comment text NOT NULL,
- notify char(1) NOT NULL default 'n',
- PRIMARY KEY (comment_id),
- KEY (entry_id),
- KEY (weblog_id),
- KEY (author_id),
- KEY (status),
- KEY (site_id)
- )";
- // Trackback table.
- $D[] = 'exp_trackbacks';
- $Q[] = "CREATE TABLE exp_trackbacks (
- trackback_id int(10) unsigned NOT NULL auto_increment,
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- entry_id int(10) unsigned NOT NULL default '0',
- weblog_id int(4) unsigned NOT NULL,
- title varchar(100) NOT NULL,
- content text NOT NULL,
- weblog_name varchar(100) NOT NULL,
- trackback_url varchar(200) NOT NULL,
- trackback_date int(10) NOT NULL,
- trackback_ip varchar(16) NOT NULL,
- PRIMARY KEY (trackback_id),
- KEY (entry_id),
- KEY (weblog_id),
- KEY (site_id)
- )";
- // Status Groups
- $D[] = 'exp_status_groups';
- $Q[] = "CREATE TABLE exp_status_groups (
- group_id int(4) unsigned NOT NULL auto_increment,
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- group_name varchar(50) NOT NULL,
- PRIMARY KEY (group_id),
- KEY (site_id)
- )";
- // Status data
- $D[] = 'exp_statuses';
- $Q[] = "CREATE TABLE exp_statuses (
- status_id int(6) unsigned NOT NULL auto_increment,
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- group_id int(4) unsigned NOT NULL,
- status varchar(50) NOT NULL,
- status_order int(3) unsigned NOT NULL,
- highlight varchar(30) NOT NULL,
- PRIMARY KEY (status_id),
- KEY (group_id),
- KEY (site_id)
- )";
- // Status "no access"
- // Stores groups that can not access certain statuses
- $D[] = 'exp_status_no_access';
- $Q[] = "CREATE TABLE exp_status_no_access (
- status_id int(6) unsigned NOT NULL,
- member_group smallint(4) unsigned NOT NULL
- )";
- // Category Groups
- // Note: The is_user_blog field indicates whether the blog is
- // assigned as a "user blogs" weblog
- $D[] = 'exp_category_groups';
- $Q[] = "CREATE TABLE exp_category_groups (
- group_id int(6) unsigned NOT NULL auto_increment,
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- group_name varchar(50) NOT NULL,
- sort_order char(1) NOT NULL default 'a',
- `field_html_formatting` char(4) NOT NULL default 'all',
- `can_edit_categories` TEXT NOT NULL,
- `can_delete_categories` TEXT NOT NULL,
- is_user_blog char(1) NOT NULL default 'n',
- PRIMARY KEY (group_id),
- KEY (site_id)
- )";
- // Category data
- $D[] = 'exp_categories';
- $Q[] = "CREATE TABLE exp_categories (
- cat_id int(10) unsigned NOT NULL auto_increment,
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- group_id int(6) unsigned NOT NULL,
- parent_id int(4) unsigned NOT NULL,
- cat_name varchar(100) NOT NULL,
- `cat_url_title` varchar(75) NOT NULL,
- cat_description text NOT NULL,
- cat_image varchar(120) NOT NULL,
- cat_order int(4) unsigned NOT NULL,
- PRIMARY KEY (cat_id),
- KEY (group_id),
- KEY (cat_name),
- KEY (site_id)
- )";
- $D[] = 'exp_category_fields';
- $Q[] = "CREATE TABLE `exp_category_fields` (
- `field_id` int(6) unsigned NOT NULL auto_increment,
- `site_id` int(4) unsigned NOT NULL default 1,
- `group_id` int(4) unsigned NOT NULL,
- `field_name` varchar(32) NOT NULL default '',
- `field_label` varchar(50) NOT NULL default '',
- `field_type` varchar(12) NOT NULL default 'text',
- `field_list_items` text NOT NULL,
- `field_maxl` smallint(3) NOT NULL default 128,
- `field_ta_rows` tinyint(2) NOT NULL default 8,
- `field_default_fmt` varchar(40) NOT NULL default 'none',
- `field_show_fmt` char(1) NOT NULL default 'y',
- `field_text_direction` CHAR(3) NOT NULL default 'ltr',
- `field_required` char(1) NOT NULL default 'n',
- `field_order` int(3) unsigned NOT NULL,
- PRIMARY KEY (`field_id`),
- KEY `site_id` (`site_id`),
- KEY `group_id` (`group_id`)
- )";
-
- $D[] = 'exp_category_field_data';
-
- $Q[] = "CREATE TABLE `exp_category_field_data` (
- `cat_id` int(4) unsigned NOT NULL,
- `site_id` int(4) unsigned NOT NULL default 1,
- `group_id` int(4) unsigned NOT NULL,
- PRIMARY KEY (`cat_id`),
- KEY `site_id` (`site_id`),
- KEY `group_id` (`group_id`)
- )";
- // Category posts
- // This table stores the weblog entry ID and the category IDs
- // that are assigned to it
- $D[] = 'exp_category_posts';
- $Q[] = "CREATE TABLE exp_category_posts (
- entry_id int(10) unsigned NOT NULL,
- cat_id int(10) unsigned NOT NULL,
- KEY (entry_id),
- KEY (cat_id)
- )";
- // Control panel log
- $D[] = 'exp_cp_log';
- $Q[] = "CREATE TABLE exp_cp_log (
- id int(10) NOT NULL auto_increment,
- site_id INT(4) UNSIGNED NOT NULL DEFAULT 1,
- member_id int(10) unsigned NOT NULL,
- username varchar(32) NOT NULL,
- ip_address varchar(16) default '0' NOT NULL,
- act_date int(10) NOT NULL,
- action varchar(200) NOT NULL,
- PRIMARY KEY (id),
- KEY (site_id)
- )";
- …
Large files files are truncated, but you can click here to view the full file