Jump to content
TNG Community
matvernier

Who's online

Recommended Posts

matvernier

Hi,
I've searched through this forum and the wiki to find an answer to my question but did not see it addressed anywhere.
Is there a  mod or a piece of code who would make it possible to see on the front page of my tng 12 site who is online among the registered users?

Did anyone ever added thuis type of information? If so, I would be interested to know how you maneged.

Thank you,

Share this post


Link to post
Share on other sites
manofmull

Sounds like a good idea for a new mod. It would save checking through the site log!

 

M

Share this post


Link to post
Share on other sites
matvernier

Thank you M(anofmull) for the suggestion. The only problem is that I am not a programmer and would not know how to create such a mod. Is there anyone out there who would know how to create such a mod?

Share this post


Link to post
Share on other sites
NLapierre

Hi to all,

Yes it would be nice if someone could program a mod like that. I had this feature in my old genealogy program and i found it very useful.

I could see which registered user was logged into the site and there was a clickable link to email them.

Thanks in advance to whoever can program this mod.

Share this post


Link to post
Share on other sites
Rob Severijns

If such a mod would exist I would surely use it.

 

Rob

Share this post


Link to post
Share on other sites
Rob Severijns

Looks like there's no follow up on this.

Rob

Share this post


Link to post
Share on other sites
RickM

Tis a shame, however I do believe that most of the serious Mod Developers are still in somewhat of a catch up mode catching up to V13 changes and clashes with other Mods..

 

I too am not by any standard clever enough to do this, would love working with someone to debug / test though..

Share this post


Link to post
Share on other sites
Rob Severijns

Guess you're right. People are busy updating mods etc.

I know It's not a "Need to have" but a "Nice to have"

We'll just have to  wait and see what happens.

Share this post


Link to post
Share on other sites
matvernier

Thanks to all Mods developers. I agree that it is not a 'Need to have' so I will try to be patient! :-)

Share this post


Link to post
Share on other sites
Michel KIRSCH

I think about it from time to time... But I'm not very optimistic...

Michel

Share this post


Link to post
Share on other sites
RickM

If anyone can you can Michel..

 

Share this post


Link to post
Share on other sites
Michel KIRSCH

Bof... 🤔

Try this Mod.
Try it for several days because if the user is already logged in, nothing happens.

The user is 'registered' when logged in and 'unregistered' when logged out.
What happens if the user simply closes his web browser? I don't know...
I can't test because I don't have enough connections on my online site.

The numbers of connected users is shown on the Admin page

The connected users are shown with grey background in the users's table.

If it works , I'll make it prettier...

Michel

whoisonline-admin.JPG

whoisonline-users.JPG

show_online_users_v13.0.3.beta1.zip

Share this post


Link to post
Share on other sites
Rob Severijns

Hi everyone,

Good to see you're working on this  :-)

Tested the following:

  • When User logged on: User is gray in Users overview 
  • When User logged off: User is no longer gray in User overview
  • When User closes browser / browserpage without logging off: User still gray in Users overview
    • Maybe checking who's logged on should take place every ? minutes
  • When a user is logged on I don't see the number of users connected (see screenshot)

Users.jpg

  • Is it possible to add make the number of users logged on visible on either the menubar itself or in the Info dropdown menu of the index.php ? (see screenshot)

Menubar.jpg

I will do some further testing

Thanks for the effort so far :-)

 

Rob

Share this post


Link to post
Share on other sites
RickM

Michel,

Like you I don't have enough users at the moment to prove or disprove how well this works. I have been on at my family to log in and look etc, but!!! I think that it would be great for other logged in users to know/see that others are logged in as well..

I can see how it works when I log in and out, I will test further with accounts that I know the passwords of. <Smile>..

And THANK YOU for your efforts, knew you were the man that 'if it could be done would get it done.. Definitely a mod I believe will take off..

 

Share this post


Link to post
Share on other sites
Michel KIRSCH
3 hours ago, Rob Severijns said:

When a user is logged on I don't see the number of users connected (see screenshot)

Sorry, forgot to include this part in the beta1.

This is the beta2

Michel

show_online_users_v13.0.3.beta2.zip

Share this post


Link to post
Share on other sites
Michel KIRSCH
2 hours ago, RickM said:

I can see how it works when I log in and out

As I said, when the user closes his session, the session is destroyed on HIS computer. Your site doesn't see this action. If the user has checked the "stay connected..." box, the cookie is set for one year... and the user have no need to login again. For the site he stay connected...

Search for alternative at logon/logoff... maybe when connection to the database...

Michel

Share this post


Link to post
Share on other sites
Rob Severijns

Hi Michel,

What are you getting yourself into :-)

But we're thankfull for the effort you're making 💪 👍

 

3 hours ago, RickM said:

I think that it would be great for other logged in users to know/see that others are logged in as well..

I aggree

Maybe this could be done via the Menubar ---> Info ---> online users (automaticly expand the names)

 

49 minutes ago, Michel KIRSCH said:

As I said, when the user closes his session, the session is destroyed on HIS computer. Your site doesn't see this action. If the user has checked the "stay connected..." box, the cookie is set for one year... and the user have no need to login again. For the site he stay connected...

Search for alternative at logon/logoff... maybe when connection to the database...

This is indeed a problem. Not sure how to do this. Maybe after an inactivity in use of the database for more than 10 or 15  minutes or so, set the user to logged off.

Guess this is independent of the cookie on the users computer but I'm not sure.

 

Rob

Share this post


Link to post
Share on other sites
Michel KIRSCH
8 minutes ago, Rob Severijns said:

inactivity in use of the database for more than 10 or 15  minutes or so, set the user to logged off.

Bof... Users will not be happy to logon every 15 minutes...

Seems that $_COOKIES on the site can do the work... For tomorrow. Have visit today

Michel

Share this post


Link to post
Share on other sites
Rob Severijns

I just thought that everytime a user changes it's TNG webpage, like going from the Getperson page to the Family page there is database interaction.

So the assumption I had was that if a user doen't interact with the TNG databas for more then 15 minutes the user is assumed to no longer be active in TNG and can therfore be set to logged off.

Not sure if my assumption is correct though

 

Rob

 

Share this post


Link to post
Share on other sites
bhemph

Yes, as currently implemented it shows who's logged in instead of who's online.  The mod would need a new table tng_online where it would store activity each time a page is loaded.  The code would then be able to say something like 2 logged in users and 1 guest visitor.  If you wanted to have Googlebot, Bingbot, and other indexers listed not as guests, but bots that would be possible as well, by checking the hostname for guests and could have something like 4 users, 2 guests, and 1 bot are online.  Also when that information is being displayed, there would need to be a check on the activity time in order to see if the activity was within the last 15 minutes, or whatever time is set.  Then in order to keep the table from growing too big and slowing performance, there could be a delete of the rows where the activity is more than say 4 times the activity timeout (1 hour for a 15 minute activity time).  That way it would not keep data for too long after a user closes the browser, but also shouldn't be dropping rows when one thread sees the time past the activity, the thread from that user then updates the row, then the thread doing the check for the delete ends up deleting the row.  The logged in user would become a guest at logout, which would need to be handled in the update.  This is kind of the premise of how some activity viewing shows on some forums, so just giving ideas on how to implement with what Rob is saying.

Share this post


Link to post
Share on other sites
Rob Severijns

Hello Brett,

Thanks for your input and suggestions.

The intention, as far as I'm concerned, is to show who's logged on to the website. 

 

As a personal note: 

I'm trying to keep bots away as far as possible and my website doesn't need to be found in search engines etc.

For others the opposite applies.

I block bots etc via  robot.txt, host and/or htaccess files and that could be an option for others too.

Hope there is a way to meet everyone's  needs.

 

Rob

Share this post


Link to post
Share on other sites
Michel KIRSCH
2 hours ago, bhemph said:

The mod would need

 

55 minutes ago, Rob Severijns said:

The intention,

Thanks for your inputs. There are ideas in it.

Will sleep on it and think... Michel

Share this post


Link to post
Share on other sites
matvernier

Thank you Michel for your involvement with this project!

I can see that there are a lot of things to consider for having such a mod. So far, when I want to see who has been online, I go to the "Users" section in Admin and sort the "Last Login" column. I suppose that this information may be useful and a good start for knowing when a user has logged in. Of course, as some of you have mentionned, the difficulty seems to be that people may not be online but still logged in.Users_by_date.jpg

Share this post


Link to post
Share on other sites
Michel KIRSCH
On 2/25/2021 at 5:09 PM, bhemph said:

Then in order to keep the table from growing too big

The table must result as one line for each user, registering his last activity datetime. So the max length of the table = the number of users.

Michel

Share this post


Link to post
Share on other sites
tngrlkrz

Realizing it's different software, how is the TNG forum able to post 'Who's Online'?  Is it similar to what Brent describes, ...utilizing some sort of timer?

image.png

Edit:  Sorry, should read TNG forum, no Wiki.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×