diff --git a/mod/forum/lib.php b/mod/forum/lib.php index cf4061934b1..70efb7d9a22 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -2185,30 +2185,28 @@ function forum_print_attachments($post, $return=NULL) { if ($basedir = forum_file_area($post)) { if ($files = get_directory_list($basedir)) { $strattachment = get_string("attachment", "forum"); - $strpopupwindow = get_string("popupwindow"); foreach ($files as $file) { $icon = mimeinfo("icon", $file); if ($CFG->slasharguments) { - $ffurl = "file.php/$filearea/$file"; + $ffurl = "$CFG->wwwroot/file.php/$filearea/$file"; } else { - $ffurl = "file.php?file=/$filearea/$file"; + $ffurl = "$CFG->wwwroot/file.php?file=/$filearea/$file"; } - $image = "pixpath/f/$icon\" height=\"16\" width=\"16\" alt=\"$strpopupwindow\" />"; + $image = "pixpath/f/$icon\" height=\"16\" width=\"16\" alt=\"\" />"; if ($return == "html") { - $output .= "wwwroot/$ffurl\">$image "; - $output .= "wwwroot/$ffurl\">$file
"; + $output .= "$image "; + $output .= "$file
"; } else if ($return == "text") { - $output .= "$strattachment $file:\n$CFG->wwwroot/$ffurl\n"; + $output .= "$strattachment $file:\n$ffurl\n"; } else { if ($icon == "image.gif") { // Image attachments don't get printed as links - $imagereturn .= "
wwwroot/$ffurl\" alt=\"\" />"; + $imagereturn .= "
\"\""; } else { - link_to_popup_window("/$ffurl", "attachment", $image, 500, 500, $strattachment); - echo "wwwroot/$ffurl\">$file"; - echo "
"; + echo "$image "; + echo "$file
"; } } }