Rotate Avatar

Discussion in 'Other Programming' started by midlandi, Oct 29, 2007.

Remove these ads by signing in
Remove these ads by signing in
Thread Status:
Not open for further replies.
  1. midlandi Can you smell that?

    Member Since:
    Jan 22, 2007
    Message Count:
    4,758
    Likes Received:
    33
    Location:
    Uk
    Simple script that allows you to have a rotating avatar (would work for image signatures as well) on forums. You will need access to hosting that allows PHP as well as .htaccess.
    First, create a file named avatar.png with a text editor and place the following in it:

    Now on your web host create a new directory where you will upload these two files as well as any images you wish to use for your avatar. Now you would simply enter the URL to the avatar.png file in your forum profile and you’re all set.

    I should add this was not written by me so i cannot give support for it.

    Link
  2. ST-Mike TriPHP Contributor

    Member Since:
    Oct 18, 2007
    Message Count:
    387
    Likes Received:
    13
    Location:
    Liverpool, UK
    Nice, I used to do something similar when I had images in a signature at other forums.

    If you're changing the location to the image anyway, is the .png extension really needed? I guess it stops forums from complaining the extension isn't correct and stops security software from noticing an incorrect image extension! In the past I never had a problem just specifying a PHP file though :)

    Good little snippet/tutorial!
  3. jani Designer

    Member Since:
    Apr 14, 2007
    Message Count:
    2,989
    Likes Received:
    14
    How many avatars it will rotate?
  4. ST-Mike TriPHP Contributor

    Member Since:
    Oct 18, 2007
    Message Count:
    387
    Likes Received:
    13
    Location:
    Liverpool, UK
    The script simply reads the directory it's in for .jpg,.gif and .png files other than "avator.png" which is the name you're saving the script as.

    So, technically it can rotate through as many as you like. Just remember that it has to loop through every file in the directory each time it loads! Though it would take a fair few files for this to cause any problem :p
  5. SkinnerW New Member

    Member Since:
    Oct 12, 2007
    Message Count:
    129
    Likes Received:
    4
    Location:
    Москва - New York
    Nice little script, thanks Midlandi. I'll try it on a few forums...
  6. midlandi Can you smell that?

    Member Since:
    Jan 22, 2007
    Message Count:
    4,758
    Likes Received:
    33
    Location:
    Uk
    Can you give some feedback on results you get please.
    ie. Ease of use, Reliability etc.

    Cheers.
Thread Status:
Not open for further replies.

Share This Page