<?php
/*
Plugin Name: Moose Candy
Version: 1.2.0
Plugin URI: http://jason.goldsmith.us/wp-plugins/moosecandy.phps
Description: This is a special plugin just for <a href="http://blog.nuclearmoose.com">NuclearMoose</a>
Author: Jason Goldsmith (Unteins)
Author URI: http://jason.goldsmith.us
*/ 

/*
Installation: Save this file into your wp-content/plugins folder and rename it to moosecandy.php

Usage:     To use this plugin, you need to populate the PHP array with the text
        you want to appear at the beginning of each post. This plugin will add
        each item before the appropriate post on the page, so if:
        $candy[1] = 'Hi mom';
        then the text "Hi mom" will appear before the first post
        on the other hand if:
        $candy[4] = 'The awesome 4th post of the page!';
        then the text "The awesome 4th post of the page!" will appear before the 
        4th post on the page.
        
        $candy[n] must be a valid PHP string or be able to be cast into
        a string. 
        
        That's all there is to it.
*/
$candy[1] = 'The Moose is Loose!';
$candy[4] = 'Is that REALLY an almond?';

// Don't change anything below this line
$dropping 1;

function 
moosecandy($text)
{
    global 
$dropping$candy;
    if (isset(
$candy[$dropping]))
    {
        
$the_date "<div id=\"moosecandy$dropping\" class=\"moosecandy\">";
        
$the_date .= $candy[$dropping];
        
$the_date .= '</div>';

        
$dropping++;    
        
$text $the_date "\n" $text
    }
    else { 
$dropping++;}
    return 
$text;
}

add_filter('the_date''moosecandy');
?>