echo get_comment_link($question->comment_ID); ?> "><?php echo get_comment_meta($question->comment_ID, 'title', true); ?> </a></li> <?php } ?> </ul> </div> <?php } ?> <?php if ((!ThemexCourse::isSubscriber() || !ThemexCourse::isMember()) && !ThemexCourse::isAuthor()) { ?> <div class="popup hidden"> <?php if (!ThemexCourse::isSubscriber()) { ?> <h2 class="popup-text"><?php _e('Subscribe to view this content', 'academy'); ?> </h2> <?php } else { ?> <h2 class="popup-text"><?php _e('Take a course to view this content', 'academy'); ?>
_e('Questions', 'academy'); ?> </h1> <?php if ($questions) { ?> <div class="questions-listing toggles-wrap"> <ul> <?php wp_list_comments(array('per_page' => -1, 'avatar_size' => 75, 'type' => 'comment', 'callback' => array('ThemexLesson', 'renderQuestion'))); ?> </ul> </div> <?php } ?> <?php if (comments_open() && (ThemexCourse::isMember() || ThemexCourse::isAuthor())) { ?> <div class="question-form eightcol column last"> <?php comment_form(); ?> </div> <?php } ?> </div> <!-- questions --> <?php }
?> <aside class="sidebar column fourcol"> <?php get_sidebar('lesson'); ?> </aside> <div class="column eightcol last"> <?php } else { ?> <div class="column eightcol lesson-content"> <?php } ?> <?php if (ThemexLesson::$data['prerequisite']['progress'] == 0 && ThemexLesson::$data['status'] != 'free' && ThemexCore::checkOption('lesson_hide') && !ThemexCourse::isAuthor()) { printf(__('Complete "%s" lesson before taking this lesson.', 'academy'), '<a href="' . get_permalink(ThemexLesson::$data['prerequisite']['ID']) . '">' . get_the_title(ThemexLesson::$data['prerequisite']['ID']) . '</a>'); } else { the_content(); comments_template('/questions.php'); } ?> </div> <?php if ($layout == 'right') { ?> <aside class="sidebar fourcol column last"> <?php get_sidebar('lesson'); ?> </aside>
/** * Saves lesson attachment * * @access public * @return void */ public static function saveAttachment() { $file = ThemexCore::getRewriteRule('file'); if (!empty($file)) { $index = themex_decode($file); $lesson = themex_decode($file, true); self::refresh($lesson); if (!empty(self::$data['course'])) { ThemexCourse::refresh(self::$data['course']); if (isset(self::$data['attachments'][$index]) && (ThemexCourse::isSubscriber() && ThemexCourse::isMember() || ThemexCourse::isAuthor() || self::$data['status'] == 'free')) { $attachment = self::$data['attachments'][$index]; if (isset($attachment['status']) && $attachment['status'] == 'link') { wp_redirect($attachment['url']); } else { $name = basename($attachment['url']); header('Content-Type: application/octet-stream'); header('Content-Transfer-Encoding: Binary'); header('Content-disposition: attachment; filename="' . $name . '"'); readfile($attachment['url']); } } else { wp_redirect(get_permalink(self::$data['course'])); } exit; } wp_redirect(SITE_URL); exit; } }