Hello everyone,

please don't be angry if I don't post this 100% correctly, it was quite difficult for me to get this to work, anyway...

Birthdays is not using the theme engine to display the usernames, which is obviously not as it should be (if you want to use real names, for instance).

That's why I changed part of the code to integrate the theme('username',$user) function. Here is the result.

More in detail, that's what I changed:

At line 243 (more or less, some linenumbers might have changed slightly):

$blockContent .= '<tr><td>' . theme('username',$user['name']) . ' </td><td> ' . $user['day'] . ' ' . $user['month'] . '</td></tr>';

Together with this, of course I also changed the two functions called just before.
line 479 (or one near it) now looks like this: (lines 435 and 450 look the same)

$birthdays[] = array('name' => $user, 'day' => $user->d, 'month' => $month);

I also changed the dbquery, because name was not needed anymore: (in line 460 and 425, more or less)

  $result = db_query("SELECT {dob}.uid, month({dob}.birthday) as m, day({dob}.birthday) as d

To have the same result on the birthdays page, it was easier:

$rows[$i] = array(theme('username',$birthday), $DOB, $age);

(line 391 more or less)

Just before, on line 360, I removed the call to u.name in the database query (useless, now):

$result = db_query("SELECT u.uid,  
            u.picture, 
            month(birthday) as m, 

I hope this can be of any use to someone, I really like this module, and I wanted to contribute a bit to it. Maybe one of the admins can commit my little code snippets to HEAD?

You'll find attached my version of the module (it's not a patch, it's the full file, I'm already if I can apply a patch, I guess it would take too long to create some as well), like that, you can test it for yourself and see if it works.

Have a nice day,

Felix.

CommentFileSizeAuthor
birthdays.module_1.patch21.13 KBfelixsmile

Comments

maartenvg’s picture

Status: Needs review » Closed (fixed)

Hi Felix,

Thank you very much for the work you've done. I never knew about theming the names, but now I do! :)

I've added your changes (but without your patch, because I changed a lot) to the new version which will be commited to CVS in a few days.