,

My First Plugin

I created my first plugin today, thanks to some help in #wordpress. Thanks guys. The plugin is simple, displays links to Wikipedia and BBC to show what happened on the date of that post.

Installation is simple and is explained in the readme.txt file. Any problems or questions, let me know.

This Date in History/This Day in History

Download it here

Also, feel free to donate for my hosting costs.

20 replies
  1. Caleb
    Caleb says:

    Very cool. I’m trying my best to gather 365 quotes for my Movie Quote one. Do you know if there is a certain code or command that would randomize the quotes I have so I don’t need 365?

  2. Thomas
    Thomas says:

    I have a question: Do you have this plugin activated somewhere? I’d like to see it in action.

    Also, in the readme.txt, it says insert this line of code in The Loop. Well, I’m confused. Am I looking for a filename called theloop or what is the filename?

    Thanks,
    Thomas

  3. BillH
    BillH says:

    Caleb, there is a plugin called ‘Random Quote of the Day’ that will randomize any number of quotes. You simply enter the quotes and then add a PHP statement outside The Loop to display a quote at random. The name is a bit of a misnomer as it actually displays a different quote each time you reload the page. Random Quote of the Day is found at http://www.mcmike.nl/

  4. Poeti
    Poeti says:

    Nice plugin!

    Thus it runs also in Germany
    <?php
    /* <WP plugin data>
    * Plugin Name: This Date in History
    * Version: 1
    * Description: Displays a link to what happened on this date in history
    * Author: Mike Schepker
    * Author URI: http://www.pieceofshep.com/
    * special thanks to skippy and bigjibby
    * fuer Deutschland modifiziert von http://www.poeti.de

    * add the following to the Loop: this_day(get_the_time(‘Y-m-j’));
    */

    function this_day($date)
    {
    $timestamp = strtotime($date);
    setlocale(LC_TIME, “de_DE”);
    $day = date(j,$timestamp);
    $upper_month = strftime(“%B”, $timestamp);
    $month = date(m, $timestamp);
    $year = date(Y, $timestamp);
    $url_date = $day.”._”.$upper_month;

    echo “<a href=”http://www.welt.de/data/$year/$month/$day/” title=”Die Meldungen dieses Tages in der Welt”>Heute</a> “;
    echo “<a href=”http://www.wikipedia.de/wiki/$url_date” title=”Die geschichtlichen Ereignisse dieses Tages bei Wikipedia.de”>Geschichte</a>”;
    }
    ?>

  5. immi
    immi says:

    Warning: date() [function.date]: Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in .. ?

  6. nix
    nix says:

    Although, what I’d like to know is why the date is 18 days out?

    I put the same code on both of my blogs and on the WP2.0 beta site the date is correct but on my main blog I am living historically.

    Any ideas

  7. nix
    nix says:

    Although, what I’d like to know is why the date is 18 days out?

    I put the same code on both of my blogs and on the WP2.0 beta site the date is correct but on my main blog I am living historically.

    Any ideas?

  8. shep
    shep says:

    nix, i noticed that too. i’m not sure why it’s doing that. the way it works is it automatically links to the day of whatever post it appears on. maybe because the plugin isn’t running from each post, but instead your sidebar, it’s causing a problem. email me if you like (use contact form) and i might be able to look at your code.

    cheers man.

Comments are closed.