コード例 #1
0
ファイル: index.php プロジェクト: Fznamznon/myPhotoGallery
function index_index()
{
    require MODELS . 'photo.php';
    require MODELS . 'users.php';
    $cur_user = users_getCurrentUser();
    $photo = photos_getAll();
    require VIEWS . "view.php";
}
コード例 #2
0
ファイル: photos.php プロジェクト: Fznamznon/myPhotoGallery
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';
}
コード例 #3
0
ファイル: users.php プロジェクト: Fznamznon/myPhotoGallery
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);
}
コード例 #4
0
ファイル: albums.php プロジェクト: Fznamznon/myPhotoGallery
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';
    }
}