Announcement

Collapse
No announcement yet.

How do I pull avatar images in 3.7.x?

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

  • How do I pull avatar images in 3.7.x?

    How do I pull avatar data in 3.7.x? I used the code posted below to pull a user's avatar data from image.php in 3.6.8 on my showgroups or forum leaders page but it no longer works in 3.7.x. Does anyone know how to do this in 3.7.x?

    HTML Code:
    <div style="padding: 5px; float: left; width: 125px;"><img style="margin: 15px;" src='image.php?u=$user[userid]' border='0' alt='$user[username]`s Avatar'></div>
    http://www.vbulletin.com/forum/blog_...7&d=1207282188

  • #2
    Change your image src to:

    src='image.php?type=thumb&u=$user[userid]'
    Translations provided by Google.

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

    Comment


    • #3
      Okay thank you I will try this!
      http://www.vbulletin.com/forum/blog_...7&d=1207282188

      Comment


      • #4
        That is still not showing up in the showgroups_usergroupbit on 3.7.0 beta 4.
        vBulletin - Sometimes, I'm just like, Wow, and then I'm like, Whoa, and then I'm like, Damn.

        vBulletin.org's ol' Moderator

        I have a lifetime terrorist hunting permit - #091101

        chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

        Comment


        • #5
          Yeah that did not work...is there another way to pull the avatar from the image.php file?
          http://www.vbulletin.com/forum/blog_...7&d=1207282188

          Comment


          • #6
            Im not sure about this, but i used to have similar problem in 3.6.8 until i started using this:

            Code:
            $avatarurl = fetch_avatar_url($userid);
                    if ($avatarurl == '') {
                      $avatar = "<div class='avatar_forumdisplay' style='float:$stylevar[left]'><a href='member.php?u=$userid'><img src='images/misc/noavatar.gif' border='0' width='100' height='100' alt='View $username/'s profile'></a></div>";
                    }
                    else {
                      $avatar = "<div class='avatar_forumdisplay' style='float:$stylevar[left]'><a href='member.php?u=$userid'><img src='$avatarurl[0]' border='0' width='100' height='100' alt='View $username/'s profile'></a></div>";
                    }

            Comment


            • #7
              I don't think that is gonna work in the showgroups though. I'd like to pull the thumb out like the one in the profile for the showgroups if that is possible. I already had to do a query to get the member's location since the showgroups.php doesn't do that anymore. Have I said showgroups enough?
              vBulletin - Sometimes, I'm just like, Wow, and then I'm like, Whoa, and then I'm like, Damn.

              vBulletin.org's ol' Moderator

              I have a lifetime terrorist hunting permit - #091101

              chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

              Comment


              • #8
                Originally posted by Wayne Luke View Post
                Change your image src to:

                src='image.php?type=thumb&u=$user[userid]'
                That works for custom avatars, but its a blank box for anyone with a predefined avatar. Surely there is a simple way of pulling avatars weather they are custom or not?

                in 3.6.8 on the memberinfo page we had
                Code:
                $userinfo[avatarurl]
                , this no longer works. What is 3.7 using?
                Code:
                <img src="$prepared[avatarurl]"
                is for the thumb, how do we get the normal avatar?

                Comment


                • #9
                  I would like to be able to pull the thumb but $prepared isn't in the showgroups. That is where I am wanting the avatar thumb.

                  And that line doesn't work for custom avatars in the showgroups, by the way.
                  vBulletin - Sometimes, I'm just like, Wow, and then I'm like, Whoa, and then I'm like, Damn.

                  vBulletin.org's ol' Moderator

                  I have a lifetime terrorist hunting permit - #091101

                  chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

                  Comment


                  • #10
                    Could we get a response on what we need to do to use the avatars where we want? the image.php method is useless and $prepared only gives a thumb... help

                    Comment


                    • #11
                      The $prepared does not do a thumb on Showgroups. That is what I am looking for.
                      vBulletin - Sometimes, I'm just like, Wow, and then I'm like, Whoa, and then I'm like, Damn.

                      vBulletin.org's ol' Moderator

                      I have a lifetime terrorist hunting permit - #091101

                      chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

                      Comment

                      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                      Working...
                      X