by Rosario Carcò.
Thanks again, it worked as expected. I just implemented it in mycourses block for Moodle 2.3
The code I used is very simple:
if (!$this->mycold && $CFG->block_mycourses_notvisitedsince > 0 ) {
$timestamp = time() - $CFG->block_mycourses_notvisitedsince * 86400;//Cr: calculate timestamp - number of days in seconds from today back
$lastaccess = $DB->get_field('user_lastaccess', 'timeaccess', array('courseid' => $course->id));
print_r(array('courseid and lastaccess: ',$course->id, $lastaccess));//Cr: for debugging
if ($lastaccess < $timestamp) {//Cr: skip this course and do not show it
return;
}
You will find my block in these forums, Rosario