X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=web%2Fsongbook.php;h=ae50faa264aa4ae0e68a229ce36ebe113944da6c;hb=HEAD;hp=cbfe933cab1f50b0056912ed457cebe4b5c7e78e;hpb=3fb37fca3a2cfd094e936635616421cc52ada97d;p=songbook.git diff --git a/web/songbook.php b/web/songbook.php index cbfe933..ae50faa 100644 --- a/web/songbook.php +++ b/web/songbook.php @@ -1,7 +1,17 @@ "; print "Songs:  "; @@ -48,8 +54,7 @@ function songsDropdown () { } // songsDropdown function artistsDropdown () { - $songs = getSongs(); - $artists = getArtists ($songs); + global $artists; print "
"; print "Artists:  "; @@ -66,7 +71,7 @@ function artistsDropdown () { } // artistsDropdown function setsDropdown () { - $sets = getSets(); + global $sets; print ""; print "Sets:     "; @@ -86,7 +91,7 @@ function setsDropdown () { } // setsDropdown function getArtist ($song) { - $lyrics = file_get_contents ($song); + $lyrics = @file_get_contents ($song); if (preg_match ("/\{(st|subtitle):(.*)\}/", $lyrics, $matches)) { return trim ($matches[2]); @@ -96,8 +101,6 @@ function getArtist ($song) { } // getArtist function getArtists ($songs) { - $artists = array(); - foreach ($songs as $song) { $artist = getArtist ($song); @@ -109,20 +112,3 @@ function getArtists ($songs) { return array_keys ($artists); } // getArtists -function formatTable ($songs) { - echo "
    "; - - foreach ($songs as $song) { - $artist = getArtist ($song); - - $title = basename ($song, ".pro"); - - echo "
  1. $title"; - - if ($artist != "") { - echo " ($artist)"; - } // if - } // foreach - - echo "
"; -} // formatTable