My First Plugin

April 11th, 2005 | Categories: Projects, Wordpress | Tags:

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.

  1. April 11th, 2005 at 14:25
    Reply | Quote | #1

    A very nice plugin:)

    Thanks for sharing.

  2. April 11th, 2005 at 17:17
    Reply | Quote | #2

    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?

  3. April 11th, 2005 at 20:05
    Reply | Quote | #3

    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

  4. April 11th, 2005 at 20:38
    Reply | Quote | #4

    I’ve got the same Thomas’ question.

  5. shep
    April 11th, 2005 at 20:48
    Reply | Quote | #5

    you can see it in action on the main page, next to the comment link, it says On This Date:

    as for the loop, http://codex.wordpress.org/The_Loop explains what the loop is better than i could.

    also check: http://wordpress.org/support/topic.php?id=30528 for updates and problems with the plugin.

  6. April 11th, 2005 at 21:15
    Reply | Quote | #6

    I like this plugin! I just installed in on my site. Thank you.

  7. April 12th, 2005 at 03:34
    Reply | Quote | #7

    Great idea! I have just installed it at my site (with some slight modifications…)

  8. April 12th, 2005 at 12:23
    Reply | Quote | #8

    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/

  9. April 13th, 2005 at 09:38
    Reply | Quote | #9

    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>”;
    }
    ?>

  10. April 17th, 2005 at 16:12

    i use your plugin on comments! stays very nice.

    tks!

  11. July 20th, 2005 at 07:01

    Thanks for this plugin (and for the german translation, of course). I use it for my site now!

  12. October 13th, 2005 at 21:10

    Nice plugin ! I enjoyed it so much I translated it to french, adding some extra options.

    French people, feel you free to visit this_day in history en français.

  13. immi
    October 16th, 2005 at 03:06

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

  14. shep
    October 16th, 2005 at 09:31

    immi, php’s date function doesn’t go back past 1970.

  15. November 19th, 2005 at 03:01

    Nice one – I’ve got it on my blog at

    http://nixit.co.nz/wordpress

    it works on WP 2.0 Beta too:

    http://nixit.co.nz/new

  16. November 19th, 2005 at 19:42

    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

  17. November 19th, 2005 at 19:42

    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?

  18. shep
    November 19th, 2005 at 21:58

    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.

  19. August 21st, 2006 at 14:31

    The script doesn’t seem to work on the Spanish version of WordPress available at http://wordpress-es.sourceforge.net, so I did a WP es_ES version:

    */
    function this_day($dia,$mes) {
    $fecha = $dia."_de_".strtolower($mes);
    echo "según la Wikipedia";
    }
    ?>

    Thank you for the great idea though ;)

  20. September 23rd, 2006 at 17:24

    Hi Mike,

    Inspired by your plugin, I made some modifications and turned it into a widgetized current day sidebar plugin.

    You can check it out http://jeroenonstenk.nl/maakt/wordpress/1/