SuitePlugins
Forum Replies Created
-
This is the best way I can come up with since it grabs the User ID of the current profile being displayed
$user_id = um_get_requested_user();Sorry about the delay.
This will give you a comma separate list of sports.
$user_id = um_user('ID'); um_fetch_user( $user_id ); $meta_value = um_user('sports'); // If the value is an array and it isn't empty. if ( ! empty( $meta_value ) && is_array( $meta_value ) ) { echo implode( ', ', $meta_value ); } else { echo $meta_value; }This will give you an unordered list
$user_id = um_user('ID'); um_fetch_user( $user_id ); $meta_value = um_user('sports'); // If the value is an array and it isn't empty. if ( ! empty( $meta_value ) && is_array( $meta_value ) ) { echo '<ul>'; foreach ( $meta_value as $sport ) { echo '<li>' . $sport . '<li>'; } echo '</ul>'; } else { echo $meta_value; }Also, how would you the values for sports to look like? A list on each line, a comma separated list?
If it’s an array then can you do this so I can see what the array looks like
$user_id = um_user('ID'); um_fetch_user( $user_id ); $meta_value = um_user('sports'); // If the value is an array and it isn't empty. if ( ! empty( $meta_value ) && is_array( $meta_value ) ) { print_r( $meta_value ); } else { echo $meta_value; }If you mean you want to see the image and not just the link then you will need to put the image URL into an image tag like so
$user_id = um_get_requested_user(); um_fetch_user( $user_id ); $meta_value = get_user_meta( $user_id, 'profile_picture', true ); if ( $meta_value ) { echo '<img src="' . UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/" . $meta_value . '" />'; }Ok, so that is the same image file name is the same as before but this time we know for sure that is pulling from the profile.
$user_id = um_get_requested_user(); um_fetch_user( $user_id ); $meta_value = get_user_meta( $user_id, 'profile_picture', true ); if ( $meta_value ) { echo UM()->uploader()->get_upload_base_url() . um_user( 'ID' ) . "/" . $meta_value; }What this does, is check to see if the profile_pitcure exists and if it does then build an Image URL with the meta_value. I did some research and this is where that image file may exist.
You would need access to database through PHPMyAdmin but if you aren’t sure about that then you can also do this.
$all_user_data = get_user_meta( $user_id ); print_r( $all_user_data );This will get all the data for this profile. You can look at the results to see if there is any thing stored for profile_picture at all.
Hmm. Very strange. Try echo $user_id to make sure you are getting the correct profile ID in your shortcode.
If you have access to your database, check the usermeta table and see if there is a meta_value for the meta_key profile_picture and the User ID from echo.
Try this
$user_id = um_get_requested_user(); um_fetch_user( $user_id ); $meta_value = um_filtered_value( 'profile_picture' ); echo $meta_value;um_get_requested_user() – Gets the ID of the current profile ID.
Ok. So you would like it to get the photo of the currently logged in user OR the photo for the profile that you are looking at?
In what file are you placing the code and what page is it showing on?
Is profile_picture your custom user meta? Do you know where the files are stored?
The profile ID is the same as user ID in the database. So if you are looking for the currently logged in user ID, then you can use
get_current_user_id()If this doesn’t help, let me know.
Hi @throm17
Please try this for returning the unfiltered value of the user data.
$user_id = um_user('ID'); um_fetch_user( $user_id ); $meta_value = get_user_meta($user_id, 'mobile_number', true ); echo $meta_value;You can try this one for a filtered version
$user_id = um_user('ID'); um_fetch_user( $user_id ); $meta_value = um_filtered_value( 'mobile_number' ); echo $meta_value;Forum: Plugins
In reply to: [User List for Ultimate Member] Malfunction with IPad 3 + SafariThanks for letting me know. This is pretty strange but I will do a cross-browser check and make the necessary improvements.
Thanks.
Do you mean the links that appear after a user is logged in? Where it shows Your Account and Logout?