|
Joined: Jan 2000
Posts: 796
Addict
|
Addict
Joined: Jan 2000
Posts: 796 |
The Last Seen box seems to not be considering the time offset. It mentions the last seen according to server time and not the offset time that is configured in UBBThreads.
So if I have 6 hours offset, even if I just logged in, it says I was seen last 6 hours ago.
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
The time is pulled from your U_Laston field in the database and it's also cached so that throws it off by how ever many minutes it is between updates. Your U_Laston field isn't updated by threads that often. I have another thread around here where I mention the points that .threads updates at but I'm not sure where it is. If I remember correctly it only updated during login and when making a post or viewing a list of posts, I believe. Since the duration of time and not the time itself is displayed I did not use member's U_TimeOffset because there would be no point. If the server seen User X 10 minutes ago it's the same amount of elapsed time for everyone else too. Also, if you "just logged in" it may not reflect on the "last seen" untill cache is refreshed. I know the use of cache has had many people thinking things were not working but I still believe it's a needed feature as it helps speed things up considerably.
|
|
|
|
Joined: Jan 2000
Posts: 796
Addict
|
Addict
Joined: Jan 2000
Posts: 796 |
Interesting, then by some weird coincidence I have been logging in every 6 hours, it always said “6 hours” and a few minutes… Didn’t notice I was doing that, haha. I logged out and back in to check if this was right, and sure enough, it said I logged in 6 seconds ago, so the time offset I was thinking was just that, coincidence with my login times. I guess what confuses me, and others as well, is that if I logged in 6 hours ago, and do so again now, it tells me I was last seen 6 hours ago, as if I wasn’t really online right now. Anyway... thanks for explaining that.
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
No problem. For a true "last seen" one would need a new database field in which it was updated at every page load. Perhaps at some point when I can squeeze more queries out of the way I can add in such a tracking feature. (never enough time in a day though)
|
|
|
|
Joined: Jan 2000
Posts: 796
Addict
|
Addict
Joined: Jan 2000
Posts: 796 |
I am starting to wonder about it again... I just logged in and it said I was last seen 6 hours and 10 seconds ago. I havent logged in the site for nearly 18 hours, so that is obviously wrong. It seems more like it was trying to say I was last seen 10 seconds ago (now), and for some reason adding those 6 hours (coincidence or not, the time offset with my server).
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
hmmm... well I'll have to look over the code when I get a chance. Had you made a post or anything like that in that past 18 hours? It seemed to always be working when I would look at the times posted when it wasn't being cached. Guess I'll have to play with it some... lol
|
|
|
|
Joined: Jan 2000
Posts: 796
Addict
|
Addict
Joined: Jan 2000
Posts: 796 |
Hadnt posted anything for days.
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
I'm testing this with a setup that's not cached. There's no change in how things are calculated or retrieved from the database and the times *seem* to be as correct as they can with the U_Laston information.
After looking over the code I can't see where it would be going wrong. It takes the unix time stamp from the U_Laston field and subtracts it from the current unix time stamp. The number of seconds left over is then broke down into years, months, days, hours, minutes and seconds by dividing this time and the remainders by the corrosponding number of seconds for each block. I can't seem to see where I would be going wrong with this though.
Perhaps it is a matter of caching still. Or more to the point of not updating cache. But that seems to be working in that I see others being listed as time passes.
Right now it has you last seen as:
MTO: 41 minutes, 37 seconds ago...
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
I'm not sure if this has anything to do with the above, but when of my users looked at the IIP page on my testing forum it said he was last seen about 16 minutes ago, when he in fact had never been there before.
|
|
|
|
Joined: Jan 2000
Posts: 796
Addict
|
Addict
Joined: Jan 2000
Posts: 796 |
At the site I've set it up I hadnt entered for more than 48 hours, so I just entered and it said I was last seen "6 hours, 0 seconds ago". So just to make sure I changed the server time offset from 6 to 5. Went back to the mainpage, and now it said I was last seen 5 hours and a few minutes ago... so it confirms it has something to do with the time offset thing. Check the site out at www.enred.cc if you'd like Colors are terrible in my opinion, but its not my choice. The site is a friends, a non-profit for christian youth leaders (Spanish).
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
Was he a new user? His last seen time would have been at login. It only pulls the timestamp from the U_Laston field. If their not a registered user it wont see them. Only .threads scripts update this field though. I'm starting to think that this box isn't quite right since it isn't using something that was ment to track users every step of the way. The core .threads script, ubbt.inc.php would need to be modified so that every call to send_header would update a field used to track real "last seen" times for each user.
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
Let me see if I can understand/explain this some. Just "entering" the forum index. This time will be updated when you login. This time will be updated when you make a post. This time will be updated during the send_header function when no temp cookies are available. (first visit with that browser or perhaps they have been deleted). I had thought once that viewing postlist.php updated this field but it does not. It updates the temp cookie. I have searched for queries that update this field and the above examples are all that I can find. Based on this fact I intend on yanking this box untill I have something put together to track with every send_header call.
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
No, he is a long time user, but it was the first time he logged in to the test site, which uses an old copy of the database.
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
So then his U_Laston field was updated with the new time at login. That's why it was such a short period of time even though it may have been longer prior to login.
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
But the thing is, he had just logged in. The time should be seconds, not more than one minute at most.
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
hmmmm... now that may be a bug. lol
I'll go over the code that calculates the elapsed time. Wouldn't surprise me if I had something wrong in there. I converted that function from one I had written in TcL for an eggdrop bot a number of years ago.
But, like I said above though. The U_Laston time really isn't accurate since it's not updated with every send_header call. Wouldn't it be better to just drop that box for now untill something more accurate can be done?
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
Yeah, don't spend any time fixing it that could be spent coding on IIP6. =]
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
I have a site that has no cache in use. I'll test the login/last seen times there. If I logout and then login my last seen times should be seconds off. If it isn't then I'll try and hunt it down there. If it's off as many minutes as your user's was I'll spend some time on that elapsed time function because I'll be using it later on.
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
I just tested on my site with no cache in use but the same function is used for calculating the times. After each login I was last seen 1 or 2 seconds ago. I can't say for sure what may have caused the large discrepancy with your user's time though. I think I'll leave this one alone for now... lol
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
We could hope that it's was a temporary thing... I'll let you know if something happens when we go public with IIP.
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
Ok thanks. You may want to set the cache time for lastseen to 0 too to keep it from getting in the way.
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
Good idea, I'll do that.
Thanks for an awesome add-on by the way, it can't be said too often.
|
|
|
|
Joined: Jun 2001
Posts: 3,273
That 70's Guy
|
That 70's Guy
Joined: Jun 2001
Posts: 3,273 |
I'm glad you were finally able to upgrade and put it to use. I figured you would have some good input on things and I was right.
|
|
|
|
Joined: May 1999
Posts: 1,715
Addict
|
Addict
Joined: May 1999
Posts: 1,715 |
Glad to be able to help a bit, to give something back is always nice.
I'm still thinking of how to add some of the pals to my own front page, which uses my own article system... Will probably have to hack an external pal-reader or something. =]
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 87
Joined: December 2001
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|