<?php
  
/*
-----------------
Удаление заставки
-----------------
*/
  
IF (GET('get') == 'delete'){
  
  @UNLINK(ROOT.'/files/upload/screensaver/source/'.$settings['SCREENSAVER'].'');
  @UNLINK(ROOT.'/files/upload/screensaver/850x200/'.$settings['SCREENSAVER'].'');
  
  DB::GET_SET("UPDATE `USERS_SETTINGS` SET `SCREENSAVER` = '".NULL."' WHERE `USER_ID` = '".$user['ID']."' LIMIT 1");
  
  REDIRECT('/id'.$user['ID'].'');

}

/*
---------------------------
Заставка на личной странице
---------------------------
*/ 

ECHO "<div style='position: relative;'>";
  
ECHO "<div id='sreensaver_upgrade'>";

IF (IS_FILE(ROOT.'/files/upload/screensaver/850x200/'.$account_settings['SCREENSAVER'].'')) {
  
  ECHO "<img src='/files/upload/screensaver/850x200/".$account_settings['SCREENSAVER']."' style='width: 100%;'>";
  
}ELSE{
  
  IF ($account['SEX'] == 2){
    
    ECHO "<img src='/files/upload/screensaver/no_screen_saver/woman.jpg' style='width: 100%;'>";
    
  }ELSE{
    
    ECHO "<img src='/files/upload/screensaver/no_screen_saver/man.jpg' style='width: 100%;'>";
  
  }
  
}

ECHO "</div><br /><br />";

//Аватар
REQUIRE (ROOT.'/users/profile/account/plugins/avatar.php');

IF ($account['ID'] == $user['ID']){
  
  ?><a id="upload-screensaver" class="btn-screensaver" onclick="modal_open('#screensaver')" load="none"><?=ICONS('image', 13, 'fa-fw')?></a><?
  
  /*
  -----------------------
  Выгрузка новой заставки
  -----------------------
  */
  
  ECHO "<div class='overlay'>";
  
  ECHO "<div class='modal' id='screensaver'>";
  
  ECHO "<div class='modal-title'>";
  ECHO "<b>".LG('Новая заставка')."</b>";
  ?><a onclick="modal_close('#screensaver')" load="none" class="btn-modal-close"><?=ICONS('times', 20, 'fa-fw')?></a><?
  ECHO "</div>";
  
  ECHO "<div class='modal-optimize'>";
  
  ECHO "<div class='list-menu'>";
  
  ECHO "<div id='upload-screensaver-show'></div>";

  ECHO "</div>";
  
  ECHO "</div>";
  
  ECHO "</div>";
  
  ECHO "</div>";
  
}

ECHO "</div>";
  
?>