X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=web%2Fsongbook.php;h=26917b96314ab24376baa67f85b19daeb00bfd34;hb=94f8497fd2e67ccf0bfc18dd50e91de049f19aec;hp=cbfe933cab1f50b0056912ed457cebe4b5c7e78e;hpb=3fb37fca3a2cfd094e936635616421cc52ada97d;p=songbook.git diff --git a/web/songbook.php b/web/songbook.php index cbfe933..26917b9 100644 --- a/web/songbook.php +++ b/web/songbook.php @@ -1,7 +1,15 @@ "; print "Songs:  "; @@ -48,8 +52,7 @@ function songsDropdown () { } // songsDropdown function artistsDropdown () { - $songs = getSongs(); - $artists = getArtists ($songs); + global $artists; print "
"; print "Artists:  "; @@ -66,7 +69,7 @@ function artistsDropdown () { } // artistsDropdown function setsDropdown () { - $sets = getSets(); + global $sets; print ""; print "Sets:     "; @@ -86,7 +89,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 +99,6 @@ function getArtist ($song) { } // getArtist function getArtists ($songs) { - $artists = array(); - foreach ($songs as $song) { $artist = getArtist ($song); @@ -109,20 +110,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