Announcement

Collapse
No announcement yet.

Template Variable For the User's Avatar (Instead of Avatar Thumbnail)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Template Variable For the User's Avatar (Instead of Avatar Thumbnail)

    I am attempting to enlarge avatars displayed next to posts in conversation_userinfo. I've found that vB doesn't have built-in resizing options, and that it can be done with CSS. So far so good.

    This template uses these tags to call the thumb version of the images:

    Code:
    {vb:raw avatarbase}{vb:raw conversation.senderAvatar.avatarpath}
    Code:
    {vb:raw avatarbase}{vb:raw conversation.avatar.avatarpath}
    Resizing a 64x64 thumbnail to 160x160 of course makes it look terrible. So I'd like to use the same image that appears on the user's Profile page instead. It's big enough, and the URL is identical ... only with "&thumb=1" inserted.

    What vb tags can I use to call this larger image?

    (I tried just copying {vb:raw baseurl_corecdn}/{vb:raw avatarUrl.avatarpath} from the Profile template, but it doesn't return anything. Presumably that one is dependent upon a user ID value that isn't being passed in the conversation thread.

  • #2
    The avatar in the conversation display is actually a thumbnail -

    <img src="./core/custompics/avatar/thumbs/avatar46343_2.jpeg" alt="DarrenS" title="DarrenS">

    That URL is for your avatar in the post avatar above. The avatar on your profile page should pull the non-thumbnail version:

    <img class="profile-photo" src="./core/custompics/avatar/avatar46343_2.jpeg" alt="DarrenS" id="profilePicImg">

    Unfortunately, the avatar sizes are hard coded and there are no settings to change the size of full size and thumbnail sizes that I know of. I don't know why it was implemented this way except that whoever implemented it probably did so because of expediency.

    As for copying variables, not all variables are available in all locations.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment


    • #3
      Thanks for the reply. So you suspect that, within a discussion thread, there is in fact no variable capable of summoning the larger avatar uploaded by the user (where usergroups have been enabled to use larger avatars)?

      There is still a setting to allow usergroups to upload larger images. Does vB5 only use this on the user's profile page?

      Finally, can the hard-coded sizes be adjusted by editing core files?

      Comment


      • #4
        Update: I've found a viable path for the larger user avatar path, in case it helps anyone in the future:

        Code:
        src="{vb:raw avatarbase}image.php?userid={vb:raw conversation['userid']}"
        This goes in Conversation Templates >> conversation_userinfo.

        Comment


        • #5
          Originally posted by Wayne Luke View Post
          The avatar in the conversation display is actually a thumbnail -

          <img src="./core/custompics/avatar/thumbs/avatar46343_2.jpeg" alt="DarrenS" title="DarrenS">

          That URL is for your avatar in the post avatar above. The avatar on your profile page should pull the non-thumbnail version:

          <img class="profile-photo" src="./core/custompics/avatar/avatar46343_2.jpeg" alt="DarrenS" id="profilePicImg">

          Unfortunately, the avatar sizes are hard coded and there are no settings to change the size of full size and thumbnail sizes that I know of. I don't know why it was implemented this way except that whoever implemented it probably did so because of expediency.

          As for copying variables, not all variables are available in all locations.
          So, is it possible to change it to the actual user uploaded file, not the generated thumbnail? My forum is all about animation, and many users have animated gif avatars. After upgrade from 3.8 to 5.6.4 the avatars got switched to thumbs and those thumbs are not animated, which is really bad. Where can I find any info on those objects like conversation.avatar and others?

          Comment

          Related Topics

          Collapse

          Working...
          X