Home › Forums › Legacy Support › Support queries › Styling issues › How to show custom profile fields in student page
- This topic has 12 replies, 2 voices, and was last updated 4 years, 11 months ago by logan.
Viewing 13 posts - 1 through 13 (of 13 total)
-
AuthorPosts
-
April 18, 2019 at 3:42 am #205113roathSpectatorHello, In the student page (dashboard), is it possible to show custom profile fields below the name of the student (next to the student's image)? Thank you. Regards, RodrigoApril 18, 2019 at 5:25 am #205121loganMemberHello, Please let me know the question with a screenshot & proper demarcation. which fields and where??April 19, 2019 at 4:54 am #205287roathSpectatorHello Logan, I've attached an image with the exact position that I want the custom fields to be shown. I would like to show them below the name of the student. https://prnt.sc/ndzkcd The fields that I want to be displayed are two custom profile fields that I've created. Thank youApril 19, 2019 at 1:27 pm #205392loganMemberHello, Yes that is possible, but it depends which details do you want to print there. Refer: https://cl.ly/af9bcd these are the basic details which is printing there. Please paste this snippets in your wp-admin >> plugins >> editor >> wplms-customizer plugin >> wplms-customizer.php add_action('bp_profile_after_member_header_meta',function(){ global $current_user; get_currentuserinfo(); echo "<h3>Username: " . $current_user->user_login . "</h3></br>"; echo "<h3>User email: " . $current_user->user_email . "</h3></br>"; echo "<h3>User first name: " . $current_user->user_firstname . "</h3></br>"; echo "<h3>User last name: " . $current_user->user_lastname . "</h3></br>"; echo "<h3>User display name: " . $current_user->display_name . "</h3></br>"; echo "<h3>User ID: " . $current_user->ID . "</h3></br>"; },99);April 20, 2019 at 11:14 pm #205556roathSpectatorYes, that's it but I want to show custom profile fields created by me. I've created 2 fields: "profession" and "business type" and I want them to be shown. Thank you.April 21, 2019 at 6:13 am #205567loganMemberHello, For that i will need your database access. only then i can check the user_id, meta_key & meta_value only then i will be able to write new codes. Share your c-panel credentials in a private reply. Note: this is a custom feature request but you are our valuable customer that is why i am taking this request. i just want you to have some patience. this could take little time.April 29, 2019 at 2:58 pm #206761roathSpectatorThis reply has been marked as private.April 30, 2019 at 11:39 am #206924loganMemberHello, Please add profile fields by your own. make these fields mandatory when users fill these items while registering. if it has records only then i will be able to fetch its details from data bas. i don't want to change your custom registration form or profile fields details. or if you are entering these details directly by wp-admin > users > profile fields. that will also work. but i want you to add these items in your profile. then share screenshot of the area you want to print. then i will write new codes for it.May 1, 2019 at 5:48 am #207029loganMemberHey there, Please paste this snippets in your wp-admin >> plugins >> editor >> wplms-customizer plugin >> wplms-customizer.php Or in Please add this code in your wplms-customizer.php file in wplms customizer plugin by using your FTP/SFTP/cpanel: add_action('bp_profile_after_member_header_meta',function(){ if(!is_user_logged_in()){ return; }else{ $user_id = bp_displayed_user_id(); $user = get_user_by('id',$user_id); //get_currentuserinfo(); echo "<span>User ID: " . $user->id . "</span></br>"; echo "<span>Username: " . $user->user_login . "</span></br>"; echo "<span>User email: " . $user->user_email . "</span></br>"; echo "<span>User first name: " . $user->user_firstname . "</span></br>"; echo "<span>User last name: " . $user->user_lastname . "</span></br>"; echo "<span>User display name: " . $user->display_name . "</span></br>"; } },99);May 10, 2019 at 4:04 pm #208671roathSpectatorThis reply has been marked as private.May 13, 2019 at 1:02 pm #208889loganMemberActually, i need to check the meta key of the registration form field. please share screenshot of the form. also, i will need your database access only then it is feasible.May 16, 2019 at 3:33 am #209313roathSpectatorHello Logan, I have a good understanding of SQL queries and I usually extract data via direct query in the database. What meta_key? I checked the tables bp_xprofile_fields, data and meta but didn't find this field. But I can show the results from the table bp_xprofile_fields for the two custom fields: Field: "Cargo" id = 14, group_id = 1, parent_id = 0, type = selectbox, name = "Cargo", description = '', is_required = 1, is_default_option = 0, field_order = 4, option_order = 0, order_by = 'asc', can_delete = 1 Field: "Setor de Trabalho" id = 22, group_id = 1, parent_id = 0, type = selectbox, name = "Setor de Trabalho (em caso de estudante, escolher setor aonde pretende fazer o estágio)", description = '', is_required = 1, is_default_option = 0, field_order = 5, option_order = 0, order_by = 'asc', can_delete = 1 The "options" id's for the field_id = 14 are between 212 -226 (items for the selectbox) The "options" id's for the field_id = 22 are between 165 -185 If you need any more query results I can provide it here. Thanks.May 16, 2019 at 1:40 pm #209436loganMemberHello, Please provide your ftp credentials and admin credentials in a private reply. i will check this on your end. lets finalize it. add_action('bp_profile_after_member_header_meta',function(){ if(!is_user_logged_in()){ return; }else{ $user_id = bp_displayed_user_id(); $user = get_user_by('id',$user_id); //get_currentuserinfo(); $field1 = 12; $field2= 16; echo "<span>User ID: " . $user->id . "</span></br>"; echo "<span>Username: " . $user->user_login . "</span></br>"; echo "<span>User email: " . $user->user_email . "</span></br>"; echo "<span>User first name: " . $user->user_firstname . "</span></br>"; echo "<span>User last name: " . $user->user_lastname . "</span></br>"; echo "<span>User display name: " . $user->display_name . "</span></br>"; echo "<span>Field 1: " . bp_get_profile_field_data( 'field='.$field1 .'&user_id=' . $user->id) . "</span></br>"; echo "<span>Field 2: " . bp_get_profile_field_data( 'field='.$field2 .'&user_id=' . $user->id) . "</span></br>"; ; } },99);
-
AuthorPosts
Viewing 13 posts - 1 through 13 (of 13 total)
- The topic ‘How to show custom profile fields in student page’ is closed to new replies.