Changeset 140604
- Timestamp:
- 07/29/2009 06:20:29 PM (17 years ago)
- Location:
- wplyrics/trunk/wplyrics
- Files:
-
- 2 edited
-
wp_lyrics.php (modified) (11 diffs)
-
wplyrics.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wplyrics/trunk/wplyrics/wp_lyrics.php
r140600 r140604 2 2 /* 3 3 Plugin Name: WP-Lyrics 4 Plugin URI: http:// bloqnum.com/wp-lyrics/5 Description: Simple plugin to hide the lyrics of the songs you publish (they will be between [lyrics] and [/lyrics]) 4 Plugin URI: http://wordpress.org/extend/plugins/wplyrics/ 5 Description: Simple plugin to hide the lyrics of the songs you publish (they will be between [lyrics] and [/lyrics]). Allows you to customize the replacement text. 6 6 Author: Adrian Moreno 7 Version: 0. 27 Version: 0.3 8 8 Author URI: http://bloqnum.com 9 9 */ … … 58 58 */ 59 59 function hidelyrics($content = '') { 60 60 61 $options = $this->load_options(); 61 62 62 $pre = "<h5 class='wplyricstitle'>".$options['title']." <a class='wplyricslink' title='".$options['more']."' onclick='open_lyrics(this);' style='cursor:pointer;display:none;'>[+]</a></h5><div class='wplyrics'>"; 63 $pre = "<h5 class='wplyricstitle'>"; 64 $pre .= $options['title']; 65 $pre .= " <a class='wplyricslink' title='"; 66 $pre .= $options['more']; 67 $pre .= "' onclick='open_lyrics(this);' style='cursor:pointer;display:none;' >"; 68 $pre .= $options['symbol1']; 69 $pre .= "</a></h5><div class='wplyrics'>"; 70 63 71 $post = "</div>"; 64 72 … … 73 81 add_option('wp_lyrics_more', 'Show the lyrics...'); 74 82 add_option('wp_lyrics_less', 'Hide the lyrics...'); 83 add_option('wp_lyrics_symbol1', '[+]'); 84 add_option('wp_lyrics_symbol2', '[-]'); 75 85 } 76 86 … … 79 89 $wp_lyrics_more = get_option('wp_lyrics_more'); 80 90 $wp_lyrics_less = get_option('wp_lyrics_less'); 91 $wp_lyrics_symbol1 = get_option('wp_lyrics_symbol1'); 92 $wp_lyrics_symbol2 = get_option('wp_lyrics_symbol2'); 93 81 94 82 95 $options = array( 83 96 'title' => $wp_lyrics_title, 84 97 'more' => $wp_lyrics_more, 85 'less' => $wp_lyrics_less 98 'less' => $wp_lyrics_less, 99 'symbol1' => $wp_lyrics_symbol1, 100 'symbol2' => $wp_lyrics_symbol2 86 101 ); 87 102 return $options; … … 100 115 'title' => $options['title'], 101 116 'more' => $options['more'], 102 'less' => $options['less'] 117 'less' => $options['less'], 118 'symbol1' => $options['symbol1'], 119 'symbol2' => $options['symbol2'] 103 120 )); 104 121 … … 115 132 116 133 } 117 118 119 134 120 135 /* … … 123 138 124 139 function add_admin_pages(){ 125 //add_submenu_page('options-general.php', "WP Lyrics", "WP Lyrics", 10, "WP Lyrics", array(&$this,"output_sub_admin_page_0"));126 140 add_options_page('WP Lyrics Options', 'WP Lyrics', 8, 'wp_lyrics', 'output_admin_page'); 127 141 } … … 137 151 $wp_lyrics_more = get_option('wp_lyrics_more'); 138 152 $wp_lyrics_less = get_option('wp_lyrics_less'); 139 153 $wp_lyrics_symbol1 = get_option('wp_lyrics_symbol1'); 154 $wp_lyrics_symbol2 = get_option('wp_lyrics_symbol2'); 155 156 140 157 // Read in existing option value from database 141 158 $opt_val = get_option( $opt_name ); … … 148 165 $wp_lyrics_more_val = $_POST['wp_lyrics_more']; 149 166 $wp_lyrics_less_val = $_POST['wp_lyrics_less']; 167 $wp_lyrics_symbol1_val = $_POST['wp_lyrics_symbol1']; 168 $wp_lyrics_symbol2_val = $_POST['wp_lyrics_symbol2']; 169 150 170 151 171 // Save the posted value in the database … … 153 173 update_option( 'wp_lyrics_more', $wp_lyrics_more_val ); 154 174 update_option( 'wp_lyrics_less', $wp_lyrics_less_val ); 175 update_option( 'wp_lyrics_symbol1', $wp_lyrics_symbol1_val ); 176 update_option( 'wp_lyrics_symbol2', $wp_lyrics_symbol2_val ); 177 155 178 156 179 // Put an options updated message on the screen … … 178 201 </p> 179 202 203 <p><?php _e("Clickable 'View more' link text:", 'wp_lyrics' ); ?> 204 <input type="text" name="wp_lyrics_symbol1" value="<?php echo $wp_lyrics_symbol1; ?>" size="4"> 205 </p> 206 207 <p><?php _e("Clickable 'View less' link text:", 'wp_lyrics' ); ?> 208 <input type="text" name="wp_lyrics_symbol2" value="<?php echo $wp_lyrics_symbol2; ?>" size="4"> 209 </p> 210 180 211 <p class="submit"> 181 <input type="submit" name="Submit" value="<?php _e('Update Options', ' mt_trans_domain' ) ?>" />212 <input type="submit" name="Submit" value="<?php _e('Update Options', 'wp_lyrics' ) ?>" /> 182 213 </p> 183 214 -
wplyrics/trunk/wplyrics/wplyrics.js
r140600 r140604 9 9 more = WPLyricsSettings.more; 10 10 less = WPLyricsSettings.less; 11 11 symb1 = WPLyricsSettings.symbol1; 12 symb2 = WPLyricsSettings.symbol2; 12 13 //change [+] 13 if (jQuery(el).html() == '[+]'){14 jQuery(el).html( '[-]');14 if (jQuery(el).html() == symb1){ 15 jQuery(el).html(symb2); 15 16 jQuery(el).attr('title', less); 16 17 }else{ 17 jQuery(el).html( '[+]').attr('title', more);18 jQuery(el).html(symb1).attr('title', more); 18 19 } 19 20 }
Note: See TracChangeset
for help on using the changeset viewer.