}
 // 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);
 }
 // RUN FILE UPLOAD FUNCTION FOR EACH SUBMITTED FILE
 $action_music = array();
 for ($file_index = 1; $file_index < 6; $file_index++) {
     $file_param = "file{$file_index}";
     if (empty($_FILES[$file_param]['name'])) {
         continue;
     }
     $file_result[$file_param] = $music->music_upload($file_param, $space_left);
     if (!$file_result[$file_param]['is_error']) {
         $file_result[$file_param]['message'] = 4000085;
         // INSERT ACTION
         $actions->actions_add($user, "newmusic", array($user->user_info['user_username'], $user->user_displayname));
         // UPDATE LAST UPDATE DATE (SAY THAT 10 TIMES FAST)
         $user->user_lastupdate();
     } else {
         $file_result[$file_param]['message'] = $file_result[$file_param]['is_error'];
     }
     SE_Language::_preload($file_result[$file_param]['message']);
 }
 // OUTPUT JSON RESULT
 if ($isAjax) {
     SE_Language::load();
     if (!$file_result['file1']['is_error']) {
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;
}