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 }
?> <?php if (!ThemexCourse::isSubscriber()) { ?> <a href="#" class="element-button medium submit-button left"><?php _e('Subscribe Now', 'academy'); ?> </a> <input type="hidden" name="course_action" value="subscribe_user" /> <input type="hidden" name="user_redirect" value="<?php echo intval(reset(ThemexCourse::$data['plans'])); ?> " /> <?php } else { if (!ThemexCourse::isMember()) { ?> <?php if (ThemexCourse::$data['status'] != 'private' && ThemexCourse::$data['capacity'] >= 0) { ?> <a href="#" class="element-button medium price-button submit-button left"> <?php if (ThemexCourse::$data['status'] == 'premium' && ThemexCourse::$data['product'] != 0) { ?> <span class="caption"><?php _e('Take This Course', 'academy'); ?> </span> <span class="price"><?php echo ThemexCourse::$data['price']['text']; ?>
/** * 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; } }
?> <h4 class="nomargin"><a href="<?php echo get_permalink(ThemexLesson::$data['ID']); ?> " class="<?php if (ThemexLesson::$data['status'] == 'free') { ?> disabled<?php } ?> "><?php echo get_the_title(ThemexLesson::$data['ID']); ?> </a></h4> <?php if (ThemexCourse::isMember() && !empty(ThemexLesson::$data['quiz']) && !empty(ThemexLesson::$data['progress'])) { ?> <div class="course-progress"> <span style="width:<?php echo ThemexLesson::$data['progress']; ?> %;"></span> </div> <?php } ?> </div> <?php if (!empty(ThemexLesson::$data['attachments'])) { ?> <div class="lesson-attachments">
function themex_content($atts, $content = null) { extract(shortcode_atts(array('type' => 'public'), $atts)); $out = ''; if (isset(ThemexCourse::$data)) { if ($type == 'private' && ThemexCourse::isMember() || $type == 'public' && !ThemexCourse::isMember()) { $out .= do_shortcode($content); } } else { if ($type == 'private' && is_user_logged_in() || $type == 'public' && !is_user_logged_in()) { $out .= do_shortcode($content); } } return $out; }