Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 1,654 total)
  • Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    On button click, use a page refresh or ajax to fire a function that calls bp_activity_add.

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    You’re using that hook incorrectly.
    What do you think $args represents in your function?

    Here is the hook, from bp-activity\bp-activity-functions.php
    do_action( 'bp_activity_posted_update', $r['content'], $r['user_id'], $activity_id );
    Notice that it passes 3 separate arguments.
    And $content is not one of them.
    And there is no scope for a return.
    And that hook runs after the activity has been created, so even if your function was less malformed, it wouldn’t work as you expect.

    The correct hook is called earlier in the same function as the hook you’re using.
    $add_content = apply_filters( 'bp_activity_new_update_content', $activity_content );
    Adjust $activity_content and return it.

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    There are, unfortunately, two sets of user data.

    Your imported data was placed in the _usermeta table.
    This data will show in wp-admin > users > user > profile

    BuddyPress uses different tables: _xprofile_
    This data will show in wp-admin > users > user > extended profile
    And on the front end while viewing a member profile.

    You may want to write a script that migrates from usermeta to xprofile.
    Study the structure of the tables used for xprofile.

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    What hook are you using?

    Try:

    function anika_test() { 
        echo 'logged in ID: ' .  bp_loggedin_user_id();
        echo '<br>some field: ' .  xprofile_get_field_data('some field name', bp_loggedin_user_id() );
    }
    add_action( 'bp_ready', 'anika_test' );

    bp_displayed_user_id() needs to be called in the context of a profile.
    Look at the template files for an appropriate hook.

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    It’d be a lot easier to answer your questions if you were explicit about the functions you’re using, for example: bp_group_list_admins()

    Since it’s called in a template, overload the template and make a call to your own version of that function that sets ‘type’ to whatever you want.

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    BP_Group_Member_Query is a class extension of BP_User_Query
    Take a look at the code examples here:
    https://codex.buddypress.org/developer/bp_user_query/

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    Did you try:
    bp_get_group_slug();

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    There are several functions re the group creator that are available in the groups loop.
    For example: bp_group_creator_username()
    Look in bp-groups\bp-groups-template.php

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    Try this…

    Make a template overload of this file:
    bp-templates\bp-legacy\buddypress\members\single\profile\profile-loop.php

    In that new file, change this:
    <?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>

    to this, assuming the id of your base group is 1

    <?php while ( bp_profile_groups() ) : bp_the_profile_group(); ?>
        <?php if( bp_get_the_profile_group_id() != 1 ) : ?>

    And add an <?php endif; ?> before the <?php endwhile; ?> near the bottom of the page.

    Do the same for:
    bp-templates\bp-legacy\buddypress\members\single\profile\edit.php

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    If you mean add a link to navigation, you can do that via …/wp-admin/nav-menus.php

    If you want to add it elsewhere, it’s just a simple link.

    It sounds like you are having trouble adding the link in a specific place.
    So you need to be specific about that place.

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    >…the page I created for the Members.

    How did you create that page?
    You should just create a page titled ‘Members’. The page should be blank.
    You then assign that page to the Members component through Settings > BuddyPress
    You should then be able to see a listing of all active members by visiting:
    …yoursite.com/members/

    Or is your issue just about navigation?

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    Please use the code button.

    You need to include the user id:
    echo xprofile_get_field_data( 'Undergraduate College/University', $current_user->ID );

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    Manually create the pages.
    Just enter the title and publish – the pages should be blank.

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    Your server / hosting provider is imposing resource / process limits.
    You need to talk to them.

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    Are there other profile groups that you want to be visible and editable?

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    Use the members widget code in your own widget and adjust to your liking.

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    Check your site-wide settings, in wp-admin, for Forums.

    btw: this is the BuddyPress support forum.

    The bbPress support forum is here.

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    There is no need for rudeness – even if you didn’t understand a reply.

    >When is it better to install buddypress on a subdomain and when on the primary domain?

    It depends on what you’re trying to do.

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    You’ll need to use a custom query.
    Untested, try:

    global $wpdb;
    $field_id = 8; // change to the id of 'school name'.
    $query = "SELECT field_value FROM " . $wpdb->prefix . "bp_xprofile_data WHERE field_id = " . $field_id;
    $school_names = $wpdb->get_col( $query );

    $school_names will be an array.
    Loop thru it to create your dropdown.

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    >after I have chosen an image to upload and pressed “open” on the media screen.

    On what avatar screen are you seeing ‘open’ ?

    > Is there a non minified version of the script somewhere?

    Yes, in buddypress/bp-core/js/

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    Have you tried using the filter hooks in bp-core/bp-core-avatars?
    There are several filters for adjusting various paths.
    Haven’t tried it, but might work.

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    There are before and after save filter hooks.

    After it’s saved, use the filter in bp_activity_content_body
    apply_filters_ref_array( 'bp_get_activity_content_body', array( $activities_template->activity->content, &$activities_template->activity ) );

    Before it is saved, use this hook in bp-activity\classes\class-bp-activity-activity.php
    apply_filters_ref_array( 'bp_activity_content_before_save', array( $this->content, &$this ) );

    Both filter functions will require you to do some php string parsing – easy to do.
    Lots of info out there, like: http://www.stumiller.me/code-snippet-strip-links-from-string-in-php/

    Profile photo of shanebp
    shanebp
    Moderator

    @shanebp

    Use a hook for testing, something like:

    function jr_test() {
       bp_activity_add(...); 
    }
    add_action( 'bp_ready', 'jr_test' );
Viewing 25 replies - 1 through 25 (of 1,654 total)
Skip to toolbar