Exemplo n.º 1
0
function index_index()
{
    require MODELS . 'photo.php';
    require MODELS . 'users.php';
    $cur_user = users_getCurrentUser();
    $photo = photos_getAll();
    require VIEWS . "view.php";
}
Exemplo n.º 2
0
function photos_showByUser($id)
{
    require MODELS . "photo.php";
    require MODELS . "users.php";
    $cur_user = users_getCurrentUser();
    $user = users_getById($id);
    $photo = photos_getByUser($id);
    require VIEWS . 'show_photos_by_user.php';
}
Exemplo n.º 3
0
function users_logout()
{
    require MODELS . "users.php";
    $cur_user = users_getCurrentUser();
    if ($cur_user['id'] != -1) {
        $cur_user['id'] = -1;
        $cur_user['name'] = 'Guest';
        unset($_SESSION['user']);
    }
    header('location: ' . WEB);
}
Exemplo n.º 4
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';
    }
}