Example #1
0
    _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 
}
<head>
<title><?php 
wp_title('|', true, 'right');
?>
</title>
<?php 
wp_head();
?>
</head>
<body <?php 
body_class('single-certificate');
?>
>
<?php 
$ID = ThemexCore::getRewriteRule('certificate');
$certificate = ThemexCourse::getCertificate(themex_decode($ID), themex_decode($ID, true));
if (isset($certificate['user'])) {
    ?>
	<div class="certificate-wrap">
		<?php 
    if (!empty($certificate['background'])) {
        ?>
		<div class="substrate">
			<img src="<?php 
        echo $certificate['background'];
        ?>
" class="fullwidth" alt="" />
		</div>
		<?php 
    }
    ?>
 /**
  * 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;
     }
 }
Example #4
0
	<?php 
    } else {
        ?>
		<?php 
        if (!ThemexCore::checkOption('course_retake')) {
            ?>
		<a href="#" class="element-button secondary medium submit-button left"><?php 
            _e('Unsubscribe Now', 'academy');
            ?>
</a>
		<input type="hidden" name="course_action" value="remove_user" />
		<?php 
        }
        ?>
		<?php 
        if (ThemexCourse::hasCertificate()) {
            ?>
		<a href="<?php 
            echo ThemexCore::getURL('certificate', themex_encode(ThemexCourse::$data['ID'], ThemexUser::$data['user']['ID']));
            ?>
" target="_blank" class="element-button medium certificate-button"><?php 
            _e('View Certificate', 'academy');
            ?>
</a>
		<?php 
        }
        ?>
	<?php 
    }
}
?>
<?php

ThemexCourse::refresh($post->ID);
?>
<div class="course-preview <?php 
echo ThemexCourse::$data['status'];
?>
-course">
	<div class="course-image">
		<a href="<?php 
the_permalink();
?>
"><?php 
the_post_thumbnail('normal');
?>
</a>
		<?php 
if (empty(ThemexCourse::$data['plans']) && ThemexCourse::$data['status'] != 'private') {
    ?>
		<div class="course-price product-price">
			<div class="price-text"><?php 
    echo ThemexCourse::$data['price']['text'];
    ?>
</div>
			<div class="corner-wrap">
				<div class="corner"></div>
				<div class="corner-background"></div>
			</div>			
		</div>
		<?php 
}
Example #6
0
<div class="widget">
	<div class="widget-title">
		<h4 class="nomargin left"><?php 
_e('Students', 'academy');
?>
</h4>
	</div>
	<div class="widget-content clearfix">
		<div class="users-listing clearfix">
			<?php 
$counter = 0;
foreach (ThemexCourse::getMembers() as $ID) {
    ThemexUser::refresh($ID);
    if (!empty(ThemexUser::$data['active_user'])) {
        $counter++;
        ?>
					<div class="user-image <?php 
        echo $counter == 3 ? 'last' : '';
        ?>
">
						<div class="bordered-image">
							<a title="<?php 
        echo ThemexUser::$data['active_user']['profile']['full_name'];
        ?>
" href="<?php 
        echo ThemexUser::$data['active_user']['profile_url'];
        ?>
"><?php 
        echo get_avatar($ID, 100);
        ?>
</a>
Example #7
0
<?php

get_header();
the_post();
ThemexLesson::refresh(ThemexCore::getPostRelations($post->ID, 0, 'quiz_lesson', true), true);
ThemexCourse::refresh(ThemexLesson::$data['course'], true);
$layout = ThemexCore::getOption('lessons_layout', 'right');
if ($layout == 'left') {
    ?>
<aside class="sidebar column fourcol">
	<?php 
    get_sidebar('lesson');
    ?>
</aside>
<div class="column eightcol last">
<?php 
} else {
    ?>
<div class="eightcol column">
<?php 
}
?>
	<h1><?php 
the_title();
?>
</h1>
	<?php 
the_content();
?>
	<div class="quiz-listing">
		<form id="quiz_form" action="<?php 
Example #8
0
        ?>
</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');
        ?>
</h2>
		<?php 
    }
    ?>
<?php

ThemexCourse::queryRelatedCourses();
if (have_posts()) {
    ?>
<div class="related-courses clearfix">
<h1><?php 
    _e('Related Courses', 'academy');
    ?>
</h1>
	<div class="courses-listing clearfix">
		<?php 
    $counter = 0;
    while (have_posts()) {
        the_post();
        $counter++;
        ?>
			<div class="column threecol <?php 
        echo $counter == 4 ? 'last' : '';
        ?>
">
			<?php 
        get_template_part('content', 'course-grid');
        ?>
			</div>
			<?php 
        if ($counter == 4) {
            $counter = 0;
            echo '<div class="clear"></div>';
        }
    }
?>
	<?php 
if ($next = ThemexCourse::getAdjacentLesson(ThemexLesson::$data['ID'])) {
    ?>
	<a href="<?php 
    echo get_permalink($next->ID);
    ?>
" title="<?php 
    _e('Next Lesson', 'academy');
    ?>
" class="element-button next-lesson secondary"><span class="button-icon nomargin next"></span></a>
	<?php 
}
?>
	<?php 
if ($prev = ThemexCourse::getAdjacentLesson(ThemexLesson::$data['ID'], false)) {
    ?>
	<a href="<?php 
    echo get_permalink($prev->ID);
    ?>
" title="<?php 
    _e('Previous Lesson', 'academy');
    ?>
" class="element-button prev-lesson secondary"><span class="button-icon nomargin prev"></span></a>
	<?php 
}
?>
</div>
<?php 
echo do_shortcode(themex_html(ThemexLesson::$data['sidebar']));
if (!empty(ThemexLesson::$data['attachments'])) {
Example #11
0
<div class="course-rating rating-form">
	<div data-score="<?php 
echo round(ThemexCourse::$data['rating']);
?>
" <?php 
if (ThemexCourse::isRated()) {
    ?>
data-readonly="true"<?php 
}
?>
></div>
	<?php 
if (!ThemexCourse::isRated() && !ThemexWoo::isCheckout()) {
    ?>
	<form class="ajax-form hidden" action="<?php 
    echo AJAX_URL;
    ?>
" method="POST">
		<input type="hidden" name="course_rating" class="rating" value="" />
		<input type="hidden" name="course_id" value="<?php 
    echo ThemexCourse::$data['ID'];
    ?>
" />		
		<input type="hidden" name="course_action" value="update_rating" />
		<input type="hidden" name="nonce" class="nonce" value="<?php 
    echo wp_create_nonce(THEMEX_PREFIX . 'nonce');
    ?>
" />
		<input type="hidden" name="action" class="action" value="<?php 
    echo THEMEX_PREFIX;
    ?>
?>
		<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">
Example #13
0
function themex_users($atts, $content = null)
{
    extract(shortcode_atts(array('number' => '3', 'order' => 'date', 'role' => '', 'id' => ''), $atts));
    $orderby = 'registered';
    $orderdir = 'ASC';
    switch ($order) {
        case 'activity':
            $orderby = 'post_count';
            $orderdir = 'DESC';
            break;
        case 'name':
            $orderby = 'display_name';
            break;
        case 'date':
            $orderby = 'registered';
            $orderdir = 'DESC';
            break;
    }
    $args = array('number' => intval($number), 'orderby' => $orderby, 'order' => $orderdir);
    if (!empty($id)) {
        $args['include'] = explode(',', $id);
    }
    if (!empty($role)) {
        $args['role'] = $role;
    }
    $users = ThemexCourse::getAuthors($args);
    $out = '<div class="experts">';
    foreach ($users as $user) {
        $GLOBALS['user'] = $user;
        ob_start();
        get_template_part('content', 'profile');
        $out .= ob_get_contents();
        ob_end_clean();
    }
    $out .= '</div>';
    return $out;
}
Example #14
0
 /**
  * Uncompletes order
  *
  * @access public
  * @param int $ID
  * @return void
  */
 public static function uncompleteOrder($ID)
 {
     $relations = ThemexWoo::getRelatedPost($ID, array('course_product', 'plan_product'));
     if (!empty($relations)) {
         foreach ($relations as $related) {
             if ($related->post_type == 'course') {
                 ThemexCourse::removeUser($related->ID, $related->post_author, true);
             } else {
                 if ($related->post_type == 'plan') {
                     ThemexCourse::unsubscribeUser($related->ID, $related->post_author, true);
                 }
             }
         }
     }
 }
Example #15
0
echo ThemexCourse::$data['status'];
?>
-course">
		<h1><?php 
the_title();
?>
</h1>
		<div class="widget-content">
			<?php 
the_content();
?>
			<footer class="course-footer">
				<?php 
get_template_part('module', 'form');
?>
			</footer>
		</div>						
	</div>
</div>
<?php 
if (ThemexCourse::hasMembers() || is_active_sidebar('course') || !empty(ThemexCourse::$data['sidebar'])) {
    ?>
<aside class="sidebar threecol column last">
	<?php 
    echo do_shortcode(themex_html(ThemexCourse::$data['sidebar']));
    if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('course')) {
    }
    ?>
</aside>
<?php 
}
Example #16
0
    ?>
<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>
Example #17
0
_e('Description', 'academy');
?>
</h4>
		</div>
		<div class="widget-content">
			<?php 
the_content();
?>
			<footer class="course-footer">
				<?php 
get_template_part('module', 'form');
?>
			</footer>
		</div>						
	</div>
</div>
<?php 
if (ThemexCourse::hasMembers() || is_active_sidebar('course') || !empty(ThemexCourse::$data['sidebar'])) {
    ?>
<aside class="sidebar threecol column last">
	<?php 
    echo do_shortcode(themex_html(ThemexCourse::$data['sidebar']));
    if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('course')) {
    }
    if (ThemexCourse::hasMembers()) {
        get_template_part('module', 'users');
    }
    ?>
</aside>
<?php 
}
Example #18
0
 /**
  * Refreshes module data
  *
  * @access public	 
  * @return void
  */
 public static function refresh($ID = 0, $extended = false)
 {
     if (!isset(self::$data['ID']) || $ID != self::$data['ID'] || $extended && !self::$data['extended']) {
         self::$data = self::getCourse($ID, $extended);
     }
 }
	<?php 
if (empty($courses)) {
    ?>
	<h2 class="secondary"><?php 
    _e('No courses yet.', 'academy');
    ?>
</h2>
	<?php 
} else {
    ?>
	<div class="user-courses-listing">
	<?php 
    foreach ($courses as $ID) {
        ?>
		<?php 
        ThemexCourse::refresh($ID);
        ?>
		<div class="course-item <?php 
        if (ThemexCourse::$data['progress'] != 100) {
            ?>
started<?php 
        }
        ?>
">
			<div class="course-title">
				<?php 
        if (ThemexCourse::$data['author']['ID'] == ThemexUser::$data['active_user']['ID']) {
            ?>
				<div class="course-status"><?php 
            _e('Author', 'academy');
            ?>
Example #20
0
    if ($layout == 'right') {
        ?>
<div class="eightcol column">
<?php 
    } else {
        ?>
<div class="fullwidth-section">
<?php 
    }
}
?>
	<?php 
echo category_description();
?>
	<?php 
ThemexCourse::queryCourses();
?>
	<?php 
if ($view == 'list') {
    ?>
	<div class="posts-listing clearfix">
	<?php 
    while (have_posts()) {
        the_post();
        get_template_part('content', 'course-list');
    }
    ?>
	</div>
	<?php 
} else {
    ?>
Example #21
0
<div class="widget aligncenter">
	<div class="widget-title">
		<h1 class="nomargin aligncenter"><?php 
the_title();
?>
</h1>
	</div>
	<div class="plan-preview">
		<?php 
$price = ThemexCourse::getPlanPrice($post->ID);
if (!empty($price)) {
    ?>
		<div class="plan-price product-price">
			<?php 
    echo $price;
    ?>
		</div>
		<?php 
}
?>
		
		<div class="plan-description">
			<?php 
the_content();
?>
		</div>
		<?php 
if (!ThemexWoo::isCheckout()) {
    ?>
		<footer class="plan-footer">
			<form action="<?php