Welcome to our community

Be a part of something great, join today!

[SOLVED] User Login History

Prakhar

MHB Ambassador
MHB Ambassador
Mar 18, 2015
184
After logging in, I can't see the "you've last visited" information. It would be nice if it is designed as a click-able link and clicking it gives the entire history of our MHB login sessions.
 

MarkFL

Administrator
Staff member
Feb 24, 2012
13,735
After logging in, I can't see the "you've last visited" information.
Can you post a screenshot of what you are talking about?

It would be nice if it is designed as a click-able link and clicking it gives the entire history of our MHB login sessions.
Storing the entire session history for every user in the database would be quite impractical and take up a lot of space on the server. :D
 

Prakhar

MHB Ambassador
MHB Ambassador
Mar 18, 2015
184
Can you post a screenshot of what you are talking about?
I mean to say that every user should be able to see when they last visited the website after logging in.

For example: Hello Prakhar! You last visited: 15 June 2015 at 3:30 p.m.
Storing the entire session history for every user in the database would be quite impractical and take up a lot of space on the server. :D
Not all, just the last few.
 

Prakhar

MHB Ambassador
MHB Ambassador
Mar 18, 2015
184
If someone logs in with the "Remember?" option checked, he/she doesn't automatically get logged out which is as per the "Remember?" option. But, can we have such a feature that when someone keeps the "Remember?" option checked, then, while logging in next time, there is no need to type the username. Only the password needs to be typed (as seen in GMail) and there is a link below to log in with a different username. This might not be (so) useful, but still it saves the typing of the username every time.
 

MarkFL

Administrator
Staff member
Feb 24, 2012
13,735
If someone checks the "Remember Me?" option, then they will not need to log in again, until they actually log out. If they do log out, then their browser should remember the username upon typing just the first letter. Multiple accounts is not something we encourage though.
 

Prakhar

MHB Ambassador
MHB Ambassador
Mar 18, 2015
184

MarkFL

Administrator
Staff member
Feb 24, 2012
13,735
The last visit time of a user is already stored in a user's cached information, and with a simple plugin and template edit, it can be displayed. This is an example of this on my local dev site:

lastvisit.png

Is this the kind of thing you had in mind?
 

Prakhar

MHB Ambassador
MHB Ambassador
Mar 18, 2015
184
Yes I meant the same.
 

MarkFL

Administrator
Staff member
Feb 24, 2012
13,735
Okay, now the next issue becomes where to display this information such that it does not push down the main part of our pages (the information between the breadcrumb and the footer) nor get in the way on the small screen style. Any suggestions?
 

Prakhar

MHB Ambassador
MHB Ambassador
Mar 18, 2015
184
Towards the right but below the bread crumb, there is an MHB search bar and below that is Current Time. Maybe below the Current Time? Or maybe, the Current Time and Last Visited information is displayed just above the search bar but below the brown border of the blue rectangle and the search bar comes just above the "We Recommend..." line. Whatever is more suitable to you. I would prefer my second option.
 

MarkFL

Administrator
Staff member
Feb 24, 2012
13,735
Towards the right but below the bread crumb, there is an MHB search bar and below that is Current Time. Maybe below the Current Time? Or maybe, the Current Time and Last Visited information is displayed just above the search bar but below the brown border of the blue rectangle and the search bar comes just above the "We Recommend..." line. Whatever is more suitable to you. I would prefer my second option.
The breadcrumb has to have its own line all to itself because of long thread titles when viewing threads. Now, we could code it such that this information only displays on the home page and uses CSS positioning so that it does not push anything down. I will play around with this idea and report back soon. (Yes)
 

MarkFL

Administrator
Staff member
Feb 24, 2012
13,735
Okay, this is what I came up with based on your second suggestion, and it doesn't interfere with long breadcrumbs or push anything down, so it can display on all pages. :D

lastvisitmhb.jpg

Would that work for you?
 

Prakhar

MHB Ambassador
MHB Ambassador
Mar 18, 2015
184
Yes that is nice. It would be even better if the "current time" and "last visited" are both aligned by their colons, just like this:

$\begin{array}{rl}\text{Current Time: }& \text{07:30} \\ \text{You Last Visited: }& \text{07:01 (August 7, 2015)}
\end{array}$
 

MarkFL

Administrator
Staff member
Feb 24, 2012
13,735
I like your idea of aligning the descriptors, however I think it would look better if the times were right-aligned like so:

lastvisitmhb2.png

What do you think?
 

Ackbach

Indicium Physicus
Staff member
Jan 26, 2012
4,183
I don't know - I think Prakhar's alignment is a tad easier to read, and not just because it's a larger font in this thread.
 

anemone

MHB POTW Director
Staff member
Feb 14, 2012
3,589
In this case, I am in favor of Prakhar's alignment. :)
 

MarkFL

Administrator
Staff member
Feb 24, 2012
13,735
I don't know - I think Prakhar's alignment is a tad easier to read, and not just because it's a larger font in this thread.
Easy enough to do...how's this?

lastvisitmhb3.png
 

anemone

MHB POTW Director
Staff member
Feb 14, 2012
3,589

Prakhar

MHB Ambassador
MHB Ambassador
Mar 18, 2015
184

MarkFL

Administrator
Staff member
Feb 24, 2012
13,735
As you can see, we have added a background and rounded border to contain the current time and last visit data. You will also find that when you visit the profile pages of other users, you will see their last visit data as well:

lastvisitprofile.png

Thank you, Prakhar, for this useful suggestion! (Yes)

I will now mark this thread as [SOLVED]