PDA

View Full Version : Last online in users profile


zarkov
20 May 2001, 07:10
This is a hack i created after installing the "User has started X threads" hack by tube dog.

This is my first hack and im so proud i just had to share it with you all.

I will say that im new to vbb and PHP & MySQL so the code may not be the best.

Version of vbb: RC2

Files needed: getinfo.txt & lastonline.txt See zip file below

Files to modify: member.php

Template to modify: getinfo

Please reply with likes/dislikes/modifications.


The way to install it as as in tubedogs hack

1) Open lastonline.txt
2) Find this code in members.php

// get last post
$totalposts=$userinfo[posts];
if ($userinfo[posts]!=0 and $userinfo[lastpost]!=0) {
$lastpostdate=vbdate($dateformat,$userinfo[lastpost]);
$lastposttime=vbdate($timeformat,$userinfo[lastpost]);

$getlastposts=$DB_site->query("SELECT thread.title,thread.threadid,thread.forumid,postid,post.dateline FROM post,thread WHERE thread.threadid=post.threadid AND thread.visible = 1 AND post.userid='$userid' ORDER BY post.dateline DESC LIMIT 20");

while ($getlastpost=$DB_site->fetch_array($getlastposts)) {

$getperms=getpermissions($getlastpost[forumid]);
if ($getperms[canview]) {
$lastposttitle=$getlastpost[title];
$lastposturl="showthread.php?s=$session[sessionhash]&postid=$getlastpost[postid]#post$getlastpost[postid]";
break;
}
}
} else {
$lastpostdate="Never";
}


and copy the contents of lastonline in immediatly after it.


3) Upload member.php to your server
4) Then open getinfo.txt
5) Find this code in the getinfo template

<tr>
<td bgcolor="#DEDEDE"><normalfont><b>Last Post:</b></normalfont></td>
<td bgcolor="#DEDEDE"><normalfont>$lastpostdate $lastposttime<br><a href="$lastposturl">$lastposttitle</a>$nolastpost</normalfont></td>
</tr>


and copy the contents of getinfo.txt immedietly after it.

smelialichu
20 May 2001, 11:30
Lovely hack, I think I may try this one outr.

zarkov
20 May 2001, 23:24
ok I think its good but then i wrote it. lol

I will hopefuly modify it to show if a user is currently online.

heres a screenshot of it in action.

vtrac
22 May 2001, 07:22
Nice.. thanks!

Degen
25 May 2001, 20:04
Thanks! It works great!

c0bra
26 May 2001, 18:14
Nice hack. Invades users privacy though? Would be kewl if you could add an option to switch this off in the users control panel.

Sarge
27 May 2001, 06:12
http://www.dlrarmy.com/forums/member.php?s=&action=getinfo&userid=4650

Check this out. It lists the last time a person was online... but it is earlier than the last post time.

Why is that?

antilife
27 May 2001, 15:05
How would I add this to a column on the members page after the Join Date?

zarkov
01 Jun 2001, 11:24
Cobra, Personaly I dont consider it an invasion of privacy after all the stuff on the profile pages anyway, Plus its only the last time they logged in and last time they posted , Info that could be got elsewhere anyway, last Post and PM tracking for example.

Sarge, Yea I noticed this too which is why i then changed the titles to say last logged in and last activity rather than last online,
i think that the last logged in date/time is literaly that the last time the cookie was reset, so this will stay the same until either the users cookies are deleted and they login again or they logout and therefore they login again.
The last activity is the last time they did anything at all, not just post but anything.

Antilife, I dont have the code to hand ( im at work ) but all you need to do is edit the template stated in the original post and find the line that displays the info you want to put this after then copy the contents of the txt file to there instead of where i suggested.

Johnny
04 Jul 2001, 13:35
before i had this hack to! but now i lost him! i've got vb 2.0.1 and i can't find the template: getinfo
how does this template now called in vb 2.0.1

tnx
Johnny

Johnny
04 Jul 2001, 17:58
nobody??? there should be someone know the right template??

Johnny

ztsky
04 Jul 2001, 21:22
Originally posted by Johnny
nobody??? there should be someone know the right template??

Johnny

getinfo
You should find it in 2.01.

Johnny
05 Jul 2001, 08:39
i can't find him! when i use the search functie he have no results with the template called getinfo!

i will look again.
Johnny

Johnny
05 Jul 2001, 10:28
nope i can't find the template! :(
in which string is the template "getinfo" ??

very weird! i've looked in a other board of a friend and on that board there is too not a template called "getinfo"

Johnny

First-Man
05 Jul 2001, 11:37
Originally posted by Johnny
nope i can't find the template! :(
Klick in the CP on [show all] and search again!
do not klick only on [expand list]!
bye bye

Johnny
06 Jul 2001, 09:01
tnx i found him!

Johnny

webhost
09 Jul 2001, 21:58
Installed hack today. I see one problem, I was logged in this morning for 2 hours on my board 7/9/01 but the last online time it shows is 9:00 pm 7/7/01. Why is this?

webhost
12 Jul 2001, 05:50
Why does this hack not show the correct time of last online time a member was online? Can someone fix this please.

Joey

Tim Wheatley
02 Feb 2002, 11:35
Works great, thanks.

(2.2.2)

wvvwnet
28 Feb 2002, 12:43
Thanks, it's realy a great hack ;)

mondaynightmike
28 Feb 2002, 13:10
Really good hack, well done.

nafae
28 Feb 2002, 20:14
some ppl say it works, some say it doesn't work, so, does it work!?

Austin Dea
19 Aug 2002, 07:10
erm...you could use $bbuserinfo[lastvisitdate], no?

Tok Muda
19 Aug 2002, 07:29
I tried using Austin method.. it works without the hack..

ExAvIoUr
12 Sep 2002, 03:43
Added it only in the template like Austin Dea mentioned ... works great. :)

Austin Dea
14 Sep 2002, 07:02
I think that var was a new addition since version 2.0.0/2.0.1

N9ne
24 Oct 2002, 21:40
What's Austin's method?

Austin Dea
25 Oct 2002, 05:29
Find in template 'getinfo':
<tr>
<td bgcolor="#13486D"><normalfont><b>Last Post:</b></normalfont></td>
<td bgcolor="#13486D"><normalfont>$lastpostdate $lastposttime<br><a href="$lastposturl">$lastposttitle</a>$nolastpost</normalfont></td>
</tr>

Under that add:<tr><td valign="top"><smallfont><b>Last Visit:</b></smallfont></td><td valign="top"><smallfont>$bbuserinfo[lastvisitdate]</smallfont></td></tr>

N9ne
25 Oct 2002, 20:20
Thanks :)

Chris M
25 Oct 2002, 20:24
Cool:)

Satan

N!ck
31 Oct 2002, 00:58
ummmm... $bbuserinfo[lastvisitdate] shows the last visit date of whoever's viewing the profile, if i am not mistaken. try viewing multiple profiles and see if they don't match.

212rikanmofo
19 Apr 2003, 04:57
nick you're correct, so this doesnt work, how do you make it so its exclusive to that certain member only... i want to add this in my postbit... its showing the same info for everyone... hrmm

Austin Dea
19 Apr 2003, 05:58
Yeah I noticed it a while ago but forgot about this thread. Use his hack ;)

212rikanmofo
20 Apr 2003, 22:44
is there anywya i can put this in my postbit? please help

Alien
21 May 2003, 01:03
I'd like to see this in postbit as well, anyone know how to accomplish this?

ImportPassion
09 Jun 2003, 16:29
this should be last post not last online. I have been looking for last post for a while and stumbled on this.