Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 1,053 total)
  • Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    Correction — you can also use bp_group_name() by passing a group to it as its argument.

    Take your group_id, instantiate a group, and pass it to bp_group_name():

    
    $args = array( 
      'group_id' => $my_id
    );
    
    $group = groups_get_group( $args );
    ..
    bp_group_name( $group);
    
    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    For a loop like that you can use bp_has_groups() instead of groups_get_user_groups(). Is there a reason why you rejected that approach?

    Then a my groups widget can have a simple core like this:

    
    		<?php if ( bp_has_groups( 'type=alphabetical&user_id=' . bp_loggedin_user_id() ) ) : ?>
    
    			<ul id="my-groups-list">
    				<?php while ( bp_groups() ) : bp_the_group(); ?>
    					<li class="row collapse">
    						<div class="item-avatar small-3 columns">
    							<a href="<?php bp_group_permalink() ?>"><?php bp_group_avatar_thumb() ?></a>
    						</div>
    
    						<div class="item small-9 columns">
    							<div class="item-title"><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></div>
    						</div>
    					</li>
    				<?php endwhile; ?>
    			</ul>
    
    		<?php else: ?>
    
    			<div class="widget-error"><?php _e( 'No current groups.', 'my-groups-widget' ); ?></div>
    
    		<?php endif; ?>
    

    Note: If you want to use functions like bp_group_name(), you need to be inside a bp_has_groups() loop. The loop and bp_the_group() instantiate structures in the group template that are then used by bp_group_name.

    If you want to use groups_get_user_groups() and setup your own loop, you’ll need to use different functions to access the name, permalink, etc. Look in bp-groups-functions.php, bp-groups-template.php and in bp-group-classes.php to get an idea what’s available.

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    or even easier for the displayed user id:

    bp_displayed_user_id();

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    That’s more of an s2member question than a BuddyPress one – so, better asked on their forums.

    Anyway:

    In your PHP template for displaying the user, you can add the following code:

    echo get_user_field('s2member_access_label', $user_id);

    and to get the $user_id for the displayed user, you can use:

    global $bp;
    $user_id = $bp->displayed_user->id;
    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    @strangechild — there is some documentation here: https://codex.buddypress.org/themes/theme-compatibility-1-7/theme-compatibility-2/

    The intro is confusing, but if you jump to the second section, it tells you where to find files and where they need to be added to your theme, if you want to override them.

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    ok.. props to @hnla

    Defining the constant BP_ENABLE_MULTIBLOG in bp-custom.php fixed the problem.

    @boone – any thoughts on this vs. enabling BP on a site by site basis (as suggested as preferable in your in file comments)? Is activity / members / groups, etc. shared when BP is activated separately for each site?

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    @rameshwormaharjan

    If you look in the implementation bp_has_activities(), you’ll see if no user id is supplied as an argument it will default to the displayed_user id on a member page.

    See lines 316 and 382 of bp-activity-template.php

    If you’re on a non member page it will show activity relative to the logged in user (line 382).

    Try passing the logged in user id as an argument to your bp_has_activities() call, that should override the displayed user default on a member page.

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    We’ve used WP FB Autoconnect on a lot of BuddyPress sites – https://wordpress.org/plugins/wp-fb-autoconnect/

    There’s a functional free version, and just a few dollars extra for the pro version

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    Sounds like you are using an old / outdated plugin with a recent version of BuddyPress.

    Looks like called wp-cache might be the problem — see if this link helps you https://wordpress.org/support/topic/advanced-cachephp-problems-on-upgrade

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    Maybe I’m just confused by the naming:

    I know I can do this by creating my own class named BP_Legacy in my theme and customising, but this doesn’t seem a correct approach.

    Is the BP_Legacy class supposed to behave like a pluggable function? i.e. you are expected to redeclare the class with the same name?

    On a separate but related matter — if I want to create a completely bespoke theme (not theme compat), how do I stop an instance of BP_Legacy being created and registering its actions?

    I’ve tried declaring add_theme_support(‘buddypress’) hooked on to ‘after_setup_theme’, but that doesn’t stop an instance of BP_Legacy being constructed and registering its actions.

    Looking at the BP_Theme_Compat constructor, it would appear that add_theme_support(‘buddypress’) should stop it — does it need to be hooked on to something earlier than ‘after_setup_theme’?

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    You shouldn’t be using Genesis Connect with current versions of BuddyPress.

    From the Genesis Connect developer:

    As of BP 1.7 you do not need to have GenesisConnect. We are currently maintaining it for customers who had BP installs prior to BP 1.7.

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    Hi R-a-y,

    Yes, had looked at the implementation in the default BP components, and ‘gotten’ my head around it.

    Good to get confirmation that this is the right approach for 3rd party as well.

    Thanks, Roger

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    Hey Dan,

    thanks, yes, BuddyDrive looks to have the ‘correct’ solution.

    It creates a BP_Theme_Compat class for the component – the same approach that the internal components (Groups, Activity, etc.) do.

    @boone, @r-a-y … is that the recommended approach for 3rd party components going forward?

    Cheers,
    Roger

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    a gentle 2 day bump

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    Resurrecting an old thread, but we encountered the same problem on 1.7 install, and fixed in same way.

    I note the problem doesn’t seem to occur on testbp.org

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    We had problems upgrading a large site – see: https://buddypress.org/support/topic/wsod-in-wp-admin-activating-site-tracking-upgrade-from-1-2-9-1-5/

    I assume some BP script in the backend was timing out.

    We solved by:

    1. exporting our users / user_meta table. Leaving just the admin user
    2. upgrading BP
    3. Reimporting the users

    This worked fine. The problem only occurred if all the users were present during the actual upgrade process.

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    Depending where the links are being added / submitted, you might also be able to add a filter in your PHP code to strip them out.

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    @r-a-y — looks like your reply and my edit with thanks crossed!

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    Have the solution — the code to implement the BP_Legacy class in buddypress-functions.php had changed between beta and full release.

    I needed to update the buddypress-functions.php file in our theme to match these changes.

    @r-a-y: thanks for getting back to me. Yes, this is a considerable build based on the new theming approach — it’s been about 4 months in development (with a number of devs involved). We’d seen it through a number of alpha / betas of 1.7, so was a bit of a shock when the WSOD appeared! Anyway, that problem sorted now.

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    @shanebpdev – sorry, just seen your comment. Thanks for the feedback.

    The client is partnered with a publishing company, and uses the publishing company’s servers — unfortunately, I don’t have too many details on the specification — concentrating on the development side of this project.

    At one stage, we had considerable server problems (when we were handling 100 / 1000s of new member registrations each day). I suspect though that this was due in no small part to the number of DB queries being fired off on each page view. Hopefully, that issue is considerably reduced with 1.7+. We’re still 1.6.x for Enterprise Nation.

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    Problem is that groups_create_group() doesn’t set the total_member_count — so subsequent calls to set up the Groups Template fail to load the groups.

    We worked around by explicitly setting: groups_update_groupmeta( $group_id, ‘total_member_count’, (int) groups_get_groupmeta( $group_id, ‘total_member_count’) + 1 );

     

    Will add to trac as bug.

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    Hasn’t @ray already raised this on the trac?

    We’ve also been having issues with activation links not redirecting correctly in 1.7

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    Yep, it’s one of the most useless things in BuddyPress.

    You can get rid of those links by adding the following to your bp-custom.php file:

     

    function remove_xprofile_links() {

    remove_filter( ‘bp_get_the_profile_field_value’, ‘xprofile_filter_link_profile_data’, 9, 2 );

    }

    add_action( ‘bp_init’, ‘remove_xprofile_links’ );

     

    Profile photo of Roger Coathup
    Roger Coathup
    Participant

    @rogercoathup

    This is another example of directory features we built for a BuddyPress site: http://www.enterprisenation.com/business-directory/

    It’s based around custom post types & taxonomies, and integrates as a component with BuddyPress profiles.

    But, in response to OP @giannisff, these directory systems are custom builds – there’s no good off the shelf plugin providing the solution.

     

Viewing 25 replies - 1 through 25 (of 1,053 total)