Changeset 9684
- Timestamp:
- 11/14/2008 05:52:38 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/plugins/hello.php
r9001 r9684 2 2 /** 3 3 * @package Hello_Dolly 4 * @author Matt Mullenweg 5 * @version 1.5 4 6 */ 5 7 /* … … 12 14 */ 13 15 14 /** These are the lyrics to Hello Dolly */ 15 $lyrics = "Hello, Dolly 16 function hello_dolly_get_lyric() { 17 /** These are the lyrics to Hello Dolly */ 18 $lyrics = "Hello, Dolly 16 19 Well, hello, Dolly 17 20 It's so nice to have you back where you belong … … 42 45 Dolly'll never go away again"; 43 46 44 // Here we split it into lines 45 $lyrics = explode("\n", $lyrics); 46 // And then randomly choose a line 47 $chosen = wptexturize( $lyrics[ mt_rand(0, count($lyrics) - 1) ] ); 47 // Here we split it into lines 48 $lyrics = explode("\n", $lyrics); 49 50 // And then randomly choose a line 51 return wptexturize( $lyrics[ mt_rand(0, count($lyrics) - 1) ] ); 52 } 48 53 49 54 // This just echoes the chosen line, we'll position it later 50 55 function hello_dolly() { 51 global $chosen;56 $chosen = hello_dolly_get_lyric(); 52 57 echo "<p id='dolly'>$chosen</p>"; 53 58 } … … 62 67 #dolly { 63 68 position: absolute; 64 top: 2.3em;69 top: 4.5em; 65 70 margin: 0; 66 71 padding: 0; 67 right: 10px; 68 font-size: 16px; 69 color: #d54e21; 72 right: 215px; 73 font-size: 11px; 70 74 } 71 75 </style>
Note: See TracChangeset
for help on using the changeset viewer.