diff options
| author | Zach DeCook <zachdecook@gmail.com> | 2018-03-11 18:46:00 -0400 |
|---|---|---|
| committer | Zach DeCook <zachdecook@gmail.com> | 2018-03-11 18:46:00 -0400 |
| commit | 0026ca48c2800425ea5018b2626c390114aea68f (patch) | |
| tree | bc3ef982046661135ac655f34bf53e780db5e787 /page.php | |
| parent | 94efcb6043d4f80a05912ac51fce7a1e13e5f2cc (diff) | |
| download | prosongsa-0026ca48c2800425ea5018b2626c390114aea68f.tar.gz | |
* Meta Parsing: Allow {Key:C} tags
Diffstat (limited to 'page.php')
| -rw-r--r-- | page.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/page.php b/page.php index a3fb4c5..cdc7921 100644 --- a/page.php +++ b/page.php @@ -25,6 +25,7 @@ function toc(){ $toc .= "<li><a href=?song=$matches[1]>" . $line . "</a>"; } if( preg_match("/^{Verse: ?(.*)}/i", $line, $matches)) $toc .= " ($matches[1])"; + if( preg_match("/^{Key: ?(.*)}/i", $line, $matches)) $toc .= " ($matches[1])"; if( preg_match("(^{p\d+(\(\S\S?\S?\))?})", $line)) $toc .= " (Reviewed)"; if( preg_match( "/\{p?\d*\((.+m?)\)\}/", $line, $matches) ) $toc .= " ($matches[1])"; @@ -98,11 +99,13 @@ function load_song( $number, $transp = 0 ) } } - if( preg_match( "/\{p?\d*\((.+m?)\)\}/", $line, $matches) ) + if ( preg_match( "/\{p?\d*\((.+m?)\)\}/", $line, $matches) + || preg_match("/^{Key: ?(.*)}/i", $line, $matches) + ) { if ( isset( $suggestedSong[$current_song])) { - $suggestedSong[$current_song]['key'] = $matches[1]; + $suggestedSong[$current_song]['key'] = $matches[1]; } if ( $current_song === $number ) { |
