PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /home/trave494/donotedelete/123movies.kerhosting.com/wp-content/themes/betube/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : /home/trave494/donotedelete/123movies.kerhosting.com/wp-content/themes/betube/template-favorite.php

<?php
/**
 * Template name: Favorite Posts
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage betube
 * @since betube 1.0
 */
if ( !is_user_logged_in() ) {	
	global $redux_demo; 
	$login = betube_get_template_url('template-login.php');
	wp_redirect( $login ); exit;
}
if(isset($_POST['unfavorite'])){
	$author_id = sanitize_text_field($_POST['author_id']);
	$post_id = sanitize_text_field($_POST['post_id']);
	echo betube_authors_unfavorite($author_id, $post_id);	
}
/*==========================
 BeTubePro : Define Variables
===========================*/
global $redux_demo, $current_user, $current_userID, $paged, $wp_query;
$current_user = wp_get_current_user();
$current_userID = $current_user->ID;
$user_info = get_userdata($user_ID);
$displayName = $current_user->display_name;
if(empty($displayName)){
	$displayName = $current_user->user_nicename;
}
if(empty($displayName)){
	$displayName = $current_user->user_login;
}
$beTubedateFormat = get_option( 'date_format' );
$authorEmail = $current_user->user_email;
$betubeAuthorIMG = get_user_meta($current_userID, "betube_author_avatar_url", true);
$betubeAuthorIMG = betube_get_image_url($betubeAuthorIMG);
if(empty($betubeAuthorIMG)){
	$betubeAuthorIMG = betube_get_avatar_url ($authorEmail, $size = '150' );
}
/*==========================
 BeTubePro : Get Template URLS
===========================*/
$pagepermalink = get_permalink($post->ID);
$profileURL = betube_get_template_url('template-profile.php');
$all_adds = betube_get_template_url('template-all-posts.php');
$favouriteURL = betube_get_template_url('template-favorite.php');
$newPostAds = betube_get_template_url('template-submit-video.php');
$editPostURL = betube_get_template_url('template-edit-video.php');
?>
<?php get_template_part('templates/dashboard/btp_dashboard_header'); ?>
<div class="container-fluid">
	<div class="row">
		<?php get_template_part('templates/dashboard/btp_dashboard_nav'); ?>
		<main class="col-md-12 ml-xl-auto col-lg-12 col-xl-10 bm_admin_main">
			<nav class="bm_admin_main_nav nav align-items-center py-3 box-shadow-bottom bg-white">
				<button class="bm_cl_navbar__toggler navbar-toggler d-inline-flex d-xl-none align-items-center">
					<i class="bm_cl_navbar__toggler_icon fas fa-bars"></i>
				</button>
				<div class="media bm_admin_sidebar_author ml-auto p-0">
					<div class="media-body bm_admin_sidebar_author_body align-self-center">
						<h6 class="bm_admin_sidebar_author_heading small mb-0">
							<?php esc_html_e( 'Hello, ', 'betube' ); ?>&nbsp;<?php echo esc_html($displayName); ?>
						</h6>
					</div>
					<img class="bm_admin_sidebar_author_img ml-2" src="<?php echo esc_url($betubeAuthorIMG);?>" alt="<?php echo esc_html($displayName); ?>">
				</div><!--media-->
			</nav>
			<section class="bm_admin_main_content pt-4 px-xl-2">
				<!--breadcrumb-->
				<div class="bm_admin_main_content_head d-flex align-items-center mb-4 flex-wrap">
					<h4 class="mb-0 mr-3">
						<?php esc_html_e( 'My Favorite Ads', 'betube' ); ?>
					</h4>
					<nav aria-label="breadcrumb">
						<ol class="breadcrumb bg-transparent mb-0 p-0 rounded-0 pl-0">
							<li class="breadcrumb-item">
								<a href="<?php echo esc_url($profileURL); ?>"><?php esc_html_e( 'Profile', 'betube' ); ?></a>
							</li>
							<li class="breadcrumb-item active" aria-current="page">
								<?php echo get_the_title(); ?>
							</li>
						</ol>
					</nav>
					<a href="<?php echo esc_url($newPostAds);?>" class="btn btn-success ml-auto">
						<i class="fas fa-edit"></i>
						<span class="d-none d-sm-inline-block">
							<?php esc_html_e( 'Post video', 'betube' ); ?>
						</span>
					</a>
				</div>
				<!--breadcrumb-->
				<div class="bm_admin_main_content_cya p-4 bg-white shadow-sm mb-4">
					<?php
					if( function_exists('betube_authors_all_favorite')){
						$favoriteIds = betube_authors_all_favorite($current_userID);
						if(!empty($favoriteIds)){
						$args = wp_parse_args($wp->matched_query);
						if ( !empty ( $args['paged'] ) && 0 == $paged ) {
							$wp_query->set('paged', $args['paged']);
							$paged = $args['paged'];
						}
						$args = array(
							'post_type'  => 'post',
							'post__in' => $favoriteIds,
							'paged' => $paged,
							'posts_per_page' => 10,
						);					
						$wp_query = new WP_Query($args);
						if($wp_query->have_posts()){
					?>
					<div class="table-responsive">
						<table class="table bm_adv_table bm_packages_table">
							<thead class="bm_adv_table_head bm_packages_table_head">
								<tr>
									<th scope="col"><?php esc_html_e( 'Video title', 'betube' ); ?></th>
									<th scope="col"><?php esc_html_e( 'Views', 'betube' ); ?></th>
									<th scope="col"><?php esc_html_e( 'Action', 'betube' ); ?></th>
								</tr>
							</thead>
							<tbody class="bm_adv_table_body">
							<?php
								while ($wp_query->have_posts()) : $wp_query->the_post();
								$postThumb = betube_thumb_url($post->ID, 'post-thumbnail');
								$post_time = get_post_meta($post->ID, 'post_time', true);
								$post_quality = get_post_meta($post->ID, 'post_quality', true);
							?>
								<tr>
									<td>
										<div class="media bm_admin_main_content_widgets_media mb-3">
											<?php if(!empty($postThumb)){ ?>
											<a href="<?php the_permalink(); ?>">
												<img class="rounded mr-2 bm_admin_main_content_widgets_img" src="<?php echo esc_url($postThumb);?>" alt="<?php echo get_the_title();?>">
											</a>
											<?php }?>
											<div class="media-body overflow-hidden">
												<?php if(!empty($post_quality)){ ?>
												<span class="badge badge-success badge-pill mb-1">
													<i class="fas fa-ribbon"></i>
													<?php echo esc_html($post_quality);?>
												</span>
												<?php } ?>
												<?php if(!empty($post_time)){ ?>
												<span class="badge badge-success badge-pill mb-1">
													<i class="far fa-clock"></i>
													<?php echo esc_html($post_time);?>
												</span>
												<?php } ?>
												<h6 class="mb-0 text-ellipses">
													<a class="text-dark" href="<?php the_permalink(); ?>">
													<?php echo get_the_title();?>
													</a>
												</h6>
												<span class="text-secondary small">
												<?php esc_html_e( 'Posted :', 'betube' ); ?> <?php echo get_the_date($beTubedateFormat, $post->ID); ?>
												<?php esc_html_e( 'Posted :', 'betube' ); ?> <?php echo get_the_date($beTubedateFormat, $post->ID); ?>
												</span>
											</div>
										</div>
									</td>
									<td>
										<?php echo betube_get_post_views($post->ID); ?>
										<?php esc_html_e( 'Views', 'betube' ); ?>
									</td>
									<td>
										<div class="d-flex align-items-center">
											<a href="<?php the_permalink(); ?>" class="btn btn-light mr-2" data-toggle="tooltip" data-placement="top" title="<?php esc_attr_e( 'View', 'betube' ); ?>">
												<i class="fas fa-eye"></i>
											</a>
											<form method="post">
												<?php
												if( function_exists('betube_authors_favorite_remove')){
													echo betube_authors_favorite_remove($current_userID, $post->ID);
												}
												?>
												<button type="submit" class="btn btn-light" data-toggle="tooltip" data-placement="top" title="<?php esc_attr_e( 'un favorite', 'betube' ); ?>" name="unfavorite" value="unfavorite">
													<i class="fas fa-heart-broken"></i>
												</button>
											</form>
										</div>
									</td>
								</tr>
								<?php endwhile; ?>								
							<?php  ?>								
							</tbody>
						</table>
					</div><!--table-responsive-->
					<?php
						echo paginate_links();
						wp_reset_query();
					}}else{
					?>
					<p><?php esc_html_e("You do not have any favorite video yet!", 'betube') ?></p>
					<?php }} ?>
				</div><!--bm_admin_main_content_cya-->
			</section>
		</main>
	</div><!--row-->
</div><!--container-fluid-->
<?php get_template_part('templates/dashboard/btp_dashboard_footer'); ?>