Change logic for new installs

This commit is contained in:
moodler
2005-04-25 15:21:06 +00:00
parent 920d16c925
commit 57e0eac48e
2 changed files with 14 additions and 4 deletions
+7 -4
View File
@@ -3,11 +3,12 @@
function hotpot_upgrade($oldversion) {
global $CFG;
$ok = true;
$newinstall = true;
if ($oldversion < 2004021400) {
execute_sql(" ALTER TABLE `{$CFG->prefix}hotpot_events` ADD `starttime` INT(10) unsigned NOT NULL DEFAULT '0' AFTER `time`");
execute_sql(" ALTER TABLE `{$CFG->prefix}hotpot_events` ADD `endtime` INT(10) unsigned NOT NULL DEFAULT '0' AFTER `time`");
$newinstall = true;
$newinstall = false;
}
// update from HotPot v1 to HotPot v2
@@ -15,11 +16,13 @@ function hotpot_upgrade($oldversion) {
$ok = $ok && hotpot_get_update_to_v2();
$ok = $ok && hotpot_update_to_v2_from_v1();
if (!empty($newinstall)) { /// Disable this module by default
@set_field('modules', 'visible', '0', 'name', 'hotpot');
}
$newinstall = false;
}
if ($newinstall) { /// Disable this module by default in new installs
@set_field('modules', 'visible', '0', 'name', 'hotpot');
}
return $ok;
}
function hotpot_get_update_to_v2() {
+7
View File
@@ -2,13 +2,20 @@
function hotpot_upgrade($oldversion) {
$ok = true;
$newinstall = true;
// update from HotPot v1 to HotPot v2
if ($oldversion < 2005031400) {
$ok = $ok && hotpot_get_update_to_v2();
$ok = $ok && hotpot_update_to_v2_from_v1();
$newinstall = false;
}
if ($newinstall) { /// Disable this module by default in new installs
@set_field('modules', 'visible', '0', 'name', 'hotpot');
}
return $ok;
}
function hotpot_get_update_to_v2() {