Celebrating birthdays

"Happy Birthday! It's your special day". That's what this block is all about. This block is a great way to celebrate the birthdays of class members and teachers.

Note

Anthony Borrow is Moodle's "CONTRIB Co-ordinator", that means he co-ordinates code contributed to Moodle, among other things. All the module offerings reviewed in this book, that have been published in the last three years or so, have come before his eyes, and have been advised by his experience. The most amazing thing is that Anthony does this significant and necessary work voluntarily, despite offers of payment.

Anthony was asked to take on the role of CONTRIB co-ordinator after he contributed the Birthday block. Anthony was an early Moodle adopter. He has experience as an IT professional and continues to assist in the running of Moodle sites at a number of schools.

Apart from being a true Moodler, Anthony also leads an inspiring life as a Jesuit Priest, living in the United States. He speaks Spanish and is interested in Tai-Chi.

Getting ready

Unzip and copy the birthday block directory into the /moodle/blocks/ directory, then visit the Notifications page.

How to do it...

Before adding this block to courses, there are a few steps that must be taken at the site level. First, visit the block's global configuration page at Site Administration | Modules | Blocks | Birthday.

How to do it...

There are four settings on the configuration page:

  1. The first you can leave as is, but take note of the value for this setting, as you will need it later. The default is DOB.
  2. The second setting relates to the future time period for which birthdays are shown, in other words, how far into the future birthdays are checked. The default value is zero, which means birthdays occurring on the current date are shown. You can probe further by setting another value, for example seven days to look a week ahead.
  3. The third setting allows you to adjust the format of date values expected on your site. This may vary according to your location and culture, but may also depend on how dates are copied if they are sourced from another system.
    • The final setting allows you to control whether or not the block will appear when there are no birthdays to display. You may wish to save space if there are no birthdays, but this behavior is not the norm. It may confuse teachers if the block does not appear after they add it, just because there are no upcoming birthdays.

Save the changes to the Birthday block's global settings, then navigate to Site Administration | Users | Accounts | User profile fields. Here you will add a profile field for users' dates of birth:

How to do it...

In the drop-down list labeled Create a new profile field select the Text input option. You should be redirected to a new page in order to specify the new profile field:

How to do it...

The Common settings section has a number of settings you will need to change. The Short name should reflect the setting specified earlier in the Birthday block's global settings; the default there was DOB.

For the Name setting, enter an appropriate name that equates to Date of birth. You may also wish to add some prompt that indicates how the date should be entered if it is entered manually. You may also wish to add a description, but this is not seen by users.

The author of the Birthday block recommends that the field be locked. This means that it cannot be changed after it is first entered. You may wish to change the setting labeled Display on signup page depending on how user accounts are created on your site. If self-enrolment is possible, set this to Yes. Scrolling down you will see a grouping of Specific settings.

How to do it...

Leave the Default value setting blank. Set the Display size and Maximum length settings to 10 to accommodate sufficient characters for dates, including date-part separators. Save these settings and this field should now appear at the bottom of each user's Edit profile page.

How to do it...

With this field in place, it is also possible to include the field when creating accounts by uploading users.

You will only need to make these site-wide changes once. Afterwards, teachers can add the Birthday block as they see fit by selecting Birthday from the Blocks menu.

How it works...

Once added to a course page (assuming user's birthdays have been entered) the Birthday block will display current and upcoming birthdays. If there are no birthdays to show, the block will either be absent, or show the following (depending on the block's global visibility setting):

How it works...

When there are people having birthdays on the current day or (if a number of days has been specified) in coming days, they will be presented with their name and profile picture:

How it works...

Clicking on a user's name shows their profile. Clicking on the envelope below the user's profile allows someone to send a birthday greeting using the messaging facility.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.42.128