mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Added logic in function forum_get_recent_mod_activity for groups
This commit is contained in:
parent
6a0c9cf8a3
commit
90708fc1f3
1 changed files with 28 additions and 31 deletions
|
@ -2308,12 +2308,6 @@ function forum_get_recent_mod_activity(&$activities, &$index, $sincetime, $cours
|
||||||
$userselect = "";
|
$userselect = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($groupid) {
|
|
||||||
$groupselect = " AND d.groupid = '$groupid'";
|
|
||||||
} else {
|
|
||||||
$groupselect = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
$posts = get_records_sql("SELECT p.*, d.name, u.firstname, u.lastname,
|
$posts = get_records_sql("SELECT p.*, d.name, u.firstname, u.lastname,
|
||||||
u.picture, d.groupid, cm.instance, f.name, cm.section
|
u.picture, d.groupid, cm.instance, f.name, cm.section
|
||||||
FROM {$CFG->prefix}forum_posts p,
|
FROM {$CFG->prefix}forum_posts p,
|
||||||
|
@ -2335,6 +2329,8 @@ function forum_get_recent_mod_activity(&$activities, &$index, $sincetime, $cours
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach ($posts as $post) {
|
foreach ($posts as $post) {
|
||||||
|
|
||||||
|
if (empty($groupid) || ismember($groupid, $post->userid)) {
|
||||||
$tmpactivity->type = "forum";
|
$tmpactivity->type = "forum";
|
||||||
$tmpactivity->defaultindex = $index;
|
$tmpactivity->defaultindex = $index;
|
||||||
$tmpactivity->instance = $post->instance;
|
$tmpactivity->instance = $post->instance;
|
||||||
|
@ -2355,6 +2351,7 @@ function forum_get_recent_mod_activity(&$activities, &$index, $sincetime, $cours
|
||||||
|
|
||||||
$index++;
|
$index++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue