FreiChat related discussions
Private chatrooms - display problem

Hi,
I'm trying to use Freichat for creating "private" chatrooms for Joomla users. "Private" means administrator creates chatroom and sets who can access that room.
To achieve this I've created additional table - frei_private__rooms with just two rows - user_id and room_id. This table is to hold information which user is allowed to use witch room.
IF THERE ARE NO USERS SET TO PARTICULAR ROOM, THAT MEANS THE ROOM IS PUBLIC.

In original code (/server/freichat.php)I've changed just two SQL Queries:
1st (line about 265)
<?php $query2 = "SELECT r.room_name,r.id as room_id,count(s.id) as online_count
FROM frei_rooms as r
LEFT join frei_session as s
on r.id=s.in_room
where r.id NOT IN (select distinct room_id from frei_private_rooms)
or r.id IN (select room_id from frei_private_rooms where user_id=".$_SESSION[$this->uid . 'usr_ses_id'].")
AND time>" . $this->online_time2 . "
Group BY r.id ORDER BY r.room_order";
?>
And second (line about 545)
<?php $query2 = "SELECT r.room_name,r.id as room_id,count(s.id) as online_count
FROM frei_rooms as r
LEFT join frei_session as s
on r.id=s.in_room
where r.id NOT IN (select distinct room_id from frei_private_rooms) or r.id IN (select room_id from frei_private_rooms where user_id=".$_SESSION[$this->uid . 'usr_ses_id'].")
Group BY r.id ORDER BY r.room_order";
?>
Modified QUERY is to filter just PUBLIC rooms, or that user is assigned to.

And it works pretty well. BUT....
But when user is clicking on different room name, those private rooms are disappearing! What else should I change, or where to look for room function that refreshes room list?

I know this is complicated but if anyone could help me it would be great :)

Hi, I&#039;m trying to use Freichat for creating &quot;private&quot; chatrooms for Joomla users. &quot;Private&quot; means administrator creates chatroom and sets who can access that room. To achieve this I&#039;ve created additional table - frei_private__rooms with just two rows - user_id and room_id. This table is to hold information which user is allowed to use witch room. IF THERE ARE NO USERS SET TO PARTICULAR ROOM, THAT MEANS THE ROOM IS PUBLIC. In original code (/server/freichat.php)I&#039;ve changed just two SQL Queries: 1st (line about 265) &amp;lt;?php $query2 = &quot;SELECT r.room_name,r.id as room_id,count(s.id) as online_count FROM frei_rooms as r LEFT join frei_session as s on r.id=s.in_room where r.id NOT IN (select distinct room_id from frei_private_rooms) or r.id IN (select room_id from frei_private_rooms where user_id=&quot;.$_SESSION[$this-&amp;gt;uid . &#039;usr_ses_id&#039;].&quot;) AND time&amp;gt;&quot; . $this-&amp;gt;online_time2 . &quot; Group BY r.id ORDER BY r.room_order&quot;; ?&amp;gt; And second (line about 545) &amp;lt;?php $query2 = &quot;SELECT r.room_name,r.id as room_id,count(s.id) as online_count FROM frei_rooms as r LEFT join frei_session as s on r.id=s.in_room where r.id NOT IN (select distinct room_id from frei_private_rooms) or r.id IN (select room_id from frei_private_rooms where user_id=&quot;.$_SESSION[$this-&amp;gt;uid . &#039;usr_ses_id&#039;].&quot;) Group BY r.id ORDER BY r.room_order&quot;; ?&amp;gt; Modified QUERY is to filter just PUBLIC rooms, or that user is assigned to. And it works pretty well. BUT.... But when user is clicking on different room name, those private rooms are disappearing! What else should I change, or where to look for room function that refreshes room list? I know this is complicated but if anyone could help me it would be great :)

check what changes occur in the tables when the user clicks on a different room name.
also add a suggestion in the suggestion category of the forums, we usually go through the suggestions while working on newer versions.
we are already working on group chat, this will help in your situation since a group chat is invite based.

check what changes occur in the tables when the user clicks on a different room name. also add a suggestion in the suggestion category of the forums, we usually go through the suggestions while working on newer versions. we are already working on group chat, this will help in your situation since a group chat is invite based.
Necessity is the mother of all inventions!
48
1
0
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft