<?php
  
$sql = "SELECT `PHOTOS`.`ID`,`PHOTOS`.`ID_DIR` FROM `PHOTOS` LEFT JOIN `PHOTOS_DIR` ON (`PHOTOS_DIR`.`ID` = `PHOTOS`.`ID_DIR` OR `PHOTOS_DIR`.`ID_DIR` = `PHOTOS`.`ID_DIR`) AND `PHOTOS`.`USER_ID` = '".$user['ID']."' WHERE `PRIVATE` = '0' GROUP BY `PHOTOS`.`ID`";
  
$count = DB::GET_STRING_ALL($sql);

$photo_i = 0;

WHILE ($count->FETCH()){ $photo_i++; }

ECHO "<a href='/modules/?path=photos&section=users&id=".$user['ID']."'><div class='list-menu hover'>"; 

S_ICONS('camera', 'small', '#46C04A', '#39993D');

ECHO " <span class='menu-icons-optimize'>".LG('Фото')." <span class='count'>".$photo_i."</span></span>";

ECHO "</div></a>";
  
?>