2002-12-15 02:41:07 +00:00
|
|
|
<?PHP // $Id$
|
|
|
|
|
|
|
|
function forum_upgrade($oldversion) {
|
|
|
|
// This function does anything necessary to upgrade
|
|
|
|
// older versions to match current functionality
|
|
|
|
|
2002-12-23 09:39:26 +00:00
|
|
|
global $CFG;
|
2002-12-15 02:41:07 +00:00
|
|
|
|
2003-04-24 08:45:27 +00:00
|
|
|
if ($oldversion < 2003042402) {
|
|
|
|
execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('forum', 'move discussion', 'forum_discussions', 'name')");
|
|
|
|
}
|
|
|
|
|
2003-08-25 07:39:06 +00:00
|
|
|
if ($oldversion < 2003082500) {
|
|
|
|
table_column("forum", "", "assesstimestart", "integer", "10", "unsigned", "0", "", "assessed");
|
|
|
|
table_column("forum", "", "assesstimefinish", "integer", "10", "unsigned", "0", "", "assesstimestart");
|
|
|
|
}
|
2003-08-15 13:59:24 +00:00
|
|
|
|
2003-08-25 12:47:36 +00:00
|
|
|
if ($oldversion < 2003082502) {
|
|
|
|
execute_sql("UPDATE {$CFG->prefix}forum SET scale = (- scale)");
|
|
|
|
}
|
|
|
|
|
2003-10-06 18:02:35 +00:00
|
|
|
if ($oldversion < 2003100600) {
|
|
|
|
table_column("forum", "", "maxbytes", "integer", "10", "unsigned", "0", "", "scale");
|
|
|
|
}
|
|
|
|
|
2004-01-01 04:48:55 +00:00
|
|
|
if ($oldversion < 2004010100) {
|
|
|
|
table_column("forum", "", "assesspublic", "integer", "4", "unsigned", "0", "", "assessed");
|
|
|
|
}
|
|
|
|
|
2004-01-14 11:50:29 +00:00
|
|
|
if ($oldversion < 2004011404) {
|
|
|
|
table_column("forum_discussions", "", "userid", "integer", "10", "unsigned", "0", "", "firstpost");
|
|
|
|
|
|
|
|
if ($discussions = get_records_sql("SELECT d.id, p.userid
|
|
|
|
FROM {$CFG->prefix}forum_discussions as d,
|
|
|
|
{$CFG->prefix}forum_posts as p
|
|
|
|
WHERE d.firstpost = p.id")) {
|
|
|
|
foreach ($discussions as $discussion) {
|
|
|
|
update_record("forum_discussions", $discussion);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2004-01-23 12:09:25 +00:00
|
|
|
if ($oldversion < 2004012200) {
|
|
|
|
table_column("forum_discussions", "", "groupid", "integer", "10", "unsigned", "0", "", "userid");
|
|
|
|
}
|
2004-01-14 11:50:29 +00:00
|
|
|
|
2004-02-06 13:15:15 +00:00
|
|
|
if ($oldversion < 2004020600) {
|
|
|
|
table_column("forum_discussions", "", "usermodified", "integer", "10", "unsigned", "0", "", "timemodified");
|
|
|
|
}
|
|
|
|
|
2004-05-02 23:08:19 +00:00
|
|
|
if ($oldversion < 2004050300) {
|
|
|
|
table_column("forum","","rsstype","integer","2", "unsigned", "0", "", "forcesubscribe");
|
|
|
|
table_column("forum","","rssarticles","integer","2", "unsigned", "0", "", "rsstype");
|
|
|
|
set_config("forum_enablerssfeeds",0);
|
|
|
|
}
|
|
|
|
|
2002-12-15 02:41:07 +00:00
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
|
|
|