Page 1 of 1

Avatar system

Posted: Sat Mar 27, 2010 3:55 pm
by witherdon
i was thinking of having a box that users can upload a avatar into, but i have no idea how to do this does anyone know? that would be a great help.

Re: Avatar system

Posted: Sat Mar 27, 2010 7:27 pm
by Gustava
There's two ways to do this, you can have it link to where the picture is or you can have it uploaded to your server and then link it from there so to speak..

The simpler one is the first way, straight linking to the picture where-ever it is. You basically just make a form with a textbox and a submit button. The user types in the link and submits it. In your database you would have a column for 'avatars', and when they submit it you would just like

Code: Select all

avatar = that link they submitted
So that column would just hold website links...and when you want to show the avatar:

Code: Select all

<img src='$userstats3[avatar]'>
Where '$userstats3' is the part that selects from the database for the correct user. I can post the exact code later if you need it, as well as if you want to resize it on upload. And if you want the avatars uploaded to your server instead of this way, I used to have a great tutorial link on how to do it...I'l try to dig it up later as well.

Re: Avatar system

Posted: Sun Mar 28, 2010 3:21 pm
by witherdon
thanks
i have already worked out how to upload stuff with security as well but i was unsure of linking it to the site.
it seems so obvious now.