Photo Upload As Part of Registration Process?
Posted: 03 April 2007 05:18 AM   [ Ignore ]  
Research Assistant
RankRankRank
Total Posts:  421
Joined  12-22-2003

I can’t believe this hasn’t been asked before, but I can’t seem to find anything similar in the forums, user guide, knowledge base, or wiki after multiple searches.

Here’s my question: is it possible to allow/require a user to upload a photo during the member registration process?

Thanks in advance for any help anyone can offer.

Frank

Profile
 
 
Posted: 03 April 2007 02:24 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23751
Joined  05-20-2002

Yea- it is odd that I haven’t seen it come up before.  I suspect the reason you can’t do it is EE doesn’t allow non-members to upload anything.  It’s also complicated by the variety of ways you may be adding members- eveything from manual registration to automatic- no need to confirm an email.  What option you go with there would probably impact a lot on how you’d work around it (automatic, no confirmation being the easiest).

That said, I think you could work around it- though how you do so could affect how much customization you need to do.  Could you just tweak the return to take then to the profile section, let them do it there?  Or more elegant- there are plenty of hooks in mod.member_register.php- so if you needed to tie in something more complex, I’d start there.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 03 April 2007 02:53 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
RankRankRank
Total Posts:  421
Joined  12-22-2003

Hmmmm .... I like the “tweak the return” idea because I actually want the registration process to include more than just a photo. I want the new members to also add bios, multiple website addresses in some cases, etc., etc. Only including the basic elements on the registration page and then the other items in the profile section might make the process seem less daunting.

After I posted the initial request, I did find this thread which seems to provide a way to have new members upload an avatar during the registration process, so I might take a look at that to see if it will work for photos as well.

Thanks Robin. Your suggestion gave me a good alternative which may turn out to be the best approach.

Frank

Profile
 
 
Posted: 03 April 2007 03:05 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23751
Joined  05-20-2002

Man- you’re more on top of it than I am!  (Bookmarks….)

But the redirect may well work if you want something as extensive as it sounds like.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 05 April 2007 12:36 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
RankRankRank
Total Posts:  421
Joined  12-22-2003

Robin:

Any idea on how I might need to modify the extension in that thread to work for a photo upload rather than an avatar upload?

I did the obvious thing - replaced “avatar” with “photo” throughout the php file - but I didn’t really expect that to work. I edited the php file, uploaded it to the site, and followed the directions at the end of the file.

When testing it, everything seemed to work fine, but ultimately, the photo wasn’t uploaded.

Any ideas?

Thanks,
Frank

Profile
 
 
Posted: 05 April 2007 12:58 PM   [ Ignore ]   [ # 5 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23751
Joined  05-20-2002

Try this before I crack it open and take a look- put the original version back up.  See if it’s working to upload the avatar.  If not, we’ll square that away first.  If it is- I’ll pull it down and take a peek.  You’re approach sounded pretty reasonable.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 06 April 2007 11:32 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
RankRankRank
Total Posts:  421
Joined  12-22-2003

Thanks Robin. I put the original version up and the avatar was successfully uploaded. Still no luck on the photo, though. Thanks for any help you can offer.

Frank

Profile
 
 
Posted: 10 April 2007 09:57 AM   [ Ignore ]   [ # 7 ]  
Research Assistant
RankRankRank
Total Posts:  421
Joined  12-22-2003

Hi. Just wanted to make sure this hadn’t been lost in the shuffle.

Thanks,
Frank

Profile
 
 
Posted: 10 April 2007 12:43 PM   [ Ignore ]   [ # 8 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23751
Joined  05-20-2002

Yes- it got a bit lost in the shuffle!  I just took a look…  It looks pretty simple to switch over to uploading the photo- but there are a lot of places where it would need tweaking.  And the nicest thing would be to have it allow a user config so that you could allow either/both avatars/photos.

But- in a crunch, are you going to be using avatars at all?  If not- I think it would be easy to just have the photos loaded/treated as avatars.  And then maybe just change the query:

// ----------------------------------------
        //  Update DB
        // ----------------------------------------

        
$avatar = 'uploads/'.$new_filename;
        
$DB->query("UPDATE exp_members SET avatar_filename = '{$avatar}', avatar_width='{$width}', avatar_height='{$height}' WHERE member_id = '".$member_id."' ");


To update the photo fields instead of the avatar fields.  That would end up with it showing as a photo instead of an avatar wherever a photo is meant to show.  But otherwise- you just ‘collapse’ the avatar and photo folders into a single folder.

I’m not dead sure that’s what I’d do- and to do the switch in the code shouldn’t be too hard- but you’d need to swap out quite a few preferences and stuff.

Hm- does that help?  (Of course, best option is Paul got bored and added it to the extension!  But I don’t know that he’s bored right now!)

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 10 April 2007 12:57 PM   [ Ignore ]   [ # 9 ]  
Research Assistant
RankRankRank
Total Posts:  421
Joined  12-22-2003

Thanks Robin. Won’t be using avatars, so maybe I’ll just go that route. Won’t have a chance to try it until this evening, but I’ll let you know how it goes.

Paul’s not bored? I think that’s a wonderful thing, because it probably means he’s busy doing all sorts of exciting development for the Ellis Lab community of users! I know he never has time to enjoy himself doing anything else, so I’m assuming he’s hard at work for us. <grin>

Frank

Profile
 
 
Posted: 10 April 2007 01:01 PM   [ Ignore ]   [ # 10 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23751
Joined  05-20-2002

LOL- he manages to stay busy!  Would be a nice tweak to the extension, though.  But if you aren’t using avatars- I’d just set my avatar settings like you want your photo settings to be.  Then tweak the query so that it goes in as a photo.

If that give you trouble, yell back and I’ll take a closer look.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 10 April 2007 10:45 PM   [ Ignore ]   [ # 11 ]  
Research Assistant
RankRankRank
Total Posts:  421
Joined  12-22-2003

Well, I tried changing the avatar version as follows:

// ----------------------------------------
//  Update DB
// ----------------------------------------

$avatar = 'uploads/'.$new_filename;
$DB->query("UPDATE exp_members SET photo_filename = '{$avatar}', photo_width='{$width}', photo_height='{$height}' WHERE member_id = '".$member_id."' ");

I can get the photo to upload now, but I’m having problems with the path. The file is actually being uploaded to:

/images/avatars/uploads/

But the control panel is looking for the photo at:

/images/member_photos/uploads/

I played around with the path a little bit, but I can’t seem to get it to work.

Any ideas?

Thanks,
Frank

Profile
 
 
Posted: 11 April 2007 12:54 PM   [ Ignore ]   [ # 12 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23751
Joined  05-20-2002

The simple way- go to ‘Members and Groups- Member Prefs’ and change the paths for the photo to match the path for the avatar.  I think that will do it.

If not, I’ll take a look at the code- there’s a spot or two where the path is pulled up based on the avatar prefs- I’m fairly sure that’s what’s jamming you up.  But if you change the photo path in the cp, no need to hack.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 11 April 2007 04:09 PM   [ Ignore ]   [ # 13 ]  
Research Assistant
RankRankRank
Total Posts:  421
Joined  12-22-2003

That did it!

Thanks so much for your help.

Frank

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66475 Total Logged-in Users: 40
Total Topics: 84881 Total Anonymous Users: 18
Total Replies: 455407 Total Guests: 222
Total Posts: 540288    
Members ( View Memberlist )