Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'hide fields'

Viewing 25 results - 151 through 175 (of 260 total)
  • Author
    Search Results
  • #129738
    Hugo Ashmore
    Participant

    Profiles are by default public, you can also extend them by creating your own custom xprofile fields, these and any profile fields can be further modified if wished to show or hide some based on whether the displayed user is also the logged in user.

    #128706
    Marcella
    Participant

    Hey @davidveldt this should do it if you are using the default theme. Otherwise you should integrate as you see fit.

    theme/registration/register.php

    You can add any groups or fields as you require. The groups and fields here are arbitrary.

    ` ‘player’, 4 => ‘coach’, 5 =>’parent’, 6 => ‘instructor’); ?>

    $role) : ?>
    <div id="” class=”role-fields”>

    <label for="”>

    <textarea rows="5" cols="40" name="” id=””>

    <input type="hidden" name="signup_profile_field_ids" id="signup_profile_field_ids" value="” />

    `

    Create some profile groups to cater for each role. You can find the group id within the BuddyPress admin… In the url bar or investigate your database.

    You should set-up the $roles array above to match your requirements.

    Within the loop you can show any fields you have created within that xprofile group. If you have a select box within that group you would add the following code as outlined in the bp-default register.php

    `

    <label for="”>

    <select name="” id=””>

    `

    Finally add the following jQuery where you house any other code of similar ilk.

    `
    jQuery(“.role-fields”).hide();
    $roles = jQuery(“#roles”);
    jQuery(“#field_2”).change(function()
    {
    $role = jQuery(this).val().toLowerCase();
    jQuery(“.role-fields”).hide();
    jQuery(“#” + $role).toggle();
    });
    `

    Here’s a pastebin for all that above. http://pastebin.com/QFdTdstz

    No need for tabs or accordion this time.

    Hope that helps you on the Road.

    #128632
    Marcella
    Participant

    Just an example here, running with Paul Gibbs start point.

    Create xprofile fields as normal.

    Each career group would also have its own xprofile group.

    Player would have his / her own set of fields.
    Coach would have his / her own set of fields.
    Parent would have his / her own set of fields.
    Instructor would have his / her own set of fields.

    None of the above would be required fields. (as far as BuddyPress is concerned (unless you roll some PHP codes))

    You’d have another xprofile group specifically for required fields (this would be your first group).

    You would make the “type” part of the required group and set it as a select box.

    You could then write your registration form mark-up matching the requirements of jQuery tabs or jQuery accordion.

    The “type” would be the last item on the required fields. Once that was selected you could then show or hide the corresponding jQuery ui-tab-panel that holds those form fields.

    You could then on-the-fly make those fields then required using some jQuery also but a bit hacky.

    #128623
    David Veldt
    Participant

    Hmmm good point. Definitely worth checking out, however I still run into figuring out how to show/hide info depending on what they select from the drop-down. Not sure how to go about this…

    #126155
    freque.unce
    Participant

    I changed register.php to display profile group 3 (optional profile fields I added via dash) instead of 1, to hide the required displayname option on signup, which forces it to clone username data by default. I then removed the ability to change names in xprofiles’ edit.php (with if/else, statements on textbox & submit button for profile group 1).

    Those 2 steps take care of all future occurances, so I then went in and changed all of my existing users’ display names to match their usernames, manually, via the dashboard.

    Problem solved. More of a substitute than a removal, but it works for me. Hopefully someone will find this useful.

    modemlooper
    Moderator

    Just read you don’t want to edit home.php. There isn’t a filter for privacy like there is with messages for showing profile sections. Messages and xprofile fields has logic for output and can be filtered but the actual page needs a code edit.

    #118111

    In reply to: Profile rating system

    @christophg Sorry for the delay in getting the registration/profile idea to you. Here is what I do:

    I use S2member to keep my customers and brands separate. I then created a new profile group called “Company Profile”. I made this the last profile group. I then added the following code to the file:
    members/single/profile/edit.php

    `
    <?php if (S2MEMBER_CURRENT_USER_ACCESS_LEVEL

    ul.menu li:last-child{display:none;}
    .company-profile{display:none;}

    `

    The above code hides the profile group on the edit menu from users below level 2, my brand level. And it also hides the profile group edit fields from anyone below level two. In case the menu item shows for some reason. And, unfortunately, this will not hide the menu item from users in IE 8 and below. But it WILL hide the profile group from them.

    I tried using jquery to affect last-child in IE. Although I can get the jq to work on a test page on IE, it won’t work on the menu item… not sure why.

    Next, my brands all belong to a private group, and I use a group conditional script to show the brands profile info front and center on their profile page with custom styling. This allows the brand members only to have a slick looking page that is different from regular consumer pages.

    `

    `

    Let me know if you need anything else. Or if something doesn’t make sense.

    #116012
    danbpfr
    Participant
    #115874

    I use S2member to monitor my sites membership, it provides hooks and such (not too sure about the terminology) that allow you to display content to certain user roles. I have a user role for companies (experts). I also have a profile field group just for them. It is the last group.

    I have added inline css using last-child selector to hide the menu option to edit this profile group from everyone except members that have a level 2 membership. And since Buddypress will only show profile data if the field has been filled in, it only shows on Experts (level 2 ) users public profiles.

    If this is confusing, let me know and I’ll try to give exact steps for how I accomplished this.

    #110277
    sdpkelkar
    Member

    Hi.
    Thanks for the code Brajesh! I just had one question. I’ve defined different profile field groups for different user types. I want to restrict the visibility of these filed groups to only those users (e.g. users of type A get to see only those profile fields for user type A). My problem is that when I use your code

    <?php global $bp;
    if(bp_get_current_profile_group_id()==1)
    bp_core_redirect($bp->displayed_user->domain.”profile/edit/group/2″);
    ?>

    it shows the same profile fields for all user types. I guessed it was because 1 is the base profile group ID and tried changing the if loop to

    if(bp_get_current_profile_group_id()==ID number of group)
    bp_core_redirect($bp->displayed_user->domain.”profile/edit/group/ID number of group”);

    but now it shows me only the ‘Editing base profile’ screen

    Is this code correct?

    Cheers

    #109848
    tiger625
    Member

    Not sure. I just downloaded and it worked. I did notice when I was in a member profile and looked at my public profile tab the fields showed up. When not logged in or logged in as another user, the fields were not visible. I am also using Role Manager plugin, not sure if that makes any difference.

    #105081
    Philipp
    Participant

    @aljuk Another 6 hours of work and sill no solution. I tried exactly what you said. And I also tried it on my development installation – There it’s working like a charm. I don’t have an idear what to do… ;(
    I use the latest versions of bp and wp. On my testdrive I use the same plugins. I also checked another theme.
    All this work just to hide ONE profile field.
    Do you have another idear? ;)

    Thanks a lot!

    Philipp

    #104856
    aljuk
    Member

    Hmm, that’s strange. It’s working for me exactly as advertised.
    What’s the history of your theme? Is it default, child, custom etc?

    Maybe cookies…
    In the Admin, set “let user decide” for some fields.
    Log out.
    Clear your cookies, make sure to delete all cookies from the domain, and from any test domains, and any local domains (eg. mamp wamp etc. if you’re using that) that you’re developing the site on.
    Log in as a subscriber level user.
    What result now?

    #104844
    Philipp
    Participant

    @aljuk Thanks a lot for you answer. But I also tried that and I logged out as admin and signed in as a normal user. Still the same.
    Another idear?

    Thanks a lot for the link. I’ll take a look to it! :)

    All the best!

    #104829
    aljuk
    Member

    “If I activate it and set a field (e.g. birthdate) to “users only” – nothing happens. There are also no settings for the users in the frontend of buddypress.”

    If you set it to “users only” in Admin, you’re not giving your user the choice, and that’s why there is no selector in the front end. The user will only get the selector if you choose “let user decide”.

    #104828
    aljuk
    Member

    @philippmuenchen – it works fine. I’m guessing you’re trying to test it while you’re logged in as Admin? The privacy controls don’t apply to Admin. Admin can see everything. Log in as a regular user and then test.

    Age calculation: http://code.hyperspatial.com/all-code/buddypress-code/buddypress-age/

    @noizeburger – it works for all fieldgroups, not just Base.

    #104824
    Philipp
    Participant

    Hi and sorry for the second post. But I’m trying to find out since one week why the BP Profile Privacy PlugIn isn’t working for me.
    If I activate it and set a field (e.g. birthdate) to “users only” – nothing happens. There are also no settings for the users in the frontend of buddypress. So there’s something wrong? Any idear what to try to fix it?

    I’m looking forward – Hopefully for an answer! ;)

    Philipp

    #104370
    Philipp
    Participant

    It is in the fieldgroup “ID1”.

    #104358
    noizeburger
    Participant

    BP Profile Privacy only works for fields in the fieldgroup “Base” (ID 1). In which group did you place the birthday field?

    #104335
    Philipp
    Participant

    I activated it and made my settings but nothing happens. E.g. I said “Birthday” just for “User” but it’s still visible. There are also no settings in the frontend if I use “Let user decide”.
    I already deleted all fields with “bp_profile_privacy” in the database and activated the plugin again. But it’s still the same… No idear!?

    Thanks a lot!

    #104333
    modemlooper
    Moderator

    I just tried that plugin and it seems to be working. What didn’t work for you?

    #104323
    Philipp
    Participant

    I just tried BP Profile Privacy. It’s not working with the latest BP release, isn’t it!? :(
    So maybe another idear?

    #104308
    Philipp
    Participant

    Thanks for the answers. But I just want to hide one of the profile fields from public….
    But you could also help me, if you tell me this:

    Is it possible to convert a date (e.g. Birthday 12.07.1987) to an “age” “23”?! That would solve the Problem also.
    I just don’t want that anyone is able to see the birthdate of my users…

    Thanks a lot and all the best!

    #104290
    Dave Wright
    Participant

    There is a plugin called profile privacy that may do what you want

    #104287
    Hugo Ashmore
    Participant

    Use the conditional function `is_user_logged_in()` in an ‘if’ conditional before the field in question.

Viewing 25 results - 151 through 175 (of 260 total)
Skip to toolbar