Ejemplo n.º 1
0
        $dir = 270;
    }
    // ROTATE IMAGE
    $album->album_media_rotate($media_id, $dir);
    // SET THUMBPATH
    $thumb_path = $url->url_userdir($user->user_info[user_id]) . $media_id . "_thumb.jpg?" . rand();
    // SEND AJAX CONFIRMATION
    echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><script type='text/javascript'>";
    echo "var img = window.parent.document.getElementById('file_{$media_id}');";
    echo "img.src = '{$thumb_path}';";
    echo "</script></head><body></body></html>";
    exit;
    // UPDATE FILES IN THIS ALBUM
} elseif ($task == "doupdate") {
    // GET TOTAL FILES
    $total_files = $album->album_files($album_info[album_id]);
    // DELETE NECESSARY FILES
    $album->album_media_delete(0, $total_files, "media_id ASC", "(media_album_id='{$album_info['album_id']}')");
    // UPDATE NECESSARY FILES
    $media_array = $album->album_media_update(0, $total_files, "media_id ASC", "(media_album_id='{$album_info['album_id']}')");
    // SET ALBUM COVER AND UPDATE DATE
    $newdate = time();
    $album_info[album_cover] = $_POST['album_cover'];
    if (!in_array($album_info[album_cover], $media_array)) {
        $album_info[album_cover] = $media_array[0];
    }
    $database->database_query("UPDATE se_albums SET album_cover='{$album_info['album_cover']}', album_dateupdated='{$newdate}' WHERE album_id='{$album_info['album_id']}'");
    // UPDATE LAST UPDATE DATE (SAY THAT 10 TIMES FAST)
    $user->user_lastupdate();
    // SHOW SUCCESS MESSAGE
    $result = 1;
Ejemplo n.º 2
0
            $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);
$smarty->assign('albums', $album_array);
include "footer.php";
Ejemplo n.º 3
0
// CHECK PRIVACY
$privacy_max = $owner->user_privacy_max($user);
if (!($album_info['album_privacy'] & $privacy_max)) {
    $page = "error";
    $smarty->assign('error_header', 639);
    $smarty->assign('error_message', 1000125);
    $smarty->assign('error_submit', 641);
    include "footer.php";
}
// UPDATE ALBUM VIEWS
if ($user->user_info[user_id] != $owner->user_info['user_id']) {
    $album_views_new = $album_info[album_views] + 1;
    $database->database_query("UPDATE se_albums SET album_views='{$album_views_new}' WHERE album_id='{$album_info['album_id']}' LIMIT 1");
}
// GET TOTAL FILES IN ALBUM
$total_files = $album->album_files($album_info['album_id'], $where);
// MAKE MEDIA PAGES
$page_vars = make_page($total_files, $media_per_page, $p);
// GET MEDIA ARRAY
$file_array = $album->album_media_list($page_vars[0], $media_per_page, $sortby, $where, $select);
// SET GLOBAL PAGE TITLE
$global_page_title[0] = 1000155;
$global_page_title[1] = $owner->user_displayname;
$global_page_title[2] = $album_info['album_title'];
$global_page_description[0] = 1000156;
$global_page_description[1] = $album_info['album_desc'];
// ASSIGN VARIABLES AND DISPLAY ALBUM PAGE
$smarty->assign('album_info', $album_info);
$smarty->assign('files', $file_array);
$smarty->assign('total_files', $total_files);
$smarty->assign('p', $page_vars[1]);
/* $Id: user_blog_album_browse.php 168 2009-05-22 23:15:00Z john $ */
$page = "user_blog_album_browse";
include "header.php";
// ENSURE ALBUMS ARE ENABLED FOR THIS USER
if (!$user->level_info['level_album_allow'] || !$user->level_info['level_blog_create']) {
    //header("Location: user_home.php");
    exit;
}
$album = new se_album($user->user_info['user_id']);
// Show albums
if (empty($_GET['album_id'])) {
    // GET ALBUMS
    $total_albums = $album->album_total();
    $album_array = $album->album_list(0, $total_albums);
    $space_used = $album->album_space();
    $total_files = $album->album_files();
    $smarty->assign('albums_total', $total_albums);
    $smarty->assign_by_ref('albums', $album_array);
} else {
    $album_id = $_GET['album_id'];
    $album_query = $database->database_query("SELECT * FROM se_albums WHERE album_id='{$album_id}' AND album_user_id='{$user->user_info['user_id']}'");
    $album_info = $database->database_fetch_assoc($album_query);
    $total_files = $album->album_files($album_info['album_id']);
    $file_array = $album->album_media_list(0, $total_files, "media_id ASC", "(media_album_id='{$album_id}')");
    $smarty->assign('album_id', $album_id);
    $smarty->assign('album_info', $album_info);
    $smarty->assign('media_total', $total_files);
    $smarty->assign('media', $file_array);
}
// ASSIGN VARIABLES AND SHOW VIEW ALBUMS PAGE
include "footer.php";