Exemplo n.º 1
0
    $smarty->assign('error_message', 828);
    $smarty->assign('error_submit', 641);
    include "footer.php";
}
// ENSURE ALBUMS ARE ENABLED FOR THIS USER
if (!$owner->level_info['level_album_allow']) {
    header("Location: " . $url->url_create('profile', $owner->user_info['user_username']));
    exit;
}
// SET PRIVACY LEVEL AND WHERE CLAUSE
$privacy_max = $owner->user_privacy_max($user);
$where = "(album_privacy & {$privacy_max})";
// CREATE ALBUM OBJECT
$album = new se_album($owner->user_info['user_id']);
// GET TOTAL ALBUMS
$total_albums = $album->album_total($where);
// GET ALBUM ARRAY
$album_array = $album->album_list(0, $total_albums, "album_order ASC", $where);
// GET CUSTOM ALBUM STYLE IF ALLOWED
if ($owner->level_info['level_album_style']) {
    $albumstyle_info = $database->database_fetch_assoc($database->database_query("SELECT albumstyle_css FROM se_albumstyles WHERE albumstyle_user_id='{$owner->user_info['user_id']}' LIMIT 1"));
    $global_css = $albumstyle_info['albumstyle_css'];
}
// SET GLOBAL PAGE TITLE
$global_page_title[0] = 1000160;
$global_page_title[1] = $owner->user_displayname;
$global_page_description[0] = 1000161;
$global_page_description[1] = $owner->user_displayname;
// ASSIGN SMARTY VARIABLES AND DISPLAY ALBUMS PAGE
$smarty->assign('albums', $album_array);
$smarty->assign('total_albums', $total_albums);
    $media_query = $database->database_query("SELECT media_id, media_order, media_album_id FROM se_media LEFT JOIN se_albums ON se_media.media_album_id=se_albums.album_id WHERE media_id='{$media_id}' AND se_albums.album_user_id='" . $user->user_info[user_id] . "'");
    if ($database->database_num_rows($media_query) == 1) {
        $media_info = $database->database_fetch_assoc($media_query);
        $prev_query = $database->database_query("SELECT media_id, media_order FROM se_media LEFT JOIN se_albums ON se_media.media_album_id=se_albums.album_id WHERE se_media.media_album_id='{$media_info['media_album_id']}' AND se_albums.album_user_id='" . $user->user_info[user_id] . "' AND media_order<{$media_info['media_order']} ORDER BY media_order DESC LIMIT 1");
        if ($database->database_num_rows($prev_query) == 1) {
            $prev_info = $database->database_fetch_assoc($prev_query);
            // SWITCH ORDER
            $database->database_query("UPDATE se_media SET media_order={$prev_info['media_order']} WHERE media_id={$media_info['media_id']}");
            $database->database_query("UPDATE se_media SET media_order={$media_info['media_order']} WHERE media_id={$prev_info['media_id']}");
            // SEND AJAX CONFIRMATION
            echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><script type='text/javascript'>";
            echo "window.parent.reorderMedia('{$media_info['media_id']}', '{$prev_info['media_id']}');";
            echo "</script></head><body></body></html>";
            exit;
        }
    }
}
// SHOW FILES IN THIS ALBUM
$total_files = $album->album_files($album_info[album_id]);
$file_array = $album->album_media_list(0, $total_files, "media_order ASC", "(media_album_id='{$album_info['album_id']}')");
// GET LIST OF OTHER ALBUMS
$total_albums = $album->album_total("album_id<>'{$album_info['album_id']}'");
$album_array = $album->album_list(0, $total_albums, "album_order ASC", "album_id<>'{$album_info['album_id']}'");
// ASSIGN VARIABLES AND SHOW UDPATE ALBUMS PAGE
$smarty->assign('result', $result);
$smarty->assign('files', $file_array);
$smarty->assign('files_total', $total_files);
$smarty->assign('album_info', $album_info);
$smarty->assign('albums', $album_array);
$smarty->assign('albums_total', $total_albums);
include "footer.php";
Exemplo n.º 3
0
        $prev_query = $database->database_query("SELECT album_id, album_order FROM se_albums WHERE album_user_id='" . $user->user_info[user_id] . "' AND album_order<'" . $album_info[album_order] . "' ORDER BY album_order DESC LIMIT 1");
        if ($database->database_num_rows($prev_query) == 1) {
            $prev_info = $database->database_fetch_assoc($prev_query);
            // SWITCH ORDER
            $database->database_query("UPDATE se_albums SET album_order='" . $prev_info[album_order] . "' WHERE album_id='" . $album_info[album_id] . "'");
            $database->database_query("UPDATE se_albums SET album_order='" . $album_info[album_order] . "' WHERE album_id='" . $prev_info[album_id] . "'");
            // SEND AJAX CONFIRMATION
            echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><script type='text/javascript'>";
            echo "window.parent.reorderAlbum('{$album_info['album_id']}', '{$prev_info['album_id']}');";
            echo "</script></head><body></body></html>";
            exit;
        }
    }
}
// GET ALBUMS
$total_albums = $album->album_total();
$album_array = $album->album_list(0, $total_albums, "album_order ASC");
$space_used = $album->album_space();
$total_files = $album->album_files();
// CALCULATE SPACE FREE, CONVERT TO MEGABYTES
if ($user->level_info[level_album_storage]) {
    $space_free = $user->level_info[level_album_storage] - $space_used;
} else {
    $space_free = $dfs = disk_free_space("/") ? $dfs : pow(2, 32);
}
$space_free = $space_free / 1024 / 1024;
$space_free = round($space_free, 2);
// ASSIGN VARIABLES AND SHOW VIEW ALBUMS PAGE
$smarty->assign('space_free', $space_free);
$smarty->assign('total_files', $total_files);
$smarty->assign('albums_total', $total_albums);