echo _AT('authoring_img_info'); ?> </span> <?php } ?> </div> </li> <?php for ($i = $start_num; $i < $end_num; $i++) { // only display the first 200 character of course description $row = $this->courses[$i]; // find whether the current user is the author of this course if (isset($_SESSION['user_id'])) { $user_role = $userCoursesDAO->get($_SESSION['user_id'], $row['course_id']); } $len_description = 330; if (strlen($row['description']) > $len_description) { $description = Utility::highlightKeywords(substr($row['description'], 0, $len_description), $keywords) . ' ...'; } else { $description = Utility::highlightKeywords($row['description'], $keywords); } ?> <li class="course"> <?php if ($user_role['role'] == TR_USERROLE_AUTHOR) { ?> <img src="<?php echo TR_BASE_HREF;
include_once TR_INCLUDE_PATH . 'classes/DAO/ContentDAO.class.php'; $contentDAO = new ContentDAO(); $content_row = $contentDAO->get($_content_id); $_course_id = $content_row['course_id']; } // Generate $_SESSION['s_cid']: record the last visited content_id // for authors and the users who have the current course in "my courses" list, // save the last visited content_id into user_courses and set the session var. // @see ContentUtility::saveLastCid() // for the users who don't have the current course in "my courses" list, // set the session var as $_GET['cid'] if ($_course_id > 0) { if ($_SESSION['user_id'] > 0) { include_once TR_INCLUDE_PATH . 'classes/DAO/UserCoursesDAO.class.php'; $userCoursesDAO = new UserCoursesDAO(); $user_courses_row = $userCoursesDAO->get($_SESSION['user_id'], $_course_id); if ($user_courses_row && $user_courses_row['last_cid'] > 0) { $_SESSION['s_cid'] = $user_courses_row['last_cid']; } else { if ($_content_id > 0) { $_SESSION['s_cid'] = $_content_id; } else { // first time accessing this course, no last cid yet unset($_SESSION['s_cid']); } } } else { $_SESSION['s_cid'] = $_content_id; } } // Generate contentManager.