summaryrefslogtreecommitdiffstats
path: root/localplay.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-04-09 04:28:56 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-04-09 04:28:56 +0000
commit7b1e57d0ccdda52881645f7c16f42ceb5da15881 (patch)
treef5ab9bcad4009845e4bc99010b195207084b3abf /localplay.php
parentde5f1c00d30c01d7e8628dafe8e4c02b2f3c61ea (diff)
downloadampache-7b1e57d0ccdda52881645f7c16f42ceb5da15881.tar.gz
ampache-7b1e57d0ccdda52881645f7c16f42ceb5da15881.tar.bz2
ampache-7b1e57d0ccdda52881645f7c16f42ceb5da15881.zip
fixed playlist add problem and a few other minor bugs
Diffstat (limited to 'localplay.php')
-rw-r--r--localplay.php80
1 files changed, 22 insertions, 58 deletions
diff --git a/localplay.php b/localplay.php
index 4e9b66d0..816f40c4 100644
--- a/localplay.php
+++ b/localplay.php
@@ -20,15 +20,9 @@
*/
-/*!
- @header Song Document
- @discussion Actually play files from albums, artists or just given
- a bunch of id's.
- Special thanx goes to Mike Payson and Jon Disnard for the means
- to do this.
-*/
require('modules/init.php');
+
/* If we are running a demo, quick while you still can! */
if (conf('demo_mode')) {
exit();
@@ -36,59 +30,29 @@ if (conf('demo_mode')) {
$web_path = conf('web_path');
-if($user->prefs['play_type'] != 'local_play') {
- show_template('header');
- echo "<span align=\"center\" class=\"fatalerror\">Localplay Currently Disabled</span>";
- show_footer();
- exit;
+if($GLOBALS['user']->prefs['localplay_level'] < 1) {
+ access_denied();
+ exit();
}
-switch($_REQUEST['submit'])
-{
- case ' X ':
- $action = "stop";
- break;
- case ' > ':
- $action = "play";
- break;
- case ' = ':
- $action = "pause";
- break;
- case '|< ':
- $action = "prev";
- break;
- case ' >|':
- $action = "next";
- break;
- case (substr_count($_REQUEST['submit'],"+") == '1'):
- $amount = trim(substr($_REQUEST['submit'],2,strlen($_REQUEST['submit']-2)));
- $action = "volplus";
+/* Scrub in the action */
+$action = scrub_in($_REQUEST['action']);
+
+show_template('header');
+
+
+switch ($action) {
+ case 'delete_songs':
+
+
break;
- case (substr_count($_REQUEST['submit'],"-") == '1'):
- $amount = trim(substr($_REQUEST['submit'],2,strlen($_REQUEST['submit']-2)));
- $action = "volminus";
- break;
- case 'clear':
- $action = "clear";
- break;
- case 'start':
- $action = "start";
- break;
- case 'kill':
- $action = "kill";
- break;
- default:
- echo _("Unknown action requested") . ": '$_REQUEST[submit]'<br />";
- exit;
-}
-$systr = conf('localplay_'.$action);
-$systr = str_replace("%AMOUNT%",$amount,$systr);
-if (conf('debug')) { log_event($user->username,'localplay',"Exec: $systr"); }
-@exec($systr, $output);
-$web_path = conf('web_path');
-if($output)
- print_r($output);
-else
- header("Location: $web_path");
+ default:
+ require_once (conf('prefix') . '/templates/show_localplay.inc.php');
+ break;
+} // end switch action
+
+
+
+show_footer();
?>