コード例 #1
0
ファイル: tagfiles.php プロジェクト: tomaskovacik/phpmp2
         case "songformat":
             make_link("", "tagfiles", "Song", array("sort" => "file"));
             break;
         default:
             make_link("", "tagfiles", $column, array("sort" => $column));
     }
     echo "</td>";
 }
 echo "</tr>\n";
 foreach ($tagfiles as $key => $songinfo) {
     echo "<tr" . ($counte % 2 != 1 ? " class=\"alt\"" : "") . ">";
     foreach ($configuration["columns_files"] as $keyz => $column) {
         echo "<td>";
         if (array_key_exists(strtoupper(mbFirstChar($songinfo["file"])), $letters_tagfiles) && $letters_tagfiles[strtoupper(mbFirstChar($songinfo["file"]))] != false) {
             echo "<a name=\"tagfiles_" . strtoupper(mbFirstChar($songinfo["file"])) . "\" style=\"display: inline\"></a>";
             $letters_tagfiles[strtoupper(mbFirstChar($songinfo["file"]))] = false;
         }
         switch ($column) {
             case "Function":
                 make_link("", "status", $configuration["add"], array("command" => "add", "arg" => htmlentities(rawurlencode($songinfo["file"]))));
                 break;
             case "Number":
                 echo $counte;
                 break;
             case "Title":
                 if (array_key_exists($column, $songinfo) && strlen($songinfo[$column]) > 0) {
                     make_link("", "files", htmlspecialchars($songinfo[$column]), array("search" => "1", "searchtext" => htmlentities(rawurlencode($songinfo[$column])), "searchwhat" => "title", "exact" => "true"));
                 } else {
                     echo htmlspecialchars($songinfo["file"]);
                 }
                 break;
コード例 #2
0
ファイル: albums.php プロジェクト: tomaskovacik/phpmp2
    $albums = array_merge(array("Any album" => ""), array_values($albums));
    foreach ($albums as $key => $val) {
        if (!isset($letters_albums[strtoupper(mbFirstChar($val))])) {
            $letters_albums[strtoupper(mbFirstChar($val))] = true;
        }
    }
    $songinfo = null;
    $counte = 0;
    echo " <small>";
    make_index_table($letters_albums, "albums_", false);
    echo "</small></h2>\n";
    echo "<table cellspacing=\"0\">\n";
    foreach ($albums as $key => $val) {
        if ($letters_albums[strtoupper(mbFirstChar($val))] == true) {
            echo "<a name=\"albums_" . strtoupper(mbFirstChar($val)) . "\"></a>";
            $letters_albums[strtoupper(mbFirstChar($val))] = false;
        }
        echo "<tr" . ($counte % 2 != 1 ? " class=\"alt\"" : "") . ">";
        echo "<td>";
        make_link("", "tagfiles", is_string($key) ? $key : $val, $arguments = array("album" => htmlentities(rawurlencode($val))), false, null, "tagfiles");
        echo "</td>";
        echo "</tr>\n";
        $counte++;
    }
    echo "</table>\n";
} else {
    echo "</h2>\nNo albums found.<br />\n";
}
?>
</div>
コード例 #3
0
ファイル: artists.php プロジェクト: tomaskovacik/phpmp2
    $artists = array_merge(array("Any artist" => ""), array_values($artists));
    foreach ($artists as $key => $val) {
        if (!array_key_exists(strtoupper(mbFirstChar($val)), $letters_artists)) {
            $letters_artists[strtoupper(mbFirstChar($val))] = true;
        }
    }
    $songinfo = null;
    $counte = 0;
    echo " <small>";
    make_index_table($letters_artists, "artists_", false);
    echo "</small></h2>\n";
    echo "<table cellspacing=\"0\">\n";
    foreach ($artists as $key => $val) {
        if ($letters_artists[strtoupper(mbFirstChar($val))] == true) {
            echo "<a name=\"artists_" . strtoupper(mbFirstChar($val)) . "\"></a>";
            $letters_artists[strtoupper(mbFirstChar($val))] = false;
        }
        echo "<tr" . ($counte % 2 != 1 ? " class=\"alt\"" : "") . ">";
        echo "<td>";
        make_link("", "albums", is_string($key) ? $key : $val, $arguments = array("artist" => htmlentities(rawurlencode($val))), false, null, "albums");
        echo "</td>";
        echo "</tr>\n";
        $counte++;
    }
    echo "</table>\n";
} else {
    echo "</h2>\nNo artists found.<br />\n";
}
?>
</div>
コード例 #4
0
ファイル: directories.php プロジェクト: tomaskovacik/phpmp2
     }
     echo "</tr>\n";
 }
 foreach ($dirs as $key => $dir) {
     echo "<tr" . ($counte % 2 != 1 ? " class=\"alt\"" : "") . ">";
     foreach ($configuration["columns_directories"] as $keyz => $column) {
         echo "<td";
         if ($column == "Function") {
             echo " style=\"width: " . strlen($configuration["add"]) . "em\"";
         } elseif ($column == "Update") {
             echo " style=\"width: " . strlen($configuration["update"]) . "em\"";
         }
         echo ">";
         if (is_int($key) && array_key_exists(strtoupper(mbFirstChar($dir)), $letters_dirs) && $letters_dirs[strtoupper(mbFirstChar($dir))] != false) {
             echo "<a name=\"dirs_" . strtoupper(mbFirstChar($dir)) . "\" style=\"display: inline\"></a>";
             $letters[strtoupper(mbFirstChar($dir))] = false;
         }
         if (!strpos($dir, "mediaartlocal")) {
             switch ($column) {
                 case "Function":
                     if (is_int($key)) {
                         make_link("", "playlist", $configuration["add"], array("command" => "add", "arg" => htmlentities(rawurlencode($dir))));
                     }
                     break;
                 case "Update":
                     if (is_int($key)) {
                         make_link("", "directories", $configuration["update"], array("command" => "update", "arg" => htmlentities(rawurlencode($dir))));
                     }
                     break;
                 case "Number":
                     echo $counte;
コード例 #5
0
ファイル: connection.php プロジェクト: tomaskovacik/phpmp2
        } else {
            $command_successful = false;
        }
    }
    $files = array();
    $letters_files = array();
    if (array_key_exists("searched", $configuration)) {
        $ls = do_mpd_command($connection, $configuration["searched"], null, true);
    } else {
        $ls = do_mpd_command($connection, "lsinfo" . (array_key_exists("directory", $configuration) ? " \"" . $configuration["directory"] . "\"" : ""), null, true);
    }
    if (is_array($ls) && array_key_exists("file", $ls)) {
        if (is_array($ls["file"])) {
            foreach ($ls["file"] as $key => $file) {
                $tmp = do_mpd_command($connection, "listallinfo \"" . $file . "\"", null, true);
                $files[] = $tmp;
                if (!isset($letters_files[strtoupper(mbFirstChar(get_songinfo_first($tmp, isset($configuration["sort"]) ? $configuration["sort"] : array("file"), 0)))])) {
                    $letters_files[strtoupper(mbFirstChar(get_songinfo_first($tmp, isset($configuration["sort"]) ? $configuration["sort"] : array("file"), 0)))] = true;
                }
            }
        } else {
            $tmp = do_mpd_command($connection, "listallinfo \"" . $ls["file"] . "\"", null, true);
            $files[] = $tmp;
            $letters_files[strtoupper(mbFirstChar(get_songinfo_first($tmp, isset($configuration["sort"]) ? $configuration["sort"] : array("file"), 0)))] = 1;
        }
        $files = array_values($files);
        usort($files, "sort_song");
    }
    $mpd_status = do_mpd_command($connection, "status", null, true);
    $is_connected = true;
}