Closed (fixed)
Project:
Birthdays
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Sep 2007 at 14:50 UTC
Updated:
13 Jul 2009 at 20:40 UTC
Hi all,
I would like to add the picture of users on the Birthdays block.
Today, the block show user name, age and date.
I would like to add the user avatar !
(next to user name for example)
Could you please help me ?
Thanks in advance,
Jeremy
Comments
Comment #1
maartenvg commentedYou have to override theme_birthdays_block() by copying the entire function to your template.php and renaming it to themename_birthdays_block(). Then add the appropriate PHP & HTML code for the user picture.
something like this.
Replace
with
Which added a 'theme('user_picture', $user)'.
Comment #2
maartenvg commentedComment #3
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
alextronic commentedHi Maarten,
I'm using Drupal 6.10, I'm using a Birthdays block and in my custom "birthdays-block.tpl.php" I have the following:
...but the picture does not display. I've read the posts above but I don't know if they apply for D6, or if there has been any advance and maybe there's an easy way to insert user's images in blocks.
(By the way, I never found the function theme_birthdays_block()!! ...I hope I don't have to deal with it)
Thanks in advance.
Comment #5
alextronic commentedOK, I did it. In the birthdays templates (page and/or block), create new column (
<td>) in the table's header, Then add the corresponding<td>cell inside the foreach($birthdays as $birthday) loop that follows; something like this:<td><?php if (!empty($birthday['account']->picture)) { print "<img src='".$birthday['account']->picture."'></div>"; } else { print "No image available"; } ?></td>Hope it helps to others.