<div class="medd">
<?php get_header(); ?>
<?php global $qaleb;?>
<style>
button, html input[type="button"], input[type="reset"], input[type="submit"] { display: inline-block; height: auto; line-height: auto; width: auto; border-radius: none; color:#e2e2e2; font-family: Num_Medium; text-shadow: none; background: none; transition: all .6s ease; box-shadow: none; font-size: 12px; opacity:none;margin: none; }
</style>
<div id="post-media">
<div class="container">
<div id="post-media-balans">
<div class="media-right">
<?php
if(get_post_meta( get_the_ID(), 'href-link-player', true )!=null){
$video_link = get_post_meta( get_the_ID(), 'href-link-player', true );
}
?>
<?php
if($video_link==""&&$video_code!=""){
echo htmlspecialchars_decode($video_code);
}else if($video_link!=""){
?>
<div class="head-video">
<div class="video-cover">
<?php if(has_post_thumbnail()){?>
<img src="<?php the_post_thumbnail_url('img-10'); ?>" alt="<?php the_title(); ?>">
<?php }else{ ?>
<img src="<?php bloginfo("template_url"); ?>/img/none.png">
<?php } ?>
<i class="fa" id="hv_play"></i>
</div>
<video id="video_tag" controls class="embed-responsive-item">
<source src="<?php echo $video_link; ?>" type="<?php echo 'video/'.pathinfo($video_link, PATHINFO_EXTENSION);?>">
جهت نمایش فیلم از مرورگر بروزتر استفاده نمایید. </video>

<?php

} ?>
</div>

<div class="dropdown">
<button onclick="myFunction()" class="dropbtn"> دانلود فیلم</button>
<div id="myDropdown" class="dropdown-content">
<?php if(get_post_meta( get_the_ID(), 'href-link-1080', true )!=null){ ?>
<a href="<?php echo get_post_meta( get_the_ID(), 'href-link-1080', true ); ?>"><i class="fa fa-download" aria-hidden="true"></i>  دانلود با کیفیت 1080</a>
<?php } ?>
<?php if(get_post_meta( get_the_ID(), 'href-link-720', true )!=null){ ?>
<a href="<?php echo get_post_meta( get_the_ID(), 'href-link-720', true ); ?>"><i class="fa fa-download" aria-hidden="true"></i>  دانلود با کیفیت 720</a>
<?php } ?>
<?php if(get_post_meta( get_the_ID(), 'href-link-480', true )!=null){ ?>
<a href="<?php echo get_post_meta( get_the_ID(), 'href-link-480', true ); ?>"><i class="fa fa-download" aria-hidden="true"></i>  دانلود با کیفیت 480</a>
<?php } ?>
<?php if(get_post_meta( get_the_ID(), 'href-link-360', true )!=null){ ?>
<a href="<?php echo get_post_meta( get_the_ID(), 'href-link-360', true ); ?>"><i class="fa fa-download" aria-hidden="true"></i>  دانلود با کیفیت 360</a>
<?php } ?>
<?php if(get_post_meta( get_the_ID(), 'href-link-240', true )!=null){ ?>
<a href="<?php echo get_post_meta( get_the_ID(), 'href-link-240', true ); ?>"><i class="fa fa-download" aria-hidden="true"></i>  دانلود با کیفیت 240</a>
<?php } ?>
</div>
</div>

<div class="cmdark_title"><b><?php the_title(); ?></b>
<div class="ico">
<?php if(get_post_meta( get_the_ID(), 'meta-text-7', true )!=null){ ?><span class="ico"> گزارشگر : <?php echo get_post_meta( get_the_ID(), 'meta-text-7', true ); ?></span>    | <?php } ?>
<?php if($qaleb['singl-category-ac']=='1'){?><span class="ico">  شناسه خبر : <?php the_ID();?></span>    | <?php } ?>
<?php if($qaleb['singl-date-ac']=='1'){?> <span class="ico">تاریخ انتشار : <?php the_time(' d F Y  -  G:i');  ?></span>    | <?php } ?>
<?php if($qaleb['singl-view-ac']=='1'){?><span class="ico"> <?php set_post_views (get_the_ID()); ?><?php echo get_post_views (get_the_ID()); ?></span> <?php } ?>
</div>
</div>
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<?php if(get_the_content()!=null){ ?>
<?php the_content(); ?>
<br>
<?php } ?>

<div class="page-bottom">
<?php if($qaleb['singl-social-ac']=='1'){?><?php get_template_part('inc/share'); ?><?php } ?>
<?php if($qaleb['singl-link-ac']=='1'){?><?php get_template_part('inc/link'); ?><?php } ?>
</div>
<div id="lin-10"></div>

<div class="box-header"><b><?php echo $qaleb['single-comment-title']; ?></b></div>
<ul class="respond-detile">
<?php echo $qaleb['single-comment-text']; ?>
</ul>
<?php comments_template('/comments.php'); ?>

<?php endwhile; endif; ?>
<div class="clear"></div>
</div>
<div class="media-left">
<?php
								$categories = get_the_category();
								$cats = array();
								foreach ( $categories as $category ) { 
										$cats[] = esc_attr( $category->term_id ); 
								}
								$args = new WP_Query(array(
								'post_type' =>'media',
								'cat'	=> $cats,
								'posts_per_page' => $qaleb['media-related-count'],
								'post__not_in' => array(get_the_ID()),
								));
							if($args->have_posts()) : while($args->have_posts()) : $args->the_post();
							?>
<div class="left-main-media-contain">
<div class="left-contain-image"><a href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url('img-200'); ?>" alt="<?php the_title(); ?>"></a></div>
<div class="left-contain-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</div>
<div class="dark-meta"><b><i class="fa fa-calendar-o" aria-hidden="true"></i> <?php the_time('d M Y'); ?></b><span><i class="fa fa-eye" aria-hidden="true"></i><?php echo get_post_views (get_the_ID()); ?></span></div>
</div>
<?php endwhile; endif; wp_reset_query(); ?>

</div>
</div></div></div>
<script>
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
</script>
<script>
if($(".video-null").html()!=null){
$("#hv_play").hide();
}

$tci = 1;
$("#hv_play").click(function() {
if($(".video-null").html()==null){
$("#hv_play").hide();
$(".video-cover").fadeOut("fast");
$(this).fadeOut("fast");
$("#video_tag").attr("autoplay","");
}
});
</script>
<?php if($qaleb['sidcontrol']=='1'){?>
<script>
$(document).ready(function() {
$('.media-right,.media-left')
.theiaStickySidebar({
additionalMarginTop: 30
});
});
</script>
<?php } ?>
<?php get_footer(); ?>
</div>