Index: file.php
===================================================================
RCS file: /cvsroot/moodle/moodle/file.php,v
retrieving revision 1.46.2.3
diff -u -F ^f -r1.46.2.3 file.php
--- file.php 5 Jul 2008 14:17:29 -0000 1.46.2.3
+++ file.php 7 Jul 2008 09:21:57 -0000
@@ -1,5 +1,9 @@
libdir.'/filelib.php');
/// MDL-14072: Prevent NULLs, empties and numbers to be processed by the
/// heavy interlinking. Just a few cpu cycles saved.
@@ -3685,17 +3686,7 @@
//Now decode wwwroot and file.php calls
$search = array ("$@FILEPHP@$");
-
- //Check for the status of the slasharguments config variable
- $slash = $CFG->slasharguments;
-
- //Build the replace string as needed
- if ($slash == 1) {
- $replace = array ($CFG->wwwroot."/file.php/".$restore->course_id);
- } else {
- $replace = array ($CFG->wwwroot."/file.php?file=/".$restore->course_id);
- }
-
+ $replace = array(get_file_url($restore->course_id));
$result = str_replace($search,$replace,$content);
if ($result != $content && debugging()) { //Debug
Index: blog/lib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/blog/lib.php,v
retrieving revision 1.80.2.15
diff -u -F ^f -r1.80.2.15 lib.php
--- blog/lib.php 7 Jul 2008 03:19:09 -0000 1.80.2.15
+++ blog/lib.php 7 Jul 2008 09:22:11 -0000
@@ -306,11 +314,7 @@
include_once($CFG->libdir.'/filelib.php');
$icon = mimeinfo("icon", $file);
$type = mimeinfo("type", $file);
- if ($CFG->slasharguments) {
- $ffurl = "$CFG->wwwroot/file.php/$filearea/$file";
- } else {
- $ffurl = "$CFG->wwwroot/file.php?file=/$filearea/$file";
- }
+ $ffurl = get_file_url("$filearea/$file");
$image = "
pixpath/f/$icon\" class=\"icon\" alt=\"\" />";
if ($return == "html") {
Index: blog/rsslib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/blog/rsslib.php,v
retrieving revision 1.12
diff -u -F ^f -r1.12 rsslib.php
--- blog/rsslib.php 31 Aug 2007 05:46:34 -0000 1.12
+++ blog/rsslib.php 7 Jul 2008 09:22:11 -0000
@@ -38,11 +38,8 @@
$path .= '/rss.xml';
$rsspix = $CFG->pixpath .'/i/rss.gif';
- if ($CFG->slasharguments) {
- $path = $CFG->wwwroot.'/rss/file.php/'.$path;
- } else {
- $path = $CFG->wwwroot.'/rss/file.php?file='.$path;
- }
+ require_once($CFG->libdir.'/filelib.php');
+ $path = get_file_url($path, null, 'rssfile');
print '

';
}
Index: files/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/files/index.php,v
retrieving revision 1.121.2.5
diff -u -F ^f -r1.121.2.5 index.php
--- files/index.php 14 May 2008 16:42:31 -0000 1.121.2.5
+++ files/index.php 7 Jul 2008 09:22:13 -0000
@@ -812,11 +812,8 @@ function displaydir ($wdir) {
print_cell("center", "", 'checkbox');
echo "";
- if ($CFG->slasharguments) {
- $ffurl = str_replace('//', '/', "/file.php/$id/$fileurl");
- } else {
- $ffurl = str_replace('//', '/', "/file.php?file=/$id/$fileurl");
- }
+
+ $ffurl = str_replace('//', '/', get_file_url("$id/$fileurl"));
link_to_popup_window ($ffurl, "display",
" pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" /> ".htmlspecialchars($file),
480, 640);
Index: lib/filelib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/filelib.php,v
retrieving revision 1.50.2.17
diff -u -F ^f -r1.50.2.17 filelib.php
--- lib/filelib.php 5 Jul 2008 15:34:28 -0000 1.50.2.17
+++ lib/filelib.php 7 Jul 2008 09:22:21 -0000
@@ -9,20 +9,32 @@ function get_file_url($path, $options=nu
// type of file
switch ($type) {
+ case 'httpscoursefile':
+ $url = $CFG->httpswwwroot."/file.php";
+ break;
+ case 'rssfile':
+ $url = $CFG->wwwroot."/rss/file.php";
+ break;
+ case 'user':
+ $url = $CFG->wwwroot."/user/pix.php";
+ break;
+ case 'usergroup':
+ $url = $CFG->wwwroot."/user/pixgroup.php";
+ break;
case 'coursefile':
default:
- $url = "$CFG->wwwroot/file.php";
+ $url = $CFG->wwwroot."/file.php";
}
if ($CFG->slasharguments) {
$parts = explode('/', $path);
$parts = array_map('rawurlencode', $parts);
$path = implode('/', $parts);
- $ffurl = "$CFG->wwwroot/file.php/$path";
+ $ffurl = $url.'/'.$path;
$separator = '?';
} else {
- $path = rawurlencode("/$path");
- $ffurl = "$CFG->wwwroot/file.php?file=$path";
+ $path = rawurlencode('/'.$path);
+ $ffurl = $url.'?file='.$path;
$separator = '&';
}
Index: lib/questionlib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/questionlib.php,v
retrieving revision 1.119.2.12
diff -u -F ^f -r1.119.2.12 questionlib.php
--- lib/questionlib.php 2 Jul 2008 09:14:56 -0000 1.119.2.12
+++ lib/questionlib.php 7 Jul 2008 09:22:26 -0000
@@ -1503,12 +1503,10 @@ function get_question_image($question) {
if (substr(strtolower($question->image), 0, 7) == 'http://') {
$img .= $question->image;
- } else if ($CFG->slasharguments) { // Use this method if possible for better caching
- $img .= "$CFG->wwwroot/file.php/$coursefilesdir/$question->image";
-
} else {
- $img .= "$CFG->wwwroot/file.php?file=/$coursefilesdir/$question->image";
- }
+ require_once($CFG->libdir .'/filelib.php');
+ $img = get_file_url("$courseid/{$question->image}");
+ }
}
return $img;
}
@@ -2290,12 +2288,8 @@ function question_url_check($url){
*/
function question_replace_file_links_in_html($html, $fromcourseid, $tocourseid, $url, $destination, &$changed){
global $CFG;
- if ($CFG->slasharguments) { // Use this method if possible for better caching
- $tourl = "$CFG->wwwroot/file.php/$tocourseid/$destination";
-
- } else {
- $tourl = "$CFG->wwwroot/file.php?file=/$tocourseid/$destination";
- }
+ require_once($CFG->libdir .'/filelib.php');
+ $tourl = get_file_url("$tocourseid/$destination");
$fromurl = question_file_links_base_url($fromcourseid).preg_quote($url, '!');
$searchfor = array('!(<\s*(a|img)\s[^>]*(href|src)\s*=\s*")'.$fromurl.'(")!i',
'!(<\s*(a|img)\s[^>]*(href|src)\s*=\s*\')'.$fromurl.'(\')!i');
Index: lib/rsslib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/rsslib.php,v
retrieving revision 1.52.2.2
diff -u -F ^f -r1.52.2.2 rsslib.php
--- lib/rsslib.php 31 Dec 2007 15:36:48 -0000 1.52.2.2
+++ lib/rsslib.php 7 Jul 2008 09:22:27 -0000
@@ -25,12 +25,8 @@ function rss_get_link($courseid, $userid
//This function returns the URL for the RSS XML file.
function rss_get_url($courseid, $userid, $modulename, $id) {
global $CFG;
- if ($CFG->slasharguments) {
- $rsspath = "$CFG->wwwroot/rss/file.php/$courseid/$userid/$modulename/$id/rss.xml";
- } else {
- $rsspath = "$CFG->wwwroot/rss/file.php?file=/$courseid/$userid/$modulename/$id/rss.xml";
- }
- return $rsspath;
+ require_once($CFG->libdir.'/filelib.php');
+ return get_file_url($courseid.'/'.$userid.'/'.$modulename.'/'.$id.'/rss.xml', null, 'rssfile');
}
//This function prints the icon (from theme) with the link to rss/file.php
Index: lib/weblib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/weblib.php,v
retrieving revision 1.970.2.95
diff -u -F ^f -r1.970.2.95 weblib.php
--- lib/weblib.php 2 Jul 2008 06:38:09 -0000 1.970.2.95
+++ lib/weblib.php 7 Jul 2008 09:22:42 -0000
@@ -4294,11 +4294,8 @@ function print_file_picture($path, $cour
} else if ($courseid) {
$output .= ' slasharguments) { // Use this method if possible for better caching
- $src = $wwwroot .'/user/pix.php/'. $user->id .'/'. $file .'.jpg';
- } else {
- $src = $wwwroot .'/user/pix.php?file=/'. $user->id .'/'. $file .'.jpg';
- }
+ require_once($CFG->libdir.'/filelib.php');
+ $src = get_file_url($user->id.'/'.$file.'.jpg', null, 'user');
} else { // Print default user pictures (use theme version if available)
$class .= " defaultuserpic";
$src = "$CFG->pixpath/u/$file.png";
@@ -4604,13 +4598,10 @@ function print_group_picture($group, $co
$size = 35;
}
if ($group->picture) { // Print custom group picture
- if ($CFG->slasharguments) { // Use this method if possible for better caching
- $output .= ' ';
- } else {
- $output .= ' ';
- }
+ require_once($CFG->libdir.'/filelib.php');
+ $grouppictureurl = get_file_url($group->id.'/'.$file.'.jpg', null, 'usergroup');
+ $output .= ' ';
}
if ($link or has_capability('moodle/site:accessallgroups', $context)) {
$output .= '';
Index: lib/wiki_to_markdown.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/wiki_to_markdown.php,v
retrieving revision 1.11
diff -u -F ^f -r1.11 wiki_to_markdown.php
--- lib/wiki_to_markdown.php 7 Mar 2006 20:26:27 -0000 1.11
+++ lib/wiki_to_markdown.php 7 Jul 2008 09:22:42 -0000
@@ -264,24 +264,16 @@
$line = eregi_replace( " ([a-zA-Z]+):([0-9]+)\(([^)]+)\)",
" [\\3](".$CFG->wwwroot."/mod/\\1/view.php?id=\\2) ", $line );
+ require_once($CFG->libdir.'/filelib.php');
+ $coursefileurl = get_file_url($this->courseid);
+
// Replace picture resource link
- if ($CFG->slasharguments) {
- $line = eregi_replace( "/([a-zA-Z0-9./_-]+)(png|gif|jpg)\(([^)]+)\)",
- "", $line );
- } else {
- $line = eregi_replace( "/([a-zA-Z0-9./_-]+)(png|gif|jpg)\(([^)]+)\)",
- "", $line );
- }
+ $line = eregi_replace( "/([a-zA-Z0-9./_-]+)(png|gif|jpg)\(([^)]+)\)",
+ "", $line );
// Replace file resource link
- if ($CFG->slasharguments) {
- $line = eregi_replace( "file:/([[:alnum:]/._-]+)\(([^)]+)\)",
- "[\\2]($CFG->wwwroot/file.php/$this->courseid/\\1)", $line );
- } else {
- $line = eregi_replace( "file:/([[:alnum:]/._-]+)\(([^)]+)\)",
- "[\\2]($CFG->wwwroot/file.php?file=/$this->courseid/\\1)", $line );
- }
-
+ $line = eregi_replace( "file:/([[:alnum:]/._-]+)\(([^)]+)\)",
+ "[\\2](".$coursefileurl."/\\1)", $line );
return $line;
}
Index: lib/editor/htmlarea/coursefiles.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/editor/htmlarea/coursefiles.php,v
retrieving revision 1.13.8.1
diff -u -F ^f -r1.13.8.1 coursefiles.php
--- lib/editor/htmlarea/coursefiles.php 2 Apr 2008 06:10:01 -0000 1.13.8.1
+++ lib/editor/htmlarea/coursefiles.php 7 Jul 2008 09:22:45 -0000
@@ -755,17 +755,13 @@ function displaydir ($wdir) {
print_cell("center", "");
}
echo " | ";
- if ($CFG->slasharguments) {
- $ffurl = "/file.php/$id$fileurl";
- } else {
- $ffurl = "/file.php?file=/$id$fileurl";
- }
+ $ffurl = get_file_url($id$fileurl);
link_to_popup_window ($ffurl, "display",
" pixpath/f/$icon\" class=\"icon\" alt=\"$strfile\" />",
480, 640);
$file_size = filesize($filename);
- echo "wwwroot.$ffurl."',";
+ echo "$file";
echo " | \n";
Index: mod/data/preset_class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/data/preset_class.php,v
retrieving revision 1.2.2.3
diff -u -F ^f -r1.2.2.3 preset_class.php
--- mod/data/preset_class.php 13 Apr 2008 22:57:09 -0000 1.2.2.3
+++ mod/data/preset_class.php 7 Jul 2008 09:22:50 -0000
@@ -712,7 +712,8 @@
print_error('movezipfailed', 'data');
}
- $html .= ''.get_string('download', 'data')."";
+ require_once($CFG->libdir.'/filelib.php');
+ $html .= ''. get_string('download', 'data') .'';
$html .= '';
return $html;
}
Index: mod/data/field/file/field.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/data/field/file/field.class.php,v
retrieving revision 1.17.2.4
diff -u -F ^f -r1.17.2.4 field.class.php
--- mod/data/field/file/field.class.php 30 May 2008 01:34:41 -0000 1.17.2.4
+++ mod/data/field/file/field.class.php 7 Jul 2008 09:22:51 -0000
@@ -42,12 +42,8 @@
$src = empty($contents[0]) ? '' : $contents[0];
$name = empty($contents[1]) ? $src : $contents[1];
$displayname = empty($contents[1]) ? '' : $contents[1];
- $path = $this->data->course.'/'.$CFG->moddata.'/data/'.$this->data->id.'/'.$this->field->id.'/'.$recordid;
- if ($CFG->slasharguments) {
- $source = $CFG->wwwroot.'/file.php/'.$path;
- } else {
- $source = $CFG->wwwroot.'/file.php?file=/'.$path;
- }
+ require_once($CFG->libdir.'/filelib.php');
+ $source = get_file_url($this->data->course.'/'.$CFG->moddata.'/data/'.$this->data->id.'/'.$this->field->id.'/'.$recordid);
} else {
$src = '';
$name = '';
Index: mod/data/field/picture/field.class.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/data/field/picture/field.class.php,v
retrieving revision 1.24.2.1
diff -u -F ^f -r1.24.2.1 field.class.php
--- mod/data/field/picture/field.class.php 30 May 2008 01:34:41 -0000 1.24.2.1
+++ mod/data/field/picture/field.class.php 7 Jul 2008 09:22:51 -0000
@@ -45,11 +45,8 @@
$description = $content->content1;
}
$path = $this->data->course.'/'.$CFG->moddata.'/data/'.$this->data->id.'/'.$this->field->id.'/'.$recordid;
- if ($CFG->slasharguments) {
- $filepath = $CFG->wwwroot.'/file.php/'.$path.'/'.$filename;
- } else {
- $filepath = $CFG->wwwroot.'/file.php?file=/'.$path.'/'.$filename;
- }
+ require_once($CFG->libdir.'/filelib.php');
+ $filepath = get_file_url("$path/$filename");
}
$str = '';
$str .= '
\n";
$n = 1;
+ require_once($CFG->libdir .'/filelib.php');
foreach ($files as $file) {
$icon = mimeinfo("icon", $file);
- if ($CFG->slasharguments) {
- $ffurl = "file.php/$filearea/$file";
- } else {
- $ffurl = "file.php?file=/$filearea/$file";
- }
+ $ffurl = get_file_url("$filearea/$file");
// removed target=\"uploadedfile\"
// as it does not validate MDL_7861
echo "".get_string("attachment", "workshop")." $n: pixpath/f/$icon\"
class=\"icon\" alt=\"".get_string('file')."\" />".
- " wwwroot/$ffurl\">$file |
\n";
+ " $file\n";
}
} else {
echo "| ".get_string("noattachments", "workshop")." |
\n";
Index: question/export.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/export.php,v
retrieving revision 1.43.2.1
diff -u -F ^f -r1.43.2.1 export.php
--- question/export.php 2 Nov 2007 16:20:19 -0000 1.43.2.1
+++ question/export.php 7 Jul 2008 09:23:13 -0000
@@ -118,12 +118,8 @@
// link to download the finished file
$file_ext = $qformat->export_file_extension();
- if ($CFG->slasharguments) {
- $efile = "{$CFG->wwwroot}/file.php/".$qformat->question_get_export_dir()."/$from_form->exportfilename".$file_ext."?forcedownload=1";
- }
- else {
- $efile = "{$CFG->wwwroot}/file.php?file=/".$qformat->question_get_export_dir()."/$from_form->exportfilename".$file_ext."&forcedownload=1";
- }
+ require_once($CFG->libdir.'/filelib.php');
+ $efile = get_file_url($qformat->question_get_export_dir() .'/'. $from_form->exportfilename.$file_ext, array('forcedownload'=>1));
echo "";
echo "$txt->downloadextra
";
Index: question/format/hotpot/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format/hotpot/format.php,v
retrieving revision 1.12.4.4
diff -u -F ^f -r1.12.4.4 format.php
--- question/format/hotpot/format.php 5 Feb 2008 04:09:58 -0000 1.12.4.4
+++ question/format/hotpot/format.php 7 Jul 2008 09:23:14 -0000
@@ -43,11 +43,8 @@
// shouldn't happen !!
$courseid = 0;
}
- if ($CFG->slasharguments) {
- $baseurl = "$CFG->wwwroot/file.php/$courseid/";
- } else {
- $baseurl = "$CFG->wwwroot/file.php?file=/$courseid/";
- }
+ require_once($CFG->libdir.'/filelib.php');
+ $baseurl = get_file_url($courseid).'/';
// get import file name
global $params;
Index: question/format/qti2/format.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format/qti2/format.php,v
retrieving revision 1.12.4.1
diff -u -F ^f -r1.12.4.1 format.php
--- question/format/qti2/format.php 2 Nov 2007 16:20:35 -0000 1.12.4.1
+++ question/format/qti2/format.php 7 Jul 2008 09:23:16 -0000
@@ -405,6 +405,7 @@ function handle_questions_media(&$questi
function quiz_export_prepare_questions($questions, $quizid, $courseid, $shuffleanswers = null) {
global $CFG;
// add the answers to the questions and format the image property
+ require_once($CFG->libdir.'/filelib.php');
foreach ($questions as $key=>$question) {
$questions[$key] = get_question_data($question);
$questions[$key]->courseid = $courseid;
@@ -420,11 +421,7 @@ function handle_questions_media(&$questi
if ($localfile) {
// create the http url that the player will need to access the file
- if ($CFG->slasharguments) { // Use this method if possible for better caching
- $questions[$key]->mediaurl = "$CFG->wwwroot/file.php/$question->image";
- } else {
- $questions[$key]->mediaurl = "$CFG->wwwroot/file.php?file=$question->image";
- }
+ $questions[$key]->mediaurl = get_file_url($question->image);
} else {
$questions[$key]->mediaurl = $question->image;
}
@@ -908,10 +905,9 @@ function xml_entitize(&$collection) {
global $CFG;
if (substr(strtolower($file), 0, 7) == 'http://') {
$url = $file;
- } else if ($CFG->slasharguments) { // Use this method if possible for better caching
- $url = "{$CFG->wwwroot}/file.php/$courseid/{$file}";
} else {
- $url = "{$CFG->wwwroot}/file.php?file=/$courseid/{$file}";
+ require_once($CFG->libdir.'/filelib.php');
+ $url = get_file_url("$courseid/$file");
}
return $url;
}
Index: question/format/qti2/qt_common.php
===================================================================
RCS file: /cvsroot/moodle/moodle/question/format/qti2/qt_common.php,v
retrieving revision 1.4
diff -u -F ^f -r1.4 qt_common.php
--- question/format/qti2/qt_common.php 15 Jun 2007 10:24:29 -0000 1.4
+++ question/format/qti2/qt_common.php 7 Jul 2008 09:23:16 -0000
@@ -102,10 +102,9 @@ function get_media_tag($file, $courseid
// if it's a moodle library file, it will be served through file.php
if (substr(strtolower($file), 0, 7) == 'http://') {
$media = $file;
- } else if ($CFG->slasharguments) { // Use this method if possible for better caching
- $media = "{$CFG->wwwroot}/file.php/$courseid/$file";
} else {
- $media = "{$CFG->wwwroot}/file.php?file=/$courseid/$file";
+ require_once($CFG->libdir.'/filelib.php');
+ $media = get_file_url("$courseid/$file");
}
$ismultimedia = false;
Index: theme/standardlogo/header.html
===================================================================
RCS file: /cvsroot/moodle/moodle/theme/standardlogo/header.html,v
retrieving revision 1.26.2.1
diff -u -F ^f -r1.26.2.1 header.html
--- theme/standardlogo/header.html 23 Nov 2007 16:41:16 -0000 1.26.2.1
+++ theme/standardlogo/header.html 7 Jul 2008 09:23:20 -0000
@@ -23,17 +23,11 @@
} else if (file_exists($CFG->dirroot.'/logo.gif')) {
$standardlogo = $CFG->httpswwwroot.'/logo.gif';
} else if (file_exists($CFG->dataroot.'/1/logo.jpg')) {
- if (empty($CFG->slasharguments)) {
- $standardlogo = $CFG->httpswwwroot.'/file.php?file=/1/logo.jpg';
- } else {
- $standardlogo = $CFG->httpswwwroot.'/file.php/1/logo.jpg';
- }
+ require_once($CFG->libdir.'/filelib.php');
+ $standardlogo = get_file_url('1/logo.jpg', null, 'httpscoursefile');
} else if (file_exists($CFG->dataroot.'/1/logo.gif')) {
- if (empty($CFG->slasharguments)) {
- $standardlogo = $CFG->httpswwwroot.'/file.php?file=/1/logo.gif';
- } else {
- $standardlogo = $CFG->httpswwwroot.'/file.php/1/logo.gif';
- }
+ require_once($CFG->libdir.'/filelib.php');
+ $standardlogo = get_file_url('1/logo.gif', null, 'httpscoursefile');
} else {
$standardlogo = $CFG->httpsthemewww .'/'. current_theme().'/logo.gif';
}
Index: userpix/index.php
===================================================================
RCS file: /cvsroot/moodle/moodle/userpix/index.php,v
retrieving revision 1.9.2.2
diff -u -F ^f -r1.9.2.2 index.php
--- userpix/index.php 22 Apr 2008 06:16:18 -0000 1.9.2.2
+++ userpix/index.php 7 Jul 2008 09:23:21 -0000
@@ -25,13 +25,10 @@
$fullname = fullname($user);
echo "wwwroot/user/view.php?id=$user->id&course=1\" ".
"title=\"$fullname\">";
- if ($CFG->slasharguments) { // Use this method if possible for better caching
- echo '
';
- } else {
- echo '
';
- }
+ require_once($CFG->libdir.'/filelib.php');
+ $userpictureurl = get_file_url($user->id.'/f1.jpg', null, 'user');
+ echo '
';
echo " \n";
}
Index: userpix/upgrade.php
===================================================================
RCS file: /cvsroot/moodle/moodle/userpix/upgrade.php,v
retrieving revision 1.5.2.1
diff -u -F ^f -r1.5.2.1 upgrade.php
--- userpix/upgrade.php 22 Apr 2008 06:16:18 -0000 1.5.2.1
+++ userpix/upgrade.php 7 Jul 2008 09:23:21 -0000
@@ -22,13 +22,10 @@
$fullname = fullname($user);
echo "wwwroot/user/view.php?id=$user->id&course=1\"".
"title=\"$fullname\">";
- if ($CFG->slasharguments) { // Use this method if possible for better caching
- echo '
';
- } else {
- echo '
';
- }
+ require_once($CFG->libdir.'/filelib.php');
+ $userpictureurl = get_file_url($user->id.'/f1.jpg', null, 'user');
+ echo '
';
echo " \n";
}