• allyngibson

    (@allyngibson)


    I’ve written my first WordPress plug-in.

    Once installed, the plug-in generates a date in Shire Reckoning, the calendrical system in use in the Shire in Middle-Earth during the late third age. I’ve done this before, but as a BASIC program. Now I’ve rewritten the program in fairly simple .php code.

    Interested parties may download the plug-in here.

    How does one call the plug-in? I inserted the following code into my sidebar.php file:

    <?php shire_reckoning(); ?>

    The function can also take arguments in the order (month, day, year). The default is to generate the current date.

Viewing 6 replies - 16 through 21 (of 21 total)
  • Thread Starter allyngibson

    (@allyngibson)

    Users who would like to download the “On this date in Middle-Earth history” may do so now.

    The .zip file contains two files.

    shire.php, which generates the date only and which was released a few days ago.
    shire2.php, which generates the date and also lists important happenings on that day in Middle-Earth history.

    The updated plug-in is called in almost the same manner.

    <php shire_reckoning2(); ?>

    The Shire2 plug-in can take four arguments (month, day, year, info). The fourth argument, info, is either true or false, and determines whether or not you want the historical information listed.

    tgrisier

    (@tgrisier)

    Ok, I love this plugin but how do I turn off the bullets?

    Thread Starter allyngibson

    (@allyngibson)

    Open the .php code in a text editor and strip out the [li] tags, and replace the [/li] tags with maybe something like <br>. If you want to try this file, I’ve made that change.

    Sorry, I should have thought of something like that. I wrote the plug-in so it would look nice with my own set-up, not realizing that other set-ups are different.

    jennmiller

    (@jennmiller)

    Got it working on both my sites. Thanks for the bonus!

    vkaryl

    (@vkaryl)

    That’s great, Allyn! I capitalized the day and month names, and added a break tag and some square brackets around the info sentences – makes it display better in Quentin…. Thanks for this truly nifty additive!

    tgrisier

    (@tgrisier)

    Thanks a million, Allyn. Works like a charm.

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘New Plugin: Shire Reckoning’ is closed to new replies.