Really connected users

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
User avatar
LuigiMdg
Registered User
Posts: 143
Joined: Sat Jan 10, 2015 9:12 pm
Contact:

Really connected users

Post by LuigiMdg »

Hello,
on my forum you can watch a specific channel streamed..
Would it be possible to visualize how many users are really connected to it?
Because as I understand it, if they have not done an operation in the last 5 minutes will be displayed as disconnected, while they are probably watching the channel.. Right?
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Really connected users

Post by david63 »

LuigiMdg wrote: Tue Apr 10, 2018 10:04 am on my forum you can watch a specific channel streamed..
As core phpBB does not have "channels" then this is either an extension or some custom coding, so your question would be better asked at the place where you obtained this code.
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
LuigiMdg
Registered User
Posts: 143
Joined: Sat Jan 10, 2015 9:12 pm
Contact:

Re: Really connected users

Post by LuigiMdg »

It is a simple popup with channel in streaming.. But the 'problem' is not on the channel.. I would simply like users to continue to be viewed as connected, because under the popup with the streaming channel, the forum page remains opened..
I was thinking of inserting a small piece of code in the forum that updates the page every 300 seconds for example.. But I was wondering if there could be a more professional solution
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Really connected users

Post by david63 »

LuigiMdg wrote: Tue Apr 10, 2018 10:17 am t is a simple popup with channel in streaming
But it is not core phpBB so nobody here knows what the code is or what it is doing.
david63 wrote: Tue Apr 10, 2018 10:08 am your question would be better asked at the place where you obtained this code.
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53411
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Really connected users

Post by Brf »

LuigiMdg wrote: Tue Apr 10, 2018 10:17 am I was thinking of inserting a small piece of code in the forum that updates the page every 300 seconds for example.. But I was wondering if there could be a more professional solution
I wrote a mod back in 2.0 that did that. It had an ajax that refreshed once per minute.

I think this type of thing is what you are looking for. Your "channel" being an external page is really irrelevant. What you are looking for is a "keep-alive" in the phpBB board page that is being left open.
User avatar
LuigiMdg
Registered User
Posts: 143
Joined: Sat Jan 10, 2015 9:12 pm
Contact:

Re: Really connected users

Post by LuigiMdg »

Brf wrote: Tue Apr 10, 2018 12:05 pm I wrote a mod back in 2.0 that did that. It had an ajax that refreshed once per minute.

I think this type of thing is what you are looking for. Your "channel" being an external page is really irrelevant. What you are looking for is a "keep-alive" in the phpBB board page that is being left open.
Exactly..!
It's what I was trying to make clear to david63, but my english is apparently very poor..!
What is the name of the extension?
Or if you can directly give me the ajax code that interests me, then I can easily find the landing page from there
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53411
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Really connected users

Post by Brf »

It was a mod back in 2.0. I doubt it could be applied directly to 3.2.
User avatar
LuigiMdg
Registered User
Posts: 143
Joined: Sat Jan 10, 2015 9:12 pm
Contact:

Re: Really connected users

Post by LuigiMdg »

Yes.. Only after I answered you I understood the message better..
I have to try to call the who's online, sending the variable of the page where the user is located.
Now I do some tests but I see it hard..!
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53411
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Really connected users

Post by Brf »

LuigiMdg wrote: Tue Apr 10, 2018 4:51 pm I have to try to call the who's online,
No. You just have to renew the user's session. That all all the "who's online" is.
My old mod simply started up a blank page in ajax mode, setting the session parameter that said to skip updating the user's page.
User avatar
LuigiMdg
Registered User
Posts: 143
Joined: Sat Jan 10, 2015 9:12 pm
Contact:

Re: Really connected users

Post by LuigiMdg »

II've found a very very simple solution.. I've used the function session_create renewed every 300 seconds :D
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53411
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Really connected users

Post by Brf »

That should work, depending on how you are implementing it. Set it for less than 300 seconds though, if your online time is 5 minutes. My mod used 61 seconds to avoid the 1-minute limit in the session storing routine.
User avatar
LuigiMdg
Registered User
Posts: 143
Joined: Sat Jan 10, 2015 9:12 pm
Contact:

Re: Really connected users

Post by LuigiMdg »

Brf wrote: Tue Apr 10, 2018 5:27 pm That should work, depending on how you are implementing it. Set it for less than 300 seconds though, if your online time is 5 minutes. My mod used 61 seconds to avoid the 1-minute limit in the session storing routine.
This is the JS:

Code: Select all

	var interval = 250000; //1000 = 1 second
	function doAjax() {
		$.ajax({
			type: 'POST',
			url: 'refresh_session.php',
			data: $(this).serialize(),
			dataType: 'json',
			success: function (data) {
                    
                },
                complete: function (data) {
                    setTimeout(doAjax, interval);
                }
            });
	}
	setTimeout(doAjax, interval);
Post Reply

Return to “phpBB Custom Coding”