forked from wp-plugins/wp-sms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.php
41 lines (34 loc) · 1.19 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
<?php
function wp_sms_install() {
global $wp_sms_db_version, $table_prefix, $wpdb;
$create_sms_subscribes = ("CREATE TABLE IF NOT EXISTS {$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 IF NOT EXISTS {$table_prefix}sms_subscribes_group(
ID int(10) NOT NULL auto_increment,
name VARCHAR(250),
PRIMARY KEY(ID)) CHARSET=utf8
");
$create_sms_send = ("CREATE TABLE IF NOT EXISTS {$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
");
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($create_sms_subscribes);
dbDelta($create_sms_subscribes_group);
dbDelta($create_sms_send);
add_option('wp_sms_db_version', WP_SMS_VERSION);
// Delete notification new wp_version option
delete_option('wp_notification_new_wp_version');
}