PDA

View Full Version : [BETA] Online Users Listing


25 Jul 2000, 05:31
Here is the long awaited (yeah right :) ) Online Users hack as shown at http://www.baseballboards.com/boards/
and referenced in kevinho's post.

Anyway, I stuck it in its own php file for ease of installing when vB updates are released.

To Do List:

Add javascript radio buttons to the right of the refresh button which easily allow the current user to change their "invisible to online list" profile setting
Include support for the following URLs:

member.php?action=clearcookies - AKA logout
index.php?action=showsmilies - Showing Smilies
index.php?action=showbbcode - Showing BBCode
showthread.php?postid=455277#post455277



Known Bugs:

I know there are URLs I'm forgetting, I usually wait until it says "Unknown Location" then I check to see what the URL is.
It can be slow if your tables are huge


To install you need two things:

A php file called anything you want (or member.php)
Your browser opened to your board/admin to add two new templates


Create the aforementioned PHP file or feel free to open member.php and pick a nice place.

Paste the following into your file of choice:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Ugly, eh? :D

Create a template called whoisonline and fill it with:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



and then one called whoisonlinebit and fill it with:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



NOTE: If you do not have private messaging installed (why not???!?!) then remove this line:


Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



That should do it! All you have to do is create a link for it such as http://www.baseballboards.com/boards/whoisonline.php?action=onlineusers and then you'll get a nice list.

I would appreciate help on cleaning / optimizing the code and any URLs that I forgot cases for.

Thanks!!

--
Matt

[Edited by mrogish on 08-29-2000 at 10:32 PM]

25 Jul 2000, 09:45
Cool, I was waiting for someone to release this
http://216.10.26.98/vb/index.php - click the Whos online link.

Nice job, is there any chance of getting it to show where the guests are browsing?

I changed a bit of the html, it uses the meta refresh instead of the java method, and I changed some of the layout and set it to use the variables instead of having fixed fonts and colours etc.

25 Jul 2000, 13:24
ukliam,
Thanks for the kind words, I'll try to keep making improvements as I get more free time!

If you want to show all users remove
'WHERE s.userid <> 0' from the SELECT statement. That *should* display everything in the table. However, the code will be slightly goofed as there is no profile for USERID=0 (a guest), so if anyone clicks on the username vB should display an error (no userid or somesuch).

30 Aug 2000, 02:07
WOW Cool! Just found this hack. I liek the way it tells exactly what the user is doing, like viewing the homepage, posting a new thread, etc. Good Job!

I am adding this to my homepage now (one of few hacks that I will actually install because it doesnt require modification of the main script(s) )

Thanks again
~Chris

30 Aug 2000, 02:18
Thanks TechTalk,
I intentionally made it a separate .php file for the very reason that if it's not adopted into the final release :) I will have to stick it into the code again and again (like PMs).

Actually, I've updated it a lot to fix miscellaneous bugs that I've found (the largest one being the fact that non-moderators can view the topics of moderator-only threads -- this can be a security breach if you have important topics inside (such as "What to do with user XXX??").

Known bugs:
Logged out user (member.php?action=clearcookies)

Example:
http://www.baseballboards.com/boards/whoisonline.php?action=onlineusers

Here is whoisonline.php:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------

30 Aug 2000, 02:21
P.S.

If you are using it, you'll notice that forums the user doesn't have permission to see will show up as "mods only". Well, the $locationlink points to "/boards" since the directory structure we have is:
http://www.baseballboards.com/boards/ <-PHP files live here (aka "forums").

So, if your index.php resides in a different dir, replace
$locationLink = "/boards/";

with

$locationLink = "/SOME/PATH/";

30 Aug 2000, 02:23
woah... alot of code :eek:

gonna try this out...

30 Aug 2000, 02:30
eva2000:

Yep, it is fairly inefficent right now. This will probably change later, but right now I'm too busy with other boards 'stuff' to worry about it. :(

However, v2 of whoisonline.php will not be as inefficent, slow, etc. This was my first crack at it and it *works*, just not too quickly depending on the number of users / posts.

30 Aug 2000, 02:45
OK got it working here:
http://www.extremeforums.com/forums/onlineusers.php

I did change one thing: I got rid of the first "if" statement so I didnt have to add the "?action=onlineusers" to the end of the url.

One thing i noticed:
if the user is on:
http://www.extremeforums.com/forums/onlineusers.php

Then it says they are on "Extreme Forums Main".... Any fix for this?

Thanks
~Chris

30 Aug 2000, 03:24
Chris,

Yep, that is because I (for some unknown reason now) have it checking the second half of the URL to see what the user is doing.. so in effect it looks at the ?action=WHATEVER and if it sees "onlineusers" it will display "Online users listing". When you removed that, that functionality ceased to exist.

However, if you want it to work, here's how to "fix" :) it:

Change:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



Note: this exists in two places: line 189 and 363.. yeah I know it is dumb that I have to repeat the code twice, again... V2 will not suck! :)

To:



Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------



So, that should check $phpFile for the existance of "onlineusers.php" and be happy.

Ok, I realize that could be done with $PHP_SELF, but for the time being do it my crappy way. :)

30 Aug 2000, 03:32
cool i added the link right next to the buddy list at http://animeboards.net/forums/index.php :D

http://animeboards.net/forums/whoisonline.php3?action=onlineusers

30 Aug 2000, 03:43
eva2000:

Cool! Glad to see people are using my code -- and it hasn't destroyed their system!

Oh wait, as soon as I've said that.. I can't get to your site! :( Is it down?


[Edited by mrogish on 08-29-2000 at 11:45 PM]

30 Aug 2000, 04:18
nope.. i can access it fine so can all my members...

30 Aug 2000, 04:21
eva2000,

Ok, I bet it is Road Runner's DNS servers flaking out again. Hope you enjoy the hack! :)

30 Aug 2000, 04:25
thanks... i do love it... seems members are staying longer and logging in for longer times and i only had the hack in for a few minutes :D

greate work :D

30 Aug 2000, 04:30
Oh, it's moments like these that make it all worthwhile...
**sniff**
*wipes a tear from his eye* :)

30 Aug 2000, 05:02
Also you did forget the "announcement.php" link. So if they are viewing an announcement, then it thinks they are just looking at that forum.

Any idea when the next version will be out?

Thanks
~Chris

30 Aug 2000, 05:04
Also if a user is at say:
http://www.extremeforums.com/forums/index.php?action=bbcode

It says "Unknown Location!" when infact they are viewing vb code ;)

Ill post some more info if you want it

~Chris

30 Aug 2000, 05:09
TechTalk,

Could you keep track of those things that break and then e-mail them to me?

I gotta get to bed now, early mornings really suck if I stay up all night!

If you compile a list of broken things and then let me know what they are (e-mail?), I'll cut a new version tomorrow!

30 Aug 2000, 05:12
Sure ;)

30 Aug 2000, 05:36
wow can't wait until tomorrow :D

30 Aug 2000, 08:45
Hmm.. looks very similar to Stalion/Ed's buddy list ;)

Ofcourse this hack existed earlier.

30 Aug 2000, 14:20
When I use this, no matter what it shows the user as being on Forums Main. The only canges I have made are to change the extension to php3 and /boards/ to /board/

http://www.influx9.com/board/whoisonline.php3?action=onlineusers

30 Aug 2000, 20:26
Originally posted by Bane
When I use this, no matter what it shows the user as being on Forums Main. The only canges I have made are to change the extension to php3 and /boards/ to /board/

http://www.influx9.com/board/whoisonline.php3?action=onlineusers

Do a search and replace with your favorite text editor. Replace all instances of "php" with "php3"

~Chris

30 Aug 2000, 21:56
Im sorry, I should have said extensions.. I have already changed all the .php with .php3, as well as the actual files extension and the /path/

at - http://www.influx9.com/board/whoisonline.txt

[Edited by Bane on 08-30-2000 at 06:01 PM]

31 Aug 2000, 00:20
also 'unknown location' shows up when a member is viewing a category page or the avatar.php or buddy.php pages

03 Sep 2000, 03:31
i deleted a thread in a forum and now when i use http://animeboards.net/forums/whoisonline.php3?action=onlineusers it gives me an message

No forum specified. If you followed a valid link, please notify the webmaster ?

03 Sep 2000, 22:59
/me wonders if their is still going to be a new version......

James, John........PLEASE!, PLEASE KILL THE CSS IN THE TEXT FIELDS AND THE YELLOW SMILIES!!!! NO YELLOW SMILIES!!! :D :mad:

~Chris

03 Sep 2000, 23:11
and not to mention NO YELLOW HOVER LINK ! :D

03 Sep 2000, 23:56
Yep, there will be, however I just got a new motherboard today (Dual PIII!) and I'm messing with it in one of my other boxes. As soon as it gets up and/or running, I'll fix the userlisting! :)

05 Sep 2000, 16:13
I don't know why I didn't see this one earlier! I'll wait for the new version to come out.

07 Sep 2000, 05:30
Still working on it in case anyone cares. Some other board things have been taking 110% of my time and will probably continue to do so for a few weeks. I will get to it as soon as I can! :(

07 Sep 2000, 11:57
I'm still interested.

Parker

08 Sep 2000, 09:36
Me too

08 Sep 2000, 12:34
Yup still waiting.....and I even took the time to send you an e-mail with some bugs :)

~Chris

08 Sep 2000, 12:39
yep very interested still... works wonders on tracking my members hehe

19 Sep 2000, 01:58
so how's this wonderful hack going on the bugs ? my version isn't reporting the threads viewed correctly now that there's more members http://animeboards.net/forums/whoisonline.php3?action=onlineusers ?

08 Oct 2000, 16:53
Almost done!

Expect to have a leaner, meaner script by the end of today! (Hopefully, as long as our database doesn't expload or anything! ;))

13 Oct 2000, 07:08
Looking forward to seeing this script as well.

Is today the lucky day? It is Friday the 13th, after all.

14 Oct 2000, 21:24
i'm watting ...

but i have a good idea

1 - hide everything about hidden user .
2 - add time for logged users .
3 - hide hidden forums and topics .

13 Dec 2000, 09:37
Any word on if a new version of this exists?

15 Dec 2000, 16:36
Thanks It works!

[Edited by Scaramanga_gold on 12-16-2000 at 10:05 AM]

18 Dec 2000, 16:17
im gettin a Error if im trying to click the location of a user if he is currently at the Private Messaging:

Database error in vBulletin: Invalid SQL: SELECT msgid,toid,fromid,title,UNIX_TIMESTAMP(datetime)
AS datetime,iconid,text,signature FROM privatercvdmsgid=11 WHERE msgid= AND fromid=1

mysql error: You have an error in your SQL syntax near '11 WHERE msgid= AND fromid=1'
at line 1
mysql error number: 1064
Date: Monday 18th of December 2000 10:18:59 AM
Script: /private.php?action=show&table=privatercvdmsgid=11
Referer:/whoisonline.php?action=onlineusers

19 Dec 2000, 22:16
It seems that the URLs being generated by whoisonline.php are not working as they should be for me. For example, sometimes the weirdest link is thrown out there. I have a link to a specific thread and it takes me to a reply page for that thread. Or... I have a link to a specific thread and it will look for the domain showthread.php as opposed to the file showthread.php on my domain. Have I done something incorrect?

Please advise.

Thanks,
Cygnus

20 Dec 2000, 12:23
another question. anyone can tell me what do I need to add to see where are the guests ?(guest1,guest2,guest3...)

20 Dec 2000, 21:24
Help?

Cygnus

20 Dec 2000, 22:01
http://www.vbulletin.com/forum/showthread.php?threadid=5007

21 Dec 2000, 04:38
That's great but that doesn't fix my problem and it has added a new one.

I am trying to get one of these links to /forumdisplay.php?forumid=11 and it is taking me to /?forumid=11

The new problem is that the first person listed has no name though they have a location.

For the time being, I am going to pull all of the hrefs out of the code in your hack. I hope that you fix your hack so that it delivers what you said it would. Hacks that don't work are useless. Promises to revise hacks and leaving people hanging for months without so much as a peep on your progress is pretty lame. I don't mean to be a ++++ but as a developer, we already have a shitty enough reputation as slackers that I hate to see that furthered - even if it is among other developers.

Cygnus