Fixed user graphs for site-level, all logs

This commit is contained in:
moodler
2003-07-25 13:23:28 +00:00
parent b0dd12a912
commit da0c90c313
2 changed files with 14 additions and 3 deletions
+9 -1
View File
@@ -34,6 +34,14 @@
switch ($type) {
case "usercourse.png":
$site = get_site();
if ($course->id == $site->id) {
$courseselect = 0;
} else {
$courseselect = $course->id;
}
$maxseconds = COURSE_MAX_LOG_DISPLAY * 3600 * 24; // seconds
if ($timenow - $course->startdate > $maxseconds) {
$course->startdate = $timenow - $maxseconds;
@@ -63,7 +71,7 @@
$timestart = $timefinish;
}
if ($rawlogs = get_logs_usercourse($user->id, $course->id, $coursestart)) {
if ($rawlogs = get_logs_usercourse($user->id, $courseselect, $coursestart)) {
foreach ($rawlogs as $rawlog) {
$logs[$rawlog->day] = $rawlog->num;
}