ob_end_clean();
    echo <<<EOF
<?xml version="1.0" encoding="UTF-8"?><playlist version="0" xmlns = "http://xspf.org/ns/0/">
  <trackList>
{$tracklist_xml}  </trackList>
</playlist>
EOF;
    exit;
} elseif ($task == "deletesong") {
    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_delete($music_id)) {
        echo '{"result":"success"}';
    } else {
        echo '{"result":"failure"}';
    }
    exit;
} elseif ($task == "editsongtitle") {
    if (empty($user) || !$user->user_exists || !$user->level_info['level_music_allow']) {
        $is_error = 1;
    }
    if (!trim($music_title)) {
        SE_Language::_preload(4000086);
        SE_Language::load();
        $music_title = SE_Language::_get(4000086);
    }
    $music = new se_music($user->user_info['user_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
$i = "id";
// MUSIC_ID
$t = "t";
// MUSIC_TITLE
    $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']) {
    $space_left = $user->level_info['level_music_storage'] - $space_used;
} else {
    $space_left = $dfs = disk_free_space("/") ? $dfs : pow(2, 32);
}
$space_left_mb = $space_left / 1024 / 1024;
$space_left_mb = round($space_left_mb, 2);
// ASSIGN VARIABLES