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.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / templates / student-public-profile.php
tutor / templates Last commit date
course-filter 5 years ago dashboard 5 years ago email 5 years ago global 5 years ago loop 5 years ago profile 5 years ago shortcode 5 years ago single 5 years ago template-part 5 years ago widget 5 years ago archive-course-init.php 5 years ago archive-course.php 5 years ago course-none.php 5 years ago dashboard.php 5 years ago instructor-setting.php 5 years ago login.php 5 years ago public-profile-setting.php 5 years ago single-assignment.php 5 years ago single-course-enrolled-announcements.php 5 years ago single-course-enrolled-overview.php 5 years ago single-course-enrolled-questions.php 5 years ago single-course-enrolled-subpage.php 5 years ago single-course-enrolled.php 5 years ago single-course-instructor.php 5 years ago single-course.php 5 years ago single-lesson.php 5 years ago single-preview-lesson.php 5 years ago single-quiz.php 5 years ago student-public-profile.php 5 years ago template.php 5 years ago
student-public-profile.php
164 lines
1 <?php
2 /**
3 * Template for displaying student & instructor Public Profile.
4 * It is used for both of instructor and student. Separate file has not been introduced due to complicacy and backward compatibility. -JK
5 *
6 * @since v.1.0.0
7 *
8 * @author Themeum
9 * @url https://themeum.com
10 *
11 * @package TutorLMS/Templates
12 * @version 1.4.3
13 */
14
15 $user_name = sanitize_text_field(get_query_var('tutor_student_username'));
16 $get_user = tutor_utils()->get_user_by_login($user_name);
17
18 if(!is_object($get_user) || !property_exists($get_user, 'ID')){
19 wp_redirect(get_home_url().'/404');
20 exit;
21 }
22
23 $user_id = $get_user->ID;
24 $is_instructor = tutor_utils()->is_instructor($user_id);
25
26 $profile_layout = tutor_utils()->get_option(($is_instructor ? 'instructor' : 'student').'_public_profile_layout', 'pp-circle');
27 !$is_instructor ? $profile_layout='pp-circle' : 0; // For now
28
29 $tutor_user_social_icons = tutor_utils()->tutor_user_social_icons();
30
31 foreach ($tutor_user_social_icons as $key => $social_icon){
32 $url = get_user_meta($user_id, $key, true);
33 $tutor_user_social_icons[$key]['url']=$url;
34 }
35
36 get_header();
37 ?>
38
39 <?php do_action('tutor_student/before/wrap'); ?>
40
41 <div <?php tutor_post_class('tutor-full-width-student-profile tutor-page-wrap tutor-user-public-profile tutor-user-public-profile-'.$profile_layout); ?>>
42 <div class="tutor-container photo-area">
43 <div class="cover-area">
44 <div style="background-image:url(<?php echo tutor_utils()->get_cover_photo_url($user_id); ?>)"></div>
45 <div></div>
46 </div>
47 <div class="pp-area">
48 <div class="profile-pic" style="background-image:url(<?php echo get_avatar_url($user_id, array('size' => 150)); ?>)"></div>
49 <div class="profile-name">
50 <h3><?php echo $get_user->display_name; ?></h3>
51 <?php
52 if($is_instructor){
53 $course_count = tutor_utils()->get_course_count_by_instructor($user_id);
54 $student_count = tutor_utils()->get_total_students_by_instructor($user_id);
55 ?>
56 <span>
57 <span><?php echo $course_count; ?></span>
58 <?php $course_count>1 ? _e('Courses', 'tutor') : _e('Course', 'tutor'); ?>
59 </span>
60 <span><span></span></span>
61 <span>
62 <span><?php echo $student_count;?></span>
63 <?php $student_count>1 ? _e('Students', 'tutor') : _e('Student', 'tutor'); ?>
64 </span>
65 <?php
66 }
67 else{
68 $enrolled_course = tutor_utils()->get_enrolled_courses_by_user($user_id);
69 $enrol_count = is_object($enrolled_course) ? $enrolled_course->found_posts : 0;
70
71 $complete_count = tutor_utils()->get_completed_courses_ids_by_user($user_id);
72 $complete_count = $complete_count ? count($complete_count) : 0;
73 ?>
74 <span>
75 <span><?php echo $enrol_count; ?></span>
76 <?php $enrol_count>1 ? _e('Courses Enrolled', 'tutor') : _e('Course Enrolled', 'tutor'); ?>
77 </span>
78 <span><span></span></span>
79 <span>
80 <span><?php echo $complete_count; ?></span>
81 <?php $complete_count>1 ? _e('Courses Completed', 'tutor') : _e('Course Completed', 'tutor'); ?>
82 </span>
83 <?php
84 }
85 ?>
86 </div>
87 <div class="profile-rating-media">
88 <?php
89 if($is_instructor){
90 $instructor_rating = tutor_utils()->get_instructor_ratings($user_id);
91 ?>
92 <div class="tutor-rating-container">
93 <div class="ratings">
94 <span class="rating-generated">
95 <?php tutor_utils()->star_rating_generator($instructor_rating->rating_avg); ?>
96 </span>
97
98 <?php
99 echo " <span class='rating-digits'>{$instructor_rating->rating_avg}</span> ";
100 echo " <span class='rating-total-meta'>({$instructor_rating->rating_count})</span> ";
101 ?>
102 </div>
103 </div>
104 <?php
105 }
106 ?>
107 <div class="tutor-social-container">
108 <?php
109 foreach ($tutor_user_social_icons as $key => $social_icon){
110 $url = $social_icon['url'];
111 echo !empty($url) ? '<a href="'.$url.'" target="_blank" rel="noopener noreferrer nofollow" class="'.$social_icon['icon_classes'].'" title="'.$social_icon['label'].'"></a>' : '';
112 }
113 ?>
114 </div>
115 </div>
116 </div>
117 </div>
118
119
120 <div class="tutor-container" style="overflow:auto">
121 <div class="tutor-user-profile-sidebar">
122 <?php // tutor_load_template('profile.badge', ['profile_badges'=>(new )]); ?>
123 </div>
124 <div class="tutor-user-profile-content">
125
126 <h3><?php _e('Biography', 'tutor'); ?></h3>
127 <?php tutor_load_template('profile.bio'); ?>
128
129 <?php
130 if($is_instructor){
131 ?>
132 <h3><?php _e('Courses', 'tutor'); ?></h3>
133 <?php
134 add_filter('courses_col_per_row', function(){
135 return 3;
136 });
137
138 tutor_load_template('profile.courses_taken');
139 ?>
140
141 <?php
142 /* if(tutor_utils()->get_option('show_courses_completed_by_student')){
143 echo '<h3>',__('Course Completed', 'tutor'),'</h3>';
144 tutor_load_template('profile.enrolled_course');
145 } */
146 ?>
147
148 <?php
149 /* if(tutor_utils()->get_option('students_own_review_show_at_profile')){
150 echo '<h3>',__('Reviews Wrote', 'tutor'),'</h3>';
151 tutor_load_template('profile.reviews_wrote');
152 } */
153 ?>
154 <?php
155 }
156 ?>
157 </div>
158 </div>
159 </div>
160 <?php do_action('tutor_student/after/wrap'); ?>
161
162 <?php
163 get_footer();
164