Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 976 through 1,000 (of 2,756 total)
  • @henrywright

    Moderator

    Sorry @life5000, I noticed that earlier in this post I mentioned you should add the snippet to your theme’s functions.php. That’s not right. It should go into your theme’s (or child theme’s) style.css file.

    I’ve just updated it so it has the right info.

    In reply to: Like Button

    @henrywright

    Moderator

    You should report the problem you’re having on the plugin’s GitHub repo and hopefully they’ll be able to issue a fix.

    @henrywright

    Moderator

    I put this die because there is redirect after this action.

    Right! If you don’t want the redirect then that’s one way to stop it šŸ™‚

    @henrywright

    Moderator

    Thanks for this, super useful! +1

    @henrywright

    Moderator

    Great to see you figured this out. You probably want to let the function return naturally without using die("END");?

    @henrywright

    Moderator

    Great to see you got it working!

    @henrywright

    Moderator

    Have a read of the Playing with the user’s ID in different contexts article. It should give you an idea how to get the user’s ID in many of the different situations you’ll come across when using BP.

    Take for example the logged in user, you can use bp_loggedin_user_id() to get their ID.

    @henrywright

    Moderator

    I don’t think you can do global $user_id;. So when adding your activity, $user_id isn’t what you expect it to be.

    @henrywright

    Moderator

    I’m not sure why you have 2? There’s only supposed to be 1. Do you have a screenshot or a link you can post?

    @henrywright

    Moderator

    You can do this through your theme’s style.css file but the solution will depend on which theme you’re using.

    #activity {
        font-size: 110%;
    }

    Note it’s the #activity bit that will depend on your theme so that might need changing.

    @henrywright

    Moderator

    The BuddyPress username field is mandatory. There’s no way to remove it without breaking functionality.

    @henrywright

    Moderator

    @paragbhagwat You could always submit a request on Trac to ask that the extra argument(s) you need be passed.

    Ref: https://buddypress.trac.wordpress.org/

    The username and password you use here in the forums will work there too.

    @henrywright

    Moderator

    That’s because you have to build the message back up. You can do that because all of the variables you might need are passed to your custom function.

    @henrywright

    Moderator

    Try something like this:

    function paragbhagwat_message_filter( $message, $group, $requesting_user_name, $profile_link, $group_requests, $settings_link ) {
        // Do something with $message here.
        return $message;
    }
    add_filter( 'groups_notification_new_membership_request_message', 'paragbhagwat_message_filter', 10, 6 )
    In reply to: How can I contribute?

    @henrywright

    Moderator

    Hey @venutius

    It’s great to see you’re interested in contributing. Check out the Participate and Contribute article for the various ways you can help out with the project.

    Hope this helps!

    @henrywright

    Moderator

    Looking at the Activity Loop article, there’s 3 steps to this:

    1. Pass display_comments to your loop:

    if ( bp_has_activities( bp_ajax_querystring( 'activity' ) . '&display_comments=stream' ) ) :

    2. Wrap your HTML in an activity class (This is an optional step if you want AJAX to work).

    3. Add the code (see article) inside your loop, below activity-content and above the closing list item tag.

    @henrywright

    Moderator

    If you go to Settings > BuddyPress and then select the Settings tab at the top, you should see Blog & Forum Comments under the Activity Settings section on that page. Ensure that checkbox is checked.

    @henrywright

    Moderator

    This will work, I’ve used the right hook this time, and tested myself to make sure it’s working:

    function venutius_display_member_role() {
    
        global $members_template;
    
        // This is a confirmed group member.
        if ( $members_template->member->is_confirmed )
            echo '<p>Member</p>';
    
        // This is a group moderator.
        if ( $members_template->member->is_mod )
            echo '<p>Mod</p>';
    
        // This is a group admin.
        if ( $members_template->member->is_admin )
            echo '<p>Admin</p>';
    }
    add_action( 'bp_group_members_list_item_action', 'venutius_display_member_role' );
    

    @henrywright

    Moderator

    Yes I get that, I guess we could think of an alternative, like @groupadmin?

    Yep, something like that’d work!

    @henrywright

    Moderator

    I added it to the Members.php file but it seems to have no effect.

    This should actually go in your theme’s functions.php file.

    @henrywright

    Moderator

    would it be possible to have a shout to both admins and mods?

    I thought about that but there’s a slight problem using @admin or @administrator as a command. Most BuddyPress websites use these usernames as their main user account. To avoid notifying the main site admin, we need to think of a different command to use for this group.

    @henrywright

    Moderator

    I haven’t tried this but you could try doing something like this:

    function venutius_display_member_role() {
    
        global $members_template;
    
        // This is a confirmed group member.
        if ( $members_template->member->is_confirmed )
            echo '<p>Member</p>';
    
        // This is a group moderator.
        if ( $members_template->member->is_mod )
            echo '<p>Mod</p>';
    
        // This is a group admin.
        if ( $members_template->member->is_admin )
            echo '<p>Admin</p>';
    }
    add_action( 'bp_directory_groups_item', 'venutius_display_member_role' );

    @henrywright

    Moderator

    @venutius The issue you were having with blank notifications has now been fixed. You’ll also need to update bbPress once the new version of that plugin is released.

    @henrywright

    Moderator

    One additional feature I was thinking about, a bit of a leap, would be that ability of the user to configure their own user group to send mentions to, a subset of their friends that they may wish to send shouts to.

    Setting up arbitrary groups of members is a good idea, but I think that functionality should belong in a separate plugin. This plugin just hooks into existing collections of users such as friends, mods, group members etc.

    Also, currently the notification message includes the text @group, I was wondering about removing this to enable to nicer formatting for the message.

    The notification text can be localised using a language file. See the Customizing Labels, Messages, and URLs article for info on how you can do that.

    @henrywright

    Moderator

    Oh and I forgot to answer:

    Is it possible to post a message to a group (and all members) from my own (activity) stream? Like just type ā€œ@locomotives-group messagemessagemessageā€ and post it in my stream to do the same thing as your plugin does now when I post ā€œ@group messagemessagemessageā€ on the group wall?

    This kind of thing, whilst a good idea, won’t be possible because you can have 2 groups with the same name. There’s no way of telling which group is the intended group.

Viewing 25 replies - 976 through 1,000 (of 2,756 total)
Skip to toolbar