Files
Landing/wp-content/themes/upstudy/tutor/tpl-part/course/th-layout-5.php
T
2026-04-23 04:33:43 +03:30

153 lines
7.1 KiB
PHP

<?php
if ( ! defined( 'ABSPATH' ) ) exit;
$tutor_archive_media_show = Upstudy::setting( 'tutor_archive_media_show' );
$tutor_archive_title_show = Upstudy::setting( 'tutor_archive_title_show' );
$tutor_excerpt_show = Upstudy::setting( 'tutor_excerpt_show' );
$tutor_cat_show = Upstudy::setting( 'tutor_cat_show' );
$tutor_wishlist_show = Upstudy::setting( 'tutor_wishlist_show' );
$tutor_instructor_img_on_off = Upstudy::setting( 'tutor_instructor_img_on_off' );
$tutor_instructor_name_on_off = Upstudy::setting( 'tutor_instructor_name_on_off' );
$tutor_lesson_show = Upstudy::setting( 'tutor_lesson_show' );
$tutor_lesson_text_show = Upstudy::setting( 'tutor_lesson_text_show' );
$tutor_price_show = Upstudy::setting( 'tutor_price_show' );
$tutor_enroll_show = Upstudy::setting( 'tutor_enroll_show' );
$tutor_enroll_text_show = Upstudy::setting( 'tutor_enroll_text_show' );
$tutor_review_show = Upstudy::setting( 'tutor_review_show' );
$tutor_review_text_show = Upstudy::setting( 'tutor_review_text_show' );
$tutor_level_show = Upstudy::setting( 'tutor_level_show' );
$tutor_see_more_btn = Upstudy::setting( 'tutor_see_more_btn' );
$tutor_see_more_btn_text = Upstudy::setting( 'tutor_see_more_btn_text' );
$tutor_intro_video = Upstudy::setting( 'tutor_intro_video' );
$tutor_quiz_show = Upstudy::setting( 'tutor_quiz_show' );
$tutor_quiz_text_show = Upstudy::setting( 'tutor_quiz_text_show' );
$video = tutor_utils()->get_video();
$videoSource = tutor_utils()->avalue_dot( 'source', $video );
if (! empty( $video['source_youtube'] ) && $videoSource == 'youtube') {
$tutor_intro_video_url = $video["source_youtube"];
}
elseif(! empty( $video['source_vimeo'] ) && $videoSource == 'vimeo'){
$tutor_intro_video_url = $video["source_vimeo"];
}
else{
$tutor_intro_video_url = '';
}
echo '<div class="upstudy-course layout__5 review__show col__3">';
echo '<div class="course__container">';
echo '<div class="course__media">';
if ( !empty( $tutor_intro_video_url ) && $tutor_intro_video ) :
echo '<div class="intro-video-sidebar">';
echo '<div class="intro-video" style="background-image:url('. esc_url( $get_options['thumb_url'] ) .')">';
echo '<a href="' . esc_url( $tutor_intro_video_url ) . '" class="upstudy-popup-videos bla-2"><i class="dt-icon-play-button"></i></a>';
echo '</div>';
echo '</div>';
else :
echo '<a class="course-thumb" href="' . esc_url( get_the_permalink() ) . '">';
echo '<img class="w-100" src="' . esc_url( $get_options['thumb_url'] ) . '" alt="' . esc_attr( upstudy_thumbanil_alt_text( get_post_thumbnail_id( get_the_id() ) ) ). '">';
echo '</a>';
endif;
if ($tutor_price_show) {
echo '<div class="price__5">';
get_template_part( 'tutor/tpl-part/price');
echo '</div>';
}
echo '</div>';
echo '<div class="course__content">';
echo '<div class="course__content--info">';
echo '<div class="course-meta-inline-wrap">';
$students = tutor_utils()->count_enrolled_users_by_course();
$students = $students ? $students : 0; // Ensure $students is an integer
$students_text = ($students == 1) ? esc_html__(' Student', 'upstudy') : esc_html__(' Students', 'upstudy');
if ($tutor_enroll_show && $students > 0) { // Check if there are students
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-enroll"><i class="dt-icon-user"></i></span>';
echo '<span class="value">';
echo esc_attr($students);
if ($tutor_enroll_text_show) {
echo esc_html($students_text);
}
echo '</span>';
echo '</div>';
}
$lessons = tutor_utils()->get_lesson_count_by_course(get_the_ID());
$lessons = $lessons ? $lessons : 0; // Ensure $lessons is an integer
$lessons_text = ($lessons == 1) ? esc_html__(' Lesson', 'upstudy') : esc_html__(' Lessons', 'upstudy');
if ($tutor_lesson_show && $lessons > 0) { // Check if there are students
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-lesson"><i class="dt-icon-book"></i></span>';
echo '<span class="value">';
echo esc_attr($lessons);
if ($tutor_lesson_text_show) {
echo esc_html($lessons_text);
}
echo '</span>';
echo '</div>';
}
$quiz = tutor_utils()->get_quiz_count_by_course(get_the_ID());
$quiz = $quiz ? $quiz : 0; // Ensure $quiz is an integer
$quiz_text = ($quiz == 1) ? esc_html__(' Quiz', 'upstudy') : esc_html__(' Quiz', 'upstudy');
if ($tutor_quiz_show && $quiz > 0) {
echo '<div class="course-meta-inline">';
echo '<span class="upstudy-meta-border upstudy-course-quiz"><i class="dt-icon-lightbulb"></i></span>';
echo '<span class="value">';
echo esc_attr($quiz);
if ($tutor_quiz_text_show) {
echo esc_html($quiz_text);
}
echo '</span>';
echo '</div>';
}
echo '</div>'; // End Meta
if ( $tutor_archive_title_show ) {
echo '<div class="get__title--info">';
echo upstudy_get_title();
echo '</div>';
}
if ( $tutor_see_more_btn ) {
echo '<div class="course__meta-right">';
echo '<div class="view-more-btn">';
if (!empty($tutor_see_more_btn_text)) {
echo '<a href="' . esc_url( get_permalink() ) . '">'. $tutor_see_more_btn_text .'</a>';
} else {
echo '<a href="' . esc_url( get_permalink() ) . '">'. esc_html__('View More', 'upstudy').'</a>';
}
echo '</div>';
echo '</div>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';