Exemple #1
0
function albums_showById($id)
{
    require MODELS . 'albums.php';
    require MODELS . 'users.php';
    $cur_user = users_getCurrentUser();
    $album = albums_getById($id);
    if ($album === false) {
        echo "Нельзя просто так взять и показать";
    } else {
        require MODELS . 'photo.php';
        $photo = photos_getByAlbum($id);
        require VIEWS . 'show_photos_by_album.php';
    }
}
Exemple #2
0
function photos_show($id)
{
    require MODELS . "photo.php";
    require MODELS . "users.php";
    require MODELS . "albums.php";
    $cur_user = users_getCurrentUser();
    $photo = photos_getById($id);
    $photo['user'] = users_getById($photo['user_id']);
    $photo['album'] = albums_getById($photo['album_id']);
    if ($photo['album'] == false) {
        $photo['album'] = ['id' => -1, 'name' => 'Без альбома'];
    }
    require VIEWS . "photo.php";
}