From: moodler Date: Wed, 10 Mar 2004 11:29:35 +0000 (+0000) Subject: If $CFG->loglifetime is active then use it make the log graphing nicer. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=99674db811899435b293ff6f7f59f15d8999e45e;p=moodle.git If $CFG->loglifetime is active then use it make the log graphing nicer. bug 1120 --- diff --git a/course/loggraph.php b/course/loggraph.php index c7fb6f344c..306028eaf6 100644 --- a/course/loggraph.php +++ b/course/loggraph.php @@ -45,6 +45,14 @@ if ($timenow - $course->startdate > $maxseconds) { $course->startdate = $timenow - $maxseconds; } + + if (!empty($CFG->loglifetime)) { + $maxseconds = $CFG->loglifetime * 3600 * 24; // seconds + if ($timenow - $course->startdate > $maxseconds) { + $course->startdate = $timenow - $maxseconds; + } + } + $timestart = $coursestart = usergetmidnight($course->startdate); if ((($timenow - $timestart)/86400.0) > 40) {