mirror of
https://github.com/moodle/moodle.git
synced 2025-02-16 05:45:36 +01:00
Added some more efficiencies to the code, but something seems to be wrong
with this function as the SQL is not finding any new posts at all for me. Needs checking!
This commit is contained in:
parent
a328113f13
commit
9cba7a8c80
@ -745,7 +745,7 @@ function forum_user_complete($course, $user, $mod, $forum) {
|
||||
|
||||
function forum_print_overview($courses,&$htmlarray) {
|
||||
global $USER, $CFG;
|
||||
|
||||
|
||||
if (empty($courses) || !is_array($courses) || count($courses) == 0) {
|
||||
return array();
|
||||
}
|
||||
@ -754,9 +754,6 @@ function forum_print_overview($courses,&$htmlarray) {
|
||||
return;
|
||||
}
|
||||
|
||||
$strforum = get_string('modulename','forum');
|
||||
$strnumunread = get_string('overviewnumunread','forum');
|
||||
$strnumpostssince = get_string('overviewnumpostssince','forum');
|
||||
|
||||
// get all forum logs in ONE query (much better!)
|
||||
$sql = "SELECT instance,cmid,l.course,COUNT(l.id) as count FROM {$CFG->prefix}log l "
|
||||
@ -801,6 +798,14 @@ function forum_print_overview($courses,&$htmlarray) {
|
||||
$unread = array();
|
||||
}
|
||||
|
||||
if (empty($unread) and empty($new)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$strforum = get_string('modulename','forum');
|
||||
$strnumunread = get_string('overviewnumunread','forum');
|
||||
$strnumpostssince = get_string('overviewnumpostssince','forum');
|
||||
|
||||
foreach ($forums as $forum) {
|
||||
$str = '';
|
||||
$count = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user