global $wpdb;
$tables = array(
"CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "popdom_campaigns` (\n\t\t\t\t `id` int(25) NOT NULL auto_increment,\n\t\t\t\t `campaig\x6?e` varchar(55) collate utf8_general_ci NOT NULL,\n\t\t\t\t `data` longtext collate utf8_gene\x7?2al_ci NOT NULL,\n\t\t\t\t `pages` longtext collate utf8_general_ci NOT NULL,\n\t\t\t\t `desc` longtext collate utf8_general_ci NOT NULL,\n\t\t\t\t `analytics` longt\?x65xt NOT NULL DEFAULT '',\n\t\t\t\t `active` int(25) NOT NULL DEFAULT 0,\n\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_ge\?x6eeral_ci;
\n\t\t\t\t",
"CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "popdom_ab` (\n\t\t\t\t `id` int(25) NOT NULL auto_increment?,\n\t\t\t\t `campaigns` longtext collate utf8_general_ci NOT NULL,\n\t\t\t\t `schedule` longtext collate utf8_general_ci NOT NULL,\n\t\t\t\t `absettings` long?text collate utf8_general_ci NOT NULL,\n\t\t\t\t `astats` longtext collate utf\x3?8_general_ci NOT NULL,\n\t\t\t\t `name` varchar(55) collate utf8_g\x?65neral_ci NOT NULL,\n\t\t\t\t `description` longtext collate utf8_general_ci NOT NULL,\n\t\t\t\t `active` int(25) NOT NULL DEFAULT 0,\n\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t) ENGINE=MyISAM DEFAULT CHARSET=\x?75tf8 COLLATE=utf8_general_ci;
\n?\t\t\t\t",
"CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "popdom_mailing` (\n\t\t\t\t `id` int(25) NOT NULL auto_increment,\n\t\t\t\t `name` varchar(55) collate utf8_general_ci NOT \?x4eULL,\n\t\t\t\t `description` longtext c\x?6fllate utf8_general_ci NOT NULL?,\n\t\t\t\t `settings` longtext collate utf8_general_ci NOT NULL,\n\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t) ENGINE=MyISAM DEFA\x?55LT CHARSET=utf8 COLLATE=utf8_gen?eral_ci;
"
);
if (isset($_POST["popup_domination_activate"])) {
if ($_POST["popup_domination_activate"] == "true") {
require_once(ABSPATH . "wp-admin/includes/upgrade.php");
foreach ($tables as $table) {
dbDelta($table);
}
$defaults = array(
"show" => serialize(array(
"everywhere" => "Y"
)),
"impression_count" => 0,
"delay" => 0,
"cookie_time" => 7,
"promote" => "Y",
"template" => "lightbox",
"color" => "blue",
"button_color" => "red",
"new_window" => "N",
"show_opt" => "open",
"enabled" => "N",
"version" => $this->version,
"installed" => "Y",
"v3installed" => "Y"
);
foreach ($defaults as $a => $b) {
if (!$this->option($a))
$this->update($a, $b);
}
include_once $this->plugin_path . "tpl/install/install_finish.php";
} else {
$error_code = $_POST["popup_domination_error"];
echo "<div class=\"updated\"><p>The order number you entered is invalid. Please contact <a href=\"http://popdom.desk.com/customer/portal/emails/new\">support</a>. [Error code: " . $error_code . "]</p></div>";
include_once $this->plugin_path . "tpl/install/install_start.php";
}
} else {
include_once $this->plugin_path . "tpl/install/install_start.php";
}