PDA

View Full Version : Extra Details in Who's Online


filburt1
03-16-2003, 10:00 PM
This adds extra details to the IP Address column of Who's Online; specifically, the user agent and the actual URL for each user.

filburt1
03-16-2003, 11:56 PM
Screenshot:

Spitfireisgod
03-16-2003, 11:59 PM
pretty nice, i may install :-0

Xanthine
03-17-2003, 12:04 AM
nice installed

Edit:
You have the wrong template in the install; whosonlinebit, it should be whosonlinebit_ip

squawell
03-17-2003, 12:09 AM
NICE.....

/me installed!!

but in step 4.
In whosonlinebit, find:

$userinfo[ipaddress]

i think it should be whoonlinebit_ip not whosonlinebit right??

filburt1
03-17-2003, 12:51 AM
Today at 09:09 PM squawell said this in Post #5 (https://vborg.vbsupport.ru/showthread.php?postid=367848#post367848)
NICE.....

* squawell installed!!

but in step 4.
In whosonlinebit, find:

$userinfo[ipaddress]

i think it should be whoonlinebit_ip not whosonlinebit right??

Whoops, fixed :)

squawell
03-17-2003, 01:00 AM
Today at 10:51 AM filburt1 said this in Post #7 (https://vborg.vbsupport.ru/showthread.php?postid=367863#post367863)


Whoops, fixed :)
thankz for the fixed!!

but another question....can just show detail for member....do not

show guests' detail.....

Boofo
03-17-2003, 01:22 AM
This seems to work great unless I get a web robot. Then I get a blank username line but the same info as the web robot on the line. ;)

LOD-squa
03-17-2003, 01:24 AM
Today at 10:22 PM Boofo said this in Post #9 (https://vborg.vbsupport.ru/showthread.php?postid=367875#post367875)
This seems to work great unless I get a web robot. Then I get a blank username line but the same info as the web robot on the line. ;)


I also get a blank userline =\

filburt1
03-17-2003, 01:35 AM
Screenshot?

Xanthine
03-17-2003, 01:36 AM
That happened to me too but when I edited the templates it went away and is working fine now.

filburt1
03-17-2003, 01:38 AM
So is it working properly or not? :confused:

LOD-squa
03-17-2003, 01:40 AM
Here ya go

filburt1
03-17-2003, 01:41 AM
:confused:! That's weird.

Is it always the same user with the blank username/ip?

LOD-squa
03-17-2003, 01:42 AM
Weird its gone now..

filburt1
03-17-2003, 01:43 AM
Maybe something stupid like emptying the session table would fix it. *shrug*

Glad to see it's working now :)

LOD-squa
03-17-2003, 01:44 AM
Excuse my stupid post but I logged out from my forum and went to online.php and noticed it appeared again. It seems that it will only appear if theres a guest on the forum.

filburt1
03-17-2003, 01:45 AM
Well I don't know what it is so in the meantime I'm moving this to beta hacks.

LOD-squa
03-17-2003, 01:59 AM
Found the fix

Find


}
$guests[$count][lastactivity] = $user[lastactivity];
$count++;
}
$userinfo[$key]['useragent'] = $user['useragent'];
$userinfo[$key]['actualurl'] = $user['location'];
}


Replace with


}
$guests[$count][lastactivity] = $user[lastactivity];
$count++;
}
}
$userinfo[$key]['useragent'] = $user['useragent'];
$userinfo[$key]['actualurl'] = $user['location'];

filburt1
03-17-2003, 02:04 AM
Do the instructions look good now?

Boofo
03-17-2003, 02:15 AM
Today at 09:41 PM filburt1 said this in Post #14 (https://vborg.vbsupport.ru/showthread.php?postid=367889#post367889)
:confused:! That's weird.

Is it always the same user with the blank username/ip?

So far it has only happened with a web robot on the site (for me, anyway). The first line looks just like the picture. ;)

LOD-squa
03-17-2003, 02:15 AM
Yet again please excuse the confusion. I noticed the browser and actual location where missing and did this:

find


$userinfo[$key][receivepm] = $user[receivepm];


after it add


$userinfo[$key]['useragent'] = $user['useragent'];
$userinfo[$key]['actualurl'] = $user['location'];



You might wanna test it. though for me it works correctly sorry to confuse you x.x

Boofo
03-17-2003, 02:16 AM
Today at 09:59 PM gohanssj2 said this in Post #19 (https://vborg.vbsupport.ru/showthread.php?postid=367900#post367900)
Found the fix

Find


}
$guests[$count][lastactivity] = $user[lastactivity];
$count++;
}
$userinfo[$key]['useragent'] = $user['useragent'];
$userinfo[$key]['actualurl'] = $user['location'];
}


Replace with


}
$guests[$count][lastactivity] = $user[lastactivity];
$count++;
}
}
$userinfo[$key]['useragent'] = $user['useragent'];
$userinfo[$key]['actualurl'] = $user['location'];



I tried doing it that way and I lost the useragent and url info.

LOD-squa
03-17-2003, 02:17 AM
Sorry check my other post lol.

filburt1
03-17-2003, 02:25 AM
Guh, please just posted revised instructions.

Boofo
03-17-2003, 02:48 AM
If I put it below the 2 brackets, I don't get the extra spaced line, but I also don't get the location or useragent for anyone. If I put it between the 2 brackets, I get the extra spaced line again with all the info and my line has all the info, but the guests and web robots only have the ip address, the other info is blank. ;)

Talisman
03-17-2003, 08:57 AM
Has worked out the exact same way for me, too.

This will be a great hack, once someone fixes this last detail.

Dean C
03-17-2003, 02:27 PM
Good idea turtle. This is almost one hack p/day so far... :p

- miSt

Broekie
03-17-2003, 02:48 PM
Nice hack!

Does anybody have any idea how to get the complete useragent info instead of just the first 50 chars? (setting the useragent field of the session table from char(50) to varchar(100) didn't do the trick)


btw, the fix for the guest-problem:
(I c/p'ed the whole bit of code to prevent confusion ;))
}
$userinfo[$key][userid] = $user[userid];
$userinfo[$key][showemail] = $user[showemail];
$userinfo[$key][receivepm] = $user[receivepm];



$userinfo[$key]['useragent'] = $user['useragent'];
$userinfo[$key]['actualurl'] = $user['location'];



}
} else { // Guest
$guests[$count][location] = $user[location];
$guests[$count][invisible] = 0;
$guests[$count][username] = "Guest";
if ($WOLresolve && $usergroupdef['canwhosonlineip']) {
$guests[$count][ipaddress] = @gethostbyaddr($user[host]);
} else {
$guests[$count][ipaddress] = $user[host];
}
$guests[$count][lastactivity] = $user[lastactivity];



$guests[$count]['useragent'] = $user['useragent'];
$guests[$count]['actualurl'] = $user['location'];



$count++;
}
}



This worked for me...

techno
03-17-2003, 07:10 PM
I cant seem to get this hack working at all. I'm running 2.2.9. Here is a screeny.

Fi_InCogNiTo
03-17-2003, 09:48 PM
Same problem here. 2.2.9 also

Sho
03-18-2003, 12:19 AM
Broekie,


in admin/sessions.php, find:

$HTTP_USER_AGENT=substr($HTTP_USER_AGENT,0,50);

Replace with:

$HTTP_USER_AGENT=substr($HTTP_USER_AGENT,0,100);

That'll show up to 100 characters. Of course, you'll have to set the field length of "useragent" in the "session" table to the same number.

Boofo
03-18-2003, 12:36 AM
What is a good length to set it at?

And, Broekie, your fix works. Everything is right now. Thanks! ;)

Boofo
03-18-2003, 01:11 AM
Today at 08:19 PM Sho said this in Post #32 (https://vborg.vbsupport.ru/showthread.php?postid=368375#post368375)
Broekie,


in admin/sessions.php, find:



Replace with:



That'll show up to 100 characters. Of course, you'll have to set the field length of "useragent" in the "session" table to the same number.

That didn't seem to change it for the web robot though, just mine (no guests were on when I checked it).

amykhar
03-18-2003, 01:21 AM
Filbert, what I would love to see in there is the referring page. Then, I could look at my guests and see where they came from. Possible?

Amy

ScottRoberts
03-18-2003, 02:13 AM
2.2.9...can not seem to get the info to show....shows IP but no other info shows....any ideas

Broekie
03-18-2003, 05:41 AM
About the 2.2.9 compatability (or how ever you write that word ;)), I still use 2.2.8 and this hack works perfectly for me.

@Boofo: The useragent fix works with guests here too, except for the one which was allready on the site before I applied the fix (but now that that guest made a move the fix works with him/her too)

Boofo
03-18-2003, 05:47 AM
It works fine here now, too. It must have been someone was logged on before I changed it. And I am running 2.2.9 and it works great here.

What would be a good limit to set for the length? I have 100 now but it seems like it might be a little long. And thanks again for the fix. ;)

Broekie
03-18-2003, 06:47 AM
The lengt of the useragent info depends on the useragent the client uses, and the info it submits. I just had a robot on my forum, and it had a useragent info of approx. 80 chars.

So I guess anything between 80 and 100 would be a nice number...


here's the useragent info I'm talking about:
sitecheck.internetseer.com (For more info see: http://sitecheck.internetseer.com)
that's 81 chars...

* Broekie sticks to the number 100 :)


[second edit]
just had one with 86 chars
[/second edit]

techno
03-18-2003, 06:46 PM
Still no worky worky for my 2.2.9... :disappointed: :disappointed:

filburt1
03-18-2003, 06:48 PM
You're not helping because you're not telling me anything new. Are you using PHP 4.3.0 or later?

techno
03-18-2003, 06:51 PM
Using PHP v4.3.0 - MySQL v3.23.55

filburt1
03-18-2003, 06:52 PM
No idea. Either I can't code or it's a 2.2.9 problem.

To whoever got this working: can you try to post revised instructions?

techno
03-18-2003, 06:55 PM
I dont think that it has anything to do with you not being able to code...I've seen lots from you.

The only thing I tried was the instructions in your text file. I didn't try any of the other stuff posted in this thread. I have several other hacks installed, I guess that could be screwing something up somewhere.

Boofo
03-18-2003, 07:02 PM
Today at 02:52 PM filburt1 said this in Post #43 (https://vborg.vbsupport.ru/showthread.php?postid=368736#post368736)
No idea. Either I can't code or it's a 2.2.9 problem.

To whoever got this working: can you try to post revised instructions?

Here you go (thanks to Broekie in this thread):

2. In online.php, find:

$userinfo[$key][showemail] = $user[showemail];
$userinfo[$key][receivepm] = $user[receivepm];

After that, add:

$userinfo[$key]['useragent'] = $user['useragent'];
$userinfo[$key]['actualurl'] = $user['location'];

3. In online.php, find:

$guests[$count][lastactivity] = $user[lastactivity];


After that, add:

$guests[$count]['useragent'] = $user['useragent'];
$guests[$count]['actualurl'] = $user['location'];

filburt1
03-18-2003, 07:06 PM
Thanks :)

Instructions updated, thread moved to full releases.

techno
03-18-2003, 07:10 PM
WooHoo!!

You guys rule. Thanks for the help!!

techno
03-19-2003, 01:15 AM
got a questions for ya's. If someone had hotlinked an image, and the person viewing the image appeared as a guest on my online.php (it has happened) would the location that the hack shows be the pic that was being linked to, or the site that the user is linking from?

If it's not the site the pic is being linked from, is there a way to make this happen?

The reason I am asking is because my host dont allow htaccess files. And I dont think an htaccess file would work for an avatar or an attached file....but this hack makes it look promising.

If this post is hard to understand, I'll try and explain myself a little better tommorrow when I am a little less innebriated.

filburt1
03-19-2003, 01:31 AM
The Actual URL will be the exact URL that the person is trying to access. It won't show standalone images but it should show attachments.

techno
03-19-2003, 01:34 AM
So it would show the URL of the image. In a case like that, is it possible to show where the image is being linked from?

filburt1
03-19-2003, 01:37 AM
I just said it won't show the URL of the image.

Check your web logs's HTTP_REFERERs. And if you can't view that with your host, change immediately because that's incredibly simple.

techno
03-19-2003, 01:43 AM
You said it would be the exact url that the person was trying to access. I took that as the url of the image cause that would be the only url they would be seeing.

Yes, I have access to weblogs, no prob. Its just that this hack would make it right there....no searching through the log files.

* techno has now been confused.

I bid you goodnight. :):)

filburt1
03-19-2003, 01:54 AM
The hack can only show you what vB pages are being accessed because those are the only ones that write to WOL. Standalone images don't. Attachments do because vB has to fetch them first.

ScottRoberts
03-19-2003, 02:57 PM
Okay. I must be doing something wrong. Shows anyone who is a member correctly, when a guest is onthe board, then I get the "blank" entry at the top and then only the IP shows for the guest....I refollowed the instructions....running 2.2.9. Any ideas or advice?

papoo
03-19-2003, 07:38 PM
thank's

X-Fan
03-20-2003, 12:32 AM
So who's able to view these extra details? I'd prefer only admins and mods if that's not already the case.

Broekie
03-20-2003, 06:52 AM
Yesterday at 05:57 PM ScottRoberts said this in Post #54 (https://vborg.vbsupport.ru/showthread.php?postid=369307#post369307)
Okay. I must be doing something wrong. Shows anyone who is a member correctly, when a guest is onthe board, then I get the "blank" entry at the top and then only the IP shows for the guest....I refollowed the instructions....running 2.2.9. Any ideas or advice?

Make sure the part of/around the code you changed in online.php looks like displayed in Post 29 (https://vborg.vbsupport.ru/showthread.php?postid=368069#post368069)


That should solve it

amykhar
03-20-2003, 01:18 PM
03-17-03 at 10:21 PM amykhar said this in Post #35 (https://vborg.vbsupport.ru/showthread.php?postid=368410#post368410)
Filbert, what I would love to see in there is the referring page. Then, I could look at my guests and see where they came from. Possible?

Amy

I hate bumping with a passion, but I think this question got lost in the bug repair frenzy :D

filburt1
03-20-2003, 01:42 PM
Will try now.

filburt1
03-20-2003, 01:44 PM
Actually I don't believe it's possible without much more hacking. My hack gets all its information from the session table and it doesn't have referrals.

Xenon
03-20-2003, 01:49 PM
hmm the query on who's online uses the user table also :)

filburt1
03-20-2003, 01:50 PM
Either way, to my knowledge vB never caches the HTTP_REFERER. An awesome idea for a hack would be record the very first HTTP_REFERER for each guest and then include that in their profile if they register. Then you can see where the guests are coming from.

Xenon
03-20-2003, 01:51 PM
oops, sorry was a missunderstanding from me.
i meant the vb refferal system was meant :)

soory ;)

amykhar
03-20-2003, 02:47 PM
Oh well, one could hope :D Thanks for trying.

Amy

Mathiau
04-03-2003, 04:37 AM
So are the instructions now udpated with all these fixes - if so would love to install!

Mathiau
04-10-2003, 11:59 PM
hey all
got the hack installed - have gone over the install about 4 times now - everything is done right - i am pretty sure of that!


in online.php when i call it in mybrowser i get


Parse error: parse error, unexpected T_STRING in E:\wwwroot\forum\online.php on line 100



Line 100 in my file has


case 'Administrator's profile':


HELP - i also have the [vB v2.3.0] Admins informations page hack installed.

Sho
04-11-2003, 07:08 AM
Write this instead: case 'Administrator\'s profile':

Mathiau
04-11-2003, 07:48 AM
nice - worked! also had to do it on line 424!

appreciated!

Sho
04-11-2003, 08:22 AM
My pleasure. You know, for PHP, the second ' marked the end of the string, so it didn't know what to do with 's profile'.

S.Shady
05-28-2003, 05:23 AM
/me installs

I like it worked perfect. Thanks