Birthday Plugin for Geeklog
by Mike Lynn mike@mlynn.com
This plugin was written using the Universal Plugin and the Plugin Developers API.
Description
The Birthday plugin was written as a method for me to learn the Geeklog API.
Thanks to Blaine Lang, Tom Willett and Vincent Furia for this document.
This plugin doesn't do much other than let members view/enter/maintain their own birthdates. It comes equipped with a block that displays the current month's birthdays and next months.
Functionality
- Birthday listing: Driven by /birthdays/index.php, this plugin
displays birthday records for members. It uses a variable called filter_month to control
what member birthdays are displayed. Selecting ALL displays a list of all registered users
and any corresponding data from the birthdays table.
- Birthday Edit Screen: Users may only edit their own birthday (unless they are in the birthdays.admin group.
Order Now and Get a Free BLOCK!
(just kidding - it's always free)
The plugin comes with a block - phpblock_birthdays() - this block simply displays member birthdays for this
and the next month.
The block also displays a link for users to add their birthday.
Just remember to create the block and add this bit to your lib-custom.php:
/**
* Birthday Block
*
* this is a block that reads from the birthday plugin by mike lynn
*
*/
function phpblock_birthdays() {
global $_CONF;
include_once($_CONF['path_html'] . "../plugins/birthdays/functions.inc");
$retval = block_birthdays();
return $retval;
}
Language Support
This plugin supports multiple languages. However, I've only provided english (any volunteers?).
Date Formats
You can control how the birthdays are displayed. The following formats are available in config.php:
Format
| Example
| Actual Date
|
dm |
11/1 |
January 11th |
md |
1/11 |
January 11th |
mmmd |
Jan/11 |
January 11th |
dmmm |
11/Jan |
January 11th |
Data
The Birthday Plugin uses a single table (called gl_birthdays oddly enough).
CREATE TABLE gl_birthdays (
bd_id int(11) NOT NULL auto_increment,
uid int(10) NOT NULL default '1',
day int(2) default NULL,
month int(2) default NULL,
year int(4) default NULL,
PRIMARY KEY (bd_id),
KEY uid (uid)
) TYPE=MyISAM;
The uid column is a link to the gl_users.uid column. Currently, year is not used.
Screenshots
Birthday Listing: |  |
Birthday Edit: |  |
Birthday Block: |  |
Getting the Plugin
I'm not sure where this will end up - but you can check
here.
Installing
Check out the install guide.
Stuff it doesn't do (yet)
- Add proper paging for the main birthday display.
- Integrate / add patches for calendar to make birthday's appear on the calendar (any volunteers?)
- Create more formatting options
- Complete additional language patches (any volunteers?)
- Integrate a line item into the menu structure
- Suggestions anybody?
- Add smarts to the editor form so that it only displays the proper number of days for the month displayed (tricky javascript bit).
- Create a mass import feature to import a large amount of birthdata.