Jump to content
TNG Community

Who's online


matvernier

Recommended Posts

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,

Link to comment
Share on other sites

  • Replies 130
  • Created
  • Last Reply

Top Posters In This Topic

  • Michel KIRSCH

    61

  • tngrlkrz

    19

  • Rob Severijns

    17

  • NLapierre

    13

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?

Link to comment
Share on other sites

  • 1 year later...

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.

Link to comment
Share on other sites

  • 2 weeks later...

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..

Link to comment
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.

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

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..

 

Link to comment
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

Link to comment
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

Link to comment
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

Link to comment
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

 

Link to comment
Share on other sites

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.

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

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

Link to comment
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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

30 minutes ago, tngrlkrz said:

how is the TNG Wiki able to post 'Who's Online'? 

Ron

I understand that the TNG Wiki uses a MediaWiki extension to do this - https://www.mediawiki.org/wiki/Extension:WhosOnline

There are many sites (search engine) which use  javascript for doing something similar,

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...