dashboard
6 years ago
email
6 years ago
global
6 years ago
loop
6 years ago
profile
6 years ago
shortcode
6 years ago
single
6 years ago
template-part
6 years ago
widget
6 years ago
archive-course.php
6 years ago
course-none.php
6 years ago
dashboard.php
6 years ago
login.php
6 years ago
single-assignment.php
6 years ago
single-course-enrolled-announcements.php
6 years ago
single-course-enrolled-overview.php
6 years ago
single-course-enrolled-questions.php
6 years ago
single-course-enrolled-subpage.php
6 years ago
single-course-enrolled.php
6 years ago
single-course.php
6 years ago
single-lesson.php
6 years ago
single-preview-lesson.php
6 years ago
single-quiz.php
6 years ago
student-public-profile.php
6 years ago
template.php
6 years ago
student-public-profile.php
133 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Template for displaying student Public Profile |
| 4 | * |
| 5 | * @since v.1.0.0 |
| 6 | * |
| 7 | * @author Themeum |
| 8 | * @url https://themeum.com |
| 9 | * |
| 10 | * @package TutorLMS/Templates |
| 11 | * @version 1.4.3 |
| 12 | */ |
| 13 | |
| 14 | get_header(); |
| 15 | |
| 16 | $user_name = sanitize_text_field(get_query_var('tutor_student_username')); |
| 17 | $sub_page = sanitize_text_field(get_query_var('profile_sub_page')); |
| 18 | $get_user = tutor_utils()->get_user_by_login($user_name); |
| 19 | $user_id = $get_user->ID; |
| 20 | |
| 21 | |
| 22 | global $wp_query; |
| 23 | |
| 24 | $profile_sub_page = ''; |
| 25 | if (isset($wp_query->query_vars['profile_sub_page']) && $wp_query->query_vars['profile_sub_page']) { |
| 26 | $profile_sub_page = $wp_query->query_vars['profile_sub_page']; |
| 27 | } |
| 28 | |
| 29 | |
| 30 | ?> |
| 31 | |
| 32 | <?php do_action('tutor_student/before/wrap'); ?> |
| 33 | |
| 34 | <div <?php tutor_post_class('tutor-full-width-student-profile tutor-page-wrap'); ?>> |
| 35 | <div class="tutor-container"> |
| 36 | <div class="tutor-row"> |
| 37 | <div class="tutor-col-12"> |
| 38 | <div class="tutor-dashboard-header"> |
| 39 | <div class="tutor-dashboard-header-avatar"> |
| 40 | <img src="<?php echo get_avatar_url($user_id, array('size' => 150)); ?>" /> |
| 41 | </div> |
| 42 | <div class="tutor-dashboard-header-info"> |
| 43 | <div class="tutor-dashboard-header-display-name"> |
| 44 | <h4><?php _e('Howdy,', 'tutor'); ?> <strong><?php echo $get_user->display_name; ?></strong> </h4> |
| 45 | </div> |
| 46 | <?php |
| 47 | if (user_can($user_id, tutor()->instructor_role)){ |
| 48 | $instructor_rating = tutor_utils()->get_instructor_ratings($get_user->ID); |
| 49 | ?> |
| 50 | <div class="tutor-dashboard-header-stats"> |
| 51 | <div class="tutor-dashboard-header-ratings"> |
| 52 | <?php tutor_utils()->star_rating_generator($instructor_rating->rating_avg); ?> |
| 53 | <span><?php echo esc_html($instructor_rating->rating_avg); ?></span> |
| 54 | <span> (<?php echo sprintf(__('%d Ratings', 'tutor'), $instructor_rating->rating_count); ?>) </span> |
| 55 | </div> |
| 56 | <!--<div class="tutor-dashboard-header-notifications"> |
| 57 | <?php /*_e('Notification'); */?> <span>9</span> |
| 58 | </div>--> |
| 59 | </div> |
| 60 | <?php } ?> |
| 61 | </div> |
| 62 | <?php |
| 63 | $tutor_user_social_icons = tutor_utils()->tutor_user_social_icons(); |
| 64 | if(count($tutor_user_social_icons)){ |
| 65 | ?> |
| 66 | <div class="tutor-dashboard-social-icons"> |
| 67 | <?php |
| 68 | $i=0; |
| 69 | foreach ($tutor_user_social_icons as $key => $social_icon){ |
| 70 | $icon_url = get_user_meta($user_id,$key,true); |
| 71 | if($icon_url){ |
| 72 | if($i==0){ |
| 73 | ?> |
| 74 | <h4><?php esc_html_e("Follow me", "tutor"); ?></h4> |
| 75 | <?php |
| 76 | } |
| 77 | echo "<a href='".esc_url($icon_url)."' target='_blank' class='".$social_icon['icon_classes']."'></a>"; |
| 78 | } |
| 79 | $i++; |
| 80 | } |
| 81 | ?> |
| 82 | </div> |
| 83 | <?php |
| 84 | } |
| 85 | ?> |
| 86 | </div> |
| 87 | </div> |
| 88 | </div> |
| 89 | </div> |
| 90 | <div <?php tutor_post_class('tutor-dashboard-student'); ?>> |
| 91 | |
| 92 | <div class="tutor-container"> |
| 93 | <div class="tutor-row"> |
| 94 | <div class="tutor-col-3"> |
| 95 | <?php |
| 96 | $permalinks = tutor_utils()->user_profile_permalinks(); |
| 97 | $student_profile_url = tutor_utils()->profile_url($user_id); |
| 98 | ?> |
| 99 | <ul class="tutor-dashboard-permalinks"> |
| 100 | <li class="tutor-dashboard-menu-bio <?php echo $profile_sub_page == '' ? 'active' : ''; ?>"><a href="<?php echo tutor_utils()->profile_url($user_id); ?>"><?php _e('Bio', 'tutor'); ?></a></li> |
| 101 | <?php |
| 102 | if (is_array($permalinks) && count($permalinks)){ |
| 103 | foreach ($permalinks as $permalink_key => $permalink){ |
| 104 | $li_class = "tutor-dashboard-menu-{$permalink_key}"; |
| 105 | $active_class = $profile_sub_page == $permalink_key ? "active" : ""; |
| 106 | echo '<li class="'. $active_class . ' ' . $li_class .'"><a href="'.trailingslashit($student_profile_url).$permalink_key.'"> '.$permalink.' </a> </li>'; |
| 107 | } |
| 108 | } |
| 109 | ?> |
| 110 | </ul> |
| 111 | </div> |
| 112 | <div class="tutor-col-9"> |
| 113 | <div class="tutor-dashboard-content"> |
| 114 | <?php |
| 115 | if ($sub_page){ |
| 116 | tutor_load_template('profile.'.$sub_page); |
| 117 | }else{ |
| 118 | tutor_load_template('profile.bio'); |
| 119 | } |
| 120 | ?> |
| 121 | </div> |
| 122 | </div> <!-- .tutor-col-8 --> |
| 123 | </div> |
| 124 | |
| 125 | </div> <!-- .tutor-row --> |
| 126 | </div> <!-- .tutor-container --> |
| 127 | </div> |
| 128 | |
| 129 | <?php do_action('tutor_student/after/wrap'); ?> |
| 130 | |
| 131 | <?php |
| 132 | get_footer(); |
| 133 |