MyBB Community Forums

Full Version: lastvisit value + new posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys,
i know this: when a user logs out then in the database's table users it is written the time that the user left in the lastvisit field (more or less).
That is the value that is displayed the next time he logs in in the welcome panel and it is also used for displaying the new posts.

Here is the problem now.
The "lastvisit" value changes many times when i am logged in the forum and that's why many times when i click on the new posts link i get "no new posts".
Probably that has something toi do also with the session (or the cookie).
Can someone tell me how can i solve this problem, i.e. the lastvisit value to change only if the user is inactive the last 2-3-5 etc. hours?

thanks
heloo there

mod4week Wrote:the lastvisit value to change only if the user is inactive the last 2-3-5 etc. hours

there is an option in the admin cp > settings > Who's Online

that will consider a user offline after certain minutes.


umm i think it's a matter of cookies, as these records are recorded inthe cookies.

regards
That will only affect the length that users are shown on the Who's Online and not the actual length of a session before it is marked as inactive.

Basically, by default, MyBB uses sessions of 900 seconds. That is, if you haven't visited within 15 minutes since you last refreshed a page, you're session and last visit will be updated.

If you want to change that, you can edit inc/class_session.php and find:
		if($time - $mybb->user['lastactive'] > 900)

You'll then need to change 900 to the number of seconds you want before a session times out.

I'd recommend, however, not doing this.

Chris