summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1e71bc4)
Also change displayset.php to extract the artist from the song itself
and if found it will override any artist specified in the .lst file.
California Dreamin'
Can't Find My Way Home
Casey Jones
California Dreamin'
Can't Find My Way Home
Casey Jones
-Doctir My Eyes
-For What It's Worth
\ No newline at end of file
+Doctor My Eyes
+For What It's Worth
\ No newline at end of file
<?php
include_once "songbook.php";
<?php
include_once "songbook.php";
-$set = $_REQUEST ["set"];
+$set = $_REQUEST["set"];
- if (preg_match ("/(.*)\s+-\s+(.*)/", $line, $matches)) {
- $song = trim ($matches[1]);
- $artist = trim ($matches[2]);
+ if (preg_match("/(.*)\s+-\s+(.*)/", $line, $matches)) {
+ $song = trim($matches[1]);
+ $artist = trim($matches[2]);
- $song = trim ($line);
- $artist = "";
+ $song = trim($line);
+ $artist = '';
} // if
if (file_exists ("$songDir/$song.pro")) {
print "<li><a href=\"webchord.cgi?chordpro=$song.pro\">";
} // if
if (file_exists ("$songDir/$song.pro")) {
print "<li><a href=\"webchord.cgi?chordpro=$song.pro\">";
- print basename ($song);
print "</a>";
} else {
print "<li>";
print "</a>";
} else {
print "<li>";
- print basename ($song);
- }
+ print basename($song);
+ } // if
+ $artist = getArtist ("$songDir/$song.pro");
- if (in_array ($artist, $artists)) {
- print "<a href=\"displayartist.php?artist=$artist\">$artist</a>";
- } else {
- print $artist;
+ if ($artist != '') {
+ print " - ";
+
+ if (in_array ($artist, $artists)) {
+ print "<a href=\"displayartist.php?artist=$artist\">$artist</a>";
+ } else {
+ print $artist;
+ } // if
<?php
$baseDir = getcwd();
$songDir = "/opt/songbook/Songs";
<?php
$baseDir = getcwd();
$songDir = "/opt/songbook/Songs";
-$debug = $_REQUEST["debug"];
+
+if (isset ($_REQUEST['debug'])) {
+ $debug = $_REQUEST['debug'];
+} // if
// Initialize music objects
$songs = getSongs($songDir);
// Initialize music objects
$songs = getSongs($songDir);
} // setsDropdown
function getArtist ($song) {
} // 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]);
if (preg_match ("/\{(st|subtitle):(.*)\}/", $lyrics, $matches)) {
return trim ($matches[2]);