}
+/// Insert default values for any important configuration variables
+
+ include_once("$CFG->dirroot/lib/defaults.php");
+
+ foreach ($defaults as $name => $value) {
+ if (!isset($CFG->$name)) {
+ $CFG->$name = $value;
+ set_config($name, $value);
+ $configchange = true;
+ }
+ }
+
+/// If any new configurations were found then send to the config page to check
+
+ if (!empty($configchange)) {
+ redirect("config.php");
+ }
+
+
/// Upgrade backup/restore system if necessary
require_once("$CFG->dirroot/backup/lib.php");
upgrade_backup_db("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards
}
-/// Insert default values for any important configuration variables
-
- include_once("$CFG->dirroot/lib/defaults.php");
-
- foreach ($defaults as $name => $value) {
- if (!isset($CFG->$name)) {
- $CFG->$name = $value;
- set_config($name, $value);
- $configchange = true;
- }
- }
-
-
-/// If any new configurations were found then send to the config page to check
-
- if (!empty($configchange)) {
- redirect("config.php");
- }
-
/// Set up the overall site name etc.
if (! $site = get_site()) {
redirect("site.php");
if ($course->category) {
$joins[] = "l.course='$course->id'";
} else {
+ $courses[0] = '';
if ($ccc = get_courses("all", "c.id ASC", "c.id,c.shortname")) {
foreach ($ccc as $cc) {
$courses[$cc->id] = "$cc->shortname";
}
$count=0;
+ $ldcache = array();
$tt = getdate(time());
$today = mktime (0, 0, 0, $tt["mon"], $tt["mday"], $tt["year"]);
print_paging_bar($totalcount, $page, $perpage, "$url&perpage=$perpage&");
- echo "<table border=0 align=center cellpadding=3 cellspacing=3>";
+ echo '<table border=0 align=center cellpadding=3 cellspacing=3>';
foreach ($logs as $log) {
- if ($ld = get_record("log_display", "module", "$log->module", "action", "$log->action")) {
- $log->info = get_field($ld->mtable, $ld->field, "id", $log->info);
+ if (isset($ldcache[$log->module][$log->action])) {
+ $ld = $ldcache[$log->module][$log->action];
+ } else {
+ $ld = get_record('log_display', 'module', $log->module, "action", $log->action);
+ $ldcache[$log->module][$log->action] = $ld;
+ }
+ if ($ld) {
+ $log->info = get_field($ld->mtable, $ld->field, 'id', $log->info);
}
- echo "<tr nowrap>";
+ echo '<tr nowrap="nowrap">';
if (! $course->category) {
- echo "<td nowrap><font size=2><a href=\"view.php?id=$log->course\">".$courses[$log->course]."</a></td>";
+ echo '<td nowrap="nowrap"><font size=2><a href="view.php?id='.$log->course.'">'.$courses[$log->course].'</a></td>';
}
- echo "<td nowrap align=right><font size=2>".userdate($log->time, "%a")."</td>";
- echo "<td nowrap><font size=2>".userdate($log->time, $strftimedatetime)."</td>";
- echo "<td nowrap><font size=2>";
- link_to_popup_window("/lib/ipatlas/plot.php?address=$log->ip&user=$log->userid", "ipatlas","$log->ip", 400, 700);
- echo "</td>";
+ echo '<td nowrap align=right><font size=2>'.userdate($log->time, '%a').'</td>';
+ echo '<td nowrap><font size=2>'.userdate($log->time, $strftimedatetime).'</td>';
+ echo '<td nowrap><font size=2>';
+ link_to_popup_window("/lib/ipatlas/plot.php?address=$log->ip&user=$log->userid", 'ipatlas',$log->ip, 400, 700);
+ echo '</td>';
$fullname = fullname($log, $isteacher);
- echo "<td nowrap><font size=2><a href=\"../user/view.php?id=$log->userid&course=$log->course\"><b>$fullname</b></td>";
- echo "<td nowrap><font size=2>";
- link_to_popup_window( make_log_url($log->module,$log->url), "fromloglive","$log->module $log->action", 400, 600);
- echo "</td>";
- echo "<td nowrap><font size=2>$log->info</td>";
- echo "</tr>";
- }
- echo "</table>";
+ echo '<td nowrap><font size=2><a href="../user/view.php?id='."$log->userid&course=$log->course".'"><b>'.$fullname.'</b></td>';
+ echo '<td nowrap><font size=2>';
+ link_to_popup_window( make_log_url($log->module,$log->url), 'fromloglive',"$log->module $log->action", 400, 600);
+ echo '</td>';
+ echo '<td nowrap><font size=2>'.$log->info.'</td>';
+ echo '</tr>';
+ }
+ echo '</table>';
print_paging_bar($totalcount, $page, $perpage, "$url&perpage=$perpage&");
}