October 29, 2006
CDay for WP Plugin

What happened on this day in history? What happened on your birthday? Web-based CDay, an almanac for web servers, reports events, birthdays, and holidays. At least that’s the opening line on the CDay website. I have used the PHP version of CDay on my WordPress blog for some time now. I like to be able to look at a day in history and see historic events and what historic figures were born on that day. CDay did this for me. I’ve even had some readers mention on their blogs that they go to my blog to see who was born on a particular day or what happened in history. I decided to edit the CDay program to be a widgetized WordPress plugin. I made the decision for multiple reasons. I wanted to let others know just how cool the CDay program was. I also wanted others to be able to easily include CDay on their WordPress blog’s sidebar. I also wanted to continue to develop my PHP skills. Out of all these wants, CDay for WP was born.

After downloading the ZIP file, unzip the contents leaving the directory structure intact. Next FTP the “cday” folder and all of its contents to your WordPress plugins directory; well, you don’t HAVE to upload the CDay_README file. This is typically at “/wp-content/plugins” on your web server.

Next, in the Admin Panel of your WordPress installation, in the “Plugins” area, activate CDay for WP. Note: once you activate CDay, it is not yet ready to use! Next you will need to go to the “Options” area of the Admin Panel and then to the “CDay” entry. You should have the initial import screen. Click the “Begin Import” button to import the events packaged with the CDay for WP plugin. (There are over 7000 events of different kinds in the included events file.) Once completed, the screen should refresh and you should now see the same import screen with a message stating a successful import. Click the “Finish” button to then remove the events file from your webserver and display the standard CDay management interface.

CDay for WP can be used as a typical WordPress plugin, but it also is widget-aware. If you have WordPress Widgets installed, simply go to the “Presentation” area of the Admin Panel. If your current theme is widget-ready, click on the “Sidebar Widgets” item and you’ll see the “CDay 4 WP” item in the available widgets.

If you do not have the Sidebar Widgets plugin installed GO GET IT AND INSTALL IT!! Seriously, though, you can insert the following line of code where you want CDay to display in your sidebar:

cday4wp();

Note that when you do this, all settings are handled by the plugin. The Admin Panel is where you enter the sidebar title text; the rest of the plugin is done as an unordered list, which is the absolute best and easiest way to set up your sidebar.

You can download the CDay for WP plugin in ZIP format by clicking here

Filed under: Computer Stuff,
Run batted in by BillH at 10:28 pm |

4 Comments

  • miklb said:  
    (On October 31st, 2006 at 8:00 pm)

    This seems like a great plugin, but trying to use this with a WP 2.1alpha-3 install produces two errors:
    Warning: Division by zero in /usr/home/frontier/public_html/WordPress/wp-content/plugins/cday/cday4wp.php on line 80
    Also, I had to make the cday folder writable to be able to finish the importing of a new file I created. I might have missed that in the read me.
    Once the plugin was activated, and the function placed in the template, this error occurred.
    Fatal error: Call to undefined function: gettext() in /usr/home/frontier/public_html/WordPress/wp-content/plugins/cday/db_mysql.php on line 163
    A quick Google shows me that perhaps my server isn’t configured for gettext. Is there a work around, or something I can do on my end server wise to implement the function?

  • BillH said:  
    (On October 31st, 2006 at 9:12 pm)

    I have resolved both of the errors described. The first was carried over from the original CDay program; it is a combination of the server being so fast and the file being so small that the time elapsed during the import is 0. I have since fixed this by computing the divisor before actually dividing and if the divisor is 0 a 1 is substituted.

    The second bug is due to your server not having the “gettext()” PHP function. It is a translating function, taking one language and translating it to the local language. Not all servers have this installed. I’ve included some code that simply echoes the English instead of translating it.

    The patched code is now available for download.

  • miklb said:  
    (On November 1st, 2006 at 6:42 pm)

    Thanks works great. And the plugin code is well commented, so it was easy to customize the output.
    Cheers.

  • Tate said:  
    (On November 17th, 2006 at 11:02 am)

    Does anyone know the name of the wordpress plugin that creates a list of your posts in a category instead of just displaying them one after the other? I want it so that when someone clicks on a category they just get a list of posts from that category.

    I'm sure Ive seen one…and sifting through the WP site is a nightmare

  • RSS feed for comments on this post.

    Sorry, the comment form is closed at this time.