3 // This script prints all the new things that have happened since the last login
4 // To do this, it calls new.php in each module. It relies on $USER->lastlogin
6 require("../config.php");
9 require_variable($id); // Course ID
11 if (! $course = get_record("course", "id", $id)) {
12 error("Could not find the course!");
15 require_login($course->id);
17 add_to_log("View Whats New", $course->id);
19 print_header("$course->shortname: What's new", "$course->fullname",
20 "<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A> -> What's new");
22 print_heading("Recent activity since your last login");
23 print_heading(logdate($USER->lastlogin));
25 print_simple_box_start("center");
26 $modules = array ("users");
28 $mods = get_records_sql("SELECT * FROM modules");
30 foreach ($mods as $mod) {
31 $modules[] = "mod/$mod->name";
34 foreach ($modules as $module) {
35 $newfile = "$CFG->dirroot/$module/new.php";
36 if (file_exists($newfile)) {
41 print_simple_box_end();
42 print_footer($course);