Forum
Welcome, Guest
Please Login to access forum.
Re:How to turn status to offline by default (1 viewing) 
Go to bottom
TOPIC: Re:How to turn status to offline by default
#610
ITS Schramm
Fresh Boarder
Posts: 8
User Offline
Re:How to turn status to offline by default Karma: 0  
OK, thank you, John.
I will do that if I found no solution in the meanwhile.

I wonder if it would be a feature also for other customers.

I think an easy way to use a default offline/online mode for users would be that the last mode will saved for each user. At next login the last mode will be restored. And for the very first time the default is offline instead of online mode.

Best regards
Michael
 
Logged Logged  
  The administrator has disabled public write access.
#611
John Dagelmore
Admin
Posts: 3722
User Online Now
Re:How to turn status to offline by default Karma: 79  
Yes that feature would be interesting also for other users.
Please keep me updated if you can help me doing something

John
 
Logged Logged  
  The administrator has disabled public write access.
#655
ITS Schramm
Fresh Boarder
Posts: 8
User Offline
Re:How to turn status to offline by default Karma: 0  
Hello John,

I'm a little bit frustrated. I spend hours trying to understand the code, but I can't.
I use the Community Builder and created a custom field to be able to configure to use the chat yes or no. Therefore I have included this code in the plugin file:

private function injectApp ($ cParams, $ app) {
$ user = JFactory :: getUser ();
if (! $ user-> id &&! ​​$ cParams-> get ('guest abled', false)) {
return;
}

// MS 9/21/2014
// Check if chat turned off, When yes then exit
$ cbUser = CBuser :: getInstance ($ user-> id);
$ cbChat = $ cbUser-> getField ('cb_chat', null, 'csv', 'none', 'profile', 0, true);
if ($ cbChat == 'no chat' {
return;
}
...

This works so far. The user set its user profile field to "no chat" and the chat disappears.

Problem: The user is still displayed in the buddy list for other users. I have tried various changes in the files stream and sender, as well as in the plugin file. Partly in the main.js, but all without success.

By the way, I wonder that the entries of table jchat_status never deleted. Therefore, I have included in the plugin file additionally this code:

// Delete old chat status entries
$ database = JFactory :: getDBO ();
$ sql = "DELETE FROM WHERE #__jchat_status userid NOT IN (SELECT session_id FROM WHERE userid #__session <> 0)";
$ database-> setQuery ($ sql);
$ result = $ database-> query ();

Now, the user should not only be able to turn on/off the chat completely, He also should be able to start the chat in the inactiv mode (like chat options > turn off chat). To do this, I would like to use the above CB custom field also. But I can't find the procedure, function or variables to put chat in this mode.

Another Question. When exactly a row creates in the table jchat_status?
At least not at login, but the user is immediately visible in the buddy list. Is this the concept?

Please enlighten me. Thanks a lot.
Regards Michael
 
Logged Logged  
  The administrator has disabled public write access.
#662
John Dagelmore
Admin
Posts: 3722
User Online Now
Re:How to turn status to offline by default Karma: 79  
Hi Michael, forget the table jchat_status. It's used by the component to hold additional data about users only when and if needed. That table can be purged by backend using the control panel button.

You should filter out the users that disabled the chat using the CB field you added. To do this you need to add an additional WHERE statement in the function getBuddyList of the stream.php model.

Hope to have well understood your questions and have well answered.

Best regards

John
 
Logged Logged  
  The administrator has disabled public write access.
#723
ITS Schramm
Fresh Boarder
Posts: 8
User Offline
Re:How to turn status to offline by default Karma: 0  
Hello John,

Please excuse the late reply. I was very busy.
The solution is now working very well.

We remember, I use the Community Builder.
Each user can now set in his CB profile:

  • no chat

  • chat on specified pages

  • chat on all pages.



For this I have added the plugin file as follows:


To exclude the user from the buddy list, I modified the models->strema.php
(see next post)
 
Logged Logged  
  The administrator has disabled public write access.
#724
ITS Schramm
Fresh Boarder
Posts: 8
User Offline
Re:How to turn status to offline by default Karma: 0  
Modification for the buddy list in the function getBuddyList of the stream.php model:


This solution meets my requirements.
Thanxs a lot.

Michael
 
Logged Logged  
  The administrator has disabled public write access.
Go to top