$var = parse_mpd_var(fgets($connection, 1024)); if (isset($var)) { if ($var === true) { break; } if ($var[0] == "file") { $thisfile = $var[1]; $tagfiles[$thisfile] = array("file" => $thisfile); } else { $tagfiles[$thisfile][$var[0]] = $var[1]; } } } foreach ($tagfiles as $key => $val) { if (!isset($letters_tagfiles[strtoupper(mbFirstChar(get_songinfo_first($val, isset($configuration["sort"]) ? $configuration["sort"] : array("file"), 0)))])) { $letters_tagfiles[strtoupper(mbFirstChar(get_songinfo_first($val, isset($configuration["sort"]) ? $configuration["sort"] : array("file"), 0)))] = true; } } make_link("", "playlist", "add all", $arguments = array("command" => "addlist", "arg" => $tagfiles)); echo "] "; if (count($tagfiles) > 0) { $songinfo = null; $counte = 0; make_index_table($letters_tagfiles, "tagfiles_", false); echo "</small></h2>\n"; echo "<table cellspacing=\"0\">\n<tr class=\"head\">"; foreach ($configuration["columns_files"] as $key => $column) { echo "<td" . ($column == "Function" ? " style=\"width: " . strlen($configuration["add"]) . "em\"" : "") . ">"; switch ($column) { case "Function": echo $configuration["add"];
function get_songinfo_first($info, $sort_history, $depth) { if (count($sort_history) > $depth) { $sortname = $sort_history[$depth]; if (array_key_exists($sortname, $info)) { return $info[$sortname]; } else { return get_songinfo_first($info, $sort_history, $depth + 1); } } else { return ""; } }