Skip to content

Commit

Permalink
adding date created and date modified for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
toyomoyo committed Feb 27, 2006
1 parent e03f2fe commit 8e24bfe
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 3 deletions.
2 changes: 2 additions & 0 deletions mod/data/backuplib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
6 changes: 6 additions & 0 deletions mod/data/db/mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions mod/data/db/mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
5 changes: 5 additions & 0 deletions mod/data/db/postgres7.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 3 additions & 1 deletion mod/data/db/postgres7.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);


Expand Down
3 changes: 2 additions & 1 deletion mod/data/restorelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

}
Expand Down
2 changes: 1 addition & 1 deletion mod/data/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 8e24bfe

Please sign in to comment.