}
// ENSURE ALBUMS ARE ENABLED FOR THIS USER
if ($user->level_info[level_album_allow] == 0) {
    header("Location: user_home.php");
    exit;
}
// BE SURE ALBUM BELONGS TO THIS USER
$album = $database->database_query("SELECT * FROM se_albums WHERE album_id='{$album_id}' AND album_user_id='" . $user->user_info[user_id] . "'");
if ($database->database_num_rows($album) != 1) {
    header("Location: user_album.php");
    exit;
}
$album_info = $database->database_fetch_assoc($album);
// SET VARS
$result = 0;
$album = new se_album($user->user_info[user_id]);
// ROTATE
if ($task == "rotate") {
    $media_id = $_GET['media_id'];
    $dir = $_GET['dir'];
    if ($dir == "cc") {
        $dir = 90;
    } else {
        $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'>";
Example #2
0
if (isset($_GET['album_id'])) {
    $album_id = $_GET['album_id'];
} else {
    $album_id = 0;
}
// SET VARS
$media_per_page = 20;
// GET ALBUM INFO
$album_query = $database->database_query("SELECT * FROM se_albums WHERE album_id='{$album_id}' AND album_user_id='{$owner->user_info['user_id']}'");
if ($database->database_num_rows($album_query) != 1) {
    header("Location: " . $url->url_create('albums', $owner->user_info['user_username']));
    exit;
}
$album_info = $database->database_fetch_assoc($album_query);
// CREATE ALBUM OBJECT
$album = new se_album($owner->user_info['user_id']);
// SET WHERE/SORTBY
$where = "(media_album_id='{$album_info['album_id']}')";
$sortby = "media_order ASC";
$select = "";
// GET CUSTOM ALBUM STYLE IF ALLOWED
if ($owner->level_info['level_album_style'] != 0) {
    $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'];
}
// 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);
Example #3
0
    $page = "error";
    $smarty->assign('error_header', 639);
    $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
Example #4
0
$page = "user_album";
include "header.php";
if (isset($_POST['task'])) {
    $task = $_POST['task'];
} elseif (isset($_GET['task'])) {
    $task = $_GET['task'];
} else {
    $task = "main";
}
// ENSURE ALBUMS ARE ENABLED FOR THIS USER
if ($user->level_info[level_album_allow] == 0) {
    header("Location: user_home.php");
    exit;
}
// CREATE ALBUM OBJECT
$album = new se_album($user->user_info[user_id]);
// BE SURE ALBUM BELONGS TO THIS USER, DELETE ALBUM
if ($task == "delete") {
    $album_id = $_GET['album_id'];
    if ($database->database_num_rows($database->database_query("SELECT album_id FROM se_albums WHERE album_id='{$album_id}' AND album_user_id='" . $user->user_info[user_id] . "'")) == 1) {
        $album->album_delete($album_id);
    }
    // MOVE ALBUM UP
} elseif ($task == "moveup") {
    $album_id = $_GET['album_id'];
    $album_query = $database->database_query("SELECT album_id, album_order FROM se_albums WHERE album_id='{$album_id}' AND album_user_id='" . $user->user_info[user_id] . "'");
    if ($database->database_num_rows($album_query) == 1) {
        $album_info = $database->database_fetch_assoc($album_query);
        $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);
// INCLUDE ALBUM FILES
include "./include/class_album.php";
include "./include/functions_album.php";
// PRELOAD LANGUAGE
SE_Language::_preload_multi(1000007, 1000123, 1000137);
// SET MENU VARS
if ($user->user_exists && $user->level_info['level_album_allow'] || !$user->user_exists && $setting['setting_permission_album']) {
    $plugin_vars['menu_main'] = array('file' => 'browse_albums.php', 'title' => 1000123);
}
if ($user->user_exists && $user->level_info['level_album_allow']) {
    $plugin_vars['menu_user'] = array('file' => 'user_album.php', 'icon' => 'album_album16.gif', 'title' => 1000007);
}
// SET PROFILE MENU VARS
if ($owner->level_info['level_album_allow'] && $page == "profile") {
    // START ALBUM
    $album = new se_album($owner->user_info['user_id']);
    $sort = "album_id DESC";
    // GET PRIVACY LEVEL AND SET WHERE
    $album_privacy_max = $owner->user_privacy_max($user);
    $where = "(album_privacy & {$album_privacy_max})";
    // GET TOTAL ALBUMS
    $total_albums = $album->album_total($where);
    // GET ALBUM ARRAY
    $albums = $album->album_list(0, $total_albums, $sort, $where);
    // ASSIGN ALBUMS SMARY VARIABLE
    $smarty->assign('albums', $albums);
    $smarty->assign('total_albums', $total_albums);
    // SET PROFILE MENU VARS
    if ($total_albums) {
        // DETERMINE WHERE TO SHOW ALBUMS
        $level_album_profile = explode(",", $owner->level_info['level_album_profile']);
Example #6
0
            $profile_viewers = $views['profileview_viewers'];
        }
        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) {
    $task = $_POST['task'];
} elseif (isset($_GET['task'])) {
    $task = $_GET['task'];
} else {
    $task = "main";
}
if (isset($_POST['album_id'])) {
    $album_id = $_POST['album_id'];
} elseif (isset($_GET['album_id'])) {
    $album_id = $_GET['album_id'];
} else {
    $album_id = 0;
}
// CREATE ALBUM OBJECT
$albums_per_page = 100;
$album = new se_album();
// DELETE ALBUM
if ($task == "deletealbum") {
    if ($database->database_num_rows($database->database_query("SELECT album_id FROM se_albums WHERE album_id='{$album_id}'")) == 1) {
        $album->album_delete($album_id);
    }
}
// SET ALBUM SORT-BY VARIABLES FOR HEADING LINKS
$i = "id";
// ALBUM_ID
$t = "t";
// ALBUM_TITLE
$u = "u";
// OWNER OF ALBUM
$f = "f";
// FILES IN ALBUM
Example #8
0
<?php

$page = "user_album_add";
include "header.php";
$task = isset($_POST['task']) ? $_POST['task'] : NULL;
// ENSURE ALBUMS ARE ENABLED FOR THIS USER
if (!$user->level_info['level_album_allow']) {
    header("Location: user_home.php");
    exit;
}
// CHECK THAT MAX ALBUMS HAVEN'T BEEN REACHED
$album = new se_album($user->user_info['user_id']);
$total_albums = $album->album_total();
if ($total_albums >= $user->level_info['level_album_maxnum']) {
    $task = "main";
}
// GET PRIVACY SETTINGS
$level_album_privacy = unserialize($user->level_info['level_album_privacy']);
rsort($level_album_privacy);
$level_album_comments = unserialize($user->level_info['level_album_comments']);
rsort($level_album_comments);
$level_album_tag = unserialize($user->level_info['level_album_tag']);
rsort($level_album_tag);
// SET VARS
$is_error = 0;
$album_title = "";
$album_desc = "";
$album_search = 1;
$album_privacy = $level_album_privacy[0];
$album_comments = $level_album_comments[0];
$album_tag = $level_album_tag[0];
$page = "user_blog_album_upload";
include "header.php";
$task = !empty($_POST['task']) ? $_POST['task'] : (!empty($_GET['task']) ? $_GET['task'] : NULL);
$album_id = !empty($_POST['album_id']) ? $_POST['album_id'] : (!empty($_GET['album_id']) ? $_GET['album_id'] : FALSE);
$isAjax = !empty($_POST['isAjax']) ? $_POST['isAjax'] : (!empty($_GET['isAjax']) ? $_GET['isAjax'] : FALSE);
$result = 0;
$is_error = 0;
$show_uploader = FALSE;
// 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;
}
// GET ALBUMS
$album = new se_album($user->user_info['user_id']);
if ($task == "doupload") {
    // CREATE NEW ALBUM IF SELECTED
    if (!$album_id) {
        $level_album_privacy = unserialize($user->level_info['level_album_privacy']);
        $level_album_comments = unserialize($user->level_info['level_album_comments']);
        $level_album_tag = unserialize($user->level_info['level_album_tag']);
        $album_title = censor($_POST['album_title']);
        $album_desc = '';
        $album_privacy = $level_album_privacy[0];
        $album_comments = $level_album_comments[0];
        $album_tag = $level_album_tag[0];
        $album_datecreated = time();
        // Untitled
        if (empty($album_title)) {
            $album_title = SE_Language::get(1500015);
Example #10
0
define('SE_PAGE_AJAX', TRUE);
$page = "album_ajax";
include "header.php";
// This is ajax
header("Content-Type: application/json");
// Get info (post only)
$task = isset($_POST['task']) ? $_POST['task'] : NULL;
$album_id = isset($_POST['album_id']) ? $_POST['album_id'] : NULL;
$media_id = isset($_POST['media_id']) ? $_POST['media_id'] : NULL;
// Must be logged in to use tasks below this section
if (!$user->user_exists) {
    echo json_encode(array('result' => FALSE, 'err' => 1));
    exit;
}
// Create album object
$album = new se_album($user->user_info['user_id']);
// Album delete
if ($task == "album_delete") {
    // Verify album exists and user is owner
    $sql = "SELECT album_id FROM se_albums WHERE album_id='{$album_id}' AND album_user_id='{$user->user_info['user_id']}'";
    $resource = $database->database_query($sql);
    if (!$database->database_num_rows($resource)) {
        echo json_encode(array('result' => FALSE, 'err' => 2));
        exit;
    }
    // Execute
    $album->album_delete($album_id);
    echo json_encode(array('result' => TRUE));
    exit;
} elseif ($task == "album_moveup") {
    // Verify album exists and user is owner
// ENSURE SORT/VIEW ARE VALID
if ($s != "album_datecreated DESC" && $s != "album_dateupdated DESC") {
    $s = "album_dateupdated DESC";
}
if ($v != "0" && $v != "1") {
    $v = 0;
}
// SET WHERE CLAUSE
$where = "CASE\r\n\t    WHEN se_albums.album_user_id='{$user->user_info[user_id]}'\r\n\t      THEN TRUE\r\n\t    WHEN ((se_albums.album_privacy & @SE_PRIVACY_REGISTERED) AND '{$user->user_exists}'<>0)\r\n\t      THEN TRUE\r\n\t    WHEN ((se_albums.album_privacy & @SE_PRIVACY_ANONYMOUS) AND '{$user->user_exists}'=0)\r\n\t      THEN TRUE\r\n\t    WHEN ((se_albums.album_privacy & @SE_PRIVACY_FRIEND) AND (SELECT TRUE FROM se_friends WHERE friend_user_id1=se_albums.album_user_id AND friend_user_id2='{$user->user_info['user_id']}' AND friend_status='1' LIMIT 1))\r\n\t      THEN TRUE\r\n\t    WHEN ((se_albums.album_privacy & @SE_PRIVACY_SUBNET) AND '{$user->user_exists}'<>0 AND (SELECT TRUE FROM se_users WHERE user_id=se_albums.album_user_id AND user_subnet_id='{$user->user_info['user_subnet_id']}' LIMIT 1))\r\n\t      THEN TRUE\r\n\t    WHEN ((se_albums.album_privacy & @SE_PRIVACY_FRIEND2) AND (SELECT TRUE FROM se_friends AS friends_primary LEFT JOIN se_users ON friends_primary.friend_user_id1=se_users.user_id LEFT JOIN se_friends AS friends_secondary ON friends_primary.friend_user_id2=friends_secondary.friend_user_id1 WHERE friends_primary.friend_user_id1=se_albums.album_user_id AND friends_secondary.friend_user_id2='{$user->user_info['user_id']}' AND se_users.user_subnet_id='{$user->user_info['user_subnet_id']}' LIMIT 1))\r\n\t      THEN TRUE\r\n\t    ELSE FALSE\r\n\tEND";
// ONLY MY FRIENDS' ALBUMS
if ($v == "1" && $user->user_exists) {
    // SET WHERE CLAUSE
    $where .= " AND (SELECT TRUE FROM se_friends WHERE friend_user_id1='{$user->user_info['user_id']}' AND friend_user_id2=se_albums.album_user_id AND friend_status=1)";
}
// CREATE ALBUM OBJECT
$album = new se_album();
// GET TOTAL ALBUMS
$total_albums = $album->album_total($where);
// MAKE ENTRY PAGES
$albums_per_page = 10;
$page_vars = make_page($total_albums, $albums_per_page, $p);
// GET ALBUM ARRAY
$album_array = $album->album_list($page_vars[0], $albums_per_page, $s, $where);
// ASSIGN SMARTY VARIABLES AND DISPLAY ALBUMS PAGE
$smarty->assign('albums', $album_array);
$smarty->assign('total_albums', $total_albums);
$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($album_array));
$smarty->assign('s', $s);
function he_wall_photo_upload($media_desc, $new_action_id)
{
    global $user, $url, $misc, $setting;
    if (!$user->level_info['level_album_allow']) {
        return array('result' => 0, 'error' => SE_Language::get(690706067));
    }
    $album_id = he_wall::get_wall_album($user->user_info['user_id']);
    if (!$album_id) {
        //create new album
        $album_id = he_wall::create_wall_album($user->user_info['user_id']);
    }
    $album_info = he_wall::get_wall_album_info($album_id);
    // SET ALBUM
    $album = new se_album($user->user_info['user_id']);
    // GET TOTAL SPACE USED
    $space_used = $album->album_space();
    if ($user->level_info['level_album_storage']) {
        $space_left = $user->level_info['level_album_storage'] - $space_used;
    } else {
        $space_left = $dfs = disk_free_space("/") ? $dfs : pow(2, 32);
    }
    $new_album_cover = '';
    $file_result = $album->album_media_upload('wall_photo', $album_id, $space_left);
    if (!$file_result['is_error']) {
        $new_album_cover = $file_result['media_id'];
        $media_path = $url->url_base . substr($url->url_userdir($user->user_info['user_id']), 2) . $file_result['media_id'] . "_thumb.jpg";
        $local_media_path = substr($url->url_userdir($user->user_info['user_id']), 2) . $file_result['media_id'] . "_thumb.jpg";
        if (file_exists('./' . $local_media_path)) {
            $thumb_width = (int) $setting['setting_he_wall_photo_thumb_width'];
            $thumb_height = (int) $setting['setting_he_wall_photo_thumb_height'];
            $media_width = $misc->photo_size($local_media_path, $thumb_width, $thumb_height, "w");
            $media_height = $misc->photo_size($local_media_path, $thumb_width, $thumb_height, "h");
            $result = array('result' => 1, 'media_path' => $media_path, 'media_width' => $media_width, 'media_height' => $media_height);
        } else {
            $result = array('result' => 0, 'error' => './' . $local_media_path);
        }
        $new_album_cover = $album_info['album_cover'] ? $album_info['album_cover'] : $new_album_cover;
        he_wall::update_wall_album($album_id, $new_album_cover);
        he_wall::update_wall_album_media($file_result['media_id'], $media_desc);
        he_wall::add_wall_album_media($new_action_id, $file_result['media_id']);
        // UPDATE LAST UPDATE DATE (SAY THAT 10 TIMES FAST)
        $user->user_lastupdate();
    } else {
        $error_msg = sprintf(SE_Language::_get($file_result['is_error']), $file_result['file_name']);
        $result = array('result' => 0, 'error' => $error_msg);
    }
    return $result;
}
    $album_id = 0;
}
// ENSURE ALBUMS ARE ENABLED FOR THIS USER
if (!$user->level_info['level_album_allow']) {
    header("Location: user_home.php");
    exit;
}
// BE SURE ALBUM BELONGS TO THIS USER
$album = $database->database_query("SELECT * FROM se_albums WHERE album_id='{$album_id}' AND album_user_id='{$user->user_info['user_id']}' LIMIT 1");
if (!$database->database_num_rows($album)) {
    header("Location: user_album.php");
    exit;
}
$album_info = $database->database_fetch_assoc($album);
// SET ALBUM
$album = new se_album($user->user_info['user_id']);
// SET RESULT AND ERROR VARS
$result = "";
$is_error = 0;
$show_uploader = 1;
$file_result = array();
// GET TOTAL SPACE USED
$space_used = $album->album_space();
if ($user->level_info['level_album_storage']) {
    $space_left = $user->level_info['level_album_storage'] - $space_used;
} else {
    $space_left = $dfs = disk_free_space("/") ? $dfs : pow(2, 32);
}
// UPLOAD FILES
if ($task == "doupload") {
    $isAjax = $_POST['isAjax'];
<?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);
}