foreach ($prefs['multihosts'] as $host => $def) { print '<div class="pref styledinputs">'; print '<input id="host' . $c . '" type="radio" name="currenthost" value="' . $host . '" onclick="displaySettings(event)"'; if ($host == $prefs['currenthost']) { print ' checked'; } print '><label for="host' . $c . '">' . $host . '</label></div>'; $c++; } print '<p>' . get_int_text("setup_ipaddress") . '<br>'; print '<input type="text" name="mpd_host" value="' . $prefs['mpd_host'] . '" /></p>'; print '<p>' . get_int_text("setup_port") . '<br>'; print '<input type="text" name="mpd_port" value="' . $prefs['mpd_port'] . '" /></p>'; print '<p>' . get_int_text("setup_password") . '<br>'; print '<input type="text" name="mpd_password" value="' . $prefs['mpd_password'] . '" /></p>'; print '<p>' . get_int_text("setup_unixsocket") . '<br>'; print '<input type="text" name="unix_socket" value="' . $prefs['unix_socket'] . '" /></p>'; print '<hr class="dingleberry" />'; print '<h3>Collection Settings</h3>'; print '<div class="pref styledinputs"><input id="dblite" type="radio" name="collection_type" value="sqlite"'; if (array_key_exists('collection_type', $prefs) && $prefs['collection_type'] == "sqlite") { print " checked"; } print '><label for="dblite">Lite Database Collection</label></div>'; print '<p class="tiny">Full featured but may be slow with a large collection</p>'; print '<div class="pref styledinputs"><input id="dbsql" type="radio" name="collection_type" value="mysql"'; if (array_key_exists('collection_type', $prefs) && $prefs['collection_type'] == "mysql") { print " checked"; } print '><label for="dbsql">Full Database Collection</input></label>'; print '<p class="tiny">Fast and full featured - requires MySQL Server:</p>';
<label for="lastfm_autocorrect">' . get_int_text('config_autocorrect') . '</label> </div> <div class="pref">' . get_int_text('config_tagloved') . ' <input class="prefinput saveotron" id="autotagname" type="text" size="40" /> </div>'; // Tags and Ratings print '<div class="textcentre configtitle"> <b>' . get_int_text('config_tagrat') . '</b> </div> <div class="pref styledinputs"> <input class="autoset toggle" type="checkbox" id="synctags"> <label for="synctags">' . get_int_text('config_synctags') . '</label>'; ?> </div> <div class="pref containerbox dropdown-container"> <?php print '<div class="divlabel styledinputs"><input class="autoset toggle" type="checkbox" id="synclove"> <label for="synclove">' . get_int_text('config_loveis') . '</label></div>'; ?> <div class="selectholder"><select id="synclovevalueselector" class="saveomatic"> <?php print '<option value="5">5 ' . get_int_text('stars') . '</option> <option value="4">4 ' . get_int_text('stars') . '</option> <option value="3">3 ' . get_int_text('stars') . '</option> <option value="2">2 ' . get_int_text('stars') . '</option> <option value="1">1 ' . get_int_text('star') . '</option>'; ?> </select> </div></div>
</div> </td> <td align="center"> <div class="togglecontainer"> <div class="togglebutton clickicon clickreplaygain icon-toggle-off" id="replaygain_auto"></div> </div> </td> </tr> </table> <?php } else { print '<table width="90%" align="center"><tr>'; print '<td align="center"><div class="togglecontainer"><div class="togglediv">' . get_int_text('button_random') . '</div></td>'; print '<td align="center"><div class="togglecontainer"><div class="togglediv">' . get_int_text('button_repeat') . '</div></td>'; print '<td align="center"><div class="togglecontainer"><div class="togglediv">' . get_int_text('button_consume') . '</div></td>'; print '</tr><tr>'; print '<td align="center"><div class="togglecontainer"> <div class="togglebutton clickicon icon-toggle-off" id="random" ' . 'onclick="player.controller.toggleRandom()"></div></div></td>'; print '<td align="center"> <div class="togglecontainer"><div class="togglebutton clickicon icon-toggle-off" ' . 'id="repeat" onclick="player.controller.toggleRepeat()"></div></div></td>'; print '<td align="center"> <div class="togglecontainer"><div class="togglebutton clickicon icon-toggle-off" ' . 'id="consume" onclick="player.controller.toggleConsume()"></div></div></td>'; print '</tr></table>'; } ?> <hr> </div> <div id="pscroller"> <div id="sortable" class="noselection fullwidth noborder"> </div>
<?php foreach ($sterms as $label => $term) { print '<div class="containerbox padright dropdown-container">'; print '<div class="fixed searchlabel"><span class="slt"><b>' . ucwords(strtolower(get_int_text($label))) . '</b></span></div>'; print '<div class="expand"><input class="searchterm enter" name="' . $term . '" type="text" /></div>'; print '</div>'; } ?> <div class="containerbox padright dropdown-container combobox"> </div> <div class="containerbox padright dropdown-container"> <?php print '<div class="fixed searchlabel"><b>' . get_int_text("label_rating") . '</b></div> <div class="expand selectholder"> <select name="searchrating"> <option value="5">5 ' . get_int_text('stars') . '</option> <option value="4">4 ' . get_int_text('stars') . '</option> <option value="3">3 ' . get_int_text('stars') . '</option> <option value="2">2 ' . get_int_text('stars') . '</option> <option value="1">1 ' . get_int_text('star') . '</option> <option value="" selected></option> </select> </div> </div>'; print '<div class="styledinputs">'; print '<div class="containerbox padright" style="margin-top:0.5em;margin-bottom:0.5em"><b>' . get_int_text('label_displayresultsas') . '</b></div>'; print '<input type="radio" class="topcheck savulon" name="displayresultsas" value="collection" id="resultsascollection"> <label for="resultsascollection">' . ucfirst(get_int_text('label_resultscollection')) . '</label><br/> <input type="radio" class="topcheck savulon" name="displayresultsas" value="tree" id="resultsastree"> <label for="resultsastree">' . ucfirst(get_int_text('label_resultstree')) . '</label> </div>';
cleanSearchTables(); prepareCollectionUpdate(); doCollection($cmd, $domains); createAlbumsList(); dumpAlbums($_REQUEST['dump']); } close_mpd(); } else { if (array_key_exists('browsealbum', $_REQUEST)) { include "player/mpd/connection.php"; include "collection/collection.php"; $doing_search = true; $domains = array(); $a = preg_match('/(a|b)(.*?)(\\d+|root)/', $_REQUEST['browsealbum'], $matches); if (!$a) { print '<h3>' . get_int_text("label_general_error") . '</h3>'; debuglog('Browse Album Failed - regexp failed to match ' . $_REQUEST['browsealbum'], "DUMPALBUMS", 3); return false; } $why = $matches[1]; $what = $matches[2]; $who = $matches[3]; $albumlink = get_albumlink($who); $cmd = 'find file "' . $albumlink . '"'; debuglog("Doing Album Browse : " . $cmd, "MPD"); prepareCollectionUpdate(); doCollection($cmd, $domains); createAlbumsList(); if (preg_match('/^.+?:album:/', $albumlink)) { print do_tracks_from_database($why, $what, $who, true); } else {
function dumpAlbums($which) { global $divtype, $prefs; $a = preg_match('/(a|b)(.*?)(\\d+|root)/', $which, $matches); if (!$a) { print '<h3>' . get_int_text("label_general_error") . '</h3>'; debuglog('Artist dump failed - regexp failed to match ' . $which, "DUMPALBUMS", 3); return false; } $why = $matches[1]; $what = $matches[2]; $who = $matches[3]; $count = null; switch ($who) { case 'root': if ($why == 'a') { collectionStats(); } else { searchStats(); } $divtype = "album1"; switch ($what) { case 'artist': $count = do_artists_from_database($why, $what, $who); break; case 'album': case 'albumbyartist': $count = do_albums_from_database($why, 'album', $who, false, false); break; } if ($count == 0) { if ($why == 'a') { emptyCollectionDisplay(); } else { emptySearchDisplay(); } } break; default: switch ($what) { case 'artist': do_albums_from_database($why, 'album', $who, false, false); break; case 'album': do_tracks_from_database($why, $what, $who, false); break; } } }
<div id="collectionsearcher" style="padding:6px"> <?php $sterms = array("label_artist" => "artist", "label_album" => "album", "label_track" => "title", "label_genre" => "genre", "musicbrainz_date" => "date", "label_composer" => "composer", "label_performer" => "performer", "label_filename" => "file", "label_anything" => "any"); include "skins/search.php"; print '<div class="podoptions dropdown-container styledinputs" style="padding-top:4px">'; print '<input class="autoset toggle" type="checkbox" id="searchcollectiononly"> <label for="searchcollectiononly">' . get_int_text("label_searchcollectiononly") . '</label>'; print '</div>'; print '<div id="searchdomaincontrol" class="podoptions containerbox padright dropdown-container styledinputs" style="padding-top:4px">'; print '<input class="autoset toggle" type="checkbox" id="search_limit_limitsearch"> <label for="search_limit_limitsearch">' . get_int_text("label_limitsearch") . '</label>'; print '</div>'; print '<div class="dropmenu styledinputs" id="mopidysearchdomains" style="margin-top:4px">'; print '</div>'; ?> <div class="containerbox"> <div class="expand"></div> <?php print '<button style="margin-right:4px" class="fixed" onclick="player.controller.search(\'find\')">' . get_int_text("button_findexact") . '</button>'; print '<button style="margin-right:4px" class="fixed" onclick="player.controller.search(\'search\')">' . get_int_text("button_search") . '</button>'; ?> </div> </div>
} foreach ($channel->slowpls as $h) { format_listenlink($channel, $h, "LQ"); } print '</div>'; $count++; } print '</div>'; } } else { ?> <div class="containerbox menuitem noselection multidrop"> <?php print '<i class="icon-toggle-closed mh menu fixed" name="somafmlist"></i>'; print '<i class="icon-somafm fixed smallcover-svg"></i>'; print '<div class="expand"><h3>' . get_int_text('label_somafm') . '</h3></div>'; ?> </div> <div id="somafmlist" class="dropmenu"></div> <?php } function format_listenlink($c, $p, $label) { $img = (string) $c->xlimage; if (!$img) { $img = (string) $c->largeimage; } if (!$img) { $img = (string) $c->image; }
debuglog(" Got something", "LYRICS"); if (preg_match('/\\<div class=\'lyricbox\'\\>\\<script\\>.*?\\<\\/script\\>(.*?)\\<\\!--/', $webpage['contents'], $matches)) { $output = html_entity_decode($matches[1]); file_put_contents('prefs/jsoncache/lyrics/' . md5($uri), $output); } else { debuglog(" preg didn't match", "LYRICS"); } } } } } } else { debuglog(" Got lyrics from file", "LYRICS"); } if ($output == null) { $output = '<h3 align=center>' . get_int_text("lyrics_nonefound") . '</h3><p>' . get_int_text("lyrics_info") . '</p>'; } print $output; function read_apple_awfulness($a) { // Whoever came up with this was on something. // All we want to do is read some metadata... // why do you have to store it in such a horrible, horrible, way? global $output; foreach ($a as $atom) { if (array_key_exists('name', $atom)) { if (preg_match('/lyr$/', $atom['name'])) { $output = preg_replace('/^.*?data/', '', $atom['data']); break; } }
function process_file($filedata) { global $numtracks, $totaltime, $prefs, $dbterms, $collection, $putinplaylistarray, $trackbytrack; global $db_time, $coll_time, $rtime; // Pre-process the file data $mytime = microtime(true); if ($dbterms['tags'] !== null || $dbterms['rating'] !== null) { // If this is a search and we have tags or ratings to search for, check them here. if (check_url_against_database($filedata['file'], $dbterms['tags'], $dbterms['rating']) == false) { return false; } } if ($prefs['ignore_unplayable'] && strpos($filedata['Title'], "[unplayable]") === 0) { debuglog("Ignoring unplayable track " . $filedata['file'], "COLLECTION", 9); return false; } if (strpos($filedata['Title'], "[loading]") === 0) { debuglog("Ignoring unloaded track " . $filedata['file'], "COLLECTION", 9); return false; } $filedata['domain'] = getDomain($filedata['file']); $unmopfile = preg_replace('/^.+?:(track|album|artist):/', '', $filedata['file']); check_is_stream($filedata); if ($filedata['type'] != 'stream') { if ($filedata['Title'] == null) { $filedata['Title'] = rawurldecode(basename($filedata['file'])); } if ($filedata['Album'] == null) { $filedata['Album'] = album_from_path($unmopfile); } if ($filedata['Artist'] == null) { $filedata['Artist'] = artist_from_path($unmopfile, $filedata['file']); } } if ($filedata['Track'] == null) { $filedata['Track'] = format_tracknum(basename(rawurldecode($filedata['file']))); } else { $filedata['Track'] = format_tracknum(ltrim($filedata['Track'], '0')); } // External Album URI (mopidy only) // OR cue sheet link (mpd only). We're only doing CUE sheets, not M3U if ($filedata['X-AlbumUri'] === null && strtolower(pathinfo($filedata['playlist'], PATHINFO_EXTENSION)) == "cue") { $filedata['X-AlbumUri'] = $filedata['playlist']; debuglog("Found CUE sheet for album " . $filedata['Album'], "COLLECTION"); } // Disc Number if ($filedata['Disc'] != null) { $filedata['Disc'] = format_tracknum(ltrim($filedata['Disc'], '0')); } if (strpos($filedata['file'], ':artist:') !== false) { $filedata['X-AlbumUri'] = $filedata['file']; $filedata['Album'] = get_int_text("label_allartist") . concatenate_artist_names($filedata['Artist']); if ($filedata['X-AlbumImage'] == null) { $filedata['X-AlbumImage'] = "newimages/artist-icon.png"; } $filedata['Disc'] = 0; $filedata['Track'] = 0; } else { if (strpos($filedata['file'], ':album:') !== false) { $filedata['X-AlbumUri'] = $filedata['file']; $filedata['Disc'] = 0; $filedata['Track'] = 0; } } // Sometimes the file domain can be http but the album domain is correct // this is true eg for bassdrive if ($filedata['X-AlbumUri'] !== null && getDomain($filedata['X-AlbumUri']) != getDomain($filedata['file'])) { $filedata['domain'] = getDomain($filedata['X-AlbumUri']); } if (strpos($filedata['file'], 'archives.bassdrivearchive.com') !== false) { // Slightly annoyingly, bassdrive archive tracks come back with http uris. $filedata['domain'] = "bassdrive"; } switch ($filedata['domain']) { // Some domain-specific fixups for mpd's soundcloud playlist plugin and various unhelpful // mopidy backends. There's no consistency of behaviour in the Mopidy backends // so to provide some kind of consistency of display we have to do a lot of work. case "soundcloud": if ($prefs['player_backend'] == "mpd") { if ($filedata['Name'] != null) { $filedata['Title'] = $filedata['Name']; $filedata['Album'] = "SoundCloud"; $arse = explode(' - ', $filedata['Name']); $filedata['Artist'] = $arse[0]; } else { $filedata['Artist'] = "Unknown Artist"; $filedata['Title'] = "Unknown Track"; $filedata['Album'] = "SoundCloud"; } } else { $filedata['folder'] = concatenate_artist_names($filedata['Artist']); $filedata['AlbumArtist'] = $filedata['Artist']; } break; case "youtube": $filedata['folder'] = $filedata['file']; $filedata['Artist'] = munge_youtube_track_into_artist($filedata['Title']); $filedata['Album'] = munge_youtube_track_into_album($filedata['Title']); $filedata['Title'] = munge_youtube_track_into_title($filedata['Title']); $filedata['AlbumArtist'] = $filedata['Artist']; break; case "spotify": $filedata['folder'] = $filedata['X-AlbumUri']; break; case "internetarchive": $filedata['X-AlbumUri'] = $filedata['file']; $filedata['folder'] = $filedata['file']; $filedata['AlbumArtist'] = "Internet Archive"; break; case "podcast http": case "podcast https": case "podcast ftp": case "podcast file": $filedata['folder'] = dirname($file); $matches = array(); $a = preg_match('/podcast\\+http:\\/\\/(.*?)\\//', $filedata['file'], $matches); if ($a == 1) { $filedata['AlbumArtist'] = $matches[1]; $filedata['Album'] = $filedata['Title']; $filedata['Album'] = preg_replace('/^Album\\:\\s*/', '', $filedata['Album']); $albumuri = $file; } else { $filedata['AlbumArtist'] = "Podcasts"; } if ($filedata['Artist'] == "http" || $filedata['Artist'] == "https" || $filedata['Artist'] == "ftp" || $filedata['Artist'] == "file" || substr($filedata['Artist'], 0, 7) == "podcast") { $filedata['Artist'] = $filedata['AlbumArtist']; } break; default: $filedata['folder'] = dirname($unmopfile); break; } $rtime += microtime(true) - $mytime; if ($trackbytrack && $filedata['AlbumArtist'] && $filedata['Disc'] !== null) { $tstart = microtime(true); do_track_by_track(new track($filedata)); $db_time += microtime(true) - $tstart; } else { $cstart = microtime(true); if ($filedata['Disc'] === null) { $filedata['Disc'] = 1; } $collection->newTrack(new track($filedata)); $coll_time += microtime(true) - $cstart; } $numtracks++; $totaltime += $filedata['Time']; }
function format_episode(&$y, &$item, $pm) { if ($item->deleted == "yes") { return; } if ($y->displaymode == "downloadednew" && (!is_dir('prefs/podcasts/' . $pm . '/' . $item->key) && $item->new == "no")) { return; } if ($y->displaymode == "new" && $item->new == "no") { return; } if ($y->displaymode == "unlistened" && $item->listened == "yes") { // Track cannot be new and unlistened, that can't happen because it makes no sense return; } if ($y->displaymode == "downloaded" && !is_dir('prefs/podcasts/' . $pm . '/' . $item->key)) { return; } print '<div class="clickable clicktrack item podcastitem draggable" name="' . htmlspecialchars_decode($item->link) . '">'; print '<div class="containerbox">'; if ($item->new == "yes") { print '<i title="' . get_int_text("podcast_tooltip_new") . '" class="icon-sun fixed newpodicon fridge"></i>'; } else { if ($item->listened == "no") { print '<i title="' . get_int_text("podcast_tooltip_notnew") . '" class="icon-unlistened fixed oldpodicon fridge"></i>'; } } print '<div class="podtitle expand">' . $item->title . '</div></div>'; print '<div class="whatdoicallthis padright clearfix"><span class="tleft"><i>' . $item->pubdate . '</i></span>'; if ($item->duration != 0) { print '<span class="tright">' . format_time($item->duration) . '</span>'; } print '</div>'; if ($y->daysLive > -1 && $item->listened == "no" && !is_dir('prefs/podcasts/' . $pm . '/' . $item->key)) { $pubtime = strtotime((string) $item->pubdate); $expiretime = $pubtime + $y->daysLive * 86400; $timeleft = format_time2($expiretime - time()); if ($expiretime < time()) { print '<div><b>' . get_int_text("podcast_expired") . '</b></div>'; } else { if ($expiretime - time() < 86400) { print '<div><b><font color="red">' . get_int_text("podcast_timeleft", array($timeleft)) . "</font></b></div>"; } else { print '<div><b>' . get_int_text("podcast_timeleft", array($timeleft)) . "</b></div>"; } } } if ($y->hidedescriptions == "true") { // Testing for true because podcasts subscribed with rompr < 0.60 won't have this option set at all } else { print '<div class="whatdoicallthis">' . format_text((string) $item->description) . '</div>'; } print '<div class="clearfix" name="podcontrols_' . $pm . '">'; if (is_dir('prefs/podcasts/' . $pm . '/' . $item->key)) { print '<i class="icon-floppy podicon tleft fridge" title="' . get_int_text("podcast_tooltip_downloaded") . '"></i>'; } else { print '<i class="icon-download podicon clickable clickicon tleft poddownload fridge" title="' . get_int_text("podcast_tooltip_download") . '" name="poddownload_' . $item->key . '"></i>'; } if ($item->listened == "no") { print '<i class="icon-headphones podicon clickable clickicon tleft podmarklistened fridge" title="' . get_int_text("podcast_tooltip_mark") . '" name="podmarklistened_' . $item->key . '"></i>'; } print '<i class="icon-cancel-circled podicon clickable clickicon tright podtrackremove fridge" title="' . get_int_text("podcast_tooltip_delepisode") . '" name="podtrackremove_' . $item->key . '" ></i>'; print '</div>'; print '</div>'; }
} $c = $track->creator; if ($c == "" || $c == null) { $c = "Radio"; } print '<div class="smallcover fixed"><img class="smallcover" name="' . md5($c . " " . $track->album) . '" src="' . $track->image . '" /></div>'; print '<div class="expand stname" style="margin-left:4px">' . utf8_encode($track->album) . '</div>'; print '<div class="fixed clickable clickradioremove clickicon" name="' . $file . '"><i class="icon-cancel-circled playlisticon"></i></div>'; print '</div>'; } } print '</div>'; ?> <script language="javascript"> $("#radiolist .enter").keyup( onKeyUp ); $('#anaconda').on('drop', handleDropRadio); </script> <?php } else { ?> <div class="containerbox menuitem noselection multidrop"> <?php print '<i class="icon-toggle-closed mh menu fixed" name="yourradiolist"></i>'; print '<i class="icon-radio-tower fixed smallcover-svg"></i>'; print '<div class="expand"><h3>' . get_int_text('label_yourradio') . '</h3></div>'; ?> </div> <div id="yourradiolist" class="dropmenu"></div> <?php }
function printFileSearch($tree, $fcount) { $prefix = "sdirholder"; $dircount = 0; print '<div class="menuitem">'; print "<h3>" . get_int_text("label_searchresults") . "</h3>"; print "</div>"; print '<div style="margin-bottom:4px"> <table width="100%" class="playlistitem"> <tr><td align="left">' . $fcount . ' ' . get_int_text('label_files') . '</td></tr> </table> </div>'; $tree->getHTML($prefix, $dircount); }
foreach ($skinrequires as $s) { $s = trim($s); $ext = strtolower(pathinfo($s, PATHINFO_EXTENSION)); if ($ext == "js") { debuglog("Including Skin Requirement " . $s, "INIT", 5); print '<script type="text/javascript" src="' . $s . '"></script>' . "\n"; } } print '<script type="text/javascript" src="skins/' . $skin . '/skin.js"></script>' . "\n"; ?> </head> <?php debuglog("Including skins/" . $skin . '/skin.php', "LAYOUT", 5); include 'skins/' . $skin . '/skin.php'; ?> <div id="tagadder" class="funkymusic dropmenu dropshadow"> <div class="configtitle textcentre hound" style="padding-top:4px"><b> <?php print get_int_text("lastfm_addtags") . '</b><i class="icon-cancel-circled clickicon playlisticonr tright" onclick="tagAdder.close()"></i></div><div>' . get_int_text("lastfm_addtagslabel"); ?> </div> <div class="containerbox padright dropdown-container tagaddbox"></div> </div> </body> </html>
</div> </div> </div> </div> <?php } ?> <div id="playlistman" class="noborder scroller mainpane invisible"> <?php print '<div class="configtitle textcentre"><b>' . get_int_text('button_saveplaylist') . '</b></div>'; ?> <div class="pref containerbox dropdown-container"><div class="fixed padright"> </div><div class="expand"><input id="playlistname" type="text" size="200"/></div> <?php print '<button class="fixed" onclick="player.controller.savePlaylist()">' . get_int_text('button_save') . '</button>'; ?> </div> <div class="pref"> <div id="playlistslist"> <div id="storedplaylists"></div> </div> </div> </div> <div id="prefsm" class="noborder scroller mainpane invisible"> <?php include "includes/prefspanel.php"; ?> </div> <div id="playlistm" class="scroller mainpane invisible">
doPodcastHeader($c); doPodcast($c); print '</div>'; } } print '</div>'; print '<script language="javascript">' . "\n"; print '$("#podcastslist .enter").keyup( onKeyUp );' . "\n"; print "\$('#podcastsinput').on('drop', podcasts.handleDrop);\n"; print '</script>' . "\n"; } } } } } } } } } else { ?> <div class="containerbox menuitem noselection multidrop"> <?php print '<i class="icon-toggle-closed mh menu fixed" name="podcastslist"></i>'; print '<i class="icon-podcast-circled fixed smallcover-svg"></i>'; print '<div class="expand"><h3>' . get_int_text('label_podcasts') . '<span id="total_unlistened_podcasts"></span><span></span></h3></div>'; ?> </div> <div id="podcastslist" class="dropmenu"> </div> <?php }
function do_unused_images() { global $allfiles; print '<div class="cheesegrater" name="unused">'; print '<div class="albumsection crackbaby">'; print '<div class="tleft"><h2>' . count($allfiles) . ' ' . get_int_text("albumart_unused") . '</h2></div><div class="tright rightpad"><button onclick="removeUnusedFiles()">' . get_int_text("albumart_deletethese") . '</button></div>'; print "</div>\n"; print '<div id="unusedimages" class="fullwidth bigholder">'; print '<div class="containerbox covercontainer">'; $colcount = 0; foreach ($allfiles as $album) { print '<div class="expand containerbox vertical albumimg closet">'; print '<div class="albumimg fixed">'; print '<img height="82px" width="82px" src="' . $album . '">'; print '</div>'; print '</div>'; $colcount++; if ($colcount == 7) { print "</div>\n" . '<div class="containerbox covercontainer">'; $colcount = 0; } } print "</div></div></div>\n"; }
function wikipedia_get_list_of_suggestions($term) { global $domain; debuglog("Getting list of suggestions for " . $term . " from " . $domain . ".wikipedia.org", "WIKIPEDIA"); $xml = wikipedia_request('http://' . $domain . '.wikipedia.org/w/api.php?action=query&list=search&srsearch=' . rawurlencode($term) . '&srprop=score&format=xml'); if ($xml != "") { $html = '<?xml version="1.0"?><api><parse><text xml:space="preserve">'; $xml = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA); if (count($xml->query->search->p) == 0) { return null; } $html .= htmlspecialchars('<h3 align="center">', ENT_QUOTES) . get_int_text("wiki_suggest", array($term)) . htmlspecialchars('</h3>', ENT_QUOTES); $html .= htmlspecialchars('<h3 align="center">', ENT_QUOTES) . get_int_text("wiki_suggest2") . htmlspecialchars('</h3>', ENT_QUOTES); $html .= htmlspecialchars('<ul>', ENT_QUOTES); foreach ($xml->query->search->p as $id) { $link = preg_replace('/\\s/', '_', $id['title']); $html .= htmlspecialchars('<li><a href="#" name="', ENT_QUOTES) . $domain . '/' . htmlspecialchars($link, ENT_QUOTES) . htmlspecialchars('" class="infoclick clickwikilink">' . $id['title'] . '</a></li>', ENT_QUOTES); } $html .= htmlspecialchars("</ul>", ENT_QUOTES); $html .= '</text></parse>'; $html .= '<rompr><domain>' . $domain . '</domain><page>' . htmlspecialchars($term, ENT_QUOTES) . '</page></rompr></api>'; return $html; } else { return ""; } }
function do_playlist_header() { print '<div class="configtitle textcentre"><b>' . get_int_text('button_loadplaylist') . '</b></div>'; print '<div class="containerbox spacer dropdown-container">'; print '<div class="fixed padright"><span style="vertical-align:middle;padding-left:8px">External URL</span></div>'; print '<div class="expand dropdown-holder"> <input class="enter" id="godfreybiggins" type="text" onkeyup="onKeyUp(event)" /></div>'; print '<button class="fixed" style="margin-left:8px;vertical-align:middle" ' . 'onclick="player.controller.loadPlaylistURL($(\'#godfreybiggins\').val())">Play</button>'; print '</div>'; }
function getCacheData($uri, $cache) { $me = strtoupper($cache); debuglog("Getting " . $uri, $me); if (file_exists('prefs/jsoncache/' . $cache . '/' . md5($uri))) { debuglog("Returning cached data", $me); header("Pragma: From Cache"); print file_get_contents('prefs/jsoncache/' . $cache . '/' . md5($uri)); } else { $content = url_get_contents($uri); $s = $content['status']; debuglog("Response Status was " . $s, $me); header("Pragma: Not Cached"); if ($s == "200") { print $content['contents']; file_put_contents('prefs/jsoncache/' . $cache . '/' . md5($uri), $content['contents']); } else { $a = array('error' => get_int_text($cache . "_error")); print json_encode($a); } } }
<?php include "includes/vars.php"; include "includes/functions.php"; include "international.php"; include "player/mpd/connection.php"; $error = 0; $dbterms = array('tags' => null, 'rating' => null); $path = array_key_exists('path', $_REQUEST) ? rawurldecode($_REQUEST['path']) : ""; $prefix = array_key_exists('prefix', $_REQUEST) ? $_REQUEST['prefix'] . '_' : "dirholder"; @open_mpd_connection(); if ($is_connected) { if ($path == "") { print '<div class="configtitle textcentre expand" style="margin-left:6px"><b>' . get_int_text('button_file_browser') . '</b></div>'; } doFileBrowse($path, $prefix); } else { header("HTTP/1.1 500 Internal Server Error"); } close_mpd(); function doFileBrowse($path, $prefix) { global $connection, $prefs; debuglog("Browsing " . $path, "DIRBROWSER"); $parts = true; $foundfile = false; $filedata = array(); $dircount = 0; fputs($connection, 'lsinfo "' . format_for_mpd($path) . '"' . "\n"); while (!feof($connection) && $parts) { $parts = getline($connection);
} ?> </div> <div class="clearfix containerbox vertical" id="pluginplaylists_everywhere"> <?php if ($prefs['player_backend'] == "mopidy") { print '<div class="textcentre textunderline"><b>Music From Everywhere</b></div>'; print '<div id="radiodomains" class="pref"><b>Play From These Sources:</b></div>'; } ?> </div> </div> </div> <div id="infopane" class="cmiddle noborder infowiki tleft"> <div id="artistchooser" class="infotext noselection invisible"></div> <?php print '<div id="artistinformation" class="infotext noselection"><h2 align="center">' . get_int_text('label_emptyinfo') . '</h2></div>'; ?> <div id="albuminformation" class="infotext noselection"></div> <div id="trackinformation" class="infotext"></div> </div> <div id="playlist" class="column noborder tright"> <?php include "skins/playlist.php"; ?> </div> </div>
getUCtext: function(key, args) { return language.gettext(key, args).toUpperCase(); } } }(); <?php print "var collection_status = " . checkCollectionStatus() . ";\n"; print "prefs.skin = '" . $skin . "';\n"; print "debug.setLevel(" . $prefs['debug_enabled'] . ");\n"; print "var interfaceLanguage = '" . $interface_language . "';\n"; print "var browserLanguage = '" . $browser_language . "';\n"; print "var rompr_version = '" . ROMPR_VERSION . "';\n"; print "var mopidy_min_version = '" . ROMPR_MOPIDY_MIN_VERSION . "';\n"; print "var player_ip = '" . get_player_ip() . "';\n"; if ($oldmopidy) { print "var mopidy_is_old = true;\n"; } else { print "var mopidy_is_old = false;\n"; } // Three translation keys are needed so regularly it makes sense to // have them as static variables, instead of looking them up every time print "var frequentLabels = {\n"; print " of: '" . get_int_text("label_of") . "',\n"; print " by: '" . get_int_text("label_by") . "',\n"; print " on: '" . get_int_text("label_on") . "'\n"; print "};\n"; ?> </script>
print $outdoc->saveHTML(); ?> </div> </div> <script type="text/javascript"> $('form[name="searchice"]').ajaxForm(function(data) { $('#icecastlist').html(data); spaghetti(); }); <?php if (array_key_exists("searchfor", $_REQUEST)) { print ' $(\'input[name="searchfor"]\').val(\'' . $_REQUEST['searchfor'] . '\');' . "\n"; } ?> </script> <?php } else { ?> <div class="containerbox menuitem noselection multidrop"> <?php print '<i class="icon-toggle-closed menu mh fixed" name="icecastlist"></i>'; print '<i class="icon-icecast fixed smallcover-svg"></i>'; print '<div class="expand"><h3>' . get_int_text('label_icecast') . '</h3></div>'; ?> </div> <div id="icecastlist" class="dropmenu"></div> <?php }