Skip to content
Browse files

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

  • Loading branch information...
1 parent 785d24f commit ab55cb4107b23762f7b25f6bc28c7feb6aacf8fa mchurch committed Aug 25, 2004
Showing with 14 additions and 3 deletions.
  1. +14 −3 mod/wiki/ewiki/plugins/moodle/downloads.php
View
17 mod/wiki/ewiki/plugins/moodle/downloads.php
@@ -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

0 comments on commit ab55cb4

Please sign in to comment.
Something went wrong with that request. Please try again.