From c351cf27995ba6221e318d8ed977f428dfb3091a Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 21 Nov 2002 16:19:19 +0000 Subject: [PATCH] For long courses reduce the text printed on x axis --- course/loggraph.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/course/loggraph.php b/course/loggraph.php index e3bff02302..58f77cad2b 100644 --- a/course/loggraph.php +++ b/course/loggraph.php @@ -40,10 +40,24 @@ } $timestart = $coursestart = usergetmidnight($course->startdate); + if ((($timenow - $timestart)/86400.0) > 40) { + $reducedays = 7; + } else { + $reducedays = 0; + } + $i = 0; while ($timestart < $timenow) { $timefinish = $timestart + 86400; - $days[$i] = userdate($timestart, "%a %d %b"); + if ($reducedays) { + if ($i % $reducedays) { + $days[$i] = ""; + } else { + $days[$i] = userdate($timestart, "%a %d %b"); + } + } else { + $days[$i] = userdate($timestart, "%a %d %b"); + } $logs[$i] = 0; $i++; $timestart = $timefinish; -- 2.39.5