Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

72 lines (54 sloc) 2.512 kb
<?PHP // $Id$
function forum_upgrade($oldversion) {
// This function does anything necessary to upgrade
// older versions to match current functionality
global $CFG;
if ($oldversion < 2003042402) {
execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('forum', 'move discussion', 'forum_discussions', 'name')");
}
if ($oldversion < 2003082500) {
table_column("forum", "", "assesstimestart", "integer", "10", "unsigned", "0", "", "assessed");
table_column("forum", "", "assesstimefinish", "integer", "10", "unsigned", "0", "", "assesstimestart");
}
if ($oldversion < 2003082502) {
execute_sql("UPDATE {$CFG->prefix}forum SET scale = (- scale)");
}
if ($oldversion < 2003100600) {
table_column("forum", "", "maxbytes", "integer", "10", "unsigned", "0", "", "scale");
}
if ($oldversion < 2004010100) {
table_column("forum", "", "assesspublic", "integer", "4", "unsigned", "0", "", "assessed");
}
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);
}
}
}
if ($oldversion < 2004012200) {
table_column("forum_discussions", "", "groupid", "integer", "10", "unsigned", "0", "", "userid");
}
if ($oldversion < 2004020600) {
table_column("forum_discussions", "", "usermodified", "integer", "10", "unsigned", "0", "", "timemodified");
}
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);
}
if ($oldversion < 2004060100) {
modify_database('', "CREATE TABLE prefix_forum_queue (
id SERIAL PRIMARY KEY,
userid integer default 0 NOT NULL,
discussionid integer default 0 NOT NULL,
postid integer default 0 NOT NULL
);");
}
return true;
}
?>
Jump to Line
Something went wrong with that request. Please try again.