Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function installation_process()
- {
- global $wpdb;
- $tables = array(
- "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "popdom_campaigns` ( `id` int(25) NOT NULL auto_increment, `campaign` varchar(55) collate utf8_general_ci NOT NULL, `data` longtext collate utf8_general_ci NOT NULL, `pages` longtext collate utf8_general_ci NOT NULL, `desc` longtext collate utf8_general_ci NOT NULL, `analytics` longtext NOT NULL DEFAULT '', `active` int(25) NOT NULL DEFAULT 0, PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;",
- "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "popdom_ab` ( `id` int(25) NOT NULL auto_increment, `campaigns` longtext collate utf8_general_ci NOT NULL, `schedule` longtext collate utf8_general_ci NOT NULL, `absettings` longtext collate utf8_general_ci NOT NULL, `astats` longtext collate utf8_general_ci NOT NULL, `name` varchar(55) collate utf8_general_ci NOT NULL, `description` longtext collate utf8_general_ci NOT NULL, `active` int(25) NOT NULL DEFAULT 0, PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;",
- "CREATE TABLE IF NOT EXISTS `" . $wpdb->prefix . "popdom_mailing` ( `id` int(25) NOT NULL auto_increment, `name` varchar(55) collate utf8_general_ci NOT NULL, `description` longtext collate utf8_general_ci NOT NULL, `settings` longtext collate utf8_general_ci NOT NULL, PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_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";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement