<?php
  
IF ($online == 1){
  
  IF (DB::GET_COLUMN("SELECT COUNT(*) FROM `USERS` WHERE `ID` = '".$ID."' AND `DATE_VISIT` > '".(TIME()-CONFIG('ONLINE_TIME_USERS'))."' AND `VERSION` = 'touch' LIMIT 1") == 1){
    
    $on = "<i class='fa fa-mobile' style='position: absolute; bottom: -15px; right: -0px; color: green; background-color: white; border-radius: 4px; padding: 0.1px 0.2em;'></i>";
  
  }ELSEIF (DB::GET_COLUMN("SELECT COUNT(*) FROM `USERS` WHERE `ID` = '".$ID."' AND `DATE_VISIT` > '".(TIME()-CONFIG('ONLINE_TIME_USERS'))."' AND `VERSION` = 'web' LIMIT 1") == 1){
    
    $on = "<i class='fa fa-circle' style='position: absolute; bottom: -15px; right: -3px; color: green; background-color: white; border-radius: 100%; padding: 2px; font-size: 10px;'></i>";
  
  }ELSE{
    
    $on = NULL;
    
  }
  
}ELSE{
  
  $on = NULL;

}
  
$size_text = $size / 2 - 2;

IF ($border == 1){ $bd = "border: 4px white solid;"; }ELSE{ $bd = NULL; }

ECHO "<span style='position: relative;'>";

IF (IS_FILE(ROOT.'/files/upload/photos/150x150/'.$photo['ID'].'.jpg')){
  
  ECHO "<img class='avatar' style='".$bd." font-size: ".$size_text."px; width: ".$size."px; height: ".$size."px; line-height: ".$size."px;' src='/photo/150x150/".$photo['ID_DIR']."/".$photo['ID']."/'>";
  
}ELSE{
  
  $login = MB_SUBSTR($account['LOGIN'], 0, 1, 'utf-8');
  
  ECHO "<span class='avatar' style='".$bd." font-size: ".$size_text."px; background-color: ".$user_set['AVATAR_PHONE']."; width: ".$size."px; height: ".$size."px; line-height: ".$size."px;'>".$login."</span>";
  
}

ECHO $on;

ECHO "</span>";

?>