2) {
$categories = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/categories");
array_push($categories, "unclassed");
foreach ($categories as $category) {
if ($category != "." && $category != "..") {
$shown = false;
if ($category == "unclassed") {
buffer("
");
$photos = scandir($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures");
foreach ($photos as $photo) {
if ($photo == "." || $photo == "..") {} else {
$praw = file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/data/webcontent/galery/pictures/" . $photo);
$pcat = explode("|", $praw)[1];
$ppath = explode("|", $praw)[0];
if ($pcat == $category) {
$shown = true;
if (file_exists($_SERVER['DOCUMENT_ROOT'] . $ppath)) {
buffer("
");
buffer("
");
if (isset(explode("|", $praw)[2])) {
buffer("
" . explode("|", $praw)[2] . "
");
}
buffer("
");
} else {
buffer("
");
buffer('
| ' . $lang["gallery"]["error"] . ' |
');
buffer("
");
}
}
}
}
if (!$shown) {
buffer("
" . $lang["gallery"]["nothing"] . "
");
}
buffer("
");
}
}
} else {
buffer("