Topic: User photo

I would like to use the advatar for the user to upload a photo of theirself instead.  How do I go about changing that title "Avatar" to be called "User Photo" also how can I take off the kb limits of uploaded photos and maybe use Image Magick or GD to automatically make that photo be sized down?

Re: User photo

Renaming it to "User Photo" shouldn't be too hard. Just have a look in the different lang-files for your language.

You can set the avatar limits in admin/options.

Having it automatically size down the pictures will involve a bit of coding though.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3 (edited by RNilsson 2003-09-11 03:27)

Re: User photo

Or you could do the following check when uploading:

            $path = $DOCUMENT_ROOT . "/photo/";
            $image = getimagesize($_FILES['memberPhoto']['tmp_name']);
            if ($_FILES['memberPhoto']['size'] > 25600) {
                print("Photo to large. Max 25kb. Try again.");
            } elseif ($image[2] != 2) {
                print("Photo is not of an approved type. Only JPEG is allowed.");
            } elseif ($image[0] > 155) {
                print("Photo is to wide. Max width is 155 pixels.");
            } elseif ($image[1] > 155) {
                print("Photo is to high. Max height is 155 pixels.");
            } elseif (move_uploaded_file($_FILES['memberPhoto']['tmp_name'], $path . $o->memberID . ".jpg")) {
                print("Photo Uploaded...");
            } else {
                print("Upload Failed. Try Again or report error to webmaster.");

Or you could just play with imagecreate as well to automaticly resize the img by using getimagesize as reference: