<?php get_header(); ?>
<?php global $qaleb;?>
<div class="gallery-content">
<div class="container">
<div class="wrapper">
<div class="player-right">
<?php if(get_post_meta( get_the_ID(), 'href-link-player', true )!=null){ ?>
<video poster="<?php the_post_thumbnail_url('loop-3'); ?>" src="<?php echo get_post_meta( get_the_ID(), 'href-link-player', true ); ?>" data-overlay="1"></video> 
<?php } ?>
</div>

<div class="player-left">
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php setPostViews(get_the_ID());?>
<?php the_content(); ?>
<?php endwhile; else : endif; ?>

<div class="player-download">
<?php if(get_post_meta( get_the_ID(), 'href-link-1080', true )!=null){ ?>
<li><i class="fa fa-download" aria-hidden="true"></i> <a href="<?php echo get_post_meta( get_the_ID(), 'href-link-1080', true ); ?>"> دانلود ویدئو </a><b>DOWNLOAD 1080i </b></li>
<?php } ?>
<?php if(get_post_meta( get_the_ID(), 'href-link-720', true )!=null){ ?>
<li><i class="fa fa-download" aria-hidden="true"></i><a href="<?php echo get_post_meta( get_the_ID(), 'href-link-720', true ); ?>"> دانلود ویدئو </a><b>DOWNLOAD 720i </b></li>
<?php } ?>
<?php if(get_post_meta( get_the_ID(), 'href-link-480', true )!=null){ ?>
<li><i class="fa fa-download" aria-hidden="true"></i><a href="<?php echo get_post_meta( get_the_ID(), 'href-link-480', true ); ?>"> دانلود ویدئو </a><b>DOWNLOAD 480i  </b></li>
<?php } ?>
<?php if(get_post_meta( get_the_ID(), 'href-link-360', true )!=null){ ?>
<li><i class="fa fa-download" aria-hidden="true"></i><a href="<?php echo get_post_meta( get_the_ID(), 'href-link-360', true ); ?>"> دانلود ویدئو </a><b>DOWNLOAD 360i  </b></li>
<?php } ?>
<?php if(get_post_meta( get_the_ID(), 'href-link-240', true )!=null){ ?>
<li><i class="fa fa-download" aria-hidden="true"></i><a href="<?php echo get_post_meta( get_the_ID(), 'href-link-240', true ); ?>">  دانلود ویدئو </a><b>DOWNLOAD 240i  </b></li>
<?php } ?>
</div>

</div>

</div>
</div>
</div>


<?php if($qaleb['media-social-ac']=='1'){?>
<div class="sh-are">
<a href="https://www.linkedin.com/shareArticle?mini=true&amp;url=<?php the_permalink() ?>"><div class="icon lin-sh"><i class="fa fa-linkedin"></i></div></a>
<a href="http://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>"><div class="icon dblue"><i class="fa fa-facebook"></i></div></a>
<a href="http://twitter.com/home?status=<?php the_permalink(); ?>"><div class="icon blue"><i class="fa fa-twitter"></i></div></a>
<a href="https://telegram.me/share/url?url=<?php the_permalink(); ?>"><div class="icon blue"><i class="fa fa-send-o"></i></div></a>
<a href="https://wa.me/?text=<?php the_permalink(); ?>"><div class="icon what-sh"><i class="fa fa-whatsapp"></i></div></a>
</div>
<?php } ?>

<div class="post-ga">
<div class="container">
<div class="wrapper">
<ul>
<?php if($qaleb['media-cod-ac']=='1'){?><li><i class="fa fa-file-text-o"></i> کد خبر : <?php the_ID();?></li><?php } ?>
<?php if($qaleb['media-date-ac']=='1'){?><li><i class="fa fa-calendar"></i> <?php the_date('');  ?> - <?php the_time('');  ?><?php } ?>		
<?php if(get_post_meta( get_the_ID(), 'meta-text-7', true )!=null){ ?><li><i class="fa fa-video-camera" aria-hidden="true"></i> ویدئو : <?php echo get_post_meta( get_the_ID(), 'meta-text-7', true ); ?> </li><?php } ?>
<?php if($qaleb['media-user-ac']=='1'){?><li><i class="fa fa-user" aria-hidden="true"></i> ارسال : <?php the_author_posts_link(); ?></li><?php } ?>
<?php if($qaleb['media-view-ac']=='1'){?><li><i class="fa fa-eye" aria-hidden="true"></i> بازدید : <?php echo getPostViews (get_the_ID()); ?></li><?php } ?>
<?php if($qaleb['media-comments-ac']=='1'){?><li><i class="fa fa-commenting-o" aria-hidden="true"></i>  <?php comments_popup_link('بدون دیدگاه', 'يک دیدگاه', '% دیدگاه'); ?></li><?php } ?>
<?php if($qaleb['media-link-ac']=='1'){?><li><i class="fa fa-link"></i><?php echo wp_get_shortlink(); ?></li><?php } ?>
</ul>
</div>
</div>
</div>

<div class="container">
<div class="wrapper">
<?php if($qaleb['media-ac']=='1'){?>
<div class="ap-page">
<div class="ttit">
<h3><?php echo $qaleb['relate-media-title']; ?></h3>
</div>
<div class="postlist">
<?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="item">
<div class="thumbnail">
<?php if(has_post_thumbnail()){?>
<a href="<?php the_permalink(); ?>"><img src="<?php the_post_thumbnail_url('loop-2'); ?>" alt="<?php the_title(); ?>"></a>
<?php }else{ ?>
<img src="<?php bloginfo("template_url"); ?>/img/none.png">
<?php } ?>				
 </div>
		 <div class="det">
            <div class="play"><i class="fa fa-play"></i></div>
            <p><?php the_title(); ?></p>
            <time><span><?php the_time(' d F Y ');  ?></span></time>
          </div>
           <a class="plink" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"></a> 
        </div>         
<?php endwhile; endif;  wp_reset_query(); ?>
 </div>
</div>
<?php } ?>

<div id="comments" class="comments-area">
<div class="ttit"><h3>ارسال دیدگاه</h3>
<?php if($qaleb['comments-1'] == '1'){?><b><?php $comments_count = wp_count_comments(get_the_ID()); echo "مجموع دیدگاهها : " . $comments_count->total_comments; ?></b><?php } ?>
<?php if($qaleb['comments-2'] == '1'){?><b><?php $comments_count = wp_count_comments(get_the_ID()); echo "در انتظار بررسی : " . $comments_count->moderated; ?></b><?php } ?>
<?php if($qaleb['comments-3'] == '1'){?><b>انتشار یافته : <?php comments_number('0', '1', '%' );?></b><?php } ?>
</div>
<?php comments_template(); ?>
</div>
</div>
</div>
<style>input[type=email]:not(.browser-default){width:94.5%;}.post-info{margin: 15px 0;}#comments{margin-top: 10px;}.ap_header{z-index:996;}</style>
<?php get_footer(); ?>