install_network

Definition:
function install_network() {}

Install Network.

Source code

function install_network() {

	global $wpdb, $charset_collate;

	$ms_queries = "

CREATE TABLE $wpdb->users (

  ID bigint(20) unsigned NOT NULL auto_increment,

  user_login varchar(60) NOT NULL default '',

  user_pass varchar(64) NOT NULL default '',

  user_nicename varchar(50) NOT NULL default '',

  user_email varchar(100) NOT NULL default '',

  user_url varchar(100) NOT NULL default '',

  user_registered datetime NOT NULL default '0000-00-00 00:00:00',

  user_activation_key varchar(60) NOT NULL default '',

  user_status int(11) NOT NULL default '0',

  display_name varchar(250) NOT NULL default '',

  spam tinyint(2) NOT NULL default '0',

  deleted tinyint(2) NOT NULL default '0',

  PRIMARY KEY  (ID),

  KEY user_login_key (user_login),

  KEY user_nicename (user_nicename)

) $charset_collate;

CREATE TABLE $wpdb->blogs (

  blog_id bigint(20) NOT NULL auto_increment,

  site_id bigint(20) NOT NULL default '0',

  domain varchar(200) NOT NULL default '',

  path varchar(100) NOT NULL default '',

  registered datetime NOT NULL default '0000-00-00 00:00:00',

  last_updated datetime NOT NULL default '0000-00-00 00:00:00',

  public tinyint(2) NOT NULL default '1',

  archived enum('0','1') NOT NULL default '0',

  mature tinyint(2) NOT NULL default '0',

  spam tinyint(2) NOT NULL default '0',

  deleted tinyint(2) NOT NULL default '0',

  lang_id int(11) NOT NULL default '0',

  PRIMARY KEY  (blog_id),

  KEY domain (domain(50),path(5)),

  KEY lang_id (lang_id)

) $charset_collate;

CREATE TABLE $wpdb->blog_versions (

  blog_id bigint(20) NOT NULL default '0',

  db_version varchar(20) NOT NULL default '',

  last_updated datetime NOT NULL default '0000-00-00 00:00:00',

  PRIMARY KEY  (blog_id),

  KEY db_version (db_version)

) $charset_collate;

CREATE TABLE $wpdb->registration_log (

  ID bigint(20) NOT NULL auto_increment,

  email varchar(255) NOT NULL default '',

  IP varchar(30) NOT NULL default '',

  blog_id bigint(20) NOT NULL default '0',

  date_registered datetime NOT NULL default '0000-00-00 00:00:00',

  PRIMARY KEY  (ID),

  KEY IP (IP)

) $charset_collate;

CREATE TABLE $wpdb->site (

  id bigint(20) NOT NULL auto_increment,

  domain varchar(200) NOT NULL default '',

  path varchar(100) NOT NULL default '',

  PRIMARY KEY  (id),

  KEY domain (domain,path)

) $charset_collate;

CREATE TABLE $wpdb->sitemeta (

  meta_id bigint(20) NOT NULL auto_increment,

  site_id bigint(20) NOT NULL default '0',

  meta_key varchar(255) default NULL,

  meta_value longtext,

  PRIMARY KEY  (meta_id),

  KEY meta_key (meta_key),

  KEY site_id (site_id)

) $charset_collate;

CREATE TABLE $wpdb->signups (

  domain varchar(200) NOT NULL default '',

  path varchar(100) NOT NULL default '',

  title longtext NOT NULL,

  user_login varchar(60) NOT NULL default '',

  user_email varchar(100) NOT NULL default '',

  registered datetime NOT NULL default '0000-00-00 00:00:00',

  activated datetime NOT NULL default '0000-00-00 00:00:00',

  active tinyint(1) NOT NULL default '0',

  activation_key varchar(50) NOT NULL default '',

  meta longtext,

  KEY activation_key (activation_key),

  KEY domain (domain)

) $charset_collate;

";

// now create tables

	dbDelta( $ms_queries );

}

2033

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: