Reorganized the attachment details page a bit, and added author info.

This commit is contained in:
mchurch
2004-08-25 13:39:18 +00:00
parent 785d24f0f6
commit ab55cb4107
+14 -3
View File
@@ -223,7 +223,7 @@ function ewiki_page_filedownload($id, $data, $action, $def_sec="") {
#-- collect entries
$files = array();
$sorted = array();
$result = ewiki_database("GETALL", array("flags", "meta", "created", "hits"));
$result = ewiki_database("GETALL", array("flags", "meta", "created", "hits", "userid"));
while ($row = $result->get()) {
if (($row["flags"] & EWIKI_DB_F_TYPE) == EWIKI_DB_F_BINARY) {
@@ -344,12 +344,23 @@ function ewiki_entry_downloads($row, $show_section=0, $fullinfo=false) {
$info->comment = $p_comment;
if ($fullinfo) {
if ($user = get_record('user', 'id', $row['userid'])) {
if (!isset($course->id)) {
$course->id = 1;
}
$picture = print_user_picture($user->id, $course->id, $user->picture, false, true, true);
$value = $picture." <a href=\"$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id\">".
fullname($user)."</a>";
}
$o .= '<a href="'.$info->url.'">'.$info->icon.$info->title.'</a>'.$info->size.'<br>'.
$info->comment.
$info->section." ".get_string("fileisoftype","wiki").": ".$info->type.'<br>'.
get_string("uploadedon","wiki").": ".$info->time.", ".
' by '.$value.'<br>'.
get_string("downloadtimes","wiki",$info->hits)."<br>".
// '(<a href="'.$info->url.'">'.$info->id."</a>)<br>".
$info->section." ".get_string("fileisoftype","wiki").": ".$info->type.
$info->comment.'<br><br>';
'<br><br>';
}
else {
// global $moodle_format; // from wiki/view.php