mirror of
https://github.com/moodle/moodle.git
synced 2025-01-20 15:08:32 +01:00
Discussions now store the last user to change them, as well as the
last time they were modified. This isn't actually used yet but it will be.
This commit is contained in:
parent
0ad4eb5f63
commit
016cd6af4f
@ -105,6 +105,10 @@ function forum_upgrade($oldversion) {
|
|||||||
table_column("forum_posts", "mailed", "mailed", "tinyint", "2");
|
table_column("forum_posts", "mailed", "mailed", "tinyint", "2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($oldversion < 2004020600) {
|
||||||
|
table_column("forum_discussions", "", "usermodified", "integer", "10", "unsigned", "0", "", "timemodified");
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ CREATE TABLE prefix_forum_discussions (
|
|||||||
groupid int(10) unsigned NOT NULL default '0',
|
groupid int(10) unsigned NOT NULL default '0',
|
||||||
assessed tinyint(1) NOT NULL default '1',
|
assessed tinyint(1) NOT NULL default '1',
|
||||||
timemodified int(10) unsigned NOT NULL default '0',
|
timemodified int(10) unsigned NOT NULL default '0',
|
||||||
|
usermodified int(10) unsigned NOT NULL default '0',
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
) COMMENT='Forums are composed of discussions';
|
) COMMENT='Forums are composed of discussions';
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
|
@ -43,6 +43,10 @@ function forum_upgrade($oldversion) {
|
|||||||
table_column("forum_discussions", "", "groupid", "integer", "10", "unsigned", "0", "", "userid");
|
table_column("forum_discussions", "", "groupid", "integer", "10", "unsigned", "0", "", "userid");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($oldversion < 2004020600) {
|
||||||
|
table_column("forum_discussions", "", "usermodified", "integer", "10", "unsigned", "0", "", "timemodified");
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,8 @@ CREATE TABLE prefix_forum_discussions (
|
|||||||
userid integer NOT NULL default '0',
|
userid integer NOT NULL default '0',
|
||||||
groupid integer NOT NULL default '0',
|
groupid integer NOT NULL default '0',
|
||||||
assessed integer NOT NULL default '1',
|
assessed integer NOT NULL default '1',
|
||||||
timemodified integer NOT NULL default '0'
|
timemodified integer NOT NULL default '0',
|
||||||
|
usermodified integer NOT NULL default '0'
|
||||||
);
|
);
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
|
|
||||||
|
@ -898,7 +898,8 @@ function forum_get_discussions($forum="0", $forumsort="d.timemodified DESC",
|
|||||||
$postdata = "p.*";
|
$postdata = "p.*";
|
||||||
}
|
}
|
||||||
|
|
||||||
return get_records_sql("SELECT $postdata, d.timemodified, u.firstname, u.lastname, u.email, u.picture
|
return get_records_sql("SELECT $postdata, d.timemodified, d.usermodified,
|
||||||
|
u.firstname, u.lastname, u.email, u.picture
|
||||||
FROM {$CFG->prefix}forum_discussions d,
|
FROM {$CFG->prefix}forum_discussions d,
|
||||||
{$CFG->prefix}forum_posts p,
|
{$CFG->prefix}forum_posts p,
|
||||||
{$CFG->prefix}user u
|
{$CFG->prefix}user u
|
||||||
@ -1774,6 +1775,7 @@ function forum_add_new_post($post) {
|
|||||||
|
|
||||||
// Update discussion modified date
|
// Update discussion modified date
|
||||||
set_field("forum_discussions", "timemodified", $post->modified, "id", $post->discussion);
|
set_field("forum_discussions", "timemodified", $post->modified, "id", $post->discussion);
|
||||||
|
set_field("forum_discussions", "usermodified", $post->userid, "id", $post->discussion);
|
||||||
|
|
||||||
return $post->id;
|
return $post->id;
|
||||||
}
|
}
|
||||||
@ -1794,6 +1796,7 @@ function forum_update_post($post) {
|
|||||||
|
|
||||||
// Update discussion modified date
|
// Update discussion modified date
|
||||||
set_field("forum_discussions", "timemodified", $post->modified, "id", $post->discussion);
|
set_field("forum_discussions", "timemodified", $post->modified, "id", $post->discussion);
|
||||||
|
set_field("forum_discussions", "usermodified", $post->userid, "id", $post->discussion);
|
||||||
|
|
||||||
return update_record("forum_posts", $post);
|
return update_record("forum_posts", $post);
|
||||||
}
|
}
|
||||||
@ -1835,6 +1838,7 @@ function forum_add_discussion($discussion) {
|
|||||||
|
|
||||||
$discussion->firstpost = $post->id;
|
$discussion->firstpost = $post->id;
|
||||||
$discussion->timemodified = $timenow;
|
$discussion->timemodified = $timenow;
|
||||||
|
$discussion->usermodified = $post->userid;
|
||||||
|
|
||||||
if (! $discussion->id = insert_record("forum_discussions", $discussion) ) {
|
if (! $discussion->id = insert_record("forum_discussions", $discussion) ) {
|
||||||
delete_records("forum_posts", "id", $post->id);
|
delete_records("forum_posts", "id", $post->id);
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
// This fragment is called by /admin/index.php
|
// This fragment is called by /admin/index.php
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
$module->version = 2004013101;
|
$module->version = 2004020600;
|
||||||
$module->requires = 2004013101; // Requires this Moodle version
|
$module->requires = 2004013101; // Requires this Moodle version
|
||||||
$module->cron = 60;
|
$module->cron = 60;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user