Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 455 total)
  • Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    Do you want the join and leave button depending on the currently logged in user ina single shortcode or 2 different shortcode. I am not sure, so here is the code that will give you join button for any group

    
    add_shortcode( 'group-join', 'devb_group_join_btn' );
    function devb_group_join_btn( $atts = '', $content = null ){
        if( !is_user_logged_in() || !bp_is_active( 'groups' ) )
            return '';
        $atts = shortcode_atts( array(
                'group_id'=> false,
                'name'    => ''  
        ), $atts );
        
        extract( $atts );
    
        if( !$group_id && !$name )
          return '';
    
        if( $name ){
            
            $group_id = groups_get_id( $name );
        }
    
        if( groups_is_user_member(get_current_user_id(), $group_id ) )
                return '';
        
        //now let us put the button
        $btn = bp_get_group_join_button( groups_get_group(array('group_id'=> $group_id ) ) );
        
        return $btn;
    }
    
    

    please make sure to pass the slug of group as name. If you want it to be extendede and leave button added, please do reply.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    Hi Peter,
    The user does not need to login. You just need to add a user meta ‘last_activity’ for each user and they will appear on your member directory.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    Hi Ben,
    What I am doing with the Limit Members Per group plugin is as follows:-

    1. Give Site Admins options to set a limit and then allow him to give the Group admins flexibility to choose the number.
    2. If the option to allow groups admins select their own limit is enabled, It will use specific settings per group otherwise the global configuration will be used.

    Do you think merging this with Limit groups per user plugin will be a good Idea? I believe they serve different purpose but I am open to merge if you all think so :)

    PS: And just to clarify, the upcoming plugin is Free not premium.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    Hi Henry,
    As Hugo linked, the function does not uses exit. You might use ‘bp_core_redirect’ though, which does not require you to put exit after it.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    If you guys mean the the sites from the navigation, then you can use the following code in either your theme’s functions.php or bp-custom.php

    
    function bpdev_remove_blogs_nav(){
        global $bp;
    
        bp_core_remove_nav_item($bp->blogs->id);//
    
    }
    add_action('wp_loaded','bpdev_remove_blogs_nav');
    

    Hope that helps.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    Hi Henry,
    That code works. All you are missing is an exit statement.
    here is the code I modified for you

    
    //redirect logged-in users away from activate page
    function bp_redirect_activate_to_profile() {
    	global $bp;
    	
    	if ( is_user_logged_in() && bp_is_activation_page() ) {
    		wp_redirect( $bp->loggedin_user->domain );
            exit(0);
    	}
    }
    add_action('wp','bp_redirect_activate_to_profile');
    

    That will work. Please do let me know if it works for you or not ?

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    If you are checking for BuddyPress activation page, you can use any of the following

    
    if( bp_is_activation_page() ) {
    //do something
    } 
    

    or

    
    if ( bp_is_current_component( 'activate' ) ){
    
    //do something
    }
    

    hope that helps.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    Awesome work guys! Loved the new enhancements in Group/Activity fetching. Opens a lot of possibilities.

    Thank you dev team for all the hard work :)

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    @bphelp thanks Ben for the heads up.
    @sooskriszta
    You are right about the use case. It is not suitable for spammers protection and neither suitable for normal sites.

    I built it specifically for membership based sites where they wanted to limit the no. of friends and charge for increasing the limit(I had got that specific requirement from a client and they implemented it with s2 members plugin in their case).

    As far as Friendship request throttling is concerned, I am about to release a plugin today which does allows site admins to limit the no. of requests sent per minute(or you can set say 30 requests per 60 mins, that flexibility lies with the site admins).

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    @webwarriorwng
    I am the author of that plugin. Can you please tell me the problem you are faccing.

    I will appreciate a little detail about your BuddyPress/WordPress version and theme you are using?

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    Do you want it to be hooked to the main menu of the bp-default theme when a user is logged in ?

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    Are you doing it on a live site? Is your Theme BuddyPress compatible. For BuddyPress 1.6.x, the BuddyPress features are only available to BuddyPress enabled theme. In BuddyPress 1.7, BuddyPress automatically supports all themes(but 1.7 is still in beta and not recommended for live site).

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    You will need to configure BuddyPress before it comes into action.

    Look for the notice in the Network admin. If it is not there, just click Network Admin-> Settings->BuddyPress and you should see the configuration wizard.

    Hope that helps.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    Hi,
    Have a look at this function

    bp_core_get_notifications_for_user here https://github.com/buddypress/trunk/blob/master/bp-members/bp-members-notifications.php#L83

    You can modify it to suit your need(this is the one that generates the notfication messages).

    and here you can see how the drop down is created

    https://github.com/buddypress/trunk/blob/master/bp-members/bp-members-buddybar.php#L18

    Hope that helps.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    @bphelp
    Thank you for the mention.
    I just put that for the community as I was implementing it in one of my upcoming themes(too much delayed).

    It is not about competition, It is about making the things accessible to everyone :) I support the idea of having multiple solutions, so the community is the winner and not individuals. I hope that the plugins can co-exist.

    @juanmaguerrero,
    The waiting for loading is not an issue. I left that because I wanted to show the load more button with spin moving. You can just deduct let us say 200 here https://github.com/sbrajesh/bp-activity-autoloader/blob/master/_inc/activity-loader.js#L27

    So, the loading will start when the user is 200px above the end of activity listings. Also, I am just using a simple variable to track the activity loading request in progress. So, there is no performance issue(It will never send multiple requests). Just thought should clarify here.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    make sure you have passed the ‘paged’ parameter with the correct value in query posts.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    Look for spaces before the opening php tag `<?php`
    Make sure you don't have white spaces before the opening php tag and the closing php tag(from your description, It is before the opening php tag).

    That will fix it.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    Yes.
    He can create it from Blog Directory. You will see the link in blogs directory if you are logged in to create a blog.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    Hi @chouf1
    sorry I could not follow up.
    That message is intended for debugging the site and will be visible if WP_DEBUG is set true as you have already noticed.

    It is there to aid the developers/site admin to properly use functions related to current user.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    No problem. You are most welcome :)

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    You Can put this code in your bp-custom.php and It will take care of your issue

    `
    add_action(‘bp_friends_setup_nav’,’bpdev_custom_hide_friends_if_not_self’);

    function bpdev_custom_hide_friends_if_not_self(){
    if(bp_is_my_profile()|| is_super_admin())
    return ;

    bp_core_remove_nav_item(‘friends’);

    }

    `

    hope that helps.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    The simple way is to add a usser meta field when an avatar is uploaded. delete the meta when avatar is deleted and check for this usermeta to show the nag to the current user.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    do not add it to your bp-custom.php
    Add it to your theme’s functions.php for now, and It will work.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    I will suggest going via the user meta route. You can add a user meta to define type of user. that will give you a lot of flexibility in future while searching/listing users.

    Avatar of Brajesh Singh
    Brajesh Singh
    Participant

    @sbrajesh

    Most probably the code you are using is trying to access logged in user’s data before init action. Since the current user is set on ‘set_current_user’ hook’ which is just before init, any function trying to access current user data should be called on or after init action.

    Hope that helps.

    Reference: http://codex.wordpress.org/Plugin_API/Action_Reference

Viewing 25 replies - 1 through 25 (of 455 total)