]> git.mjollnir.org Git - moodle.git/commitdiff
If $CFG->loglifetime is active then use it make the log graphing nicer.
authormoodler <moodler>
Wed, 10 Mar 2004 11:29:35 +0000 (11:29 +0000)
committermoodler <moodler>
Wed, 10 Mar 2004 11:29:35 +0000 (11:29 +0000)
   bug 1120

course/loggraph.php

index c7fb6f344c5ba28a985e64153362de11d1c79d0a..306028eaf64b5a061f4a6f713f9061b0135d093d 100644 (file)
        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) {