Buddpress Addon – display Image Uploads in member area.

This topic contains 8 reply and 2 voices, and was last updated by Sekander Badsha 10 years ago
Viewing 8 Posts - 1 through 8 (of 8 total)
Author Posts
November 18, 2014 at 3:29 am 30658
Sekander Badsha The Page in question: http://aaronkine.staging.wpengine.com/members/aarongrafix/ I have setup 3 image upload fields on the Registration Page. They show up in the Admin Users Profile... but how do i display them in Front End Profile Page (link above to sample page)? The file i need to edit is 'member-header.php'.. I have also tried editing 'functions.php' as explained below. I have tried many different codes that i found in your support forms but nothing works: I have checked the uploads folder and the images are successfully being uploaded to: ...wp-content/uploads/2014/11/name_of_image.jpg. Each Image upload Field is labled as OrgImage1, OrgIage2, and OrgImage3 I am using WP User Frontend PRO Ver. 2.2.6 and the Addon - BuddyPress Profile Ver. 0.2 Codes i have tried:
if ( isset( $_GET['OrgImage1'] ) ) {
    $curauth = get_userdatabylogin( $author_name );
} else {
    $curauth = get_userdata( intval( $author ) );
}
if ( isset( $_GET['OrgImage1'] ) ) {
    $curauth = get_userdatabylogin( $author_name );
} else {
    $curauth = get_userdata( intval( $author ) );
}
________________________________________________________________ ALSO This...
<img src="http://aaronkine.staging.wpengine.com/wp-content/uploads/<?php bp_member_profile_data('field=OrgImage1');  ?>" /> 
________________________________________________________________ And this in my 'functions.php'
function org_images () { ?>
<img height="100px" width="100px" src="http://aaronkine.staging.wpengine.com/wp-content/uploads/2014/11/<?php bp_member_profile_data('field=OrgImage1'); ?>" />
<?php bp_member_profile_data('field=OrgImage1') ?>
<?php echo bp_member_profile_data('field=OrgImage1') ?>

<?php }
add_action('bp_before_member_header','org_images');
NOTHING WORKS PLEASE HELP! Thanks, I am happy to give you Admin Access to my site.
November 24, 2014 at 5:07 pm 31076
Sekander Badsha Sekander Badsha

Hello Aron,

You do not need to apply any code. You just need to navigate to wp-admin -> User Frontend -> Settings -> Login/Register and assign the forms according to the user role. If you want to use the same for every user role, you can assign the same page for every role. And this will work in both back and front.

Let me know if you feel any difficulties..

Thank you 🙂

December 2, 2014 at 5:50 am 31555
Aaron Aaron

I have already assigned the Forms correctly. The problem is when creating the Registration Form i add the “Image Upload” field in the form… then click on the “Buddypress Tab” to try and MAP the field to the Buddypress profile… but the “Image Upload” field does now show up in order to map. Ultimately I want the 3 Image Uploads on my Registration form to show up in each users Buddypress Profile page.

Also, I have correctly setup the 3 image upload fields in the Buddypress Profile in order to map them.

See my images to help explain.

Form Editor page
Buddypress Addon Settings
Registration Form
Buddypress Profile

December 4, 2014 at 5:15 pm 31832
Sekander Badsha Sekander Badsha

Hello Aron,

There no feature to add images in BuddyPress registration field. So it will not integrate with BuddyPress.

December 10, 2014 at 2:13 am 32063
Aaron Aaron

OK. Understood. What if (after they register and login) i create a separate “image upload” form on their profile page… Then they can upload image… but how do i set the Form to upload the Image for that Specific Users ID… and how can i display it on their Profile Page???

December 10, 2014 at 12:41 pm 32079
Sekander Badsha Sekander Badsha

Anyone does anything in any CMS is dynamically managed and automatically assigned to that particular user. So no need to worry about assigning a file or anything to any user or get tensed about the “User ID”.

You can put avatar for profile image and image upload fields for other images in the registration page.

🙂

December 10, 2014 at 10:21 pm 32101
Aaron Aaron

Ok I have the Image Upload field working and the file gets uploaded to my Uploads Folder.

Now how do i display that image in the users profile page?
Same question worded differently — What is the Code to Display the uploaded image for that specific user?

NOTE: I ONLY want to show the Images uploaded using the Registration Form.

I know i would use this code on the Users Profile Page “bp_displayed_user_id()” but then whats the code to show the images uploaded using the Registration Form for this user?

Thanks

December 10, 2014 at 11:39 pm 32107
Aaron Aaron

OK I’m getting closer…. All i need to know now is how to ONLY show images uploaded using the Registration Form.

Here is my code that shows all of the users uploaded images

        $pictures = new WP_Query( array( 'author' => bp_displayed_user_id(), 'post_type' => 'attachment', 'post_status' => 'inheret', 'posts_per_page' => -1 ) );
        echo '<li><h3>' . $user->user_nicename . '</h3>';
            if ( $pictures->posts ) :
                echo '<ul>';
                foreach ( $pictures->posts as $picture ) :
                    echo '<li>'. wp_get_attachment_image( $picture->ID ) .'</li>';              
                endforeach;
                echo '</ul>';
            endif;
        echo '</li>';
December 11, 2014 at 12:53 pm 32131
Sekander Badsha Sekander Badsha

Please see my previous reply #31076

Viewing 8 Posts - 1 through 8 (of 8 total)