That would be pretty easy to setup another variable, but your mentioning of "skipping updating the last_visit" during the session is exactly what I'm trying to achieve.. How is that done?drathbun wrote:One thing you could do is to set an additional variable like IN_PHPBB that is set only on your site pages, rather than the phpBB pages. If that var is set, then skip updating the last_visit during the sessions logic.
Code: Select all
$last_visit = ( $userdata['user_session_time'] > 0 ) ? $userdata['user_session_time'] : $current_time;
if (!$admin)
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_session_time = $current_time, user_session_page = $page_id, user_lastvisit = $last_visit
WHERE user_id = $user_id";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error updating last visit time', '', __LINE__, __FILE__, $sql);
}
}
$userdata['user_lastvisit'] = $last_visit;