diff --git a/README.md b/README.md index a4ca286..50df2a3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,10 @@ # HomeAudio -A PHP and PERL based "jukebox style" home audio system for Linux. \ No newline at end of file +A PHP and PERL based "jukebox style" home audio system for Linux. + +## Installation + +* The **homeaudio.ini** file from the **/scripts/** folder needs to be edited and saved in **/etc/**. Make sure it is ONLY readable by the web server user. +* The [getID3](https://github.com/JamesHeinrich/getID3) project needs to be added somewhere in a folder included by PHP. +* The **tables.sql** file needs to be imported into the database referenced in the **homeaudio.ini** file. +* The **art/** folder needs to be writable by the web server user. diff --git a/ajax_listsongs.php b/ajax_listsongs.php index 93a7fe7..0b8f62e 100644 --- a/ajax_listsongs.php +++ b/ajax_listsongs.php @@ -28,7 +28,7 @@ $query = "SELECT songid FROM " . RECENTSTABLE . " ORDER BY timeplayed DESC limit $sth = $globaldbh->prepare($query); $sth->execute(); $data['volume'] = getSystemVolume(); -system("HOME=/home/web && scripts/homeaudio_togglemute.pl -show", $retval); +system("HOME=" . WEBUSERHOMEDIR . " && scripts/homeaudio_togglemute.pl -show", $retval); $data['muted'] = ($retval == 0) ? false : true; $data['songplaying'] = ""; $data['songlist'] = ""; diff --git a/ajax_togglemute.php b/ajax_togglemute.php index 7a1f141..aa9952a 100644 --- a/ajax_togglemute.php +++ b/ajax_togglemute.php @@ -1,9 +1,9 @@ diff --git a/functions.php b/functions.php index efc29a2..e7526f2 100644 --- a/functions.php +++ b/functions.php @@ -8,7 +8,7 @@ function setSystemVolume($newvol = null) { global $globaldbh; if ( is_null($newvol) ) return false; - system("HOME=/home/web && /usr/bin/amixer -q sset Master " . $newvol); + system("HOME=" . WEBUSERHOMEDIR . " && /usr/bin/amixer -q sset Master " . $newvol); $query = "UPDATE " . SETTINGSTABLE . " SET value=:value WHERE parameter='CURVOLUME'"; $fields = array(); $fields[':value'] = $newvol; diff --git a/vtest.php b/vtest.php index 3ad14ed..280fb9c 100644 --- a/vtest.php +++ b/vtest.php @@ -6,7 +6,7 @@ require 'functions.php'; echo "
"; //$curvol = getSystemVolume(); -$curvol = shell_exec("HOME=/home/web && amixer sget Master"); +$curvol = shell_exec("HOME=" . WEBUSERHOMEDIR . " && amixer sget Master"); echo "Current Volume: '", $curvol, "'\n";