Ejemplo n.º 1
0
    $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";
Ejemplo n.º 2
0
        }
        if ($user->user_exists) {
            $profile_viewers_array = explode(",", $profile_viewers);
            if (in_array($user->user_info['user_id'], $profile_viewers_array)) {
                array_splice($profile_viewers_array, array_search($user->user_info['user_id'], $profile_viewers_array), 1);
            }
            $profile_viewers_array[] = $user->user_info['user_id'];
            krsort($profile_viewers_array);
            $profile_viewers = implode(",", array_filter($profile_viewers_array));
        }
    }
    $database->database_query("INSERT INTO se_profileviews (profileview_user_id, profileview_views, profileview_viewers) VALUES ('{$owner->user_info['user_id']}', '1', '{$profile_viewers}') ON DUPLICATE KEY UPDATE profileview_views=profileview_views+1, profileview_viewers='{$profile_viewers}'");
}
// CREATE ALBUM OBJECT
$album = new se_album($owner->user_info['user_id']);
$fotos = $album->album_media_list(0, 4, "media_id DESC", "media_ext = 'jpg' or media_ext = 'jpeg' or media_ext = 'gif' or media_ext = 'png' or media_ext = 'bmp'");
/*echo "<pre>";
print_r($fotos);
echo "</pre>";
die();
*/
// DELETE COMMENT NOTIFICATIONS IF VIEWING COMMENT PAGE
if ($v == "comments" && $user->user_info['user_id'] == $owner->user_info['user_id']) {
    $database->database_query("DELETE FROM se_notifys WHERE notify_user_id='{$owner->user_info['user_id']}' AND notify_notifytype_id='3' AND notify_object_id='{$owner->user_info['user_id']}'");
}
// GET PROFILE COMMENTS
$comment = new se_comment('profile', 'user_id', $owner->user_info['user_id']);
$comments = $comment->comment_list(0, 30);
$total_comments = $comment->comment_total();
foreach ($comments as &$comment) {
    $num_month = date("n", $comment['comment_date']);
Ejemplo n.º 3
0
    $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]);
$smarty->assign('maxpage', $page_vars[2]);
$smarty->assign('p_start', $page_vars[0] + 1);
$smarty->assign('p_end', $page_vars[0] + count($file_array));
include "footer.php";
/* $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";