Hey,
Thanks again for this module, I'm finding it uber cool. I'm trying to get user pictures to show up in the notifications and I've resorted to using the following
<?php print theme('imagecache', 'user_image_small_thumbnail', $flagging_user->picture, $alt, $title, $attributes); ?>
inside the body text of the rule. The only issue is that this rendering of the user picture is static and will not change to reflect if the user changes their user picture. So if a user changes their user picture (or removes the old one) then the notification display does not pull the new user picture.
Are you considering a way to theme for this kind of stuff or perhaps a views integration of sorts for the rendering? Or, would you know of a way of achieving what I'm after without either of those?
Thanks,
Thomas
Comments
Comment #1
pribeh commentedAlright, I found the theme files (don't know why I didn't see them before) but am dumbfounded as to where I should try to call the user picture. I guess the challenge for me is figuring out how to universally define the picture of the user who's committed the action (commented on your blog, flagged (now following) you, etc.) and where to do that.
Comment #2
thomjjames commentedHi,
Good request, was hoping for requests like this related to the theming & API.
Yeh if put the imagecache definition in the rule action body it will be rendered and then the output saved to the database, so any picture changes won't be reflected.
I don't really want to start storing variables & templates and using a user_load call for each notification is a bit of a performance hit. I think the best solution is if I load in extra user data in on the notifications page query & then that user data is available in the $notifications object at theme level.
I'll have a play with this and see what works best, other solutions welcome!
Cheers
Tom
Comment #3
thomjjames commentedHi,
In the latest development snapshot the
$notificationsobject now contains the picture URL for the related user, so you can now copyuser-notifications-row.tpl.php(note the tpl name change) to your theme and use the following to output the users picture:print theme('imagecache', 'user_image_small_thumbnail', $notification->picture, $alt, $title, $attributes);Full example might be something like:
Hope that helps
Tom
Comment #4
pribeh commentedAmazing. Thanks Tom!