Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 4e31156d03
Fetching contributors…

Cannot retrieve contributors at this time

file 43 lines (37 sloc) 1.196 kb
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 42 43
<?PHP

function hotpot_upgrade($oldversion) {
global $CFG;
$ok = 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`");
}

// 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();
}

// update to HotPot v2.1
if ($oldversion < 2005090700) {
$ok = $ok && hotpot_get_update_to_v2();
$ok = $ok && hotpot_update_to_v2_1();
}

// update to from HotPot v2.1.0 or v2.1.1 to HotPot v2.1.2
if ($oldversion > 2005031419 && $oldversion < 2005090702) {
$ok = $ok && hotpot_get_update_to_v2();
$ok = $ok && hotpot_update_to_v2_1_2();
}

return $ok;
}
function hotpot_get_update_to_v2() {
global $CFG;
$filepath = "$CFG->dirroot/mod/hotpot/db/update_to_v2.php";
if (file_exists($filepath) && is_readable($filepath)) {
include_once $filepath;
$ok = true;
} else {
$ok = false;
}
return $ok;
}
?>
Something went wrong with that request. Please try again.