WordPress.org

Support

Support » Plugins and Hacks » Envolve Chat » [Plugin: Envolve Chat] Buddypress: How-To – Group-internal chats

[Plugin: Envolve Chat] Buddypress: How-To – Group-internal chats

  • Hey,

    I’ve been using Envolve chat for a bit now and really dig it – the only thing that I really wanted were group-internal chats. With the help of #buddypress-dev (freenode) I was able to splice something together. Thanks a lot boonebgorges 😉

    Simply add this to your header/footer:

    <!-- Envolve Chat -->
        <script type="text/javascript">
        var envoOptions={
        <?php if ( bp_is_group() ) : ?>
        chats : [{id : '<?php $group = groups_get_current_group(); echo $group->slug ?>', name : '<?php $group = groups_get_current_group(); echo $group->name ?>'}],
        groups : [{id : '<?php $group = groups_get_current_group(); echo $group->slug ?>-users', name : '<?php $group = groups_get_current_group(); echo $group->name ?>-Users'}]
        <?php endif ?>
    	};
        </script>

    If you’re on any groups-page you’ll find the respective chat-tab next to your other chat-rooms.

    http://wordpress.org/extend/plugins/envolve-chat/

Viewing 3 replies - 1 through 3 (of 3 total)
  • …and if you want the chats only to be visible for users of the groups you just use:

    <?php if ( bp_is_group() && groups_is_user_member( bp_loggedin_user_id(), bp_get_current_group_id() ) ) : ?>

    Thanks again boonebgorges

    And, for a final fix, this will make the group-chat only be visible inside of groups by group-members while the general chat will always be visible:

    <script type="text/javascript">
        var envoOptions={
        <?php if ( bp_is_group() && groups_is_user_member( bp_loggedin_user_id(), bp_get_current_group_id() ) ) : ?>
        chats : [{id : '<?php $group = groups_get_current_group(); echo $group->slug ?>', name : '<?php $group = groups_get_current_group(); echo $group->name ?>'}],
        <?php endif ?>
        groups : [{id : 'everyone', name : 'Everyone'}<?php if ( bp_is_group() && groups_is_user_member( bp_loggedin_user_id(), bp_get_current_group_id() ) ) : ?>, {id : '<?php $group = groups_get_current_group(); echo $group->slug ?>-users', name : '<?php $group = groups_get_current_group(); echo $group->name ?>-Users'}<?php endif ?>]};
        </script>

    In this case the group of the static-chat (configurable in the backend of envolve chat) has to be set to “everyone”. I hope that’s the last iteration, heh.

    Plugin Author james.tamplin

    @jamestamplin

    Thanks so much for posting this Flynxify! It’s really detailed and easy to understand.

    James Tamplin
    Co-Founder
    Envolve

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Envolve Chat] Buddypress: How-To – Group-internal chats’ is closed to new replies.
Skip to toolbar