Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to programmatically set birhtday value and avatar in buddypress


  • Thagintoki
    Participant

    @thagintoki

    Hi and thanks for reading my question, I have been trying to create a default data for buddypress and I am stuck, Searched about 2 days in forums but no clue. Here is the code I use:

    <?php
                        $randDate = mt_rand(0062055681,0562055681);
                        $randDate = date('Y-d-m H:m:s', $randDate);
                        echo $randDate.'<br>';
                        xprofile_set_field_data( 1, $random_user, $displayname );
                        xprofile_set_field_data( 3, $random_user, 'Man' );
                        xprofile_set_field_data( 6, $random_user, 'Woman' );
                        xprofile_set_field_data( 9, $random_user, 'Single' );
                        xprofile_set_field_data( 17, $random_user, $city );
                        xprofile_set_field_data( 18, $random_user, $country );
                        xprofile_set_field_data( 2, $user_id, $randDate );
    ?>

    everything works fine except for the datebox field which is field number (2); However the avatar still something I couldn’t find out how to do it in buddypress. Thanks for helping.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to programmatically set birhtday value and avatar in buddypress’ is closed to new replies.
Skip to toolbar