Title: Personal Photo Upload v1.0

Author: WormHole @ XMB Garage
Based on Avatar Upload by John Briggs

Description:
This modification will provide a control to set personal photo uploads to off.
This modification will provide a control to set who can upload personal photos.
This modification will provide a control to set whether all members or just staff can upload personal photos.
This modification will provide a control in member control panel to upload personal photos.
This modification will provide a new interface for personal photo options in control panel.
This modification will provide a new interface that cosmetically alters all personal photo related content in admin settings.
This modification will require GD2 Extension for this hack to work!

Copyright:  2009 XMB Garage. All rights reserved.

Compatability: XMB 1.9.8 SP3

Install Note: Before adding this modification to your forum you should back up all files related to this modification.

License Note: This modification is released under the GPL License. A copy is provided with this software.

Author Note:
You downloaded this modification from XMBGarage.com, the #1 source for XMB related downloads.
Please visit http://www.xmbgarage.com/ for support.

=======================================================================================================================================
=======
Step 1:
=======

=============================
Go To Admin Panel -> Insert Raw SQL
=============================

Upload provided file named "SQL.txt" & click "Submit Changes" button.

=======================================================================================================================================
=======
Step 2:
=======

=============
Edit File: cp.php
=============

==========
Find Code:
==========

        $avchecked[0] = $avchecked[1] = $avchecked[2] = false;
        if (!empty($avatarlist)) {
            $avchecked[1] = true;
        } else if (!empty($avataroff)) {
            $avchecked[2] = true;
        } else {
            $avchecked[0] = true;
        }

===============
Add Code Below:
===============

        // Personal Photo Upload Mod Begin
        $ppuchecked[0] = $ppuchecked[1] = $ppuchecked[2] = false;
        switch ($SETTINGS['photo_whocanupload']) {
            case 'off':
                $ppuchecked[0] = true;
                break;
            case 'all':
                $ppuchecked[1] = true;
                break;
            default:
                $ppuchecked[2] = true;
                break;
        }
        // Personal Photo Upload Mod End

==========
Find Code:
==========

        $lang['spell_checker'] .= $spell_off_reason;

===============
Add Code Below:
===============

        // Personal Photo Upload Mod Begin
        $SETTINGS['photo_filesize'] = (int) $SETTINGS['photo_filesize'];
        $SETTINGS['photo_max_width'] = (int) $SETTINGS['photo_max_width'];
        $SETTINGS['photo_max_height'] = (int) $SETTINGS['photo_max_height'];
        $SETTINGS['photo_path'] = stripslashes($SETTINGS['photo_path']);
        $SETTINGS['photo_new_width'] = (int) $SETTINGS['photo_new_width'];
        $SETTINGS['photo_new_height'] = (int) $SETTINGS['photo_new_height'];
        // Personal Photo Upload Mod End

==========
Find Code:
==========

        printsetting4($lang['tickercontents'], 'tickercontentsnew', stripslashes($SETTINGS['tickercontents']), 5, 50);
        ?>

===============
Add Code Below:
===============

        <!-- Personal Photo Upload Mod Begin -->
        <tr class="tablerow">
        <td bgcolor="<?php echo $THEME[altbg2]?>" colspan="2">&nbsp;</td>
        </tr>
        <tr class="category">
        <td colspan="2"><strong><font color="<?php echo $THEME[cattext]?>">&raquo;&nbsp;<?php echo $lang['photo_main_settings']?></font></strong></td>
        </tr>
        <?php
        printsetting3($lang['photostatus'], 'photostatusnew', array($lang['texton'], $lang['textall'], $lang['textoff']), array('on', 'all', 'off'), $ppuchecked, false);
        printsetting3($lang['photowhoupload'], 'photo_whocanuploadnew', array($lang['textoff'], $lang['photoupall'], $lang['photoupstaff']), array('off', 'all', 'staff'), $ppuchecked, false);
        printsetting2($lang['photofilesize'], 'photo_filesizenew', $SETTINGS['photo_filesize'], 5);
        printsetting2($lang['photowdimensions'], 'photo_max_widthnew', $SETTINGS['photo_max_width'], 4);
        printsetting2($lang['photohdimensions'], 'photo_max_heightnew', $SETTINGS['photo_max_height'], 4);
        printsetting2($lang['photo_newwresize'], 'photo_new_widthnew', $SETTINGS['photo_new_width'], 4);
        printsetting2($lang['photo_newhresize'], 'photo_new_heightnew', $SETTINGS['photo_new_height'], 4);
        printsetting2($lang['photo_path'], 'photo_pathnew', $SETTINGS['photo_path'], 20);
        printsetting2($lang['max_photo_size_w'], 'max_photo_size_w_new', $max_photo_sizes[0], 4);
        printsetting2($lang['max_photo_size_h'], 'max_photo_size_h_new', $max_photo_sizes[1], 4);
        ?>
        <!-- Personal Photo Upload Mod End -->

==========
Find Code:
==========

        $resetSigNew = formOnOff('resetSigNew');

===============
Add Code Below:
===============

        // Personal Photo Upload Mod Begin
        $photo_filesizenew = formInt('photo_filesizenew');
        $photo_max_widthnew = formInt('photo_max_widthnew');
        $photo_max_heightnew = formInt('photo_max_heightnew');
        $photo_pathnew = addslashes($photo_pathnew);
        $photo_new_widthnew = formInt('photo_new_widthnew');
        $photo_new_heightnew = formInt('photo_new_heightnew');
        $photo_whocanuploadnew = ($photo_whocanuploadnew == 'off') ? 'off' : ($photo_whocanuploadnew == 'all' ? 'all' : 'staff');
        // Personal Photo Upload Mod End

==========
Find Code:
==========

        $db->query("UPDATE ".X_PREFIX."settings SET

================
Replace Code With:
================

        $db->query("UPDATE ".X_PREFIX."settings SET
            photo_whocanupload='$photo_whocanuploadnew',
            photo_filesize='$photo_filesizenew',
            photo_max_width='$photo_max_widthnew',
            photo_max_height='$photo_max_heightnew',
            photo_path='$photo_pathnew',
            photo_new_width='$photo_new_widthnew',
            photo_new_height='$photo_new_heightnew',

=======================================================================================================================================================
=======
Step 3:
=======

==================
Edit File: editprofile.php
==================

==========
Find Code:
==========

loadtemplates(

================
Replace Code With:
================

loadtemplates(
'memcp_profile_photourl,

==========
Find Code:
==========

        eval('$avatar = "'.template('memcp_profile_avatarlist').'";');
        closedir($dir1);
    }

===============
Add Code Below:
===============

    // Personal Photo Mod Begin
    $photobox = '';
    if ($SETTINGS['photostatus'] == 'on') {
        eval('$photobox = "'.template('memcp_profile_photourl').'";');
    }
    // Personal Photo Mod End

==========
Find Code:
==========

    $sig = isset($_POST['newsig']) ? checkInput($_POST['newsig'], '', $SETTINGS['sightml'], '', false) : '';

===============
Add Code Below:
===============

    // Personal Photo Mod Begin
    $newphoto = isset($newphoto) ? ereg_replace(' ', '%20', $newphoto) : ''; // Problem with spaces in photo url
    $photo = $newphoto ? checkInput($newphoto, '', '', 'javascript', false) : '';
    // Personal Photo Mod End

==========
Find Code:
==========

    $sig = addslashes($sig);

===============
Add Code Below:
===============

    // Personal Photo Mod Begin
    $photo = addslashes($photo);
    // Personal Photo Mod End

==========
Find Code:
==========

    $max_size = explode('x', $SETTINGS['max_avatar_size']);
    if ($max_size[0] > 0 && $max_size[1] > 0 && ini_get('allow_url_fopen')) {
        $size = @getimagesize($_POST['newavatar']);
        if ($size === false) {
            $avatar = '';
        } else if (($size[0] > $max_size[0] && $max_size[0] > 0) || ($size[1] > $max_size[1] && $max_size[1] > 0) && !X_SADMIN) {
            error($lang['avatar_too_big'] . $SETTINGS['max_avatar_size'] . 'px', false);
        }
    }

===============
Add Code Below:
===============

    // Personal Photo Mod Begin
    $photosize = @getimagesize($photo);
    $max_photosize = explode('x', $SETTINGS['max_photo_size']);
    if ($photosize === false && ($max_photosize['0'] > 0 && $max_photosize['1'] > 0)) {
        $photo = '';
    } elseif (($max_photosize['0'] > 0 && $max_photosize['1'] > 0) && ($photosize['0'] > $max_photosize['0'] || $photosize['1'] > $max_photosize['1']) && !X_SADMIN) {
        error($lang['photo_too_big'] . $SETTINGS['max_photo_size'] . 'px', false);
    }
    // Personal Photo Mod End

==========
Find Code:
==========

$db->query("UPDATE ".X_PREFIX."members SET email='$email',

==================================================
Find Code In-Line At End Of Above Query Statement:
==================================================

 WHERE username='$user'");

================
Replace Code With:
================

, photo='$newphoto' WHERE username='$user'");

=======================================================================================================================
=======
Step 4:
=======

=================
Edit File: member.php
=================

==========
Find Code:
==========

loadtemplates(

================
Replace Code With:
================

loadtemplates(
'misc_feature_notavailable',
'member_reg_photourl',
'member_profile_photo',

==========
Find Code:
==========

                if ($SETTINGS['sightml'] == 'on') {
                    $htmlis = $lang['texton'];
                } else {
                    $htmlis = $lang['textoff'];
                }

===============
Add Code Below:
===============

                // Personal Photo Mod Begin
                $photobox = '';
                if ($SETTINGS['photostatus'] == 'on') {
                    eval('$photobox = "'.template('member_reg_photourl').'";');
                }
                // Personal Photo Mod End

==========
Find Code:
==========

                $sig = postedVar('sig', 'javascript', ($SETTINGS['sightml']=='off'), TRUE, TRUE);

===============
Add Code Below:
===============

                // Personal Photo Mod Begin
                $photo = postedVar('photo', 'javascript', TRUE, TRUE, TRUE);
                // Personal Photo Mod End

==========
Find Code:
==========

                $max_size = explode('x', $SETTINGS['max_avatar_size']);
                if ($max_size[0] > 0 && $max_size[1] > 0 && ini_get('allow_url_fopen')) {
                    $size = @getimagesize($_POST['avatar']);
                    if ($size === false ) {
                        $avatar = '';
                    } else if (($size[0] > $max_size[0] && $max_size[0] > 0) || ($size[1] > $max_size[1] && $max_size[1] > 0)) {
                        error($lang['avatar_too_big'] . $SETTINGS['max_avatar_size'] . 'px');
                    }
                }

===============
Add Code Below:
===============

                // Personal Photo Mod Begin
                $photosize = @getimagesize($photo);
                $max_photosize = explode('x', $SETTINGS['max_photo_size']);
                if ($photosize === false && ($max_photosize[0] > 0 && $max_photosize[1] > 0)) {
                    $photo = '';
                } elseif (($max_photosize[0] > 0 && $max_photosize[1] > 0) && ($photosize['0'] > $max_photosize['0'] || $photosize['1'] > $max_photosize['1']) && !X_SADMIN) {
                    error($lang['photo_too_big'] . $SETTINGS['max_photo_size'] . 'px');
                }
                // Personal Photo Mod End

==========
Find Code:
==========

$db->query("INSERT INTO ".X_PREFIX."members (username

==================================================
Find Code In-Line At End Of Above Query Statement:
==================================================

) VALUES ('$username'

================
Replace Code With:
================

, photo) VALUES ('$username'

==================================================
Find Code In-Line At End Of Above Query Statement:
==================================================

)");

================
Replace Code With:
================

, '$photo')");

==========
Find Code:
==========

                if ($memberinfo['avatar'] != '') {
                    $memberinfo['avatar'] = '<img src="'.$memberinfo['avatar'].'" alt="'.$lang['altavatar'].'" border="0" />';
                }

===============
Add Code Below:
===============

                // Personal Photo Mod Begin
                $memberinfo['photo'] = trim($memberinfo['photo']);
                $photoblock = '';
                if (!empty($memberinfo['photo'])) {
                    $memberinfo['photo'] = '<img src="'.$memberinfo['photo'].'" alt="'.$lang['photoalt'].'" title="'.$lang['photoalt'].'" border="0" />';
                    eval('$photoblock = "'.template('member_profile_photo').'";');
                }
                // Personal Photo Mod End

=======================================================================================================================
=======
Step 5:
=======

=================
Edit File: memcp.php
=================

==========
Find Code:
==========

loadtemplates(

================
Replace Code With:
================

loadtemplates(
'memcp_profile_photohidden',
'memcp_profile_userphoto',

==========
Find Code:
==========

            eval('$avatar = "'.template('memcp_profile_avatarlist').'";');
            closedir($dir1);
        }

===============
Add Code Below:
===============

        // Personal Photo Upload Mod Begin
        $photo = '';
        if ($SETTINGS['photostatus'] == 'on') {
            eval('$photo = "'.template('memcp_profile_photourl').'";');
        }

        $userphoto = $ppdeletebutton = $photohidden = '';
        if ($SETTINGS['photo_whocanupload'] != 'off' || $SETTINGS['photostatus'] != 'off') {
            if (!empty($member['photo'])) {
                eval('$userphoto = "'.template('memcp_profile_userphoto').'";');
                $ppdeletebutton = '<br /><input type="checkbox" name="photodel" value="1" />'.$lang['photodelete'].'';
            }

            $photohidden = '';
            switch ($SETTINGS['photo_whocanupload']) {
                case 'all':
                    eval('$photohidden = "'.template('memcp_profile_photohidden').'";');
                    break;
                case 'staff':
                    eval('$photohidden = "'.template('memcp_profile_photohidden').'";');
                    break;
                default:
                    $photohidden = '';
                    break;
            }
        }
        $photobox = '';
        if ($SETTINGS['photostatus'] == 'on') {
            eval('$photobox = "'.template('memcp_profile_photourl').'";');
        }
        // Personal Photo Upload Mod End

==========
Find Code:
==========

        $newavatar = formVar('newavatar');
        $avatar = $newavatar ? checkInput($newavatar, 'no', 'yes', 'javascript', false) : '';

===============
Add Code Below:
===============

        // Personal Photo Upload Mod Begin
        if (isset($newphoto)) {
            if ('http' == substr($newphoto, 0, 4)) {
                $newphoto = ereg_replace(' ', '%20', $newphoto);
            }
        } else {
            $newphoto = '';
        }

        $photo = $newphoto ? checkInput($newphoto, 'no', 'yes', 'javascript', false) : '';
        $photo = addslashes(trim($newphoto));
        // Personal Photo Upload Mod End

==========
Find Code:
==========

        $max_size = explode('x', $SETTINGS['max_avatar_size']);
        if ($max_size[0] > 0 && $max_size[1] > 0 && ini_get('allow_url_fopen')) {
            $size = @getimagesize($_POST['newavatar']);
            if ($size === false ) {
                $avatar = '';
            } else if (($size[0] > $max_size[0] && $max_size[0] > 0) || ($size[1] > $max_size[1] && $max_size[1] > 0) && !X_SADMIN) {
                error($lang['avatar_too_big'] . $SETTINGS['max_avatar_size'] . 'px', false);
            }
        }

===============
Add Code Below:
===============

        // Personal Photo Upload Mod Begin
        $max_size = explode('x', $SETTINGS['photo_filesize']);
        if ($max_size[0] > 0 && $max_size[1] > 0 && substr_count($photo, ',') < 2) {
            $size = @getimagesize($photo);
            if ($size === false ) {
                $photo = '';
            } elseif (($size[0] > $max_size[0] && $max_size[0] > 0) || ($size[1] > $max_size[1] && $max_size[1] > 0) && !X_ADMIN) {
                error($lang['photo_too_big'] . $SETTINGS['photo_filesize'] . $lang['photopixels'], false);
            }
        }

        if (isset($_COOKIE['photofile']) || isset($_POST['photofile']) || isset($_GET['photofile'])) {
            die('Action Halted Due To Illegal Activity!!');
        }

        if (isset($_FILES['photofile']['name']) && $_FILES['photofile']['tmp_name'] && !empty($_FILES['photofile']['name'])) {
            $photoext = substr($_FILES['photofile']['name'], strlen($_FILES['photofile']['name'])-3, 3);
            $newphotoname = $member['uid'].'.'.$onlinetime.'.'.$photoext;
            $check = $_FILES['photofile'];

            if (($check['size'] > $SETTINGS['photo_filesize']) && !X_SADMIN) {
                error($lang['photo_too_big'] . $SETTINGS['photo_filesize'] . $lang['photobytes'], false);
            }

            $photopath = $SETTINGS['photo_path'].'/'.$newphotoname;
            $tmppath = $check['tmp_name'];

            if (!eregi('gif|jpeg|png|jpg|bmp', $photoext)) {
                error($lang['photo_invalid_ext'], false);
            }

            if (!is_writable($SETTINGS['photo_path'])) {
                error($lang['photo_nowrite'], false);
            }

            $size = @getimagesize($tmppath);
            $width = $size[0];
            $height = $size[1];
            $type = $size[2];

            @set_time_limit(30);
            $imginfo = @getimagesize($tmppath);

            switch ($imginfo['2']) {
                case 1:
                    $type = IMG_GIF;
                    break;
                case 2:
                    $type = IMG_JPG;
                    break;
                case 3:
                    $type = IMG_PNG;
                    break;
                case 4:
                    $type = IMG_WBMP;
                    break;
                default:
                    return $tmppath;
                    break;
            }

            switch ($type) {
                case IMG_GIF:
                    if (!@function_exists('imagecreatefromgif')) {
                        return $tmppath;
                    }
                    $srcImage = @imagecreatefromgif($tmppath);
                    break;
                case IMG_JPG:
                    if (!@function_exists('imagecreatefromjpeg')) {
                        return $tmppath;
                    }
                    $srcImage = @imagecreatefromjpeg($tmppath);
                    break;
                case IMG_PNG:
                    if (!@function_exists('imagecreatefrompng')) {
                        return $tmppath;
                    }
                    $srcImage = @imagecreatefrompng($tmppath);
                    break;
                case IMG_WBMP:
                    if (!@function_exists('imagecreatefromwbmp')) {
                        return $tmppath;
                    }
                    $srcImage = @imagecreatefromwbmp($tmppath);
                    break;
                default:
                    return $tmppath;
            }

            if ($width > $SETTINGS['photo_max_width']) {
                $newwidth  = $SETTINGS['photo_new_width'];
                $newheight = ($newwidth / $width) * $height;
            } elseif ($height > $SETTINGS['photo_max_height']) {
                $newheight = $SETTINGS['photo_new_height'];
                $newwidth  = ($newheight / $height) * $width;
            }

            if (isset($newwidth)) {
                $destImage = @imagecreatetruecolor($newwidth, $newheight);
                @imagecopyresampled($destImage, $srcImage, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

                switch ($type) {
                    case IMG_GIF:
                        @imagegif($destImage, "$tmppath");
                        break;
                    case IMG_JPG:
                        @imagejpeg($destImage, "$tmppath");
                        break;
                    case IMG_PNG:
                        @imagepng($destImage, "$tmppath");
                        break;
                    case IMG_WBMP:
                        @imagewbmp($destImage, "$tmppath");
                        break;
                        @imagedestroy($srcImage);
                        @imagedestroy($destImage);
                }
            }

            @copy($tmppath, $photopath);
            $db->query("UPDATE ".X_PREFIX."members SET photo = '$photopath' WHERE username = '$xmbuser'");
        }

        if (isset($_POST['newphoto']) && empty($_FILES['photofile']['name'])) {
            $db->query("UPDATE ".X_PREFIX."members SET photo = '$newphoto' WHERE username = '$xmbuser'");
        }

        if (isset($_POST['editsubmit']) && isset($_POST['photodel']) != 1 && !empty($member['photo']) && empty($_POST['newphoto']) && empty($_FILES['photofile']['name'])) {
            $db->query("UPDATE ".X_PREFIX."members SET photo = '$member[photo]' WHERE username = '$xmbuser'");
        }

        if (isset($_POST['photodel']) && isset($_POST['photodel']) == 1 && empty($_FILES['photofile']['name'])) {
            if (@file_exists($member['photo'])) {
                @unlink($member['photo']);
            }
            $db->query("UPDATE ".X_PREFIX."members SET photo = '' WHERE username = '$xmbuser'");
        }
        // Personal Photo Upload Mod End

==========
Find Code:
==========

    if ($member['mood'] != '') {
        $member['mood'] = censor($member['mood']);
        $member['mood'] = postify($member['mood'], 'no', 'no', 'yes', 'no', 'yes', 'no', true, 'yes');
    } else {
        $member['mood'] = '';
    }

===============
Add Code Below:
===============

    // Personal Photo Mod Begin
    if (!empty($member['photo'])) {
        $member['photo'] = '<img src="'.$member['photo'].'" alt="'.$lang['photoalt'].'" title="'.$lang['photoalt'].'" border="0" />';
    } else {
        $member['photo'] = '';
    }
    // Personal Photo Mod End

=======================================================================================================================================
=======
Step 6:
=======

=======================
Edit File: lang/English.lang.php
=======================

=================================
Add Code At Very Bottom of File Above ?>:
=================================

// Personal Photo Upload Mod Begin
$lang['photooptions'] = "Personal Photo - Options:";
$lang['photoinfo'] = "A personal photo displays a small graphic image below your details in posts and profiles. Only one image can be displayed at a time, an uploadable photo's width can be no greater than <strong>$photo_max_width</strong> pixels, a height no greater than <strong>$photo_max_height</strong> pixels and a file size no more than <strong>$photo_filesize</strong> bytes.";
$lang['photocurrent'] = "Current Personal Photo";
$lang['photodelete'] = "Delete Personal Photo?";
$lang['photouploadfrom'] = "Upload personal photo from your computer:";
$lang['photowhoupload'] = "Who can upload personal photos?";
$lang['photoupall'] = "All";
$lang['photoupstaff'] = "Staff";
$lang['photofilesize'] = "The maximum personal photo upload file size in byte(s):";
$lang['photobytes'] = " byte(s)";
$lang['photopixels'] = " pixel(s)";
$lang['photowdimensions'] = "The maximum personal photo upload Width (in px):";
$lang['photohdimensions'] = "The maximum personal photo upload Height (in px):";
$lang['photo_path'] = "Personal Photo upload storage path:<br /><small>Path under your forum root dir, e.g. (./images/puploads)<br /><strong>Note:</strong> You must CHMOD this folder to 777</small>";
$lang['photo_newwresize'] = "The personal photo upload resize Width (in px):";
$lang['photo_newhresize'] = "The personal photo upload resize Height (in px):";
$lang['photo_main_settings'] = "Personal Photo Control Settings";
$lang['photo_urlmsg'] = "The maximum dimensions for remote url photos is ";
$lang['photo_invalid_ext'] = "Sorry, you cannot upload photo files with invalid image extensions. Please go back and try again.";
$lang['photo_nowrite'] = "The <strong><em>$photo_path</em></strong> directory is not writeable, make sure to set the permissions (CHMOD) for the folder to 777 on your server.";
$lang['max_photo_size_h'] = "The maximum remote url photo Height (in px):";
$lang['max_photo_size_w'] = "The maximum remote url photo Width (in px):";
$lang['photoalt'] = "Personal Photo";
$lang['phototext'] = "Personal Photo:";
$lang['photourltext'] = "Personal Photo URL:";
$lang['photostatus'] = "Personal Photo Status:";
$lang['photo_main_settings'] = "Personal Photo Settings";
$lang['photo_too_big'] = "Your personal photo is too big! The maximum allowed personal photo size on this board is: ";
// Personal Photo Upload Mod End
=======================================================================================================================================
========
Step 6:
========

========================================
Go to admin panel -> templates -> admintool_editprofile
========================================

==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[userprofilemood]</td>
<td bgcolor="$altbg2"><input type="text" name="newmood" size="25" value="$member[mood]" /></td>
</tr>

===============
Add Code Below:
===============

$photobox

=======================================================================================================================
========
Step 7:
========

=====================================
Go to admin panel -> templates -> member_profile
=====================================

==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$altbg1" valign="top">$lang[textstatus]<br /><a href="$sitelink" target="_blank">$memberinfo[avatar]</a></td>
<td bgcolor="$altbg2">$showtitle$customstatus<br />$stars<br /><br />$rank[avatarrank]</td>
</tr>

===============
Add Code Below:
===============

$photoblock

=======================================================================================================================
=======
Step 8:
=======

==========================================================
Go to admin panel -> templates -> create template name -> member_profile_photo
==========================================================

=========
Add Code:
=========

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" valign="top" width="22%">$lang[phototext]</a></td>
<td bgcolor="$THEME[altbg2]" valign="top">$memberinfo[photo]</td>
</tr>

=======================================================================================================================
========
Step 9:
========

=========================================
Go to admin panel -> templates -> member_reg_optional
=========================================

==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[memcpmood]</td>
<td bgcolor="$altbg2"><input type="text" name="mood" size="25" value="" value="" /></td>
</tr>

===============
Add Code Below:
===============

$photobox

=======================================================================================================================
=======
Step 10:
=======

==========================================================
Go to admin panel -> templates -> create template name -> member_reg_photourl
==========================================================

==========
Add Code:
==========

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[phototext]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="photo" size="40" /></td>
</tr>

=======================================================================================================================
========
Step 11:
========

===================================
Go to admin panel -> templates -> memcp_home
===================================

==========
Find Code:
==========

<td bgcolor="$altbg1" valign="top">$lang[textcusstatus]</td>
<td bgcolor="$altbg2" valign="top">$member[customstatus]</td>
<td bgcolor="$altbg1" valign="top">&nbsp;</td>
<td bgcolor="$altbg2" valign="top">&nbsp;</td>

================
Replace Code With:
================

<td bgcolor="$altbg1" valign="top">$lang[textcusstatus]</td>
<td bgcolor="$altbg2" valign="top">$member[customstatus]</td>
<td bgcolor="$THEME[altbg1]" valign="top">$lang[phototext]</td>
<td bgcolor="$THEME[altbg2]" align="center">$member[photo]</td>

=======================================================================================================================
=======
Step 12:
=======

=============================================================
Go To Admin Panel -> Templates -> Create Template -> memcp_profile_photohidden
=============================================================

======================
Add Code And Click Submit:
======================

<tr class="category">
<td colspan="2"><strong><font color="$THEME[cattext]">$lang[photooptions]</font></strong></td>
</tr>
<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" align="center" width="22%" valign="top">$lang[photocurrent]<br />$userphoto$ppdeletebutton</td>
<td bgcolor="$THEME[altbg2]" valign="top">$lang[photoinfo]</td>
</tr>
<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[photouploadfrom]</td>
<td bgcolor="$THEME[altbg2]"><input type="file" name="photofile" size="40" /></td>
</tr>

=======================================================================================================================================
=======
Step 13:
=======

===========================================================
Go To Admin Panel -> Templates -> Create Template -> memcp_profile_userphoto
===========================================================

======================
Add Code And Click Submit:
======================

<img src="$member[photo]" border="0" alt="$lang[altphoto]" />

=======================================================================================================================================
=======
Step 14:
=======

======================================
Go To Admin Panel -> Templates -> memcp_profile
======================================

==========
Find Code:
==========

<form method="post" action="memcp.php?action=profile" name="reg">

================
Replace Code With:
================

<form method="post" action="memcp.php?action=profile" name="reg" enctype="multipart/form-data">

==================
Find Code And Delete:
==================

$avatar

==========
Find Code:
==========

<tr>
<td class="ctrtablerow" bgcolor="$altbg2" colspan="2"><input type="submit" class="submit" name="editsubmit" value="$lang[texteditpro]" /></td>
</tr>

===============
Add Code Above:
===============

$photohidden
$avatar

=======================================================================================================================================
========
Step 15:
========

==========================================================
Go To Admin Panel -> Templates -> Create Template -> memcp_profile_photourl
==========================================================

==============
Replace All With:
==============

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[textphotourl]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="newphoto" size="40" value="$member[photo]" /><br />$lang[photo_urlmsg]$photo_filesize$lang[photopixels]</td>
</tr>

=======================================================================================================================================
========
Step 16:
========

Now upload the folder named "puploads" to your forum "images" directory.

Now CHMOD the "puploads" folder to 777, if you do not do this you cannot upload images to your server.

=======================================================================================================================================