>Birthdays Module for Drupal

Birthdays Module for Drupal


This is my first open-source contribution for the Drupal project. The birthdays module was created out of a personal need to remember all my friend's birthdays, but also because as much as people have been asking for one, no one has made one yet, although some quick hacks have been put up on the Drupal Forum.





Features:

 

  • A block of upcoming users birthdays (currently next 6)
  • A page list of all the user's birthdays
  • Displays user's star sign, and hooks into Yahoo Horoscopes
  • A display of the user's birthday/current age/starsign on the user's profile
  • Automatically e-mails administrator with upcoming birthdays in a certain number of days (currently 7)
  • Automatically e-mails user on their birthday
  • If the postcard module is installed, will automatically create an e-card to send them on their birthday (this requires the postcard module from: http://drupal.org/project/postcard)

 

Screenshots:

 

Because I don't have a demo site to run it on, I've provided a few screenshots as I know how everyone wants to 'see' what a module does before they install it.

Birthdays module List Page screenshotBirthdays module List Page screenshot Birthdays Block Lists upcoming user birthdaysBirthdays Block Lists upcoming user birthdays User profile page view. Clicking starsign takes you to Yahoo HoroscopesUser profile page view. Clicking starsign takes you to Yahoo Horoscopes DOB edit field on user's edit pageDOB edit field on user's edit page

 

 

Requirements:

 

This module has been written for Drupal 4.7 and above, and tested againsted MySQL V.5.0.18. If e-card functionality is required, please install the Postcard module from http://drupal.org/project/postcard.

 

To Do:

 

I am providing this module 'working', however I have a few things that need to be done before this module can be used easily by most users. The major limitation at the moment is for times sake, I have hard-coded most of the values so you may need to go into the code to modify certain values such as how many upcoming birthdays to display etc. This is because I haven't built a settings page for the module yet. Below is a list of things to do:

 

  • Add a settings page to modify module settings/remove hard-coded values
  • Add form for users to enter DOB on registration
  • Add automatic install to setup database automatically when module first used
  • Port module to Drupal V.5.0


Design Notes:

 

I've seen a lot of people asking for the DOB to be stored with the profile module, and the birthdays module read from a profiles field. However, there is a problem with this I found, in that the profiles field stores dates in the database as an array, which makes it imposible to filter dates easily. So I've created a new table using a date field to store the DOB, this way the database date functions can be used instead. I've tried to keep as much sorting/filtering in the database as possible for performance reasons on large websites. Currently it's using MySQL's days() function to show upcoming birthdays and find user's with birthdays today - however I've seen it doesn't seem to work so well, sometimes user's get an automatic e-mail the day after their birthday, and don't disapear from the block either. I'm assuming this has something to do with leap years, and I'll look into it in more detail for the next relase.

 

Known Issues:

 

  • Birthdays sometimes appear in block after the birthday has passed. Possibly to do with use of MySQL days() function.
  • Automatic e-mail/postcard does not always get sent to users, sometimes a day late, sometimes not at all
  • Admin reminder e-mail only shows one user's upcoming birthday even if there is more than one on the same day


Download:

 

The Birthdays module is now available from Drupal.org: http://drupal.org/project/birthdays

This is a wonderful module-- many thanks for all your hard work! i do have a question. in the birthdays list, it lists: User Birthday Age Starsign Profile Picture Is there any way to change it to display a profile field, like their name for example, instead of the user? Any help would be great! Thank you again very much for all your work on this module!
dgildeh's picture
This is possible, its not part of the current release but definately a feature that can be included. The module already integrates with the profile module to store the user's date of birth. Please submit this comment to the issue forum for this project on Drupal.org. I will be closing the comments on this page now as we should be using that ongoing.
when is planned realization visible for Views module (age) ? do, please, project is not started
Your module works flawlessly right out of the box on a fresh Drupal 5.1 install, it's rare enough to be noticed :) Any plans to support "feast days" (don't know whether it's the good translation) ? If you need French translation, I can handle it have a nice day !
dgildeh's picture
Thanks a lot for the feedback, you can thank Maarten for the version 5 release as he rewrote the new version (I released the module to Drupal.org not just to share the new feature but cause I didn't have time to work on it and luckily other people have come to pick it up!) I don't know what feast days are, but in Greece they have Name Days, and the rest of the world anniversaries, so I can see a lot of potential to store these dates against a user and send out a custom e-mail etc. on that day etc. Maybe we can create new 'catagories' of anniversaries on the interface to allow users to have multiple dates that the administrator can create? As for French translation, would be great, so feel free to work on it and submit it! David
this option is not shown to users...when they register or during edit.. only the webmaster is able to see and edit..why is this?? i am using Drupal 5.1 pls help
This module have not multisite suport, when users table is shared for many sites.
Is there a way not display the age and year of birth? Or at least make it optional. Thanks.
Hello, When you look at the screenshots above. I can't find that two list ( Birthdays Block and Birthdays Page ). Can you please help me.
How Bithday Module connecting(linking) with Profile, for get data from this module
Hello, I installed the bday module on my portal bur i am facing the problem is that it is not showing the birthdays of the people. so please tell me what is wrong with it. with regards Mukesh Kumar Admin kaa.siddhast.com
dgildeh's picture
Not much I can do to help you based on the limited information you've provided. Please submit this issue to the projects issue forum on Drupal.org. The direct link is here: http://drupal.org/project/issues/birthdays As an ongoing note - please do not use this page to post issues you have with the module! Please use the Issue forum above where it can be managed effectively. Thanks.
I want to build a Community. Is it possible to give each registered user its own birthday remember or is it only a general feature.
dgildeh's picture
At the moment, you can only select if all reminders are sent for all users or not. If you would like this as a feature feel free to submit a patch to us, or we will look into it as a future release feature.
when the module for Drupal 5 comes.. please do let me know.. please
I've created a patch to convert the current version to Drupal 5.1. It also fixes some bugs en issues mentioned above (mostly MySQL wise), does optimalizations and makes almost everything configurable and translatable. All dates are localized based on the locale of the website (using drupal's functions). Please review the code of the patch (especially David) and test it extensive, I hope it works for everyone. You can find it here: http://drupal.org/node/114909, along with some other remarks about it.
I've made a patch to change to the 5.1 version of drupal. It also fixes some bugs and optimalizations (mostly in the queries), added a settings page making most features optional. I also added a second block-type, and I think all strings are translatable now. The dates are adapted to your locale. It isn't reviewed yet (please do!), but it works as far as I could see. The patch can be found in the issues list here: http://drupal.org/node/114909
Any news on whether this module would be updated for Drupal 5 yet? Thanks! jacauc
I have been playing around with this module but I still can't find where to put the DOB. Did I install this incorrectly? Is there a specific way to put in the DOB or for my users to put in their DOB..thanks...
Can't seem to get this to work with drupal-4.7.5 even after numerous attempts with clean installs - nothing shows under the user account edit tab after enabling the module. Any ideas on when this will be available for Drupal 5.1? This would be a really great module for many drupal sites and seems to be the only one of its kind. Thanks.
dgildeh's picture
Hi, Thanks for all your great feedback! I will endevour to work on this in the near future but please bear with me. Anyone with any patches I'd be happy to receive them and add them into the module. I know there are a few issues with it which is why its still in 'Head' release, but I do have this working fully on my own personal site (but you won't see it unless you login).
Wow! great work! Can't wait to see this for Drupal 5 :D been waiting for a VERY long time for something like this!
I like the looks of it and will hopefully put it into use in a social networking site in the near future. Thanks for your contribution to Drupal!
Hi, I tried to use your module in my drupal website, but unfortunately I get the following error message on the page which should display the birthdays: user warning: Column 'birthday' in field list is ambiguous query: SELECT dob.uid, users.name, substring(birthday,6,2) as `month`, right(birthday, 2) as `day`FROM dob, users WHERE users.uid = dob.uid AND DAYOFYEAR(birthday) >= DAYOFYEAR(curdate())order by month, day limit 0,6 in /home5/f4134030/public_html/_abi07/drupal/includes/database.mysql.inc on line 120. Besides, I can't see the DOB edit field on the user edit page. Formerly I used another birthday module from the drupal forums, but that did not work properly, so I really appreciate your work.
Ok, thats interesting for me.. Thank you.
is it Drupal 5.x compliable ? I like your module anyway. Thanks
Hi there. I'm having a hard time getting the module to work on Drupal 4.7.4. I can see the block, but I can't find a place where the user specifies their birthday. I've look into the access control and authenticated users are already set to allow access birthdays, edit DOB and access user profiles. I can't see the field as an administrator either. It's supposed to be at a the /user/nn/edit page, right? Is there anything else I might be missing? Thanks in advance for any help you can provide.
dgildeh's picture
I have had problems submitting my project to Drupal.org. There is a CVS directory called 'birthdays' however it is being used by another project which I can't find, and the directory is empty. Posting forums and private messages to the drupal admin hasn't got any response. As soon as I get it sorted, this project will finally have an 'official' project page on Drupal.