Group records by DATE

DBirthdays module (mod_dbirthdays) shows nearest birthdays (future or past) of your site users.

Group records by DATE

Postby brejualva » Tue Jul 06, 2010 11:41 pm

For example, if several people birthday the same date that appears once the date and then the list of people..

brejualva
 
Posts: 2
Joined: Tue Jul 06, 2010 3:45 pm

Re: Group records by DATE

Postby Darkick » Wed Jul 07, 2010 6:02 am

You are not first who asks about this function. I'll think about this in next versions.

Darkick
 
Posts: 203
Joined: Fri Sep 04, 2009 10:16 pm
Location: Russia, Ekaterinburg

Re: Group records by DATE

Postby brejualva » Mon Aug 09, 2010 3:17 pm

Thanks,

and I could help by changing the query please. IN HELPER.PHP

foreach ($rows as $row) {
$birthday = &JFactory::getDate($row['birthday']);
$age = (int)round(($today->toUnix() - $birthday->toUnix()) / (365 * 24 * 60 * 60));
$birthday_details = getdate($birthday->toUnix());
$new_birthday = &JFactory::getDate(mktime(0, 0, 0, $birthday_details['mon'], $birthday_details['mday'], $birthday_details['year'] + $age));
$days_left = (int)round(($new_birthday->toUnix() - $today->toUnix()) / (24 * 60 *60));
if (($days_left <= $days_before) && ($days_left >= -$days_after)) {

//CHANGE---------
$list[(200 + $days_left).'_'.$row['name']] = array('id' => $row['id'],'birthday' => $birthday, 'name' => $row['name'], 'new_birthday' => $new_birthday, 'age' => $age, 'days_left' => $days_left);

brejualva
 
Posts: 2
Joined: Tue Jul 06, 2010 3:45 pm


Return to DBirthdays

Who is online

Users browsing this forum: No registered users and 1 guest

cron