Thanks for the suggestion, and here's where we are at:
1. The extension does the following things correctly:
The SELECT statement works properly and returns a data set in MySQL for the day assuming the tl_member table has records in it for the current date and the checkbox "Show my birthday" is checked:
Code:
SELECT *, EXTRACT(YEAR FROM (FROM_DAYS(DATEDIFF(NOW(),FROM_UNIXTIME(dateOfBirth))))) AS lb_age FROM tl_member WHERE lb_showBirthday=1 AND MONTH(FROM_UNIXTIME(dateOfBirth)) = MONTH(NOW()) AND DAY(FROM_UNIXTIME(dateOfBirth)) = DAY(NOW());
The SELECT statement with the call to the current month
Code:
SELECT *, EXTRACT(YEAR FROM (FROM_DAYS(DATEDIFF(NOW(),FROM_UNIXTIME(dateOfBirth))))) AS lb_age FROM tl_member WHERE lb_showBirthday=1 AND MONTH(FROM_UNIXTIME(dateOfBirth)) = MONTH(NOW());
returns a data set with all member birthdays for the current month.
2. The sample template (lb_default.tpl / lb_default.xhtml) does not work when ucommented. It throws a white screen. If I show this code for the lb_default.xhtml
Code:
<ul>
<?php foreach($this->arrData as $birthday): ?>[*]
<?php echo $birthday['firstname']; ?>
<?php echo $birthday['lastname']; ?>
<?php echo $birthday['age']; ?>
<?php endforeach; ?>[/list]
Modify the birthday template to your needs!</p>
it returns one record correctly displayed as "John Doe 40" (age appears to be calculated correctly).
3. The sample template to display the result set on the frontend of the website will only display 1 record from the data set, always the record with the highest id number. We believe that the template is overwriting the data set and completing on the last record when multiple records are present.
4. The original developer Yanick Witschi ("yw_") has elected to no longer maintain or update this code and has released the copyright to me if I wanted to copy/edit/update this code. If one of you can fix this, then I would assume that Yanick would extend the same courtesy to you if you wanted to publish this to the extension repository as a working extension. I think having a functioning extension for birthdays would be useful in a number of situations.
5. My objective is to be able to show:
A list of today's birthdays AND
A list of all the birthdays for the current month if possible with the birthdate above the name and age.
6. I've attached the original extension in a zip directory if anyone wants to give this a go.
Any suggestions or ideas are certainly welcome. We're still poking at this, and if we have any success I will update this thread.
Ernest McDermon
Snellville, GA
Bookmarks