×
Kunena 5.2 RC3 Released (Yesterday)

The Kunena team is thrilled to announce the third public release candidate of Kunena 5.2, a native Joomla extension for Joomla 3.9. This is a development release and should be only be used for testing; this version is not recommended for live websites at this stage.

The purpose of this release is to encourage testing by downloading, installing and identifying any problems or shortcomings that people may discover. K 5.2.0 RC3 is stable and we are aware that people will discover defects. We encourage you to use the forum to report defects, as soon as they are discovered, so that the development team can work through the problems before the release of K 5.1 as a stable product. Reporting defects does not mean that the problems can or will be fixed. The Kunena team is looking forward to hearing your feedback on how well we have achieved our design goals.

× Topics that are moved into this category are considered to be closed. Users may want to add additional information but these topics should not be resurrected in order to discuss new problems or unrelated matters.

Question Online Users, Problems counter

More
7 years 1 month ago - 7 years 1 month ago #1 by olimpo88
The online user counter, is failing. If a user opens session two browsers, or more than one device. This session is counted 2 times and the number of members does not match the displayed list.






I'm using kunena 3.0.2
Last edit: 7 years 1 month ago by olimpo88.

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago #2 by olimpo88
Configuratión

This message contains confidential information

Database collation check: The collation of your table fields are correct

Joomla! SEF: Enabled | Joomla! SEF rewrite: Enabled | FTP layer: Disabled |

This message contains confidential information
htaccess: Exists | PHP environment: Max execution time: 120 seconds | Max execution memory: 124M | Max file upload: 20M

Kunena menu details:

Warning: Spoiler!

Joomla default template details : shape5_vertex | author: Shape5.com | version: 3.0 | creationdate: Unknown

Kunena default template details : Blue Eagle 2.0 | author: Kunena Team | version: 3.0.1 | creationdate: 2013-06-29

Kunena version detailed: Kunena 3.0.2 | 2013-08-18 [ Nocturne ]
| Kunena detailed configuration:

Warning: Spoiler!
| Kunena integration settings:
Warning: Spoiler!
| Joomla! detailed language files installed:
Warning: Spoiler!

Third-party components: UddeIM 3.0

Third-party SEF components: None

Plugins: None

Modules: Kunena Latest 3.0.1 | Kunena Stats 3.0.1 | Kunena Login 3.0.1 | Kunena Search 3.0.1

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago - 7 years 1 month ago #3 by sozzled
G'day, olimpo88, and welcome to Kunena.

olimpo88 wrote: The online user counter, is failing. If a user opens session two browsers, or more than one device. This session is counted 2 times and the number of members does not match the list.

We agree with you; this is a defect. It's a problem that people have been trying to fix for over five years. It's a well known problem. It's a problem that no-one has successfully solved.

We appreciate your detailed report. As far as I know (and unless there is a better technical explanation) this problem requires a change in the way that Joomla counts connected sessions. When the Joomla people fix the cause of the problem, the Kunena team will be able to resolve the issue as far as Kunena is concerned.
Last edit: 7 years 1 month ago by sozzled.

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago - 7 years 1 month ago #4 by olimpo88
But he could fix doing a LEFT JOIN to have no more than once to members.
Or make a second query to find out how many are repeated and subtract.
I'll see how I do and then tell them.
In which file should I look for to make this change?
Last edit: 7 years 1 month ago by olimpo88.

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago - 7 years 1 month ago #5 by olimpo88
This code fix my problem.
//Countar miembros
$query = 'SELECT guest, time, client_id
FROM #__session
WHERE guest = 0 AND client_id=0 GROUP BY userid';
$db->setQuery ( $query );
$sessions = (array) $db->loadObjectList ();
$user_array=count($sessions);

Must be inserted in /libraries/kunena/user/helper.php before lines
$result ['guest'] = $guest_array;
$result ['user'] = $user_array;










Also you could do something more complicated, and surely this is not the optimal way, but it works. My time of expiration of section is 90 minutes and just wanted to show the guests online in the last 10 minutes.
 
                         $querytime="";
                        //If you want to put a time different from the system to tell guests uncomment these next 4 lines.
                        //$minutes=10;
                        //$seconds=$minutes*60;
                        //$time = JFactory::getDate()->toUnix() - $seconds;
			//$querytime = 'AND time > '.$time;
 
 
                        //Count guest
			$query = 'SELECT guest, time, client_id
				FROM #__session
				WHERE guest = 1 ' . $querytime;
			$db->setQuery ( $query );
			$sessions = (array) $db->loadObjectList ();
			$guest_array=count($sessions);
 
			//Count user
			$query = 'SELECT guest, time, client_id
				FROM #__session
				WHERE guest = 0 AND client_id=0 GROUP BY userid';
			$db->setQuery ( $query );
			$sessions = (array) $db->loadObjectList ();
			$user_array=count($sessions);
 
                        $result ['guest'] = $guest_array;
			$result ['user'] = $user_array;
 
 
 

The problem is not joomla, kunena is misusing this session table. With some adjustment can improve it :)

Edit if my English is not very good.
Attachments:
Last edit: 7 years 1 month ago by olimpo88.
The following user(s) said Thank You: Bob Britt

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago #6 by Matias
Thanks for pointing out the issue with online users count. I added it to similar bug report, which can be found from here:

github.com/Kunena/Kunena-Forum/issues/1676

I'm not sure if we can get it into our next bugfix release, though, as we're planning to get it out within few days from now with some important J3.2 fixes.
The following user(s) said Thank You: olimpo88

Please Log in or Create an account to join the conversation.

More
7 years 1 month ago #7 by Bob Britt
Just like to add my "Me To" to this fix. I really don't want to edit any files directly but would love for this to be addressed in bugfix. Thanks
The following user(s) said Thank You: olimpo88

Please Log in or Create an account to join the conversation.

  • Not Allowed: to create new topic.
  • Not Allowed: to reply.
  • Not Allowed: to edit your message.
Time to create page: 0.616 seconds