adding date created and date modified for comments

This commit is contained in:
toyomoyo 2006-02-27 02:06:35 +00:00
parent e03f2fec99
commit 8e24bfe7e8
7 changed files with 21 additions and 3 deletions

View File

@ -231,6 +231,8 @@ function backup_data_comments($bf,$preferences,$recordid){
fwrite ($bf,full_tag("RECORDID",8,false,$com_sub->recordid));
fwrite ($bf,full_tag("USERID",8,false,$com_sub->userid));
fwrite ($bf,full_tag("CONTENT",8,false,$com_sub->content));
fwrite ($bf,full_tag("CREATED",8,false,$com_sub->created));
fwrite ($bf,full_tag("MODIFIED",8,false,$com_sub->modified));
//End submission
$status =fwrite ($bf,end_tag("COMMENT",7,true));
}

View File

@ -23,6 +23,12 @@ function data_upgrade($oldversion) {
table_column("data", "", "assessed", "integer", "10");
table_column("data", "", "assesspublic", "integer", "4");
}
if ($oldversion < 2006022700) {
table_column("data_comments", "", "created", "integer", "10");
table_column("data_comments", "", "modified", "integer", "10");
}
return true;
}

View File

@ -90,6 +90,8 @@ CREATE TABLE prefix_data_comments (
userid int(10) unsigned NOT NULL default '0',
recordid int(10) unsigned NOT NULL default '0',
content text default '',
created int(10) unsigned NOT NULL default '0',
modified int(10) unsigned NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM;

View File

@ -24,6 +24,11 @@ function data_upgrade($oldversion) {
table_column("data", "", "assesspublic", "integer");
}
if ($oldversion < 2006022700) {
table_column("data_comments", "", "created", "integer");
table_column("data_comments", "", "modified", "integer");
}
return true;
}

View File

@ -72,7 +72,9 @@ CREATE TABLE prefix_data_comments (
id SERIAL PRIMARY KEY,
userid int4 NOT NULL default '0',
recordid int4 NOT NULL default '0',
content text
content text,
created integer NOT NULL default '0',
modified integer NOT NULL default '0'
);

View File

@ -345,7 +345,8 @@ function data_comments_restore_mods ($oldid, $newid, $info, $rec_info) {
$comment -> recordid = $newid;
$comment -> userid = backup_todb($com_info['#']['USERID']['0']['#']);
$comment -> content = backup_todb($com_info['#']['CONTENT']['0']['#']);
$comment -> created = backup_todb($com_info['#']['CREATED']['0']['#']);
$comment -> modified = backup_todb($com_info['#']['MODIFIED']['0']['#']);
$status = insert_record ("data_comments",$comment);
}

View File

@ -5,7 +5,7 @@
// This fragment is called by /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2006020801;
$module->version = 2006022700;
$module->requires = 2005060223; // Requires this Moodle version
$module->cron = 60;