<?php get_header(); ?>
<?php global $qaleb;?>
<div id="President">
<div class="container">
<section id="entry-content">

<div id="player-main">
<div id="thumbbil">
<?php if(has_post_thumbnail()){?>
<img src="<?php the_post_thumbnail_url('loop3'); ?>">
<?php }else{ ?>
<img src="<?php bloginfo("template_url"); ?>/img/none.png">
<?php } ?>
</div>
<div id="divMain"><div id="play-sound"></div></div>
</div>
<div class="titlem"><h3><?php wp_title(""); ?></h3></div>
<div class="player-bottom">
<?php if($qaleb['downs-ac']=='1'){?> 
<div data-dropdown="#basic" class="btn-download"><i class="fa fa-download" aria-hidden="true"></i> <?php echo $qaleb['downs-title']; ?></div>
<div class="dropdown-menu dropdown-anchor-top-left dropdown-has-anchor" id="basic">
	<ul>
	    <?php if(get_post_meta( get_the_ID(), 'href-link-320', true )!=null){ ?>
		<li><a href="<?php echo get_post_meta( get_the_ID(), 'href-link-320', true ); ?>">دانلود با کیفیت <span>320</span></a></li>
		<?php } ?>
		<?php if(get_post_meta( get_the_ID(), 'href-link-128', true )!=null){ ?>
		<li><a href="<?php echo get_post_meta( get_the_ID(), 'href-link-128', true ); ?>">دانلود با کیفیت <span>128</span></a></li>
		<?php } ?>
	</ul>
</div>
<?php } ?>
<?php if($qaleb['sound-social-ac']=='1'){?><div data-toggle="modal" data-target="#left_modal_xs" class="btn-download"><i class="fa fa-share-alt" aria-hidden="true"></i> اشتراک گذاری</div><?php } ?>
<?php if(get_post_meta( get_the_ID(), 'time-sound', true )!=null){ ?><div class="video-list"><i class="fa fa-clock-o" aria-hidden="true"></i> <?php echo get_post_meta( get_the_ID(), 'time-sound', true ); ?></div><?php } ?>
<?php if($qaleb['sound-date-ac']=='1'){?><div class="video-list"><i class="fa fa-calendar"></i> <?php the_time(' d F Y ');  ?></div><?php } ?>
<?php if($qaleb['sound-view-ac']=='1'){?><div class="video-list"><i class="fa fa-pie-chart" aria-hidden="true"></i> <?php echo getPostViews(get_the_ID()); ?></div><?php } ?>
<?php if($qaleb['sound-comments-ac']=='1'){?><div class="video-list"><i class="fa fa-comment" aria-hidden="true"></i>  <?php comments_popup_link('بدون دیدگاه', 'يک دیدگاه', '% دیدگاه'); ?></div><?php } ?>
<?php if($qaleb['sound-user-ac']=='1'){?><div class="video-list"><i class="fa fa-user" aria-hidden="true"></i> <?php the_author_posts_link(); ?></div><?php } ?>
<?php if($qaleb['sound-cod-ac']=='1'){?><div class="video-list"><i class="fa fa-file-text-o"></i> کد مطلب : <?php the_ID();?></div><?php } ?>
</div>
<div class="contentt">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php setPostViews(get_the_ID()); ?>
<?php the_content(); ?>
<?php endwhile; else : endif; ?>
</div>
<?php get_template_part('inc/post/sound'); ?>
<?php comments_template(); ?>
</section>
<section id="entry-saidbar">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar-single') ) : ?><?php endif; ?>
</section>
</div>
<div class="lin"></div>
</div>

<?php if($qaleb['sound-social-ac']=='1'){?>
<div class="modal modal-left xs fade" id="left_modal_xs" tabindex="-1" role="dialog" aria-labelledby="top_modal">
  <div class="modal-dialog modal-sm modal-dialog-centered" role="document">
    <div class="modal-content h-auto rounded-right">
      <div class="modal-header">
        <h5 class="modal-title"><i class="fa fa-share-alt"></i> به اشتراک بگذارید</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body text-center">
		<a href="http://twitter.com/home?status=<?php the_permalink(); ?>" class="btn-twitter tooltip tooltip-top" data-iro="توییتر"><i class="fa fa-twitter"></i></a>
		<a href="http://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>" class="btn-facebook tooltip tooltip-top" data-iro="فیسبوک"><i class="fa fa-facebook"></i></a>
		<a href="http://plus.google.com/share?url=<?php the_permalink(); ?>" class="btn-plus tooltip tooltip-top" data-iro="گوگل پلاس"><i class="fa fa-google-plus" aria-hidden="true"></i></a>
		<a href="https://www.linkedin.com/shareArticle?mini=true&amp;url=<?php the_permalink() ?>" class="btn-linkedin tooltip tooltip-top" data-iro="لینکداین"><i class="fa fa-linkedin"></i></a>
		<a href="https://telegram.me/share/url?url=<?php the_permalink(); ?>" class="btn-telegram tooltip tooltip-top" data-iro="تلگرام"><i class="fa fa-send-o"></i></a>
		<a href="https://wa.me/?text=<?php the_permalink(); ?>" class="btn-whatsapp tooltip tooltip-top" data-iro="واتساپ"><i class="fa fa-whatsapp"></i></a>  
      </div>	  
<?php if($qaleb['sound-link-ac']=='1'){?>
    <div class="item-cop">
        <div class="texxt"><?php echo wp_get_shortlink(); ?></div>
        <div class="coop" data-text="کپی" data-text-copied="کپی شد">
            <i class="fa fa-files-o" aria-hidden="true"></i>
            <span>کپی</span>
        </div>
    </div>
<?php } ?>	  	  
    </div>
  </div>
</div>
<?php } ?>

<?php if(get_post_meta( get_the_ID(), 'href-link-320i', true )!=null){ ?>
<script>
$(document).ready(function(){
var player1 = $('#play-sound').jsRapAudio({
	src:'<?php echo get_post_meta( get_the_ID(), 'href-link-320i', true ); ?>',
	autoplay:true,
	loop:true,
	onEnded:function(){
		console.log('onEnded');
	},
	onLoadedmetadata:function(){
		console.log(this.audio.duration);
	},
	onVolumechange:function(){
		console.log(this.audio.volume);
	}
});
});
</script>
<?php } ?>
<?php get_footer(); ?>
<?php if($qaleb['sound-link-ac']=='1'){?>
<script>
    $('div').copiq({
        parent: '.item-cop',
        content: '.texxt',
        onSuccess: function($element, source, selection) {
            $('span', $element).text($element.attr("data-text-copied"));
            setTimeout(function() {
                $('span', $element).text($element.attr("data-text"));
            }, 2000);
        }
    });
</script>
<?php } ?>