Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Making the ”Profile” Tab Open When Viewing a Profile vs ”Activity” (17 posts)

Started 1 year, 4 months ago by: thealchemist

  • Profile picture of thealchemist thealchemist said 1 year, 4 months ago:

    This is a small tweak I think, but my users are asking for it, so I figure I’d look into it. In BP, when you visit a member’s profile the “Activity” tabe is what’s open and viewable first. Is there a way – and would you please advise me – to make the “Profile” tab the one that is open?

  • Profile picture of zkwc zkwc said 1 year, 4 months ago:

    I made the same discussion here and someone posted a helpful link. http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/forcing-groups-to-show-forum-first-instead-of-activity-wall-forcing-profile-first-instead-of-activity/

  • Profile picture of thealchemist thealchemist said 1 year, 4 months ago:

    @zkwc Thanks. Checked it out. The suggestion of editing the bp-custom.php file is interesting fix for the forum tab in groups but I can’t FIND the bp-custom.php file anywhere.

  • Profile picture of Chouf1 Chouf1 said 1 year, 4 months ago:

    bp-custom must be created first by yourself to exist !

    http://codex.buddypress.org/extending-buddypress/bp-custom-php/

  • Profile picture of thealchemist thealchemist said 1 year, 4 months ago:

    @Chouf1 Well who would have known! I learn something every day … THANKS!

  • Profile picture of pcwriter pcwriter said 1 year, 4 months ago:

    @thealchemist @zkwc

    This is a great find! I asked that very same question not too long ago:

    http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-to-make-profile-the-default-tab-without-editing-wp-config/

    Even posted an enhancement suggestion in trac where I was led to believe it can’t be done.

    http://trac.buddypress.org/ticket/3007

    Now I find the reference in the link supplied by @zkwc and, lo and behold, it looks like it CAN be done.

    I can’t wait to test this out in my new BuddyBuilder theme framework.
    If it works well, I’ll incorporate the idea in so users can select ANY one of the default subnavs as group home.

  • Profile picture of thealchemist thealchemist said 1 year, 4 months ago:

    Well, I have created the bp-custom.php file, added the code they suggested, uploaded … and nada. So, I am likely missing something obvious. How does the page know to even ‘look’ at the bp-custom.php file? Also, the trick suggested works for groups … how would / could this be altered to work on the profile?

  • Profile picture of zkwc zkwc said 1 year, 4 months ago:

    Glad I could help you all find the information. @pcwriter if you find that it works PLEASE let me know. I am somewhat savvy when coding but not savvy enough and I’m scared to try it for fear of breaking my site. Wuss, I know. Buddy used to give admins the option of showing the ‘wall’ or ‘activity’ or not and now that feature is gone and it’s confusing ALL, not just some, of my users. And they never know where to post, the forum or activity.

  • Profile picture of zkwc zkwc said 1 year, 4 months ago:

    @thealchemist I know that if you copy and paste code from here it sometimes doesn’t post exactly as it should. So if you did that try typing it exactly as shown instead of copy and paste. Not sure if that’s the issue though, but just trying to help. :)

  • Profile picture of thealchemist thealchemist said 1 year, 4 months ago:

    Nope. Nada. hmmmm.

  • Profile picture of Paul Gibbs Paul Gibbs said 1 year, 4 months ago:

    pcwriter
    Loading that constant has to be done early; I’m not sure without looking if bp-custom.php is early enough or not. If it is, great. I would recommend against overwriting that file from a theme, however. A end-user may have used it to configure settings which would be lost when you overwrite the file.

  • Profile picture of pcwriter pcwriter said 1 year, 4 months ago:

    @thealchemist @zkwc @djpaul

    Hurray!

    The code snippet works just fine in functions.php. That’s good news for a theme designer: no worries about a theme overriding a user’s custom configurations in bp-custom.php.
    Now I’m off to add “Group Landing Page” as an option in my new theme. It’ll be incorporated with the theme’s “Alternate Header” option too.

    Then I’ve got to adapt the code to work with member profiles. My initial attempts have failed, but I’ve been known to be persistent at times ;-)

    For future reference, here’s the code snippet to add to functions.php or, if you have created it, bp-custom.php.
    You can see it in action here: http://rspacesandbox.org/ Click any group.

    function redirect_groups_to_forum() {
    global $bp;
    $path = clean_url( $_SERVER['REQUEST_URI'] );
    $path = apply_filters( 'bp_uri', $path );
    if ( bp_is_group_home() && strpos( $path, $bp->bp_options_nav['groups']['home']['slug'] ) === false )
    bp_core_redirect( $path . $bp->bp_options_nav['groups']['forum']['slug'] . '/' );
    }
    add_action( 'wp', 'redirect_groups_to_forum' );
  • Profile picture of pcwriter pcwriter said 1 year, 4 months ago:

    @thealchemist

    I just replied to your query at bp-tricks
    Here’s the same answer: bp-custom needs to go in your /plugins/ directory, not /buddypress/
    Hope it helps! :-)

  • Profile picture of zkwc zkwc said 1 year, 4 months ago:

    @pcwriter @thealchemist

    woohoo! that worked for my forums too! :) i am one happy camper. now hopefully my forums will stay clean! yay!

    anyone know the code for profiles? would one just replace “profile” for “group” in the code for forums? thinking that there would be MORE to that, but I’m all ears. :)

    thank you for testing @pcwriter !

  • Profile picture of thealchemist thealchemist said 1 year, 4 months ago:

    Well … heck. This conflicts with BP Chat. I got tons of error messages. So, deactivated BP Chat and I see the above code at the top of the browser window and the function won’t work. hmmmm.