dashboard
7 years ago
email
7 years ago
global
7 years ago
loop
7 years ago
profile
7 years ago
shortcode
7 years ago
single
7 years ago
widget
7 years ago
archive-course.php
7 years ago
course-none.php
7 years ago
dashboard.php
7 years ago
login.php
7 years ago
single-course-enrolled-announcements.php
7 years ago
single-course-enrolled-overview.php
7 years ago
single-course-enrolled-questions.php
7 years ago
single-course-enrolled.php
7 years ago
single-course.php
7 years ago
single-lesson.php
7 years ago
single-preview-lesson.php
7 years ago
single-quiz.php
7 years ago
student-public-profile.php
7 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 | |
| 11 | get_header(); |
| 12 | |
| 13 | $user_name = sanitize_text_field(get_query_var('tutor_student_username')); |
| 14 | $sub_page = sanitize_text_field(get_query_var('profile_sub_page')); |
| 15 | $get_user = tutor_utils()->get_user_by_login($user_name); |
| 16 | $user_id = $get_user->ID; |
| 17 | ?> |
| 18 | |
| 19 | <?php do_action('tutor_student/before/wrap'); ?> |
| 20 | |
| 21 | <div <?php tutor_post_class('tutor-full-width-student-profile tutor-page-wrap'); ?>> |
| 22 | |
| 23 | <div class="tutor-student-dashboard-leadinfo container"> |
| 24 | <div class="tutor-container"> |
| 25 | <?php |
| 26 | $user_data = get_userdata($user_id); |
| 27 | $roles = wp_roles(); |
| 28 | ?> |
| 29 | |
| 30 | <div class="tutor-row"> |
| 31 | <div class="tutor-col-auto"> |
| 32 | <div class="tutor-dashboard-avater"> |
| 33 | <?php |
| 34 | echo tutor_utils()->get_tutor_avatar($user_id, 'thumbnail'); ?> |
| 35 | </div> |
| 36 | </div> |
| 37 | <div class="tutor-col"> |
| 38 | <div class="tutor-dashboard-student-info"> |
| 39 | <h4 class="tutor-student-name"> |
| 40 | <span><?php _e('Hello,', 'tutor'); ?></span> |
| 41 | <a href="<?php echo tutor_utils()->profile_url($user_id); ?>"> <?php echo esc_html($user_data->display_name); ?> </a> |
| 42 | </h4> |
| 43 | <div class="tutor-dashboard-user-role"> |
| 44 | <span><?php _e('You are ', 'tutor'); ?></span> |
| 45 | <?php |
| 46 | if (is_array($user_data->roles) && count($user_data->roles)){ |
| 47 | foreach ($user_data->roles as $role){ |
| 48 | if ( ! empty($roles->roles[$role]['name'])){ |
| 49 | echo "<span>{$roles->roles[$role]['name']}</span>"; |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | ?> |
| 54 | </div> |
| 55 | </div> |
| 56 | </div> |
| 57 | <div class="tutor-col-12"> |
| 58 | <div class="tutor-dashboard-student-meta"> |
| 59 | <?php |
| 60 | $completed_course = tutor_utils()->get_completed_courses_ids_by_user($user_id); |
| 61 | $count_reviews = tutor_utils()->count_reviews_wrote_by_user($user_id); |
| 62 | |
| 63 | $user = wp_get_current_user(); |
| 64 | $udata = get_userdata( $user_id ); |
| 65 | $registered = $udata->user_registered; |
| 66 | $registered = date( "d M Y", strtotime( $registered ) ); |
| 67 | |
| 68 | ?> |
| 69 | <ul> |
| 70 | <li> |
| 71 | <strong><?php _e('Registration Date', 'tutor'); ?></strong> |
| 72 | <?php echo $registered; ?> |
| 73 | </li> |
| 74 | <li> |
| 75 | <strong><?php _e('Course completed', 'tutor'); ?></strong> |
| 76 | <?php echo count($completed_course); ?> |
| 77 | </li> |
| 78 | <li> |
| 79 | <strong><?php _e('Reviews Wrote', 'tutor'); ?></strong> |
| 80 | <?php echo $count_reviews; ?> |
| 81 | </li> |
| 82 | </ul> |
| 83 | </div> |
| 84 | </div> |
| 85 | </div> |
| 86 | |
| 87 | <div class="tutor-seperator"></div> |
| 88 | </div> |
| 89 | </div> |
| 90 | |
| 91 | <div <?php tutor_post_class('tutor-dashboard-student'); ?>> |
| 92 | |
| 93 | <div class="tutor-container"> |
| 94 | <div class="tutor-row"> |
| 95 | <div class="tutor-col-3"> |
| 96 | <?php |
| 97 | $permalinks = tutor_utils()->user_profile_permalinks(); |
| 98 | $student_profile_url = tutor_utils()->profile_url($user_id); |
| 99 | ?> |
| 100 | <ul class="tutor-dashboard-permalinks"> |
| 101 | <li><a href="<?php echo tutor_utils()->profile_url($user_id); ?>"><?php _e('Bio', 'tutor'); ?></a></li> |
| 102 | <?php |
| 103 | if (is_array($permalinks) && count($permalinks)){ |
| 104 | foreach ($permalinks as $permalink_key => $permalink){ |
| 105 | echo '<li><a href="'.trailingslashit($student_profile_url).$permalink_key.'"> '.$permalink.' </a> </li>'; |
| 106 | } |
| 107 | } |
| 108 | ?> |
| 109 | </ul> |
| 110 | </div> |
| 111 | <div class="tutor-col-9"> |
| 112 | |
| 113 | <?php |
| 114 | if ($sub_page){ |
| 115 | tutor_load_template('profile.'.$sub_page); |
| 116 | }else{ |
| 117 | tutor_load_template('profile.bio'); |
| 118 | } |
| 119 | |
| 120 | ?> |
| 121 | |
| 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 |