Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

How to make unavailable "chat room" for registered members?

0 votes
asked Feb 26, 2014 in Plugins by rgd
edited Feb 27, 2014 by rgd

I installed chat room plugin for my site and make the link visible for only Experts, Editors, Moderators and Admins. It is working and link tab only visible for Experts, Editors, Moderators and Admins. It is not visible for registered users but registered users can enter chat room using the link “http://www.mysite.net/chat". Please tell me how to prevent this?

After followed instruction given by Kai

Q2A version: 1.6.3

2 Answers

+1 vote
answered Feb 27, 2014 by q2apro
selected Feb 27, 2014 by rgd
Best answer

Guess it is not in the settings implemented.

Try adding the following code to qa-chat.php right after line:

public function process_request( $request ) {
you put this code block:
            // return if not at least expert
            if(qa_get_logged_in_level() < QA_USER_LEVEL_EXPERT) {
                $qa_content['custom0']='<div>Access forbidden</div>';
                return $qa_content;

Hope that helps.
commented Feb 27, 2014 by rgd
Great! It is working well. I have no any idea about coding. Only followed your instructions. I feel that how nice I have a knowledge about coding. Thank you very much your quick and marvelous support.

I have uploaded a captured image.
commented Feb 27, 2014 by q2apro
You are welcome.
0 votes
answered Feb 26, 2014 by Warsong
Panel admin - Pages - Chat room - visible for admins,experts,editors....etc.
commented Feb 27, 2014 by rgd
I have already done that as I mentioned in my question. The link is not visible to registered users. But they can log in to chat page by typing “http://www.mysite.net/chat" in address bar. Then they can see and use the chat room. I want to prevent that.