mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 17:02:03 +02:00
Old new.php system is replaced by print_recent_activity() in course/lib.php
This commit is contained in:
parent
873960de8c
commit
9f11a65e56
@ -1,44 +0,0 @@
|
||||
<?PHP // $Id$
|
||||
|
||||
// This script prints all the new things that have happened since the last login
|
||||
// To do this, it calls new.php in each module. It relies on $USER->lastlogin
|
||||
|
||||
require("../config.php");
|
||||
require("lib.php");
|
||||
|
||||
require_variable($id); // Course ID
|
||||
|
||||
if (! $course = get_record("course", "id", $id)) {
|
||||
error("Could not find the course!");
|
||||
}
|
||||
|
||||
require_login($course->id);
|
||||
|
||||
add_to_log($course->id, "course", "view new", "new.php?id=$course->id", "");
|
||||
|
||||
print_header("$course->shortname: What's new", "$course->fullname",
|
||||
"<A HREF=\"$CFG->wwwroot/course/view.php?id=$course->id\">$course->shortname</A> -> What's new");
|
||||
|
||||
print_heading("Recent activity since your last login");
|
||||
print_heading(userdate($USER->lastlogin));
|
||||
|
||||
print_simple_box_start("center");
|
||||
$modules = array ("users");
|
||||
|
||||
$mods = get_records_sql("SELECT * FROM modules");
|
||||
|
||||
foreach ($mods as $mod) {
|
||||
$modules[] = "mod/$mod->name";
|
||||
}
|
||||
|
||||
foreach ($modules as $module) {
|
||||
$newfile = "$CFG->dirroot/$module/new.php";
|
||||
if (file_exists($newfile)) {
|
||||
include($newfile);
|
||||
}
|
||||
}
|
||||
|
||||
print_simple_box_end();
|
||||
print_footer($course);
|
||||
|
||||
?>
|
@ -10,10 +10,6 @@
|
||||
<TR>
|
||||
<TD WIDTH="15%" VALIGN="TOP">
|
||||
<?
|
||||
//print_simple_box("News", $align="CENTER", $width="100%", $color="$THEME->cellheading");
|
||||
|
||||
//print_side_block("<A HREF=\"new.php?id=$course->id\">What's New!</A>",
|
||||
// "", "<FONT SIZE=1>...since your last login</FONT>");
|
||||
//if ($news = get_course_news_forum($course->id)) {
|
||||
//forum_latest_topics($news->id, 5, "minimal", "DESC", false);
|
||||
//}
|
||||
|
@ -1,39 +0,0 @@
|
||||
<?PHP // $Id$
|
||||
|
||||
// Code fragment called by /courses/new.php
|
||||
// Prints out a formatted table of all the new things that have happened
|
||||
// with this module (since the user's last login). Suitable for students.
|
||||
|
||||
// Assumes $course and $USER are defined and page has been started.
|
||||
|
||||
if ($journals = get_all_instances_in_course("journal", $course->id)) {
|
||||
|
||||
foreach ($journals as $journal) {
|
||||
if ($entry = get_record_sql("SELECT * FROM journal_entries
|
||||
WHERE timemarked > '$USER->lastlogin'
|
||||
AND journal = '$journal->id'
|
||||
AND user = $USER->id")) {
|
||||
echo "<P><B>Journal feedback: $journal->name</B></P>";
|
||||
echo "<FONT SIZE=2><UL>";
|
||||
echo "<LI><A HREF=\"/mod/journal/view.php?id=$journal->coursemodule\">Your journal entry</A> has some feedback!";
|
||||
echo ", ".userdate($entry->timemarked);
|
||||
echo "</UL></FONT>";
|
||||
}
|
||||
|
||||
if ($entries = get_records_sql("SELECT j.*, u.id as userid, u.firstname, u.lastname
|
||||
FROM journal_entries j, user u
|
||||
WHERE modified > '$USER->lastlogin'
|
||||
AND journal = '$journal->id'
|
||||
AND j.user = u.id ORDER by j.modified")) {
|
||||
echo "<P><B>Journal entries: <A HREF=\"/mod/journal/view.php?id=$journal->coursemodule\">$journal->name</A></B></P>";
|
||||
echo "<FONT SIZE=2><UL>";
|
||||
foreach ($entries as $entry) {
|
||||
echo "<LI>$entry->firstname $entry->lastname edited their journal";
|
||||
echo ", ".userdate($entry->modified);
|
||||
}
|
||||
echo "</UL></FONT>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
41
user/new.php
41
user/new.php
@ -1,41 +0,0 @@
|
||||
<?PHP // $Id$
|
||||
|
||||
// Code fragment called by /courses/new.php
|
||||
// Prints out a formatted table of all the new things that have happened
|
||||
// with this module (since the user's last login). Suitable for students.
|
||||
|
||||
// Assumes $course and $USER are defined and page has been started.
|
||||
|
||||
// First, print all the users who have updated their records.
|
||||
|
||||
if ($users = get_records_sql("SELECT u.* FROM user u, user_students s
|
||||
WHERE u.id = s.user
|
||||
AND s.course = '$course->id'
|
||||
AND u.timemodified > '$USER->lastlogin' ")) {
|
||||
|
||||
echo "<P><B>Updated User Profiles</B></P>";
|
||||
echo "<FONT SIZE=2><UL>";
|
||||
|
||||
foreach ($users as $user) {
|
||||
echo "<LI><A HREF=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</A>";
|
||||
echo " ".moodledate($user->timemodified);
|
||||
}
|
||||
echo "</UL></FONT>";
|
||||
}
|
||||
|
||||
if ($users = get_records_sql("SELECT u.* FROM user u, user_students s
|
||||
WHERE u.id = s.user
|
||||
AND s.course = '$course->id'
|
||||
AND u.currentlogin > '$USER->lastlogin' ")) {
|
||||
|
||||
echo "<P><B>User logins</B></P>";
|
||||
echo "<FONT SIZE=2><UL>";
|
||||
|
||||
foreach ($users as $user) {
|
||||
echo "<LI><A HREF=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname</A>";
|
||||
echo " ".moodledate($user->currentlogin);
|
||||
}
|
||||
echo "</UL></FONT>";
|
||||
}
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user