Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am looking for the user id of the person who wrote the message? I am trying to print the user avatar by each message
$output .= $variables['picture'] = theme('user_picture', $user); butttttt $user isn't right its just print my avatar for everyone.... any idea what to replace user with I have tryed everything...
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedcan you give me more details? messages in most places in the code have $message->uid set to the uid of the author who wrote the message, so you probably need something like:
note this could get expensive very quickly.
Comment #2
giorgio79 CreditAttribution: giorgio79 commentedWhy is it expensive? :) Would be nice to style the chat after the smartphone chat apps that show a rounded user avatar :)
Comment #3
giorgio79 CreditAttribution: giorgio79 commentedComment #4
glekli CreditAttribution: glekli as a volunteer commentedThere is a pending patch for this in #2160777: support for user picture field.
Could you please check that out and see if this is what you needed? I'll close this as duplicate.