Ticket #8188: 8188.r9683.diff
| File 8188.r9683.diff, 1.5 KB (added by jacobsantos, 4 years ago) |
|---|
-
hello.php
1 1 <?php 2 2 /** 3 3 * @package Hello_Dolly 4 * @author Matt Mullenweg 5 * @version 1.5 4 6 */ 5 7 /* 6 8 Plugin Name: Hello Dolly … … 11 13 Author URI: http://ma.tt/ 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 18 21 You're lookin' swell, Dolly … … 41 44 Dolly'll never go away 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); 48 49 50 // And then randomly choose a line 51 return wptexturize( $lyrics[ mt_rand(0, count($lyrics) - 1) ] ); 52 } 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 } 54 59 … … 61 66 <style type='text/css'> 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> 72 76 "; … … 74 78 75 79 add_action('admin_head', 'dolly_css'); 76 80 77 ?> 78 No newline at end of file 81 ?>
