
<style type="text/css">
  .new_left_right .content_main_wrapper {
    width: calc( 100vw);
    margin-left: 280px;
  }
  .container-home {
    padding: 0 20px;
  }
  .container-home.links-container{
    padding-left: 0;
    padding-right: 0;
  }
</style>
<div class="profile-container">
	<div class="pt_main_chnl_hdrr">
  <div class="card-container" style="overflow: hidden;">
    <div class="cover-container">
      <img src="{{USER cover}}" alt="{{USER name}}">
		<?php if ($pt->isowner == true) { ?>
			<div class="edit-cover-container hidden">
				<a href="{{LINK settings/avatar}}" data-load="?link1=settings&page=avatar">
					<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M4,4H7L9,2H15L17,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9Z" /></svg>
				</a>
        <?php if ($pt->profile_user->ex_cover != 'upload/photos/d-cover.jpg') { ?>
				<span class="btn btn-upload-image btn-file" onclick="PT_StartRepositioner();">
					<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M21,15H23V17H21V15M21,11H23V13H21V11M23,19H21V21C22,21 23,20 23,19M13,3H15V5H13V3M21,7H23V9H21V7M21,3V5H23C23,4 22,3 21,3M1,7H3V9H1V7M17,3H19V5H17V3M17,19H19V21H17V19M3,3C2,3 1,4 1,5H3V3M9,3H11V5H9V3M5,3H7V5H5V3M1,11V19A2,2 0 0,0 3,21H15V11H1M3,19L5.5,15.79L7.29,17.94L9.79,14.72L13,19H3Z" /></svg>
				</span>
        <?php } ?>
			</div>
		<?php } ?>
    </div>
    <?php if ($pt->isowner == true) { ?>
    <div class="cover-container-2">
		<img src="{{USER full_cover}}" alt="{{USER name}}">
		<div class="user-reposition-dragable-container">
			<span class="btn btn-upload-image btn-file" onclick="Wo_SubmitRepositioner();">
				<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z" /></svg>
			</span>
			<span class="btn btn-upload-image btn-file" onclick="PT_StopRepositioner();">
				<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>
			</span>
		</div>
		<div class="user-cover-uploading-progress user-repositioning-icons-container"></div>
    </div>
    <form class="cover-position-form hidden" method="post">
        <input class="cover-position" name="pos" value="0" type="hidden">
        <input name="user_id" value="{{USER id}}" type="hidden">
    </form>
    <?php } ?>
    
		<?php if (!empty($pt->profile_user->facebook) || !empty($pt->profile_user->google) || !empty($pt->profile_user->twitter)) { ?>
		<div class="share-video">
			<?php if (!empty($pt->profile_user->facebook)) { ?><a href="{{USER facebook}}" class="fa fa-facebook" target="_blank"></a><?php } ?>
			<?php if (!empty($pt->profile_user->google)) { ?><a href="{{USER google}}" class="fa fa-google" target="_blank"></a><?php } ?>
			<?php if (!empty($pt->profile_user->twitter)) { ?><a href="{{USER twitter}}" class="fa fa-twitter" target="_blank"></a><?php } ?>
			<?php if (!empty($pt->profile_user->instagram)) { ?><a href="{{USER instagram}}" class="fa fa-instagram" target="_blank"></a><?php } ?>
		</div>
		<?php } ?>
		
  </div>
  <div class="pt_chnl_info container-home">
    <div class="profile_avatar">
      <div class="avatar-container">
        <img src="{{USER avatar}}" alt="{{USER name}}">
      </div>
      <div class="info-container new_class_sub">
        <h4>
			<a href="{{USER url}}" data-load="?link1=timeline&id={{USER username}}">{{USER name_v}}
				<?php if ($pt->profile_user->is_pro > 0 && !empty($pt->pro_packages[$pt->profile_user->pro_type])) { ?>
				<span class="icon_pro">
					<svg xmlns="http://www.w3.org/2000/svg" width="42" height="20" viewBox="0 0 42 20">
					  <g id="pro" transform="translate(-1739 -2240)">
					    <rect id="bg" width="42" height="20" rx="8" transform="translate(1739 2240)" fill="#3f90cf"/>
					    <text id="PRO-2" data-name="PRO" transform="translate(1760.053 2254.134)" fill="#fff" font-size="12" font-weight="500"><tspan x="-11" y="0">PRO</tspan></text>
					  </g>
					</svg>
				</span>
				<?php } ?>
			</a>
        </h4>
		<?php if ($pt->profile_user->privacy->show_subscriptions_count == 'yes') { ?><span>{{SUBS}} {{LANG subscribers}}</span><?php } ?>
        
      </div>
     
    </div>
    <div class="profile_button_avatar">
      <!-- {{MESSAGE_BUTTON}} -->
	 {{BLOCK_BUTTON}}
	 {{MESSAGE_BUTTON}}
      
      <!-- {{BLOCK_BUTTON}} -->
      {{NOTIFY_BUTTON}}
      <?php if ($pt->profile_user->privacy->show_subscriptions_count == 'yes') { ?>
          <div class="subscribe-btn-container">
            {{SUBSCIBE_BUTTON}}
          </div>
      <?php } ?>
    </div>
  </div>
  <div class="links-container container-home">
    <ul>
      <li>
        <a href="{{LINK @{{USER username}}?page=videos}}" class="<?php echo ($pt->second_page == 'videos') ? 'active' : ''?>" data-load="?link1=timeline&id={{USER username}}&page=videos">{{LANG videos}}</a>
      </li>
      <li>
        <a href="{{LINK @{{USER username}}?page=play-lists}}" class="<?php echo ($pt->second_page == 'play-lists') ? 'active' : ''?>" data-load="?link1=timeline&id={{USER username}}&page=play-lists">{{LANG play_lists}}</a>
      </li>
      <?php if ($pt->config->shorts_system == 'on') { ?>
      <li>
        <a href="{{LINK @{{USER username}}?page=shorts}}" class="<?php echo ($pt->second_page == 'shorts') ? 'active' : ''?>" data-load="?link1=timeline&id={{USER username}}&page=shorts">{{LANG shorts}}</a>
      </li>
      <?php } ?>
      <li>
        <a href="{{LINK @{{USER username}}?page=liked-videos}}" class="<?php echo ($pt->second_page == 'liked-videos') ? 'active' : ''?>" data-load="?link1=timeline&id={{USER username}}&page=liked-videos">{{LANG liked_videos}}</a>
      </li>
      <?php if ($pt->config->post_system == 'on') { ?>
      <li>
        <a href="{{LINK @{{USER username}}?page=activities}}" class="<?php echo ($pt->second_page == 'activities') ? 'active' : ''?>" data-load="?link1=timeline&id={{USER username}}&page=activities">{{LANG activities}}</a>
      </li>
      <?php } ?>
      <li>
        <a href="{{LINK @{{USER username}}?page=about}}" class="<?php echo ($pt->second_page == 'about') ? 'active' : ''?>" data-load="?link1=timeline&id={{USER username}}&page=about">{{LANG about_profile}}</a>
      </li>
    </ul>
  </div>
  </div>
  <div class="page-container content pt_main_chnl_content container-home">
    {{SECOND_PAGE}}
  </div>
  <input type="hidden" id="profile-id" value="{{USER id}}">
</div>


<script type="text/javascript">
  $('.cover-container, .edit-cover-container').hover(function() { 
      $('.edit-cover-container').removeClass('hidden'); 
  });
  $('.cover-container, .edit-cover-container').mouseleave(function() {                  
     $('.edit-cover-container').addClass('hidden'); 
  });
  
  $('.avatar-container, .edit-avatar-container').hover(function() { 
      $('.edit-avatar-container').removeClass('hidden'); 
  });
  $('.avatar-container, .edit-avatar-container').mouseleave(function() {                  
     $('.edit-avatar-container').addClass('hidden'); 
  });
  function PT_StartRepositioner() {
    $('.cover-container').hide();
    $('.cover-container-2').show();
    $('.cover-container-2 img').css('cursor', '-webkit-grab').draggable({
      scroll: false,
      axis: "y",
      cursor: "-webkit-grab",
      drag: function (event, ui) {
        y1 = $('.cover-container-2').height();
        y2 = $('.cover-container-2').find('img').height();
        if (ui.position.top >= 0) {
            ui.position.top = 0;
        }else{
          if (ui.position.top <= (y1-y2)) {
              ui.position.top = y1-y2;
          }
        }
      },
      stop: function(event, ui) {
          $('input.cover-position').val(ui.position.top);
      }
    });
  }

  function PT_StopRepositioner() {
    $('.cover-container').show();
    $('.cover-container-2').hide();
  }

  function Wo_SubmitRepositioner() {
      if ($('input.cover-position').length == 1) {
          posY = $('input.cover-position').val();
          $('form.cover-position-form').submit();
      }
  }
  $('form.cover-position-form').ajaxForm({
        url:  '{{LINK aj/user/re_cover}}?hash=' + $('.main_session').val(),
        dataType:  'json', 
        beforeSend: function() {
            $('.user-reposition-dragable-container').hide();
            $('.user-repositioning-icons-container1').show();
            $('.user-repositioning-icons-container').html('<div class="pace-activity-parent"><div class="pace-activity"></div></div>').fadeIn('fast');
        },
        success: function(data) {
            if (data.status == 200) {
              $('.cover-container img').attr('src', data.url + '?time=' + Math.random()).on("load", function () {
                $('.cover-container').show();
                $('.cover-container-2').hide();
                $('.user-reposition-dragable-container').show();
                $('.user-repositioning-icons-container1').fadeOut('fast');
                $('.user-repositioning-icons-container').fadeOut('fast').html('');
              });
            }
        }
    });

</script>

<?php if (!empty($pt->profile_user->google_tracking_code)) { ?>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=<?php echo($pt->profile_user->google_tracking_code) ?>"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', '<?php echo($pt->profile_user->google_tracking_code) ?>');
</script>

<?php } ?>