/** * Main installation method of the plugin */ function install_plugin() { $this->o = get_option('gd-star-rating'); $this->i = get_option('gd-star-rating-import'); $this->g = get_option('gd-star-rating-gfx'); $this->wpr8 = get_option('gd-star-rating-wpr8'); $this->ginc = get_option('gd-star-rating-inc'); $this->bots = get_option('gd-star-rating-bots'); if (!STARRATING_AJAX && GDSR_WP_ADMIN) { if ($this->o["build"] < $this->default_options["build"] || !is_array($this->o)) { if (is_object($this->g)) { $this->g = gdsrAdmFunc::gfx_scan(); update_option('gd-star-rating-gfx', $this->g); } require_once STARRATING_PATH . "/gdragon/gd_db_install.php"; if ($this->o["build"] < 911) { gdDBInstallGDSR::upgrade_collation(STARRATING_PATH); } gdDBInstallGDSR::delete_tables(STARRATING_PATH); gdDBInstallGDSR::delete_columns(STARRATING_PATH); gdDBInstallGDSR::create_tables(STARRATING_PATH); gdDBInstallGDSR::upgrade_tables(STARRATING_PATH); gdDBInstallGDSR::alter_tables(STARRATING_PATH); gdDBInstallGDSR::alter_index(STARRATING_PATH); $this->o["database_upgrade"] = date("r"); gdsrAdmDB::install_all_templates(); $this->o = gdFunctionsGDSR::upgrade_settings($this->o, $this->default_options); $this->o["css_last_changed"] = time(); $this->o["version"] = $this->default_options["version"]; $this->o["date"] = $this->default_options["date"]; $this->o["status"] = $this->default_options["status"]; $this->o["build"] = $this->default_options["build"]; $this->o["revision"] = $this->default_options["revision"]; $this->is_update = true; update_option('gd-star-rating', $this->o); } if (!is_array($this->o)) { update_option('gd-star-rating', $this->default_options); $this->o = get_option('gd-star-rating'); gdDBInstallGDSR::create_tables(STARRATING_PATH); } if (!is_array($this->i)) { update_option('gd-star-rating-import', $this->default_import); $this->i = get_option('gd-star-rating-import'); } else { $this->i = gdFunctionsGDSR::upgrade_settings($this->i, $this->default_import); update_option('gd-star-rating-import', $this->i); } if (!is_object($this->g)) { $this->g = gdsrAdmFunc::gfx_scan(); update_option('gd-star-rating-gfx', $this->g); } if (!is_array($this->wpr8)) { update_option('gd-star-rating-wpr8', $this->default_wpr8); $this->wpr8 = get_option('gd-star-rating-wpr8'); } else { $this->wpr8 = gdFunctionsGDSR::upgrade_settings($this->wpr8, $this->default_wpr8); update_option('gd-star-rating-wpr8', $this->wpr8); } if (!is_array($this->bots)) { $this->bots = $this->default_spider_bots; update_option('gd-star-rating-bots', $this->bots); } if (!is_array($this->ginc)) { $this->ginc = array(); $this->ginc[] = $this->stars_sizes; $this->ginc[] = $this->g->get_list(true); $this->ginc[] = $this->thumb_sizes; $this->ginc[] = $this->g->get_list(false); update_option('gd-star-rating-inc', $this->ginc); } if (count($this->ginc) == 2) { $this->ginc[] = $this->thumb_sizes; $this->ginc[] = $this->g->get_list(false); update_option('gd-star-rating-inc', $this->ginc); } } }
/** * Main installation method of the plugin */ function install_plugin() { $this->o = get_option('gd-star-rating'); $this->i = get_option('gd-star-rating-import'); $this->g = get_option('gd-star-rating-gfx'); $this->wpr8 = get_option('gd-star-rating-wpr8'); if ($this->o["build"] < $this->default_options["build"]) { if (is_object($this->g)) { $this->g = $this->gfx_scan(); update_option('gd-star-rating-gfx', $this->g); } gdDBInstallGDSR::delete_tables(STARRATING_PATH); gdDBInstallGDSR::create_tables(STARRATING_PATH); gdDBInstallGDSR::upgrade_tables(STARRATING_PATH); gdDBInstallGDSR::alter_tables(STARRATING_PATH); $this->o["database_upgrade"] = date("r"); GDSRDB::insert_default_templates(STARRATING_PATH); GDSRDB::insert_extras_templates(STARRATING_PATH); GDSRDB::insert_extras_templates(STARRATING_XTRA_PATH, false); GDSRDB::update_default_templates(STARRATING_PATH); $this->o = gdFunctionsGDSR::upgrade_settings($this->o, $this->default_options); $this->o["version"] = $this->default_options["version"]; $this->o["date"] = $this->default_options["date"]; $this->o["status"] = $this->default_options["status"]; $this->o["build"] = $this->default_options["build"]; update_option('gd-star-rating', $this->o); } if (!is_array($this->o)) { update_option('gd-star-rating', $this->default_options); $this->o = get_option('gd-star-rating'); gdDBInstallGDSR::create_tables(STARRATING_PATH); } if (!is_array($this->i)) { update_option('gd-star-rating-import', $this->default_import); $this->i = get_option('gd-star-rating-import'); } else { $this->i = gdFunctionsGDSR::upgrade_settings($this->i, $this->default_import); update_option('gd-star-rating-import', $this->i); } if (!is_object($this->g)) { $this->g = $this->gfx_scan(); update_option('gd-star-rating-gfx', $this->g); } if (!is_object($this->wpr8)) { update_option('gd-star-rating-wpr8', $this->default_wpr8); $this->wpr8 = get_option('gd-star-rating-wpr8'); } else { $this->wpr8 = gdFunctionsGDSR::upgrade_settings($this->wpr8, $this->default_wpr8); update_option('gd-star-rating-wpr8', $this->wpr8); } $this->use_nonce = $this->o["use_nonce"] == 1; define("STARRATING_VERSION", $this->o["version"] . '_' . $this->o["build"]); define("STARRATING_DEBUG_ACTIVE", $this->o["debug_active"]); define("STARRATING_STARS_GENERATOR", $this->o["gfx_generator_auto"] == 0 ? "DIV" : "GFX"); $this->t = GDSRDB::get_database_tables(); }