Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 2,751 through 2,775 (of 3,820 total)
  • In reply to: url avatar

    @shanebp

    Moderator

    [ Please to not double submit your topics. ]

    The avatar urls are not stored in the database.
    You can see the paths via ftp: /wp-content/uploads/avatars/
    Here is an example url:
    yoursite.com/wp-content/uploads/avatars/1/0e5eb0617289f060a-bpfull.jpg

    @shanebp

    Moderator

    BP_Group_Extension will not be available until BP is fully loaded.

    Did you try using the function wrapper I provided ?

    @shanebp

    Moderator

    Just to be sure, do you have ‘User Groups’ enabled here /wp-admin/admin.php?page=bp-components ?

    What hook are you using to call your extension ?
    This should work:

    function jim_add_group_extension() { 
       if ( class_exists( 'BP_Group_Extension' ) ) {
        ...
       }
    }
    add_action('bp_init', 'jim_add_group_extension');

    @shanebp

    Moderator

    Using prepare would be easy and fine.
    But if it’s only being used internally, is there really any need ?
    I assume she’ll only use it on the front-end with a is_super_admin check before calling.
    And using it in a wp-admin > users column shouldn’t be a problem.

    But you’re right, using prepare is the best practice.
    And no, I’m not going to update it, lol.

    @shanebp

    Moderator

    Please use the code button to format code you paste into this forum.

    To remove the count…
    Assuming you aren’t using a language translation file, try this in your bp-custom.php file.

    function john_gettext( $translated, $original_text, $domain ) {
    
        if ( 'buddypress' !== $domain )  
               return $translated;
    
        switch ( $original_text ) {
            case 'All Members <span>%s</span>':
                return 'All Members';
    
            default:
                return $translated;
        }
    }
    add_filter( 'gettext', 'john_gettext', 20, 3 );
    

    @shanebp

    Moderator

    There are per-user entries in the bp_activity database table for type > update_profile and date_recorded.
    Here a function for retrieving that info on a per-user basis.
    Put it in bp-custom.php or your theme functions.php

    function last_profile_update( $user_id ) {
      global $wpdb; 
    	
      $last_update = $wpdb->get_var( "SELECT date_recorded FROM {$wpdb->prefix}bp_activity WHERE user_id = $user_id AND type = 'updated_profile' ORDER BY date_recorded DESC LIMIT 1" );
    	
      echo 'last profile update: ' . $last_update;
    }

    Use it wherever you want like so: last_profile_update( 1 );

    @shanebp

    Moderator

    Do you have ‘Show Avatars’ enabled on …wp-admin/options-discussion.php ?

    Do you have ‘Profile Photo Uploads’ enabled on …/wp-admin/admin.php?page=bp-settings ?

    @shanebp

    Moderator

    I’ve updated the codex page.
    Please use the updated examples.

    Note this addition$group_id = bp_get_group_id(); to function display()

    @shanebp

    Moderator

    >Buddypress is waiting for the first login of each user

    At which point it will add a last_activity timestamp.
    The easiest solution is to add those timestamps for everyone via a script.
    Put this code in your bp-custom.php file, then open your site in a browser.
    Then remove the code – or it will update the timestamp on every page load.

    
    function daten_add_last_activity() {
        global $wpdb;
        foreach ( $wpdb->get_col( "SELECT ID FROM $wpdb->users" ) as $user_id ) {
            bp_update_user_last_activity( $user_id, bp_core_current_time() );
        }
    }
    add_action('bp_init', 'daten_add_last_activity' );

    @shanebp

    Moderator

    Glad you were able to find a solution.
    And thank you for sharing it here.

    @shanebp

    Moderator

    Nothing was removed.
    It never existed.
    Perhaps you could write that code and release it to the community.
    Or you could hire a developer.
    Or you might be interested in an existing premium plugin.

    @shanebp

    Moderator

    It won’t be easy.

    You’ll have to determine who is creating a message and who the recipients are.
    And then check for an existing thread id.
    If it doesn’t, allow a new thread.
    If it does, change it from new to reply.
    You’ll need to thoroughly review the code in buddypress/bp-messages to get an idea of how it works and which hooks are available for use.

    @shanebp

    Moderator

    Did you forget to deactivate any other plugins that rely on BP?

    If so, can you use ftp to delete those plugins?

    @shanebp

    Moderator

    The default member search is not that robust.

    Most people write their own code or use a plugin like: bp-profile-search.

    @shanebp

    Moderator

    >when you use BuddyPress do all users accounts automatically become BuddyPress users?

    Yes, but you can filter them out based on things like membership level.
    It requires custom code that is specific to your install.

    @shanebp

    Moderator

    >I have introduced a new feature to my site in which members can submit posts

    So they can do that now?

    >I would like members to be able to author posts as well.

    So they can’t do that yet?
    Or they can, but the author is listed as ‘irieside’ ?

    If the latter, then the issue is how the posts are saved.
    You need to adjust the code so that it saves the logged-in-user as author.
    And that is not a BP issue, but a WP code issue.

    In reply to: Image Upload

    @shanebp

    Moderator

    No info about individual avatars is stored in the database.

    The images are here: …/wp-content/uploads/avatars/[the id of the user]

    @shanebp

    Moderator

    Nice. And thanks for sharing your solution.

    @shanebp

    Moderator

    This is possible but will require a considerable amount of custom code, especially merging the tabs. You’ll most likely need to hire a very experienced BP developer.

    @shanebp

    Moderator

    Automatically? No.

    You could try using the bbPress tools.
    …/wp-admin/tools.php?page=bbp-repair

    If that doesn’t work, you’ll need to replace those urls.
    You can write a script or use a search & replace tool like this one.
    It’s a powerful tool. Definitely try it on your clone until you understand how to use it.

    @shanebp

    Moderator

    On this page …wp-admin/admin.php?page=bp-settings
    Have you selected ‘Profile Photo Uploads > Allow registered members to upload avatars’ ?

    On this page …/wp-admin/options-discussion.php
    Have you selected ‘Avatar Display > Avatar Display Show Avatars’ ?

    @shanebp

    Moderator

    $some_field is a variable that you create.
    Its value is whatever you assign to it, iow. whatever is to the right of the = sign.
    The name of the variable can be whatever you want, as long as it’s unique.
    It could be $bongos_ahoy or $smelly_dog, etc.
    This is basic coding and not really appropriate for this forum.

    @shanebp

    Moderator

    It depends on where you want to do it.

    On a profile page:

    $some_field = bp_get_member_profile_data( 'field=Name of Field' );
    if( !empty( $some_field ) ) {
         if( $some_field == 'x') 
            echo 'x'; 
         elseif( $some_field == 'y') 
            echo 'y'; 
         else
            echo 'z'; 
    }

    On the all members page:

    $user_id = bp_get_member_user_id();
    $some_field = xprofile_get_field_data( 'Name of Field', $user_id, $multi_format = 'comma' );
    if( !empty( $some_field ) ) {
    //etc. 

    @shanebp

    Moderator

    >Thanks i will try that with but with your solution i cant call the content, but simply echo somthing ?

    Correct.

    >If i have a wp page that use the default template the slug of this page is /invitation/ i can grab only the content of that page to load it in the new tab in bp profile ?

    Use get_post

    @shanebp

    Moderator

    For your situation, it would be easier to use a template overload.

    Then you can arrange the header exactly as you want it.

    And you should not be using add_filter.
    Filters change the markup output.

    You should use add_action.
    Maybe this hook in member-header: do_action( 'bp_before_member_header_meta' );
    Or add your own do_action hook in your template overload.

Viewing 25 replies - 2,751 through 2,775 (of 3,820 total)
Skip to toolbar