PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Combining User Photo Plugin and Registration Add-on

  1. kfawcett
    Member

    I am running the User Photo plugin so that users are able to add a picture to their profile. This is then being used to populate a photo on two other plugins on the front end.

    How can I get the image upload field that I have added to my registration page to populate the user photo plugin section in my profile page?

    I know I can add custom meta fields, but I'm not sure what the custom meta field would be for this. Any ideas? Will this even work?

    Posted 13 years ago on Thursday January 20, 2011 | Permalink
  2. If this field is being displayed on the profile view page, trying looking in the source code for that page and see what the label for that field is assigned to: http://grab.by/8vwp

    There is a good chance this is the same name the meta field should be when setting up your User Registration plugin.

    Posted 13 years ago on Friday January 21, 2011 | Permalink
  3. kfawcett
    Member

    OK I figured out the correct label. It was userphoto_image_file. Now the problem is that it's adding this as the link to the photo - http://mysite.com/files/userphoto/http://mysite.com/files/gravity_forms/3/2011/01/shapeimage_14.png?1109998

    It should be http://mysite.com/files/userphoto/shapeimage_14.png?1109998

    In addition, the User Photo Plugin does some processing of the image to create a thumbnail and places both images in the file/userphoto/ directory.

    Posted 13 years ago on Friday January 21, 2011 | Permalink
  4. What's the update? Did you solve it? If so what was your solution?

    Posted 13 years ago on Monday February 7, 2011 | Permalink
  5. @Capacitron The user @kfawcett explained above he got it working fine once he determined what the correct name (userphoto_image_file) for the meta information he wanted to store. So yes, he did solve it and the solution was using the correct custom meta key when setting up the registration add-on.

    Posted 13 years ago on Monday February 7, 2011 | Permalink
  6. @Carl Got it. I should have been a bit more clear. kfawcett made the additional statement: "Now the problem is that it's adding this as the link to the photo -" kfawcett's links are now 404 so I was just curious if he ever solved that bit.

    Posted 13 years ago on Monday February 7, 2011 | Permalink
  7. Okay so this isn't exactly an elegant solution, but I've figured out how to fix this all. It involves editing the User Photo plugin's core files (everything here refers to 0.9.5.1), so updating that plugin will definitely break this. If you still want to have a go, here's the rundown:

    1. Go to /wp-content/plugins/user-photo/ and open user-photo.php
    2. Find line 602, you should see this code `<p class='image'><img src="<?php echo $bdir . $profileuser->userphoto_image_file . "?" . rand() ?>" alt="Full size image" /><br />
      Full size
      </p>
      <p class='image'><img src="<?php echo $bdir . $profileuser->userphoto_thumb_file . "?" . rand() ?>" alt="Thumbnail image" /><br />
      Thumb
      </p>`
    3. Replace that with `<p class='image'><img src="<?php echo $profileuser->userphoto_image_file . "?" . rand() ?>" alt="Full size image" /><br />
      Full size
      </p>`
    4. If you haven't already, in WordPress, go to Forms > User Registration > the feed you're looking to edit and then in the User Meta section, add a new custom meta field with the value of userphoto_image_file
    5. Save that file and you should be all set.

    This removes the thumbnail functionality of the User Photos plugin as well, which definitely sucks, but at least it's working for me at the moment. I'll let you know if there are any further updates where I can get the thumbnail functionality working as well.

    Posted 12 years ago on Wednesday December 21, 2011 | Permalink