7
Alright, seems that this actually does not work.
Technically it does report the last visit, but only after a user has logged in.
Unfortunately, the core updates the last_login table well before the theme data can pull the information.
...sigh, and I was all excited
We really should consider implementing this feature into the core. I believe it would be a simple addition, wherein on login the current user-unique data in the last_login row is copied to a (***NEW***)previous_login row. Prior to the last_login row being updated with the current time. The previous_login row could then be summoned and displayed using the code snippet i have provided altered like so.
<{php}>
if ($row["previous_login"] == 0){
$datetime = date("l M. d, Y - h:n a");
}
echo "$datetime" ;
<{/php}>
I.M.E. - It offers just a little bit more security for our users. If they see their previous_last_login time is different from when they last logged in, they would know that someone else has gained access to their account. Thereby they could take measures to prevent account hijacks and smurfing by changing their password.
This would also give users a time frame for browsing new content, i.e. they would know that they have not seen any content that was published after their previous_last_login.
I could keep going with reasons why users should be able to see their last_login, and not their current one. However, this thread would be ridiculously long.
____
The code I provided works, just not in the manner I intended because of the limitations of the core. So copy/paste/file away until another day.