<?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`) WHERE `PRIVATE` = '0' GROUP BY `PHOTOS`.`ID`";
  
$count = DB::GET_STRING_ALL($sql);

$photo_i = 0;

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

ECHO "<li class='main-wrapper'><a href='/modules/?path=photos' class='main2'>"; 

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

IF ($photo_i > 5000){
  
  $photo_count = "5000+";
  
}ELSE{
  
  $photo_count = $photo_i;

}

ECHO "<span class='menu-list-text-main'>".LG('Фотоальбомы')."</span>";

ECHO "<span class='menu-list-count-main'>".$photo_count."</span>";

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