File: /mnt/data/dev/dev-mentoring-wp/wp-content/themes/mentoring/single-mentee.php
<?php
/**
*
* The template used for mentors post style
*
* @package mentoring
* @version 1.0
* @since 1.0
*/
global $mentoring_options,$current_user,$post;
$redirect_unverified = !empty( $mentoring_options['redirect_unverified'] ) ? $mentoring_options['redirect_unverified'] : '';
if(!empty($redirect_unverified) && $redirect_unverified === 'yes'){
$profile_option = get_post_meta( $post->ID, '_profile_blocked', true );
$is_verified = get_post_meta( $post->ID, '_is_verified', true );
if( ( !empty($is_verified) && $is_verified === 'no' ) || ( !empty($profile_option) && $profile_option === 'on' ) ){
wp_redirect(home_url('/'));
die();
}
}
get_header();
$booking_option = mentoring_theme_option();
$mentor_detail_forum = !empty( $mentoring_options['mentor_detail_forum'] ) ? $mentoring_options['mentor_detail_forum'] : '';
$enable_options = !empty($mentoring_options['mentors_contactinfo']) ? $mentoring_options['mentors_contactinfo'] : '';
if( is_active_sidebar( 'mentor-sidebar-right' ) ){
$section_width = 'col-12';
} else {
$section_width = 'col-12';
}
$mentor_user_id = '';
while ( have_posts() ) {
the_post();
global $post;
$width = 271;
$height = 194;
$thumbnail = mentoring_prepare_thumbnail($post->ID, $width, $height);
$mentor_user_id = mentoring_get_linked_profile_id($post->ID,'post');
$profile_option = get_post_meta( $post->ID, '_profile_blocked', true );
$is_verified = get_post_meta( $post->ID, '_is_verified', true );
$profile_option = !empty($profile_option) ? $profile_option : '';
$post_meta = mentoring_get_post_meta( $post->ID );
$am_socials = !empty($post_meta['am_socials']) ? $post_meta['am_socials'] : '';
$social_settings = array();
if(function_exists('mentoring_get_social_media_icons_list')){
$social_settings = mentoring_get_social_media_icons_list('no');
}
$social_available = 'no';
if(!empty($social_settings) && is_array($social_settings) ) {
foreach($social_settings as $key => $val ) {
if(!empty($am_socials[$key])){
$social_available = 'yes';
break;
}
}
}
$social_sidebar = array();
$social_sidebar['social_available'] = $social_available;
$social_sidebar['social_settings'] = $social_settings;
$latitude = get_post_meta( $post->ID , '_latitude',true );
$longitude = get_post_meta( $post->ID , '_longitude',true );
?>
<div class="dc-haslayout dc-parent-section single-mentor">
<div class="container">
<div class="card">
<div id="dc-twocolumns" class="dc-twocolumns dc-haslayout">
<?php if( !empty($profile_option) && $profile_option ==='on' ){
do_action('mentoring_empty_records_html','dc-empty-institute-location',esc_html__( 'The profile is a temporary block from user.', 'mentoring' ));
} else {
get_template_part('directory/front-end/templates/mentors/single/basic'); ?>
<div class="dc-docsingle-holder">
<ul class="dc-navdocsingletab nav navbar-nav">
<li class="nav-item dc-available-location">
<a data-bs-toggle="tab" href="#locations"><?php esc_html_e('Locations','mentoring');?></a>
</li>
<li class="nav-item dc-mentor-detail">
<a id="userdetails-tab" class="active" data-bs-toggle="tab" href="#userdetails"><?php esc_html_e('Overview','mentoring');?></a>
</li>
<?php if( !empty($mentor_detail_forum) && $mentor_detail_forum === 'no' ){?>
<li class="nav-item dc-forum-section">
<a id="comments-tab" data-bs-toggle="tab" href="#comments"><?php esc_html_e('Forum Discussion','mentoring');?></a>
</li>
<?php }?>
<li class="nav-item dc-doc-feedback">
<a id="feedback-tab" data-bs-toggle="tab" href="#feedback"><?php esc_html_e('Reviews','mentoring');?></a>
</li>
</ul>
<div class="tab-content dc-contentdoctab dc-haslayout">
<?php get_template_part('directory/front-end/templates/mentors/single/locations'); ?>
<?php get_template_part('directory/front-end/templates/mentors/single/userdetails'); ?>
<?php if( !empty($mentor_detail_forum) && $mentor_detail_forum === 'no' ){get_template_part('directory/front-end/templates/mentors/single/consultation');}?>
<?php get_template_part('directory/front-end/templates/mentors/single/feedback'); ?>
<?php get_template_part('directory/front-end/templates/mentors/single/articles'); ?>
<div class="dc-shareprofile">
<?php mentoring_prepare_social_sharing( false,esc_html__('Share Profile','mentoring'),true,'dc-simplesocialicons dc-socialiconsborder',$thumbnail ); ?>
</div>
</div>
</div>
<?php if( is_active_sidebar( 'mentor-sidebar-right' )
|| ( !empty($social_available) && $social_available === 'yes' )
|| (!empty($latitude) && !empty($longitude) && !empty($enable_options))
){ ?>
<div class="col-12 col-md-6 col-lg-6 col-xl-3 float-left">
<aside id="dc-sidebar" class="dc-sidebar dc-sidebar-grid float-left mt-xl-0">
<?php
get_template_part('directory/front-end/templates/mentors-location-sidebar');
get_template_part('directory/front-end/templates/sidebar-social','',$social_sidebar);
if( is_active_sidebar( 'mentor-sidebar-right' ) ){
dynamic_sidebar( 'mentor-sidebar-right' );
}
?>
</aside>
</div>
<?php } ?>
<?php } ?>
</div>
</div>
</div>
</div>
<?php
if( ( empty($profile_option) || $profile_option ==='off' ) && !empty($mentor_user_id) && $mentor_user_id !== $current_user->ID && ( apply_filters('mentoring_is_feature_allowed', 'dc_chat', $mentor_user_id) === true )
) {
}
if ( is_user_logged_in() ) {
get_template_part('directory/front-end/templates/messages');
get_template_part('directory/front-end/templates/mentors/single/addfeedback');
}
get_template_part('directory/front-end/templates/mentors/single/bookings');
}
get_footer();