X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=web%2Fsongbook.php;h=ae50faa264aa4ae0e68a229ce36ebe113944da6c;hb=2f57b9969bf4a8a356587f2f38ae1b0c4ad2ede5;hp=a231add6b45f81f79c8bd6afb4c5114882ee0a79;hpb=14ad2485f77e44566ebc155fe6a8fac85dbc2c94;p=songbook.git diff --git a/web/songbook.php b/web/songbook.php index a231add..ae50faa 100644 --- a/web/songbook.php +++ b/web/songbook.php @@ -1,7 +1,17 @@ "; print ""; + print " "; print ""; } // songsDropdown function artistsDropdown () { - global $songs; - - $artists = getArtists ($songs); + global $artists; print "
"; print "Artists:  "; @@ -58,13 +65,33 @@ function artistsDropdown () { print ""; } // foreach - print ""; print ""; + print " "; print "
"; } // artistsDropdown +function setsDropdown () { + global $sets; + + print "
"; + print "Sets:     "; + print ""; + print " "; + print "
"; +} // 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]); @@ -74,8 +101,6 @@ function getArtist ($song) { } // getArtist function getArtists ($songs) { - $artists = array(); - foreach ($songs as $song) { $artist = getArtist ($song); @@ -87,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