I have created a new plug-in that will display the members who are having birthdays on the current month. It has many features, all which are explained in the README. There is also an example as well. Feel free to download the plugin from the left hand side.
Here is the README file:
BASIC USAGE:
{exp:pd_birthdays noresults=”None this month. <a href=add.php>add yours!</a>” month=”4″ day=”1″ showage=”no”}
… formatting and variables …
{/exp:pd_birthdays}
PARAMETERS:
month=”4″ (defaults to the current month)
If you wish to specify a month instead of using the current month, set this whatever numeric month you wish. eg. You only want to see december birthdays, you would use month=”12″
day=”12″ (defaults to the current date)
Like the month variable, this allows you to specify the day of the month to use. Otherwise this will default to the current day of month.
noresults=”No Birthdays” (Default)
If you wish to specify a short blurb to say there no birthdays that month, use this parameter. Please be sure not to use any single quotes or double quotes. This will cause anything after the single and double quotes to think the parameter value has ended, and not show everything.
showage=”No” (Default)
If you wish to display the ages of those members who are listed, then set this to showage=”Yes”. Otherwise it will not show anything.
VARIABLES:
{membername} – The name of the member having a birthday for the month. This will automatically link to the member’s homepage.
{url} – The member’s home page URL.
{bday_d} – The day of the birthday
{bday_m} – The month of the birthday
{bday_y} – The year of the birthday
{date format=”%m %d %y”} – This will display the date (not time) in format specified by format.
{age} – if showage is set to “yes” then this variable will display the member’s age.
VARIABLE PAIRS:
{date_heading}{date format=”%M”}{/date_heading} – This will enable you to show the date only once instead of many times.
CONDITIONALS:
{if birthday}
{/if}
- This will check to see if the member’s birthday is that day. If so, you can put alternate wording.
{if not_birthday}
{/if}
- Use this in conjuction with if birthday. If the users birthday is NOT that day, then you will see the output within these tags.
{if}{/if}
- You may use conditionals for all variables. eg. {if membername == “yoshi”}Hi Yoshi!{/if}
EXAMPLE:
This following example will display the current birthdays for the month and tell happy birthday to whomever may have a birthday that day:
{exp:pd_birthdays showage=”yes”}
{date_heading}{date format=”%F”} Birthdays:{/date_heading}
{if birthday}
{bday_d}: Happy Birthday, {membername}! ({age})
{/if}
{if not_birthday}
{bday_d}: {membername}
{/if}
{/exp:pd_birthdays}
Note that the age is only shown for those having a birthday that day.
- Excited
- Fascinated
- Amused
- Bored
- Sad
- Angry
Hey Yoshi, if you’re around/not too busy – can you have a look at this? Your plugin is throwing some errors and Rick said to talk to you about it… ;)
After I upgraded to EE 1.3 my birthday plugin started giving me some errors. The birthday will display but not without the errors on the main index page.
Notice: Use of undefined constant url – assumed ?url? in /home/hillopituus/public_html/hillo/plugins/pi.pd_birthdays.php on line 49
Notice: Undefined variable: not_birthday in /home/hillopituus/public_html/hillo/plugins/pi.pd_birthdays.php(126) : eval()?d code on line 1
Notice: Undefined variable: month_flag in /home/hillopituus/public_html/hillo/plugins/pi.pd_birthdays.php on line 143
I?ve since taken the code out of the template, I didnt really want all that info up there for all to see. I erased and reinstalled the plugin, but it didn?t help.
Can you shed some light on this? Thanks in advance :)
Luka