function course_image($courseid) { global $DB, $CFG; require_once($CFG->libdir. ‘/coursecatlib.php’); $courserecord = $DB->get_record(‘course’, array(‘id’ => $courseid)); $course = new course_in_list($courserecord); foreach ($course->get_course_overviewfiles() as $file) { $isimage = $file->is_valid_image(); $url = file_encode_url(“$CFG->wwwroot/pluginfile.php”, ‘/’. $file->get_contextid(). ‘/’. $file->get_component(). ‘/’. $file->get_filearea(). $file->get_filepath(). $file->get_filename(), !$isimage); if($isimage) { return html_writer::empty_tag(‘img’, array(‘src’ => $url, ‘alt’ => ‘Course Image ‘. $course->fullname, ‘class’ => ‘courseimage’)); } …

Start reading Get a image for a course from the course summary files in Moodle

I would like to share some stuff in this blog that in Moodle LMS we don’t have all enrolled users’s courses and activities report so that I have developed this moodle report by writing couple of lines of code in the following. <?php require_once(‘../config.php’); require_once($CFG->dirroot .’/course/lib.php’); require_once($CFG->libdir .’/filelib.php’); $hostname=$CFG->dbhost; $databaseuser=$CFG->dbuser; $databasepwd=$CFG->dbpass; $databasename=$CFG->dbname; mysql_connect($hostname, $databaseuser,$databasepwd); mysql_select_db($databasename); …

Start reading Generate all enrolled user’s courses and activities report in moodle LMS