echo "Study more!"; exit(0); } $file = $_GET["file"]; $word = $_GET["word"]; $around = 100; if (isset($_GET["around"])) { $around = $_GET["around"]; } $class = Auth::curClass(); if (strpos($file, $class) === FALSE) { echo "Research more! {$file} {$class}"; exit(0); } $fs = new NativeFS("./log/"); if ($fs->exists("{$file}-data.txt")) { plain($file); } else { if ($fs->exists("{$file}-data.log")) { json($file); } } function plain($file) { global $fs, $word; $lines = explode("\n", $fs->getContent("{$file}-data.txt")); $a = array(); $found = FALSE; foreach ($lines as $line) { array_push($a, "<code>" . mkTimeLink(preg_replace("/ /", " ", htmlspecialchars($line))) . "\n</code><BR>"); if ($found) {
$max = date('Y-m-d\\TH:i:s'); if (isset($_GET["min"])) { $min = $_GET["min"]; } if (isset($_GET["max"])) { $max = $_GET["max"]; } $class = Auth::curClass(); echo "<script>setRange('{$min}','{$max}');\n</script>"; $fs = new NativeFS("./log/"); foreach ($fs->ls("/") as $n) { $n = "/{$n}"; if (strpos($n, $class) != FALSE) { if (preg_match("/-data-time/", $n)) { $er = preg_replace("/-data-time/", "-data-error", $n); if ($fs->exists($er)) { readLog($n, $er); } } else { if (preg_match("/-data.log/", $n)) { readJSONLog($n); } } } } function readLog($time, $error) { global $fs, $min, $max; echo "<script>queue.push(function () {\n"; echo "setUser('{$time}');\n"; echo "setColor('green');\n";