Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 05-24-2011, 01:20 PM
richy96's Avatar
richy96 richy96 is offline
 
Join Date: Apr 2008
Location: England
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Last login date

Does $vbulletin->userinfo['lastvisit'] contain the login date/time for the users previous session or is that the start date/time of the current login session?

I want to show users things that have happened on site since they last visited (new members, blog entries etc) so need to know when they last used the site

cheers
Rich
Reply With Quote
  #2  
Old 05-24-2011, 01:41 PM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know the answer, but it's quite easy to find out by yourself :P
Reply With Quote
  #3  
Old 05-24-2011, 02:22 PM
richy96's Avatar
richy96 richy96 is offline
 
Join Date: Apr 2008
Location: England
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes did a test - it holds start of this session

was just being lazy

suppose I will have to get the previous value at log in and use that to find all new activity since last visit

unless it is already held in some other place?

Rich
Reply With Quote
  #4  
Old 05-24-2011, 02:38 PM
Disasterpiece's Avatar
Disasterpiece Disasterpiece is offline
 
Join Date: Apr 2007
Location: GER
Posts: 765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you could check the user table if anything looks like a date from last login, otherwise I suppose you've to code it yourself. It's not particularly hard.
Reply With Quote
  #5  
Old 05-24-2011, 04:52 PM
richy96's Avatar
richy96 richy96 is offline
 
Join Date: Apr 2008
Location: England
Posts: 93
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually the last logged in date seems to behave in a more complex way than I first thought

If you wander around the site a while then close your browser without logging out - I left it for about half an hour after that - then come back to the site and are still logged in (as you clicked 'remember me') then the lastactivity time is copied to the lastvisit time and lastactivity is set to the time you came back to the site. There appears to be some time out setting after which the site assumes you have been away and this is a new 'visit'.

This is OK for what I want as lastvisit is set to time of you were last active on the site so I can use it to find the events I am interested in that have occurred since then

However if you actually log out and then log back in again the lastvisit date/time is set to the time you just logged in, and the lastactivity is set a very short time (few seconds) after that. So I can't use lastvisit now to find out what has been happening in the members absence.

This makes what I am trying to do more complex - any ideas? Maybe I can grab lastactivity when a log in occurs just before it is updated, save that original value in some variable - then if that variable is set (user logged in) use it for lastvisit, if it is not set (user returned to the site) then use $vbulletin->userinfo['lastvisit']

Not sure if that would work out without trying it

Rich
PS I haven't even looked at what happens when a new member registers!

--------------- Added [DATE]1306261630[/DATE] at [TIME]1306261630[/TIME] ---------------

Oh don't worry about this - I've decided it isn't really feasible - and I would be better going with a system that shows what's been happening for the previous X days in descending date order. After a certain period the events drop off the list.

That's what a rival site is doing

Rich
Reply With Quote
  #6  
Old 05-29-2011, 11:09 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the top right of the navbar where it says You last visited: it seems to always have the last time I actually visited a site. Such as right now it's 8:07 AM Sunday morning for me, it says my last visit here was 10:43 PM, EST Saturday, which is accurate.

Since I never log out I just leave the page open and do other stuff for hours at a time it seems to be able to know when I've stopped actively browsing the forum and it knows when I start actively browsing again it's a new visit.
Reply With Quote
  #7  
Old 05-29-2011, 11:13 AM
Frosty Frosty is offline
 
Join Date: Apr 2011
Posts: 166
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah.. It's based on inactivity.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:44 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03590 seconds
  • Memory Usage 2,206KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete