} else {
    $task = "main";
}
if (isset($_POST['music_id'])) {
    $music_id = $_POST['music_id'];
} elseif (isset($_GET['music_id'])) {
    $music_id = $_GET['music_id'];
}
if (isset($_POST['owner'])) {
    $owner = $_POST['owner'];
} elseif (isset($_GET['owner'])) {
    $owner = $_GET['owner'];
}
// CREATE MUSIC OBJECT
$entries_per_page = 100;
$music = new se_music();
// DELETE SONG
if ($task == "deletesong") {
    // OUTPUT
    if ($music->music_delete($music_id)) {
        echo '{"result":"success"}';
    } else {
        echo '{"result":"failure"}';
    }
    exit;
} elseif ($task == "delete_selected" && !empty($_POST['delete_entry']) && is_array($_POST['delete_entry'])) {
    foreach ($_POST['delete_entry'] as $delete_music_id) {
        $music->music_delete($delete_music_id);
    }
}
// SET MUSIC SORT-BY VARIABLES FOR HEADING LINKS
Beispiel #2
0
include "./include/functions_music.php";
// PRELOAD LANGUAGE
SE_Language::_preload(4000004);
// SET MAIN MENU VARS
$plugin_vars['menu_main'] = array('file' => 'browse_music.php', 'title' => 4000004);
// SET USER MENU VARS
if ($user->level_info['level_music_allow']) {
    $plugin_vars['menu_user'] = array('file' => 'user_music.php', 'icon' => 'music_music16.gif', 'title' => 4000004);
}
// SET PROFILE MENU VARS
if ($owner->level_info['level_music_allow'] && $page == "profile") {
    // GET USER SETTINGS
    $user->user_settings('usersetting_music_profile_autoplay,usersetting_music_site_autoplay,usersetting_xspfskin_id');
    $owner->user_settings('usersetting_music_profile_autoplay,usersetting_music_site_autoplay,usersetting_xspfskin_id');
    // GET SKIN INFO
    $owner_music = new se_music($owner->user_info['user_id']);
    $skin_info = $owner_music->skin_info($user->usersetting_info['usersetting_xspfskin_id']);
    if (!empty($skin_info)) {
        $smarty->assign('skin_title', $skin_info['xspfskin_title']);
        $smarty->assign('skin_height', $skin_info['xspfskin_height']);
        $smarty->assign('skin_width', $skin_info['xspfskin_width']);
    }
    // AUTOPLAY
    // Rules: +USER+OWNER -> TRUE, +USER-OWNER -> FALSE, -USER+OWNER -> FALSE, -USER-OWNER -> FALSE
    $smarty->assign('autoplay', $user->usersetting_info['usersetting_music_site_autoplay'] && $owner->usersetting_info['usersetting_music_profile_autoplay']);
    // SET PROFILE MENU VARS
    $owner_music_list = $owner_music->music_list();
    if (!empty($owner_music_list)) {
        $smarty->assign('music_allow', TRUE);
        $plugin_vars['menu_profile_tab'] = "";
        $plugin_vars['menu_profile_side'] = array('file' => 'profile_music.tpl', 'title' => 4000004);
    } else {
        echo '{"result":"failure"}';
    }
    exit;
} elseif ($task == "moveupsong") {
    if (empty($user) || !$user->user_exists || !$user->level_info['level_music_allow']) {
        $is_error = 1;
    }
    $music = new se_music($user->user_info['user_id']);
    // OUTPUT
    ob_end_clean();
    if (!$is_error && $music->music_moveup($music_id)) {
        echo '{"result":"success"}';
    } else {
        echo '{"result":"failure"}';
    }
    exit;
} elseif ($task == "reordermusic") {
    if (empty($user) || !$user->user_exists || !$user->level_info['level_music_allow']) {
        $is_error = 1;
    }
    $music = new se_music($user->user_info['user_id']);
    // OUTPUT
    ob_end_clean();
    if (!$is_error && $music->music_reorder($music_order)) {
        echo '{"result":"success"}';
    } else {
        echo '{"result":"failure"}';
    }
    exit;
}
    $task = $_GET['task'];
} else {
    $task = "main";
}
if (isset($_POST['music_id'])) {
    $music_id = $_POST['music_id'];
} elseif (isset($_GET['music_id'])) {
    $music_id = $_GET['music_id'];
}
// ENSURE MUSIC IS ENABLED FOR THIS USER
if (!$user->level_info['level_music_allow']) {
    header("Location: user_home.php");
    exit;
}
// CREATE MUSIC OBJECT
$music = new se_music($user->user_info['user_id']);
$musiclist = $music->music_list();
// DELETE MULTIPLE SONGS
if ($task == "dodelete") {
    for ($i = 0; $i < count($musiclist); $i++) {
        $var = "delete_music_" . $musiclist[$i]['music_id'];
        if (!empty($_POST[$var])) {
            $music->music_delete($musiclist[$i]['music_id']);
        }
    }
}
// GET PLAYLIST
$musiclist = $music->music_list();
// GET TOTAL SPACE USED
$space_used = $music->music_space();
if ($user->level_info['level_music_storage']) {
/* $Id: user_music_settings.php 42 2009-01-29 04:55:14Z john $ */
$page = "user_music_settings";
include "header.php";
if (isset($_POST['task'])) {
    $task = $_POST['task'];
} elseif (isset($_GET['task'])) {
    $task = $_GET['task'];
} else {
    $task = "main";
}
if (!$user->level_info['level_music_allow']) {
    header("Location: user_home.php");
    exit;
}
if ($task == "dosave") {
    $profile_autoplay = $_POST["profile_autoplay"];
    $site_autoplay = $_POST["site_autoplay"];
    $music_skin = $_POST["select_music_skin"];
    $sql = "\r\n    UPDATE\r\n      se_usersettings\r\n    SET\r\n      usersetting_music_profile_autoplay='{$profile_autoplay}',\r\n      usersetting_music_site_autoplay='{$site_autoplay}',\r\n      usersetting_xspfskin_id='{$music_skin}'\r\n    WHERE\r\n      usersetting_user_id='{$user->user_info['user_id']}'\r\n    LIMIT\r\n      1\r\n  ";
    $database->database_query($sql);
}
$usersettings = $database->database_fetch_assoc($database->database_query("SELECT usersetting_music_profile_autoplay, usersetting_xspfskin_id, usersetting_music_site_autoplay FROM se_usersettings WHERE usersetting_user_id = '{$user->user_info['user_id']}'"));
$music = new se_music($user->user_info['user_id']);
if ($user->level_info['level_music_allow_skins']) {
    $skins = $music->music_skin_list();
    $smarty->assign_by_ref('skins', $skins);
}
$smarty->assign('profile_autoplay', $usersettings['usersetting_music_profile_autoplay']);
$smarty->assign('site_autoplay', $usersettings['usersetting_music_site_autoplay']);
$smarty->assign('skin_id', !empty($usersettings['usersetting_xspfskin_id']) ? $usersettings['usersetting_xspfskin_id'] : 1);
include "footer.php";
Beispiel #6
0
    $v = 0;
}
// ENSURE SORT/VIEW ARE VALID
if ($s != "music_date DESC" && $s != "music_track_num ASC") {
    $s = "music_date DESC";
}
if ($v != "0" && $v != "1") {
    $v = 0;
}
// ONLY MY FRIENDS' MUSIC
if ($v == "1" && $user->user_exists) {
    // SET WHERE CLAUSE
    $where = "(\r\n    SELECT\r\n      TRUE\r\n    FROM\r\n      se_friends\r\n    WHERE\r\n      friend_user_id1={$user->user_info[user_id]} &&\r\n      friend_user_id2=se_music.music_user_id &&\r\n      friend_status=1\r\n    ) \r\n  ";
}
// CREATE ALBUM OBJECT
$music_object = new se_music();
// GET TOTAL ALBUMS
$browse_music_total = $music_object->music_list_total(NULL, NULL, $where);
// MAKE ENTRY PAGES
$music_per_page = 20;
$page_vars = make_page($browse_music_total, $music_per_page, $p);
// GET ALBUM ARRAY
$browse_music_list = $music_object->music_list($page_vars[0], $music_per_page, $s, $where);
// ASSIGN SMARTY VARIABLES AND DISPLAY MUSIC PAGE
$smarty->assign('browse_music_list', $browse_music_list);
$smarty->assign('browse_music_total', $browse_music_total);
$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($browse_music_list));
$smarty->assign('s', $s);
$page = "user_music_upload";
include "header.php";
$task = !empty($_POST['task']) ? $_POST['task'] : (!empty($_GET['task']) ? $_GET['task'] : NULL);
$isAjax = !empty($_POST['isAjax']) ? $_POST['isAjax'] : (!empty($_GET['isAjax']) ? $_GET['isAjax'] : FALSE);
// ENSURE MUSIC IS ENABLED FOR THIS USER
if (!$user->level_info['level_music_allow']) {
    header("Location: user_home.php");
    exit;
}
// SET RESULT AND ERROR VARS
$result = "";
$is_error = FALSE;
$show_uploader = TRUE;
$file_result = array();
// SET MUSIC
$music = new se_music($user->user_info['user_id']);
$music_numleft = $user->level_info['level_music_maxnum'] - $music->music_total();
// USER HAS REACHED MAX SONGS
if ($music_numleft <= 0) {
    $page = "error";
    $smarty->assign('error_header', 639);
    $smarty->assign('error_message', 4000110);
    $smarty->assign('error_submit', 641);
    include "footer.php";
}
// UPLOAD FRAME
if ($task == "doupload") {
    $isAjax = $_POST['isAjax'];
    $file_result = array();
    // WORKAROUND FOR FLASH UPLOADER
    if ($_FILES['file1']['type'] == "application/octet-stream" && $isAjax) {
// JSON INCLUDES
if ($isAjax && !function_exists('json_encode')) {
    include_once "include/xmlrpc/xmlrpc.inc";
    include_once "include/xmlrpc/xmlrpcs.inc";
    include_once "include/xmlrpc/xmlrpc_wrappers.inc";
    include_once "include/jsonrpc/jsonrpc.inc";
    include_once "include/jsonrpc/jsonrpcs.inc";
    include_once "include/jsonrpc/json_extension_api.inc";
}
// SET RESULT AND ERROR VARS
$result = "";
$is_error = FALSE;
$show_uploader = FALSE;
$file_result = array();
// SET MUSIC
$music = new se_music($user->user_info['user_id']);
// UPLOAD FRAME
if ($task == "doupload") {
    $isAjax = $_POST['isAjax'];
    $file_result = array();
    // WORKAROUND FOR FLASH UPLOADER
    if ($_FILES['file1']['type'] == "application/octet-stream" && $isAjax) {
        $file_types = explode(",", str_replace(" ", "", strtolower($user->level_info['level_music_mimes'])));
        $_FILES['file1']['type'] = $file_types[0];
    }
    // GET TOTAL SPACE USED
    $space_used = $music->music_space();
    if ($user->level_info[level_music_storage]) {
        $space_left = $user->level_info['level_music_storage'] - $space_used;
    } else {
        $space_left = $dfs = disk_free_space("/") ? $dfs : pow(2, 32);
function he_wall_music_upload()
{
    global $user, $url;
    if (!$user->level_info['level_music_allow']) {
        return array('result' => 0, 'error' => SE_Language::get(690706066));
    }
    $music = new se_music($user->user_info['user_id']);
    $music_numleft = $user->level_info['level_music_maxnum'] - $music->music_total();
    // GET TOTAL SPACE USED
    $space_used = $music->music_space();
    if ($user->level_info['level_music_storage']) {
        $space_left = $user->level_info['level_music_storage'] - $space_used;
    } else {
        $space_left = $dfs = disk_free_space("/") ? $dfs : pow(2, 32);
    }
    $file_result = $music->music_upload('wall_music', $space_left);
    if (!$file_result['is_error']) {
        $file_path = $url->url_userdir($user->user_info['user_id']) . $file_result['music_id'] . '.' . $file_result['music_ext'];
        $file_url = str_replace('./', $url->url_base, $file_path);
        // UPDATE LAST UPDATE DATE (SAY THAT 10 TIMES FAST)
        $user->user_lastupdate();
        $result = array('result' => 1, 'file_url' => $file_url, 'title' => $file_result['music_title'], 'music_id' => $file_result['music_id']);
    } else {
        $error_msg = sprintf(SE_Language::_get($file_result['is_error']), $file_result['file_name']);
        $result = array('result' => 0, 'error' => $error_msg);
    }
    return $result;
}
include "./include/class_music.php";
include "./include/functions_music.php";
// PRELOAD LANGUAGE
SE_Language::_preload(4000004);
// SET MAIN MENU VARS
$plugin_vars['menu_main'] = array('file' => 'browse_music.php', 'title' => 4000004);
if ($user->user_exists && $user->level_info['level_music_allow']) {
    $plugin_vars['menu_user'] = array('file' => 'user_music.php', 'icon' => 'music_music16.gif', 'title' => 4000004);
}
// SET PROFILE MENU VARS
if ($owner->level_info['level_music_allow'] && $page == "profile") {
    // GET USER SETTINGS
    $user->user_settings('usersetting_music_profile_autoplay,usersetting_music_site_autoplay,usersetting_xspfskin_id');
    $owner->user_settings('usersetting_music_profile_autoplay,usersetting_music_site_autoplay,usersetting_xspfskin_id');
    // GET SKIN INFO
    $owner_music = new se_music($owner->user_info['user_id']);
    if ($owner->level_info['level_music_allow_skins']) {
        $skin_info = $owner_music->skin_info($owner->usersetting_info['usersetting_xspfskin_id']);
    } else {
        $skin_info = $owner_music->skin_info($owner->level_info['level_xpfskin_default']);
    }
    if (!empty($skin_info)) {
        $smarty->assign('skin_title', $skin_info['xspfskin_title']);
        $smarty->assign('skin_height', $skin_info['xspfskin_height']);
        $smarty->assign('skin_width', $skin_info['xspfskin_width']);
    }
    // AUTOPLAY
    // Rules: +USER+OWNER -> TRUE, +USER-OWNER -> FALSE, -USER+OWNER -> FALSE, -USER-OWNER -> FALSE
    $smarty->assign('autoplay', $user->usersetting_info['usersetting_music_site_autoplay'] && $owner->usersetting_info['usersetting_music_profile_autoplay']);
    // SET PROFILE MENU VARS
    $owner_music_list = $owner_music->music_list();