WordPress.org

Ready to get started?Download WordPress

Forums

Envolve Chat
Buddypress: How-To - Group-internal chats (4 posts)

  1. Flynxify
    Member
    Posted 2 years ago #

    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/

  2. Flynxify
    Member
    Posted 2 years ago #

    ...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

  3. Flynxify
    Member
    Posted 2 years ago #

    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.

  4. james.tamplin
    Member
    Plugin Author

    Posted 2 years ago #

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

    James Tamplin
    Co-Founder
    Envolve

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic