Is there a way or a setting where only the moderator (admin

Is there a way or a setting where only the moderator (admin role) can post in the chat room? Almost like a teacher to many students session. The users can see the the admin's posts but cannot post themselves on a Page Chatroom?

Also, any way to change the sound the page makes when a new post is posted to another sound?

Is this plugin compatible with the Membership plugin in terms of user roles/levels and such?

  • mikeg

    Also, couple of other questions:
    1. Is there anyway to clear the previous day's posts and start fresh. ie. all the posts on the chat room from the previous day are gone?

    2. When new posts are posted the sound alert works on a desktop with no issues. When I view the chat room on an Android using Google Chrome the sound alerts do not work. On Firefox it does work.

    PS - I can't give access to my site but that shouldn't be needed with these questions... as the moderator question is a setting or edit suggestion. The clearing of posts is either it can be done or it can't... and the sound alert is something you could test on your own chat room using an android device. If you can check with iOS phone for me, as I don't have one - that would be great. I guess test using Chrome and Safari or whatever the browser is that most people use with iOS devices.

    Thanks

  • Adam Czajczyk

    Hello mikeg,

    I hope you're well today and thank you for your questions!

    Is there a way or a setting where only the moderator (admin role) can post in the chat room? Almost like a teacher to many students session.

    There's a "What to show non-Authenticated" users option for chat (e.g. for site-wide chat on "Settings Site" page) that controls what non-authenticated users would see. By default it's set to "Chat Messages and User list". Therefore non-authenticated users will be able to seem messages/follow conversation but not take part in it. On the same page there's a list of available user-roles that should be automatically authenticated so you could un-check some and those users should then be able to read but not write in chat box. I think this could do the trick.

    1. Is there anyway to clear the previous day's posts and start fresh. ie. all the posts on the chat room from the previous day are gone?

    Each moderator can manually "clear" chat window. Other than that you can set maximum number of messages to be shown at once but currently there's no "date/time" based "auto-clean" option.

    2. When new posts are posted the sound alert works on a desktop with no issues. When I view the chat room on an Android using Google Chrome the sound alerts do not work. On Firefox it does work.

    Chat plugin is using a Sound Manager JS library for this and there are unfortunately some limitations regarding mobile devices related to Webkit based (meaning Chrome) browsers/app on iOs and Android. This would need some special "treatment" and a dedicted "mobile" version of chat. Therefore, I don't think it would be anything easily fixable now. However, I can tell you that there's a new, completely rewritten, chat plugin planned and although I'm not able to give you any ETA on this (unfortunately, it's not soon), I can assure you that it will be a totally "new" plugin fully updated with new features and modern devices requirement.

    I will however forward this issue to plugin's developers and ask them if they're able to find a "quick fix" way to override aforementioned limitations.

    One other thing I noticed... I have it set so Admin's are moderators. But I don't see any moderator tools anywhere when I am logged in as an admin and in the chat room?

    When you're logged in as a moderator you should see a "Hide" label for each message that let's you hide/unhide particular message. When you click on white "gear" icon in chat toolbar you - as a moderator - should also be able to close/clear chat and also once chat is close to archive it.

    I hope that helps!
    Best regards,
    Adam

  • mikeg

    Thanks for the quick reply.
    For the not letting users chat... I tried what you said before I even posted on this thread... and FYI - I will have users who do sign into the site for other things... so they will be already authenticated by Wordpress anyways... and when I uncheck those things you mentioned... nothing shows up at all for those users... regardless of what I select as to show un-authenticated users.

    On the Moderator stuff... I did see a gear before but I don't see it any longer.

  • Predrag Dubajic

    Hi mikeg,

    With the code provided below you can hide chat box from non-admin users, would this solution work for you?

    function hide_chat_box() {
    	if ( !current_user_can( 'manage_options' ) ) { ?>
    		<style type="text/css">
    			div.wpmudev-chat-box.wpmudev-chat-session-open div.wpmudev-chat-module-message-area {
    				display: none!important;
    			}
    		</style>
    <?php }
    }
    add_action( 'wp_footer', 'hide_chat_box' );

    You can add this code to your child theme functions.php file or use mu-plugin

    Best regards,
    Predrag

  • Adam Czajczyk

    Hello Mikeg!

    I'm glad that Predrag's solution worked for you. I understand that basically you'd like to extend that code to hide also a user list for non-admin users along message box, is that right?

    Here's updated Predrag's code that I think should do the job:

    function hide_chat_box() {
    	if ( !current_user_can( 'manage_options' ) ) { ?>
    		<style type="text/css">
    			div.wpmudev-chat-box.wpmudev-chat-session-open div.wpmudev-chat-module-message-area {
    				display: none!important;
    			}
    			div.wpmudev-chat-box.wpmudev-chat-session-open div.wpmudev-chat-module-users-list {display:none!important;}
    		</style>
    <?php }
    }
    add_action( 'wp_footer', 'hide_chat_box' );

    To apply it to your site please replace the code that you use recently with this one. Let me know please if this is what you wished to achieve.

    Best regards,
    Adam

  • Adam Czajczyk

    Hello mkeg!

    I checked this and was able to replicate that behavior. The issue however is that the "pop out" chat opens in a new browser window therefore we're not able to address it the same way as we did here. The simplest workaround would be then to hide the "pop-out" icon for the same users that we're hiding other parts of chat. Below is adjusted code (replace your existing one) that will do this:

    <?php
    function hide_chat_box() {
    	if ( !current_user_can( 'manage_options' ) ) { ?>
    		<style type="text/css">
    			div.wpmudev-chat-box.wpmudev-chat-session-open div.wpmudev-chat-module-message-area {
    				display: none!important;
    			}
    			div.wpmudev-chat-box.wpmudev-chat-session-open div.wpmudev-chat-module-users-list {display:none!important;}
    			div.wpmudev-chat-box.wpmudev-chat-session-open a.wpmudev-chat-action-pop-out {display:none!important;}
    		</style>
    <?php }
    }
    add_action( 'wp_footer', 'hide_chat_box' );

    In case you'd opt in for another (more customized) solution, you may want to post a question for custom development on our "Jobs & Pros" job board (please note: no WPMU DEV staff members involved!) here:

    https://premium.wpmudev.org/wordpress-development/

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.