X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=songbook%2Fsongbook.php;h=d43dedd65a681f896ce51446890810ec2a80d850;hb=9ed7209cfd57660436721ff5bf60d58e62ede295;hp=c4afcd97e20289e126fa5a59ab28a14ecda3cc90;hpb=3e2c53c2819acc0b85a8e9c422542fbe3c13fe9d;p=clearscm.git diff --git a/songbook/songbook.php b/songbook/songbook.php deleted file mode 100644 index c4afcd9..0000000 --- a/songbook/songbook.php +++ /dev/null @@ -1,87 +0,0 @@ -"; - print "Songs:  "; - print ""; - print ""; - print ""; -} // songsDropdown - -function artistsDropdown () { - global $songs; - - $artists = getArtists ($songs); - - print "
"; - print "Artists:  "; - print ""; - print ""; - print "
"; -} // artistsDropdown - -function getArtist ($song) { - $lyrics = file_get_contents ($song); - - if (preg_match ("/\{(st|subtitle):(.*)\}/", $lyrics, $matches)) { - return trim ($matches[2]); - } else { - return ""; - } // if -} // getArtist - -function getArtists ($songs) { - $artists = array(); - - foreach ($songs as $song) { - $artist = getArtist ($song); - - if ($artist != '') { - $artists[$artist] = 1; - } // if - } // foreach - - 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 \ No newline at end of file diff --git a/songbook/songbook.php b/songbook/songbook.php new file mode 120000 index 0000000..d43dedd --- /dev/null +++ b/songbook/songbook.php @@ -0,0 +1 @@ +/web/php/songbook/songbook.php \ No newline at end of file