X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=web%2Fsongbook.php;h=26917b96314ab24376baa67f85b19daeb00bfd34;hb=26c9020f1911dcd91936b2ff78906e82486b5a29;hp=a231add6b45f81f79c8bd6afb4c5114882ee0a79;hpb=14ad2485f77e44566ebc155fe6a8fac85dbc2c94;p=songbook.git diff --git a/web/songbook.php b/web/songbook.php index a231add..26917b9 100644 --- a/web/songbook.php +++ b/web/songbook.php @@ -1,7 +1,15 @@ "; print ""; + print " "; print ""; } // songsDropdown function artistsDropdown () { - global $songs; - - $artists = getArtists ($songs); + global $artists; print "
"; print "Artists:  "; @@ -58,13 +63,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 +99,6 @@ function getArtist ($song) { } // getArtist function getArtists ($songs) { - $artists = array(); - foreach ($songs as $song) { $artist = getArtist ($song); @@ -87,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