"; $query = "SELECT value FROM " . SETTINGSTABLE . " WHERE parameter='CHRISTMAS'"; $sth = $globaldbh->prepare($query); $sth->execute(); $row = $sth->fetch(); $data['christmas'] = ($row['value'] == 'true') ? true : false; $query = "SELECT value FROM " . SETTINGSTABLE . " WHERE parameter='CHRISTMASFREQ'"; $sth = $globaldbh->prepare($query); $sth->execute(); $row = $sth->fetch(); $data['christmasfreq'] = $row['value']; $query = "SELECT songid FROM " . RECENTSTABLE . " ORDER BY timeplayed DESC limit 15"; $sth = $globaldbh->prepare($query); $sth->execute(); $data['volume'] = getSystemVolume(); system("HOME=" . WEBUSERHOMEDIR . " && ../scripts/homeaudio_togglemute.pl -show", $retval); $data['muted'] = ($retval == 0) ? false : true; $data['currentsong'] = array("art"=>"", "title"=>"", "artist"=>"", "album"=>"", "year"=>""); $data['songlist'] = ""; $firstsong = true; while ( $row = $sth->fetch() ) { $song = new Song($row['songid']); if ( $firstsong ) { $data['currentsong']["art"] = $song->getArtFile(ARTURL); $data['currentsong']["title"] = $song->getTitle(HTMLSAFE); $data['currentsong']["artist"] = $song->getArtist(HTMLSAFE); $data['currentsong']["album"] = $song->getAlbum(HTMLSAFE); $data['currentsong']["year"] = $song->getYear(HTMLSAFE); $firstsong = false; } else { $data['songlist'] .= "
\n"; $data['songlist'] .= "
\n"; $data['songlist'] .= "
\n"; $data['songlist'] .= "

Title: {$song->getTitle(HTMLSAFE)}

\n"; $data['songlist'] .= "

Artist: {$song->getArtist(HTMLSAFE)}

\n"; $data['songlist'] .= "

Album: {$song->getAlbum(HTMLSAFE)}

\n"; $data['songlist'] .= "
\n"; $data['songlist'] .= "
\n"; $data['songlist'] .= "
\n"; } } if ( $debug ) { var_dump($data); echo ""; } else { echo json_encode($data); } exit(); ?>