projects
/
songbook.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Got Bachman Turner Overdrive on the same page
[songbook.git]
/
web
/
displayset.php
diff --git
a/web/displayset.php
b/web/displayset.php
index
111c43a
..
854c98e
100644
(file)
--- a/
web/displayset.php
+++ b/
web/displayset.php
@@
-11,7
+11,7
@@
<?php
include_once "songbook.php";
<?php
include_once "songbook.php";
-$set = $_REQUEST
["set"];
+$set = $_REQUEST["set"];
?>
<style>
?>
<style>
@@
-31,7
+31,7
@@
width: 100%;
<div id="content">
<?php
<div id="content">
<?php
-global $songDir;
+global $songDir
, $artists
;
print "<ol>";
print "<ol>";
@@
-44,31
+44,41
@@
foreach (file("$songDir/$set") as $line) {
continue;
} // if
continue;
} // if
- 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]);
} else {
} else {
- $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 basename($song);
print "</a>";
} else {
print "<li>";
print "</a>";
} else {
print "<li>";
- print basename ($song);
- }
+ print basename($song);
+ } // if
+
+ if ($artist == '') {
+ $artist = getArtist ("$songDir/$song.pro");
+ } // if
+
+ if ($artist != '') {
+ print " - ";
- if ($artist <> "") {
- print " - <a href=\"displayartist.php?artist=$artist\">$artist</a>";
+ if (in_array ($artist, $artists)) {
+ print "<a href=\"displayartist.php?artist=$artist\">$artist</a>";
+ } else {
+ print $artist;
+ } // if
} // if
print "</li>";
} // foreach
} // if
print "</li>";
} // foreach
-print "</o
kkk
l>";
+print "</ol>";
?>
</body>
?>
</body>