Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'profile fields'

Viewing 25 results - 1,401 through 1,425 (of 3,608 total)
  • Author
    Search Results
  • #173322
    Hugo Ashmore
    Participant

    If you want a paid option you could check out:

    BuddyNotes

    #173319
    Robert Trevellyan
    Participant

    I don’t know if there’s a way to do it natively in BuddyPress (I’m new here), but s2member can be used to create additional member fields that are only accessible to administrators, and I expect there are other plugins that offer similar functionality.

    #173277
    martinbeaulne
    Participant

    Well well. I finally found, and I’m surprised the answer didn’t come from this thread.

    It is quite simple, in fact. Just need to use the function:

    
    xprofile_set_field_data($field, $member-id,  $value);
    

    So, with a simple form sending those three values, one can update a single field anywhere. As I wanted to let members update their fields directly from their member profile ( without using the very bad and obscure edit.php ), I put a form and the function in the member-header.php

    My form and function updates three fields.

    Here is the function, somewhere in the member-header.php file:

    
    <?php
    function updatedemo() {
        $id = $_POST['id-member'];
        $liendemo = $_POST['liendemo'];
        $champdemo = $_POST['champdemo'];
        $titre = $_POST['titre'];
        $champtitre = $_POST['champtitre'];
        $description = $_POST['description'];
        $champdescription = $_POST['champdescription'];
    
        xprofile_set_field_data($champdemo, $id,  $liendemo);
        xprofile_set_field_data($champdescription, $id,  $description);
        xprofile_set_field_data($champtitre, $id,  $titre);
    }
    if(isset($_POST['submit']))
    {
        updatedemo();
        
    }
    ?>
    

    And here is the form:

    
    <?php if ( bp_is_my_profile() ) { ?>
    	<form method="post" action="<?php bp_displayed_user_link(); ?>">
    
    	<?php if ( xprofile_get_field_data('25') == "" ) { ?>
    		<img src="http://www.cinemacontact.com/fr/images/form-demo-01.jpg"><br>
    
    	<?php }; if ( !xprofile_get_field_data('25') == "" ) { ?>
    		<img src="http://www.cinemacontact.com/fr/images/form-demo-01-1.jpg"><br>
    	<?php }; ?>
    
    		<img src="http://www.cinemacontact.com/fr/images/form-demo-02.jpg"><br><input type="text" name="titre" size="40"><br>
    		<img src="http://www.cinemacontact.com/fr/images/form-demo-03.jpg"><br><input type="text" name="liendemo" size="80"><br>
    		<img src="http://www.cinemacontact.com/fr/images/form-demo-04.jpg"><br>
    		<img src="http://www.cinemacontact.com/fr/images/form-demo-05.jpg"><br>
    		<textarea style="width:400px; height:75px;" name="description"></textarea>
    		
    		<input type="hidden" name="champdemo" value="lien-4">
    		<input type="hidden" name="champdescription" value="description-4">
    		<input type="hidden" name="champtitre" value="titre-4">
    		<input type="hidden" name="id-member" value="<?php echo bp_loggedin_user_id(); ?>"><br>
    		<input type="submit" value="Envoyer" name="submit">
    	</form>
    	<?php }; ?></h3>
    

    And this actually works.

    Maybe I didn’t ask correctly at the beginning of the thread. All I wanted to know was:
    « Oh, Martin, there is, indeed, a function to update xprofile fields: xprofile_set_field_data(), don’t need to start with edit.php file. »

    🙂

    #173124
    ugcheleuce
    Participant

    @Jobster123: I’m afraid I don’t understand what you mean.

    The success of a directory does not depend on unique content but on whether you can entice users to register profiles. In addition, the success of the directory depends on how easy it is for visitors to search the directory and find the user profiles that fulfils their need. This means that a directory system needs to be easy to use for users who want to register but who aren’t computer literate or who don’t have time to figure out how to beautify their profiles beyond that which is necessary.

    Of course, it would be great if Google could index the directory, but the strength of the directory lies not in the “description” field of each profile page, but in the way all the factual fields have been set up… because those are the things that visitors will search.

    Samuel (ugcheleuce)

    #173114
    Yukon Cornelius
    Participant

    @danbp Thank you man, this is amazing!

    It didn’t do exactly what i wanted, so i made a couple of tweaks. I changed the filter so the messages were added to the profile only, not the member header meta. I also made the statement into elseif, with an array, so it would do what i needed it to, ie show up only if both fields were empty. Here’s my code. It is probably a bit messy, but it does the trick:

    function bpfr_my_message_on_profile () {	
    	
            if ( bp_is_my_profile()) :
    	
    	if ( !$data = bp_get_profile_field_data( 'field=About' ) ) : 
    	
    	echo '<p class="enter-info">Please tell the community a little bit about yourself by filling out the form on the edit tab above.</p>';	
    	
    	elseif ( !$data = bp_get_profile_field_data(array( field=>'vimeo',field=>'youtube') ) ) : 
    	
    	echo '<p class="enter-info">There is nothing here! Spruce up your profile by adding content via the edit tab above.</p>';
    	endif;
    	endif;
    }
    add_filter( 'bp_before_profile_content', 'bpfr_my_message_on_profile' );

    Thanks for all your help. You rock!

    #173014
    shanebp
    Moderator

    Visibility checks are not done when profile data is retrieved ‘outside’ BP_XProfile_Group.

    You can use bp_xprofile_get_hidden_fields_for_user() to do your own check.

    It is reasonable to expect bp_member_profile_data() to include an argument re visibility check.

    So it’s not a bug, but you can create an enhancement request ticket on trac.

    #173005
    trinzia
    Participant

    Same issue (details below)

    In this file {themename}\members\single\member-header.php, is the following code:

    		<?php
    		/***
    		 * If you'd like to show specific profile fields here use:
    		 * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field
    		 */
    		 do_action( 'bp_profile_header_meta' );
    
    		 ?>
    

    I have some custom profile fields, so I replaced the ‘do_action’ with these:

    		<h3>About Me<h3>
    		<?php bp_member_profile_data( 'field=About' ); ?>
    
    		<h3>Birthday</h3>
    		<?php bp_member_profile_data( 'field=Birthday' ); ?>
    

    When I click on the Edit Profile link, I can change visibility settings, and it appears to save them. BUT the saved settings don’t do anything. In another browser where I’m not logged in at all, I can always see all of the fields listed, no matter which settings were chosen.

    Advice?

    #172857

    In reply to: Dynamic profile fields

    paddelboot
    Participant

    Another approach might be to “fake” those dynamically created fields. Upon saving them, simply collect all data entered and save it into 1 field. When displaying the profile, extract this data into the according amount of input fields.

    bp-help
    Participant

    @shaungreen
    I am not sure I am following you but if you deactivated that plugin and a new user can register and activate an account and login successfully then this is not a BP or bbPress issue. It needs to be taken up on that plugins support forum if you insist on using this plugin. Otherwise you may want to look into alternatives! I have used:
    https://wordpress.org/plugins/bp-force-profile/
    It forces a user to complete the required xprofile fields before they can interact with the site and seem like a good deterrent against spam registrations.

    #172749

    In reply to: 'Survey' Project

    @mercime
    Participant

    I would like to create a section where people can sign in and answer questions and add their image and then have people see their answers.


    @cortttt
    Sure. Use BuddyPress Extended Profile Fields to highlight the best of your community https://codex.buddypress.org/buddypress-components-and-features/extended-profiles/
    Make sure that Extended Profiles is checked in wp-admin Settings > BuddyPress > Components

    At the top of the sections would be a running total…total years lost to illness

    Check out https://wordpress.org/plugins/buddypress-xprofile-custom-fields-type/ and then customize the plugin to include the running total years lost to illness or use/rename birthday field

    #172702
    Henry
    Member

    @shanebp good shout!

    #172701
    applegateian
    Participant

    Thanks @henrywright-1 and @shanebp

    Works a treat 🙂

    #172700
    shanebp
    Moderator

    @henrywright-1

    Don’t initialize $i as a string if you’re going to use it as an integer.

    if ( $items = bp_get_profile_field_data( array( 'field' => 'Budget' ) ) ) {
        $i = 0;
        foreach ( $items as $item ) { ?>
            <div id="size-<?php echo ++$i; ?>">
            <?php echo $item; ?>
            </div>
        <?php }
    }
    #172696
    Henry
    Member

    Ah I see what you’re trying to do.

    $i = '1';
    if ( $items = bp_get_profile_field_data( array( 'field' => 'Budget' ) ) ) {
        foreach ( $items as $item ) { ?>
            <div id="<?php echo 'size-' . $i; ?>">
            <?php echo $item; ?>
            </div>
            <?php $i++; ?>
        <?php }
    }
    #172692
    applegateian
    Participant

    Hmm ok thanks @henrywright-1

    On the front end I get:

    item-1 £500k-£2m
    item-2 £2m+

    The HTML generated is –

    <div id="size500">        
     item-1        £500k-£2m        		
    </div>    
    <div id="size500">        
     item-2        £2m+        
    </div>    
    

    How can I make those divs unique?

    #172691
    Henry
    Member

    A unique ID is easy enough, just use the loop to output a unique value. e.g.

    
    $i = '1';
    if ( $items = bp_get_profile_field_data( array( 'field' => 'Budget' ) ) ) {
        foreach ( $items as $item ) { ?>
            <!-- put what you want here -->
            <?php echo 'item-' . $i; ?>
            <?php echo $item; ?>
            <?php $i++; ?>
            <!-- put what you want here -->
        <?php }
    }
    
    #172690
    applegateian
    Participant

    Quick question @henrywright-1 – any way to give each of those that are spat out a unique id?

    Or do they have to have the same HTML around them?

    Ideally, each of the items are wrapped different id – e.g.

    
    <div id="size500">£500K</div>
    
    #172688
    applegateian
    Participant

    @henrywright-1 it’s added in /wp-admin/users.php?page=bp-profile-setup – Profile Fields under the Users menu in WP Admin.

    Your code works, thanks..!

    So I can add html into those spaces, and each item is now separated by html…I think that should do it. Thanks so much for the support Team Buddypress 🙂

    #172687
    Henry
    Member

    Is budget a field that you’ve set up under WP Admin > Profile Fields? and is it of type ‘checkbox’? also are you displaying the values on the user’s profile page? if yes to all of these then this should work:

    if ( $items = bp_get_profile_field_data( array( 'field' => 'Budget' ) ) ) {
        foreach ( $items as $item ) { ?>
            <!-- put what you want here -->
            <?php echo $item; ?>
            <!-- put what you want here -->
        <?php }
    }

    Note: I’ve amended the code so you can insert HTML a bit easier

    #172685
    applegateian
    Participant

    Hi @henrywright-1

    Thanks for the idea.

    Pasting that in (exactly as it is) doesn’t return anything for Budget.

    How do I add the HTML I want into:

            // put whatever you want here
    

    Cheers

    Ian

    #172683
    Henry
    Member

    Hi @applegateian – I think the problem might be the snippet you’re using to output the data string.

    try doing something like this:

    if ( $items = bp_get_member_profile_data( array( 'field' => 'Budget' ) ) ) {
        foreach ( $items as $item ) {
            // put whatever you want here
            echo $item;
            // put what you want here
        }
    }

    Note: I haven’t tested.

    #172679
    applegateian
    Participant

    Not sure it’s a custom hack…

    In WordPress admin, I go to Profile Fields

    Then, I have three profile groups in there. The third one is where this budget field sits.

    It’s only available to certain user types, which is why it’s in a separate profile group.

    However, as far as I know @bphelp – none of this is custom or a hack, this is standard BP functionality? Then using this snippet to show the output on the front end:

    
    	<div id="profileProjectSize">
    		<?php 
    		$data=bp_get_member_profile_data(array('field'=>'Budget'));
    		echo $data; 
    		?>
    	</div>	
    
    #172678
    bp-help
    Participant

    @applegateian
    Maybe I am missing something here! Did you add those fields in the dashboard, or was it some custom hack?

    #172677
    applegateian
    Participant

    That’s what is strange @bphelp – when I inspect element in Chrome, there are simply no tags around the checkboxes on view profile:

    #172676
    bp-help
    Participant

    @applegateian
    If your on the view profile page and you are inspecting with dev tools you should see a tr class with the field_ID followed by td class label and td class data. You should be able to use those to your advantage.

Viewing 25 results - 1,401 through 1,425 (of 3,608 total)
Skip to toolbar