function forum_print_overview($courses,&$htmlarray) {
global $USER, $CFG;
-
+
if (empty($courses) || !is_array($courses) || count($courses) == 0) {
return array();
}
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 "
$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;