Make WordPress Core

Changeset 9684


Ignore:
Timestamp:
11/14/2008 05:52:38 PM (15 years ago)
Author:
ryan
Message:

Hello Dolly update. Props zedlander and jacobsantos. fixes #8188

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/plugins/hello.php

    r9001 r9684  
    22/**
    33 * @package Hello_Dolly
     4 * @author Matt Mullenweg
     5 * @version 1.5
    46 */
    57/*
     
    1214*/
    1315
    14 /** These are the lyrics to Hello Dolly */
    15 $lyrics = "Hello, Dolly
     16function hello_dolly_get_lyric() {
     17    /** These are the lyrics to Hello Dolly */
     18    $lyrics = "Hello, Dolly
    1619Well, hello, Dolly
    1720It's so nice to have you back where you belong
     
    4245Dolly'll never go away again";
    4346
    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}
    4853
    4954// This just echoes the chosen line, we'll position it later
    5055function hello_dolly() {
    51     global $chosen;
     56    $chosen = hello_dolly_get_lyric();
    5257    echo "<p id='dolly'>$chosen</p>";
    5358}
     
    6267    #dolly {
    6368        position: absolute;
    64         top: 2.3em;
     69        top: 4.5em;
    6570        margin: 0;
    6671        padding: 0;
    67         right: 10px;
    68         font-size: 16px;
    69         color: #d54e21;
     72        right: 215px;
     73        font-size: 11px;
    7074    }
    7175    </style>
Note: See TracChangeset for help on using the changeset viewer.