Quantcast
Channel: Moodle for mobile
Viewing all articles
Browse latest Browse all 8344

Re: Private files plugin

$
0
0
par Fuchur Kool.  

Hi,

Thanks for your post.

 

This worked for me:

 

		$results = $DB->get_records_sql("SELECT id, contextid, component, component, filearea, itemid, filepath, filename, filesize, mimetype FROM {files} WHERE userid=" . $USER->id . " GROUP BY filename");

		$myfiles = array();

		foreach ($results as $result){
			$file = new stdClass();
			$file->id = (int) $result->id;
			$file->contextid = (int) $result->contextid;
			$file->component = $result->component;
			$file->filearea = $result->filearea;
			$file->itemid = (int) $result->itemid;
			$file->filepath = $result->filepath;
			$file->filename = $result->filename;
			$file->filesize = (int) $result->filesize;
			$file->mimetype = $result->mimetype;
			$myfiles[] = (array) $file;
		}

But, how can I see error msgs? I have set $DB->debug(true); but I didn't see any errors...

Viewing all articles
Browse latest Browse all 8344

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>