function insertSelect() { global $cfg, $db; authenticate('access_add'); require_once 'include/play.inc.php'; if ($cfg['player_type'] == NJB_HTTPQ) { } elseif ($cfg['player_type'] == NJB_VLC) { } elseif ($cfg['player_type'] == NJB_MPD) { $status = mpd('status'); $insPos = $status['song'] + 1; $playAfterInsert = get('playAfterInsert'); if ($status['playlistlength'] == 0) { addTracks('play'); } else { addTracks('addid', $insPos, $playAfterInsert); } } return 'add_OK'; }
$priv = getInfo($_REQUEST['id'], "private"); if ($priv == "no") { echo '<form name="mp" action="track.php?id=' . $_REQUEST['id'] . '" method="post">'; echo '<input type="hidden" name="makePrivate" value="no">'; echo '<input type="submit" onclick="document.mp.makePrivate.value=\'yes\';" style="font-weight: bold;" value="Make Track Private" title="Click here to allow users only to preview this track, not download it.">'; echo '</form>'; } else { echo '<form name="mp" action="track.php?id=' . $_REQUEST['id'] . '" method="post">'; echo '<input type="hidden" name="makePublic" value="no">'; echo '<input type="submit" onclick="document.mp.makePublic.value=\'yes\';" style="font-weight: bold;" value="Make Track Public" title="Click here to allow users to preview and download this track.">'; echo '</form>'; } echo '</td></tr>'; } if ($_REQUEST['add'] == true || inManager($_REQUEST['id'], $_SESSION['user'])) { addTracks($_SESSION['user'], $_REQUEST['id']); echo '<tr><td colspan="2" align="center"><b>This track is in <a href="manager.php">your manager</a></b></td></tr>'; } else { if (getInfo($_REQUEST['id'], 'private') == 'yes') { echo '<tr><td colspan="2" align="center">This track is private, you cannot download it at this time.</td></tr>'; } else { if (isset($_SESSION['user'])) { echo '<tr><td colspan="2" align="center"><input type="button" value="Add Track To Manager" onClick="document.addTrack.submit(); this.disabled=true;" class="addTrack"> <input type="button" value="Download Track as Single" onClick="document.downloadTrack.submit();" class="addTrack"></td></tr>'; } else { echo '<tr><td colspan="2" align="center">You must be logged in to download tracks.</td></tr>'; } } } /* echo '<tr><td colspan="2" align="center">'; $title = '<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td align="left">Comments</td></tr></table>';
if (!in_array($tracks[$i], array_slice($tracks, 0, $i))) { $newmanager .= $tracks[$i] . "\r\n"; } //Remove tracks whose ID has already been read } $file = fopen("tracks/managers/" . $_SESSION['user'] . ".manager", "w"); fwrite($file, $newmanager); fclose($file); } //Uploading tracks if (isset($_REQUEST['check']) && $error == '') { $saveTo = "tracks/managers/" . $_SESSION['user'] . "tmp.sol"; if (move_uploaded_file($_FILES['uploadedFile']['tmp_name'], $saveTo)) { $trackInfo = explode(chr(0), splitTracks($saveTo)); unlink($saveTo); addTracks($_SESSION['user'], $trackInfo[0]); } else { $error = "Error uploading your tracks"; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>