<div class="row"> 
	<div class="col-md-8"> 
		<div class="read-content">
			<div class="read-article-container">
				<div class="read-article-head">
					<?php if (IS_LOGGED) { ?>
					<?php if ($pt->user_article->user_id == $pt->user->id && !PT_IsAdmin() && !$pt->user_article->active) { ?>
						<div class="alert alert-warning">
							<i class="fa fa-fw fa-exclamation-triangle"></i> {{LANG reviewed_article}}
						</div>
					<?php } ?>
					<?php } ?>
					<a class="postCategory" href="{{LINK articles/category/{{CATEGORY_ID}}}}" data-load="?link1=articles&category_id={{CATEGORY_ID}}" class="inherit"><h5>{{CATEGORY_NAME}}</h5></a>
					<h1>{{TITLE}}</h1>    
				</div>
				<div class="read-article-description">
					<article>{{DESC}}</article>
				</div>
				<div class="read-article-feat-image">
					<img src="{{IMAGE}}"/>
				</div>
				<div class="read-article-meta">
					<span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg> {{TIME}}</span>
					<span class="middot">·</span>
					<span>{{VIEWS}} {{LANG views}} </span>
			
					<?php if ($pt->user_article->active || PT_IsAdmin()) { ?>
						<span class="dropdown pull-right read-article-share">
							<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-share-2"><circle cx="18" cy="5" r="3"></circle><circle cx="6" cy="12" r="3"></circle><circle cx="18" cy="19" r="3"></circle><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"></line><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"></line></svg> {{LANG share}}</a>
							<ul class="dropdown-menu">
								<li>{{LANG share_to}}: <span id="post-shares">{{SHARED}}</span></li>
								<li>
									<span class="share-post-btn" data-toggle="tooltip" title="Facebook">
										<a href="https://www.facebook.com/sharer.php?u={{POST_ENCODED_URL}}" target="_blank">
											<div class="btn-share">
												<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#337ab7"><path d="M5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3M18,5H15.5A3.5,3.5 0 0,0 12,8.5V11H10V14H12V21H15V14H18V11H15V9A1,1 0 0,1 16,8H18V5Z"></path></svg>
											</div>
										</a>
									</span>
									<span class="share-post-btn" data-toggle="tooltip" title="Twitter">
										<a href="http://twitter.com/intent/tweet?text={{TITLE}}&url={{POST_ENCODED_URL}}" target="_blank">
											<div class="btn-share">
												<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#55acee"><path d="M22.46,6C21.69,6.35 20.86,6.58 20,6.69C20.88,6.16 21.56,5.32 21.88,4.31C21.05,4.81 20.13,5.16 19.16,5.36C18.37,4.5 17.26,4 16,4C13.65,4 11.73,5.92 11.73,8.29C11.73,8.63 11.77,8.96 11.84,9.27C8.28,9.09 5.11,7.38 3,4.79C2.63,5.42 2.42,6.16 2.42,6.94C2.42,8.43 3.17,9.75 4.33,10.5C3.62,10.5 2.96,10.3 2.38,10C2.38,10 2.38,10 2.38,10.03C2.38,12.11 3.86,13.85 5.82,14.24C5.46,14.34 5.08,14.39 4.69,14.39C4.42,14.39 4.15,14.36 3.89,14.31C4.43,16 6,17.26 7.89,17.29C6.43,18.45 4.58,19.13 2.56,19.13C2.22,19.13 1.88,19.11 1.54,19.07C3.44,20.29 5.7,21 8.12,21C16,21 20.33,14.46 20.33,8.79C20.33,8.6 20.33,8.42 20.32,8.23C21.16,7.63 21.88,6.87 22.46,6Z"></path></svg>
											</div>
										</a>
									</span>
									<span class="share-post-btn" data-toggle="tooltip" title="Google+">
										<a href="https://plus.google.com/share?url={{POST_ENCODED_URL}}" target="_blank">
											<div class="btn-share">
												<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#d9534f"><path d="M23,11H21V9H19V11H17V13H19V15H21V13H23M8,11V13.4H12C11.8,14.4 10.8,16.4 8,16.4C5.6,16.4 3.7,14.4 3.7,12C3.7,9.6 5.6,7.6 8,7.6C9.4,7.6 10.3,8.2 10.8,8.7L12.7,6.9C11.5,5.7 9.9,5 8,5C4.1,5 1,8.1 1,12C1,15.9 4.1,19 8,19C12,19 14.7,16.2 14.7,12.2C14.7,11.7 14.7,11.4 14.6,11H8Z"></path></svg>
											</div>
										</a>
									</span>
									<span class="share-post-btn" data-toggle="tooltip" title="LinkedIn">
										<a href="https://www.linkedin.com/shareArticle?mini=true&amp;url={{POST_ENCODED_URL}}" target="_blank">
											<div class="btn-share">
												<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#007bb6"><path d="M19 3A2 2 0 0 1 21 5V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V5A2 2 0 0 1 5 3H19M18.5 18.5V13.2A3.26 3.26 0 0 0 15.24 9.94C14.39 9.94 13.4 10.46 12.92 11.24V10.13H10.13V18.5H12.92V13.57C12.92 12.8 13.54 12.17 14.31 12.17A1.4 1.4 0 0 1 15.71 13.57V18.5H18.5M6.88 8.56A1.68 1.68 0 0 0 8.56 6.88C8.56 5.95 7.81 5.19 6.88 5.19A1.69 1.69 0 0 0 5.19 6.88C5.19 7.81 5.95 8.56 6.88 8.56M8.27 18.5V10.13H5.5V18.5H8.27Z"></path></svg>
											</div>
										</a>
									</span>
									<span class="share-post-btn" data-toggle="tooltip" title="Pinterest">
										<a href="http://pinterest.com/pin/create/button/?url={{POST_ENCODED_URL}}" target="_blank">
											<div class="btn-share">
												<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="#cb2027"><path d="M9.04,21.54C10,21.83 10.97,22 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2A10,10 0 0,0 2,12C2,16.25 4.67,19.9 8.44,21.34C8.35,20.56 8.26,19.27 8.44,18.38L9.59,13.44C9.59,13.44 9.3,12.86 9.3,11.94C9.3,10.56 10.16,9.53 11.14,9.53C12,9.53 12.4,10.16 12.4,10.97C12.4,11.83 11.83,13.06 11.54,14.24C11.37,15.22 12.06,16.08 13.06,16.08C14.84,16.08 16.22,14.18 16.22,11.5C16.22,9.1 14.5,7.46 12.03,7.46C9.21,7.46 7.55,9.56 7.55,11.77C7.55,12.63 7.83,13.5 8.29,14.07C8.38,14.13 8.38,14.21 8.35,14.36L8.06,15.45C8.06,15.62 7.95,15.68 7.78,15.56C6.5,15 5.76,13.18 5.76,11.71C5.76,8.55 8,5.68 12.32,5.68C15.76,5.68 18.44,8.15 18.44,11.43C18.44,14.87 16.31,17.63 13.26,17.63C12.29,17.63 11.34,17.11 11,16.5L10.33,18.87C10.1,19.73 9.47,20.88 9.04,21.57V21.54Z"></path></svg>
											</div>
										</a>
									</span>
								</li>
							</ul>
						</span>
						<span class="pull-right">
							<span onclick="PT_LikePost(this,'up');" data-post-likes="{{LIKES}}">
								<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-thumbs-up {{LIKED}}"><path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path></svg> <span>{{LIKES}}</span>
							</span>
							<span onclick="PT_LikePost(this,'down');" data-post-dislikes="{{DIS_LIKES}}">
								<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-thumbs-down {{DIS_LIKED}}"><path d="M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"></path></svg> <span>{{DIS_LIKES}}</span>
							</span>
						</span>
					<?php } ?>
				</div>
				
				<div class="read-article-text">
					{{TEXT}}
				</div>
         
				<div class="read-article-comments-container">
					<div class="comments-content content">
						<div class="comments-header">
							<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" fill="currentColor" d="M3.75 12C3.75 7.44365 7.44365 3.75 12 3.75C16.5564 3.75 20.25 7.44365 20.25 12C20.25 16.5563 16.5564 20.25 12 20.25H4.38671C4.44208 20.1609 4.49371 20.0757 4.54156 19.9941C4.76667 19.6101 4.93921 19.254 5.02614 18.8789C5.08857 18.6096 5.10413 18.4986 5.11816 18.2225C5.13874 17.8173 5.03609 17.3357 4.88542 16.7855C4.73048 16.2197 4.49527 15.4841 4.19182 14.5351L4.18591 14.5166C3.92871 13.7122 3.75 12.8456 3.75 12ZM2.25 21C2.25 20.8424 2.29861 20.6962 2.38165 20.5755C2.77429 19.9865 3.05123 19.5703 3.24752 19.2355C3.44396 18.9004 3.52846 18.6974 3.56488 18.5402C3.59038 18.4302 3.59934 18.3841 3.60482 18.345C3.6103 18.3059 3.61436 18.2592 3.62009 18.1464C3.62723 18.0059 3.58952 17.7325 3.43869 17.1817C3.29313 16.6501 3.06774 15.9447 2.75717 14.9735C2.46937 14.0734 2.25 13.0472 2.25 12C2.25 6.61522 6.61522 2.25 12 2.25C17.3848 2.25 21.75 6.61522 21.75 12C21.75 17.3848 17.3848 21.75 12 21.75H3C2.58579 21.75 2.25 21.4142 2.25 21ZM8 13C8.55228 13 9 12.5523 9 12C9 11.4477 8.55228 11 8 11C7.44772 11 7 11.4477 7 12C7 12.5523 7.44772 13 8 13ZM13 12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12C11 11.4477 11.4477 11 12 11C12.5523 11 13 11.4477 13 12ZM16 13C16.5523 13 17 12.5523 17 12C17 11.4477 16.5523 11 16 11C15.4477 11 15 11.4477 15 12C15 12.5523 15.4477 13 16 13Z"/> </svg> {{COMMENTS_COUNT}} {{LANG comments}} 
						</div>
						<?php if ($pt->user_article->active || PT_IsAdmin()) { ?>
							<form class="form submit-article-commet">
								<div class="w100 pt_blogcomm_combo">
									<?php if (IS_LOGGED): ?>
										<img class="avatar" src="{{ME avatar}}" alt="{{ME name}} avatar" />
									<?php endif; ?>
									<textarea name="text" class="form-control" placeholder="{{LANG write_your_comment}}"></textarea>
									<button class="btn" type="submit">{{LANG publish}} <svg xmlns="http://www.w3.org/2000/svg" class="btn btn-main" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z" /></svg></button>
								</div>
							</form>
							<div class="user-comments width-100" id="post-comments" style="margin-top: 20px;">
								{{COMMENTS}}
							</div>
							<?php if ($pt->count_cmt > 0): ?>
								<div class="watch-video-show-more load-comments">{{LANG show_more}}</div>
							<?php endif; ?>
						<?php } ?>
					</div>
				</div>    
			</div>
		</div>
		<div class="clear"></div>
	</div>
	<div class="col-md-4">
		<div class="ads-placment">{{WATCH_SIDEBAR_AD}}</div>
		<div class="pt_page_headr">
			<h4 class="page_head">{{LANG categories}}</h4>
		</div>
		<div class="article-categories no-padding-both">
			<div class="pt_categories">
				<ul>
					<?php foreach ($pt->categories as $cat_id => $category): ?>
						<?php if ($pt->category == $cat_id): ?>
							<li class="active">
								<a href="<?php echo PT_Link("articles/category/$cat_id") ?>" data-load="?link1=articles&category_id=<?php echo($cat_id) ?>"><span><?php echo $category; ?></span></a>
							</li>
						<?php else: ?>
							<li>
								<a href="<?php echo PT_Link("articles/category/$cat_id") ?>" data-load="?link1=articles&category_id=<?php echo($cat_id) ?>"><span><?php echo $category; ?></span></a>
							</li>
						<?php endif; ?>
					<?php endforeach; ?>
				</ul>
				<div class="clear"></div>
			</div>
		</div>
		<div class="pt_page_headr">
			<h4 class="page_head">{{LANG related_articles}}</h4>
		</div>
		<div class="ra-sidebar-body"> 
			{{RELATED_ARTICLES}}
			<div class="clear"></div>
		</div>
		<div class="pt_page_headr">
			<h4 class="page_head">{{LANG related_videos}}</h4>
		</div>
		<div class="ra-sidebar-body"> 
			{{RELATED_VIDEOS}}
			<div class="clear"></div>
		</div>
		<div class="clear"></div>
	</div>
</div>

<script>
  jQuery(window).ready(function($) {
      $.fn.scrollTo = function (speed) {
        if (typeof(speed) === 'undefined')
            speed = 500;

        $('html, body').animate({
            scrollTop: ($(this).offset().top - 100)
        }, speed);

        return $(this);
      };

      <?php if (!empty($_GET['cl']) && is_numeric($_GET['cl'])): ?>
        if ($('#comment-<?php echo($_GET['cl']); ?>').length) {
          var comment = $('#comment-<?php echo($_GET['cl']); ?>');
          comment.scrollTo().find('p').addClass('active');
          PT_Delay(function(){
            comment.find('p').removeClass('active')
          },2000);
        }
      <?php elseif(!empty($_GET['rl']) && is_numeric($_GET['rl'])): ?>
        if ($('#reply-<?php echo($_GET['rl']); ?>').length) {
          var reply  = $('#reply-<?php echo($_GET['rl']); ?>');
          reply.scrollTo().find('p').addClass('active');
          PT_Delay(function(){
            reply.find('p').removeClass('active');
          },2000);
        }
      <?php endif; ?>
  });

  jQuery(document).ready(function($) {
      $('.share-post-btn a').click(function(event) {
        $.ajax({
          url: '{{LINK aj/main/share}}',
          type: 'POST',
          dataType: 'json',
          data: {post_id: '{{ID}}'},
        })
        .done(function(data) {
          if (data.status == 200) {
            $('#post-shares').text(data.shared);
          }
        })
        .fail(function() {
          console.log("error");
        })
      });

      $(".load-comments").click(function(event) {
        var self    = $(this);
        var last_id = ($(".article-comments").length > 0) ? $(".article-comments:last").attr('data-id') : 0;
        $.ajax({
          url: '{{LINK aj/load-more-comments}}',
          type: 'POST',
          dataType: 'json',
          data: {last_id: last_id,post_id:'{{ID}}'},
        })
        .done(function(data) {
          if (data.status == 200) {
            $('#post-comments').append(data.comments);
          }
          else{
            self.text(data.message);
          }
        })
        .fail(function() {
          console.log("error");
        })
      });

      var post = '{{ID}}';
      var form = $(".submit-article-commet");
      var hash = $('.main_session').val();
      $(".submit-article-commet").ajaxForm({
          url: '{{LINK aj/add-comment}}',
          type:'POST',
          data:{post_id:'{{ID}}',hash:hash},
          beforeSend: function() {
            var query = form.find('textarea').val();

            if (!query){
               form.find('textarea').addClass('danger-field-border');
               return false;
            }

            else if(query.length > 600){
               form.find('textarea').addClass('danger-field-border');
               return false;
            }

            else if (!$('#main-container').attr('data-logged') && $('#main-url').val()) {
              window.location.href = PT_Ajax_Requests_File() + 'login?to=' + $('#main-url').val();
              return false;
            }
          },
          success: function(data) {
            if (data.status == 200) {
               if ($('.user-comments').find('.no-comments-found').length > 0) {
                  $('.user-comments').html(data.comment);
               }

               else{
                  $('.user-comments').prepend(data.comment);
               }               
               
               form.find('textarea').val('');
               form.find('textarea').removeClass('danger-field-border');
            } 
            else {
               swal(
                 'Error!',
                 'Something went wrong.Please try again later!',
                 'error'
               );
            }
          }
      });
  });

  function PT_DeleteComment(id) {
      if (!$('#main-container').attr('data-logged') && $('#main-url').val()) {
        window.location.href = PT_Ajax_Requests_File() + 'login?to=' + $('#main-url').val();
        return false;
      }

      swal({
        title: "{{LANG confirmation}}",
        text: "{{LANG delete_confirmation}}",
        type: "warning",
        confirmButtonText:"{{LANG yes_del}}",
        cancelButtonText:"{{LANG cancel}}",
        showCancelButton:true,
      })
      .then(function(willDelete){
         if (willDelete) {
            if (!id) { return false; }

            $('#comment-' + id).slideUp('fast');
            $.post('{{LINK aj/delete-comment}}', {id: id});
         }
         else {
            swal.close();
         }
      },
      function(){
         //pass
      });      
  }

  function PT_LikePost(self,type){
    if (!self || (type != 'up' && type != 'down')){
      return false;
    }

    else if (!$('#main-container').attr('data-logged') && $('#main-url').val()) {
      window.location.href = PT_Ajax_Requests_File() + 'login?to=' + $('#main-url').val();
      return false;
    }

    var self = $(self);
    $.ajax({
      url: '{{LINK aj/like-system/}}' + type,
      type: 'POST',
      dataType: 'json',
      data: {post_id: '{{ID}}'}
    })
    .done(function(data) {
      if (data.status == 200 && type == 'up' && data.code == 1){
        self.find('span').text((data.up));
        $('[data-post-dislikes]').find('span').text((data.down));
        self.find('svg.feather').addClass('active');
        self.siblings().find('svg.feather').removeClass('active');
        
      }

      else if (data.status == 200 && type == 'up' && data.code == 0){
        self.find('span').text((data.up));
        $('[data-post-dislikes]').find('span').text((data.down));
        self.find('svg.feather').removeClass('active');
        self.siblings().find('svg.feather').removeClass('active');
      }

      else if (data.status == 200 && type == 'down' && data.code == 1){
        self.find('span').text((data.down));
        self.find('svg.feather').addClass('active');
        $('[data-post-likes]').find('span').text((data.up));
        self.siblings().find('svg.feather').removeClass('active');
      }

      else if (data.status == 200 && type == 'down' && data.code == 0){
        self.find('span').text((data.down));
        self.find('svg.feather').removeClass('active');
        $('[data-post-likes]').find('span').text((data.up));
        self.siblings().find('i').removeClass('active');
      }

      else{
        swal(
           'Error!',
           'Something went wrong.Please try again later!',
           'error'
         );
      }
    })
    .fail(function() {
      console.log("error");
    })
  }
</script>