Changeset 539307
- Timestamp:
- 05/03/2012 04:09:21 AM (14 years ago)
- Location:
- chords-and-lyrics/trunk
- Files:
-
- 3 edited
-
ChordsAndLyrics.php (modified) (12 diffs)
-
readme.txt (modified) (2 diffs)
-
screenshot-1.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
chords-and-lyrics/trunk/ChordsAndLyrics.php
r250154 r539307 3 3 * @package Chords_And_Lyrics 4 4 * @author Ron Lisle 5 * @version 1. 65 * @version 1.7 6 6 */ 7 7 /* 8 8 Plugin Name: ChordsAndLyrics 9 Plugin URI: http:// BuildAWebsiteWorkshops.com/9 Plugin URI: http://Lisles.net/ 10 10 Description: This plugin assists in the creation of staffless lead sheets. 11 Version: 1. 611 Version: 1.7 12 12 Author: Ron Lisle 13 13 Author URI: http://Lisles.net … … 15 15 Refer to Readme.txt file for more information. 16 16 17 Copyright 2008-201 0Ron Lisle17 Copyright 2008-2012 Ron Lisle 18 18 19 19 This program is free software; you can redistribute it and/or modify … … 46 46 add_settings_field('lyrics-only','Display chords or lyrics only?','cnl_lyrics_only_enabled', 47 47 'reading','cnl_setting_section'); 48 add_settings_field('european-chords','Display European chords?','cnl_european_chords_enabled', 49 'reading','cnl_setting_section'); 48 50 register_setting('reading',$user_settings_name); 49 51 } 50 52 51 53 function cnl_setting_section(){ 52 echo '<p> Choose whether to display both chords and lyrics or lyrics only</p>';54 echo '<p>Select options for displaying chords</p>'; 53 55 } 54 56 … … 64 66 } 65 67 68 function cnl_european_chords_enabled(){ 69 global $userdata; 70 get_currentuserinfo(); 71 $user_settings_name = 'cnl_setting_values_for_' . $userdata->user_login; 72 $cnl_options = get_option($user_settings_name); 73 if($cnl_options['european-chords']){ 74 $checked = ' checked="checked" '; 75 } 76 echo '<input '.$checked.' name="'.$user_settings_name.'[european-chords]" type="checkbox" />European chords'; 77 } 66 78 67 79 /* … … 85 97 // [chordsandlyrics parm=val...] ... [/chordsandlyrics] 86 98 // Parameters: 99 // format="yes" Enable/disable formatting 100 // size="normal" Adjust display size 87 101 // transpose="#" Sets the # +/- half-steps to adjust chords. 102 // european="yes" Interpret input using european convention (aHcdefg and B=Bb) 88 103 function chordsandlyricstag_func($atts, $content = null){ 89 104 $cnlData = new ChordsAndLyricsData(); 90 extract(shortcode_atts(array('format' => 'yes', 'size' => 'normal', 'transpose' => '0' ), $atts));105 extract(shortcode_atts(array('format' => 'yes', 'size' => 'normal', 'transpose' => '0', 'european' => 'no'), $atts)); 91 106 92 107 if($format != 'yes') return "[chordsandlyrics]" . $content . "[/chordsandlyrics]"; … … 94 109 $cnlData->setTranspose($transpose); 95 110 $cnlData->setSize($size); 111 $cnlData->setEuropean($european); 96 112 97 113 // Break content into separate lines. … … 112 128 private $transpose; 113 129 private $size; 130 private $european; 131 private $displayEuropean; 114 132 115 133 public function __construct() … … 122 140 $this->twoPages = $cnl_options['two-pages']; 123 141 $this->transpose = 0; 142 $this->displayEuropean = $cnl_options['european-chords']; 124 143 } 125 144 … … 136 155 public function getSize(){ 137 156 return $this->size; 157 } 158 159 public function setEuropean( $e ){ 160 $this->european = $e; 161 } 162 public function getEuropean(){ 163 return $this->european; 164 } 165 public function setDisplayEuropean( $e ){ 166 $this->displayEuropean = $e; 167 } 168 public function getDisplayEuropean(){ 169 return $this->displayEuropean; 138 170 } 139 171 … … 306 338 case 'b': 307 339 case 'B': 308 $noteVal = 2; 340 if($this->european == 'yes'){ 341 $noteVal = 1; 342 }else{ 343 $noteVal = 2; 344 } 309 345 break; 310 346 case 'c': … … 327 363 case 'G': 328 364 $noteVal = 10; 365 break; 366 case 'h': 367 case 'H': 368 $noteVal = 2; 329 369 break; 330 370 default: … … 357 397 break; 358 398 case 1: 359 if($useFlats) $xlatedNote = "Bb"; 360 else $xlatedNote = "A#"; 399 if($this->displayEuropean){ 400 $xlatedNote = 'B'; 401 }else{ 402 if($useFlats) $xlatedNote = "Bb"; 403 else $xlatedNote = "A#"; 404 } 361 405 break; 362 406 case 2: 363 $xlatedNote = 'B'; 407 if($this->displayEuropean){ 408 $xlatedNote = 'H'; 409 }else{ 410 $xlatedNote = 'B'; 411 } 364 412 break; 365 413 case 3: -
chords-and-lyrics/trunk/readme.txt
r250154 r539307 47 47 48 48 == Frequently Asked Questions == 49 = Is it possible to customize the formatting of the lyrics and chord symbols =49 = Is it possible to customize the formatting of the lyrics and chord symbols? = 50 50 Yes. Adjust the CSS in your theme. 51 51 Chords are wrapped within <div class="cnl"><div class="chord"><strong> tags. 52 52 Lyrics are wrapped within a <div class="cnl"><div class="lyric"> tags. 53 = Can I display European chords? = 54 Yes. Beginning with version 1.7, European chord convention is supported. 55 A new option in the Reading Settings allows enabling display using aHcdefg instead of abcdefg. 56 For entering chords in a post using European chord convention, add the european=yes argument 57 to the chordsandlyrics short tag (eg. [chordsandlyrics european=yes]) 53 58 54 59 == Directions for Use == … … 72 77 == Changelog == 73 78 79 = 1.7.0 = 80 * Add support for European chord style (aHcdefg, B=Bb) 81 74 82 = 1.6.0 = 75 83 * Fix bug preventing headings from showing.
Note: See TracChangeset
for help on using the changeset viewer.