Module

Developer
Supported

Stand-Alone Member Edit

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Yuri Salimovskiy

     

You must be logged in to post.

member photo

Support Request

nic
nic

hi,
I need to allow users to upload their photos. In the form, I added the field userfile and I checked that there is the following code in the end-of-function process (),

/ / update photo
        if (isset ($ _FILES [‘userfile’]))
        {
             $ this-> EE-> load-> library (‘members’);
  
             $ upload = $ this-> EE-> members-> upload_member_images (‘avatar’, $ this-> EE-> session-> userdata (‘member_id’));
            
        }

But the image is not uploaded. What’s wrong?

Yuri Salimovskiy
# 1
Developer
Yuri Salimovskiy

if you’re uploading photos (not avatars), then you need to replace ‘avatar’ with ‘photo’ in the code you’ve mentioned
The photos need to be enabled in membership preferences

nic
# 2
nic

sorry!
in the file mod.sa_member_edit.php at line 356 i have:
//update photo
    if (isset($_FILES[‘userfile’]) && ($_FILES[‘userfile’][‘name’]!=’‘))
    { 
        $this->EE->load->library(‘members’);
 
        $upload = $this->EE->members->upload_member_images(‘photo’, $this->EE->session->userdata(‘member_id’));
       
    }

what’s wrong?

nic
# 3
nic

ok now it work.
i have moved the lines under $this->categories_save(); and before $site_name = ($PREFS->item(‘site_name’) == ‘’) ? $LAN….
and i have changed:
if (isset($_FILES[‘userfile’]) && ($_FILES[‘userfile’][‘name’]!=’‘)) in the if (isset($_FILES[‘userfile’]))

nic
# 4
nic

hi, sorry for the confusion.
I tried it on 3 different sites and unfortunately the photo upload for members does not work.
I found the code in the function process is:

/ / update photo
        if (isset ($ _FILES [‘userfile’]) && ($ _FILES [‘userfile’] [‘name’]! =’‘))
        {
             $ this-> EE-> load-> library (‘members’);

             $ upload = $ this-> EE-> members-> upload_member_images (‘photo’, $ this-> EE-> session-> userdata (‘member_id’));
            
        }
can you help me?

Yuri Salimovskiy
# 5
Developer
Yuri Salimovskiy

The only thing I could suggest is to check:
a) the photos for members are enabled
b) the url/path for storing photos in membership preferences are correct
If those are correct and upload still does not work, I suggest that you try some alternative module, like Freemember

nic
# 6
nic

the strange thing is that the control panel can change the picture, the path is correct and I see no error in the error log

nic
# 7
nic

.

nic
# 8
nic

OK SOLVED!
for all the readers, add images=“on” as param.
this instruction is not present in Stand-Alone Member Edit docs