1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

avatar.php 1.1.2a

Loads a user's avatar image by GET params. For example, <img src="avatar.php?userid=1" />

  1. Jake Bunce
    This script is useful when you have any HTML web page needing to show a user's avatar, and the user's username or userid is available to you. An HTML img tag will be the typical usage:

    <img src="avatar.php?userid=3" />
    - upload this script to your forum root. :coffee:

    You have 3 GET parameters you can set:

    userid - the userid number of the user.
    username - the username of the user. Can be used instead of userid.
    size - can be s, m, or l. The default is m if not specified.

    Example usage:

    <img src="avatar.php?userid=3" />
    <img src="avatar.php?userid=3&size=s" />
    <img src="avatar.php?username=admin" />
    <img src="avatar.php?username=admin&size=l" />
    If the user is not found then it will output the default "no gender" avatar:


    This script supports all three types of avatars... default, custom, and gravatars.

    Note that calling avatars like this doesn't have the usual cache-buster timestamp in the URL. So a hard refresh might be necessary to see a user's new avatar after they have changed it.
    maszd, regegege, worrorfight and 12 others like this.

Recent Updates

  1. 1.1.2a Changes

Recent Reviews

  1. Brent W
    Brent W
    Version: 1.1.2a
    Thanks for this. Makes getting avatars for outside of xenforo applications and scripts a breeze. Helped me complete a project I was working on and saved a lot of time.
  2. tsak76
    Version: 1.1.2a
    much needed :)
  3. xIsabel38
    Version: 1.1.2a
    I use this for my staff page outside of my forum and it works perfectly. It also auto updates every time the Avatar is changed which is very nice. Recommended if you want Avatars on a site page unassociated (is that a word?) with the actual forum.
  4. (deleted member)
    Version: 1.1.2a
    So simple, great stuff. Thank you Jake.
  5. bousaid
    Version: 1.1.2
  6. Brentnauer
    Version: 1.1.2
    You are, quite simply, the most amazing person on the planet... I spent all day beating my head against the wall trying to learn this new system. THANK YOU.