View Full Version : User last active
bharvey42
02-11-2003, 06:12 PM
Is there a variable for the last visit to the board? I am making a some modifications. Is there one for online status as well?
I tried this $bbuserinfo[lastvisit]
and that didn't do it.
Also I would like to pull some info from the db and display it in the profile
Where would I make this modification in member.php?
$lastvisit = $DB_site->query("SELECT lastactivity FROM user");
That could be the query being run in member.php
$lastvisit['lastactivity'] would be the variable I think.
You'd need to use code like this though:
$lastactive=intval($lastvisit['lastactivity']/86400)
So the variable to place in the template getinfo would be $lastactive.
Ok this is just my guess on what the code could be, don't use this until someone with more experience can confirm it.
Xenon
02-11-2003, 06:32 PM
if it's for the currently logged in user
there are several
$bbuserinfo[lastvisit] -> unixdatelin from the last visit (last login)
$bbuserinfo[lastactivity] -> unixdateline when the user was active the last time (normally it would be now)
$bbuserinfo[lastpost] -> dateline of last post :)
to convert the datelines into Humanreadable text you have to use the date() function :)
He said that $bbuserinfo[lastvisit] didn't work in member.php. So I just grabbed the data again and messed with it :D I didn't know there was already variables for them :).
bharvey42
02-11-2003, 06:41 PM
no, $bbuserinfo[lastvisit] didn't work in the template.
and using $lastactive in the template doesn't work either
Xenon
02-11-2003, 06:50 PM
the $bbuserinfo variables work everywhere in every template except these templates are called from within a function where $bbuserinfo was not globalized....
if you want to show the infos from the user who's profile is viewed, you have to use $userinfo[...] instead of $bbuserinfo[..]
I don't think $lastactive will work in a template until some more code is added, I think it needs to be wrapped up with the eval()'d code for the getinfo template. Did you put in the query and other code I posted aswell? Just putting in the variable will not work.
bharvey42
02-11-2003, 09:08 PM
so insert the code into the member.php then the other code will work in the template?
I'd need to look into this, but it's 11:30pm here and I have school tomorrow. I'll look at it tomorrow evening if it's ok and release it as a proper hack?
<a href="https://vborg.vbsupport.ru/showthread.php?s=&threadid=48848" target="_blank">https://vborg.vbsupport.ru/showt...threadid=48848</a>
Hack released.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.