-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.php
54 lines (46 loc) · 1.5 KB
/
install.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
function wp_sms_install() {
global $wp_sms_db_version, $table_prefix, $wpdb;
$create_sms_subscribes = ("CREATE TABLE {$table_prefix}sms_subscribes(
ID int(10) NOT NULL auto_increment,
date DATETIME,
name VARCHAR(20),
mobile VARCHAR(20) NOT NULL,
status tinyint(1),
activate_key INT(11),
group_ID int(5),
PRIMARY KEY(ID)) CHARSET=utf8
");
$create_sms_subscribes_group = ("CREATE TABLE {$table_prefix}sms_subscribes_group(
ID int(10) NOT NULL auto_increment,
name VARCHAR(20),
PRIMARY KEY(ID)) CHARSET=utf8
");
$create_sms_send = ("CREATE TABLE {$table_prefix}sms_send(
ID int(10) NOT NULL auto_increment,
date DATETIME,
sender VARCHAR(20) NOT NULL,
message TEXT NOT NULL,
recipient TEXT NOT NULL,
PRIMARY KEY(ID)) CHARSET=utf8
");
$create_sms_fields= ("CREATE TABLE {$table_prefix}sms_fields(
ID int(10) NOT NULL auto_increment,
name VARCHAR(32) NOT NULL UNIQUE,
PRIMARY KEY(ID)) CHARSET=utf8
");
$create_sms_values= ("CREATE TABLE {$table_prefix}sms_values(
subscriber int(10) NOT NULL,
field int(10) NOT NULL,
value text NOT NULL,
PRIMARY KEY(subscriber, field)) CHARSET=utf8
");
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($create_sms_subscribes);
dbDelta($create_sms_subscribes_group);
dbDelta($create_sms_send);
dbDelta($create_sms_fields);
dbDelta($create_sms_values);
add_option('wp_sms_db_version', WP_SMS_VERSION);
}
?>