PDA

View Full Version : [Release v2] Who's Online


tubedogg
07 May 2001, 06:26
UPDATE: v0.2.2 has been released, fixing the problem of session hashes not always being removed and replaced correctly in the URLs of where people are. It also attempts to fix the problem of members appearing on the list twice, however don't hold your breath on this one.
To upgrade, just reupload online.php to your server.
--------------------------------
Old update: v0.2.1 has been released. If you already have this hack installed and working you DO NOT NEED TO UPGRADE! The only change is I adjusted the instructions to account for an error in the order I had them in. THERE IS NO CHANGE TO THE HACK ITSELF. If you have not gotten this installed and working yet, please download the zip file (online021.zip) and work from that one.
--------------------------------
Old Update: You can now see where guests are on your board. To upgrade, simply download the new zip file, and read the UPGRADE INSTRUCTIONS in the online.txt file.
--------------------------------
Old Update: I fixed a small bug that was making one long string out of the URL :eek: To upgrade, just replace online.php on your server.
--------------------------------
Old Update: I added the missing mysql.php file. :o
--------------------------------

This has been requested many, many times. It produces a page that displays who's online and where they are. You can link to it from anywhere on your board, or make it just for Admins and Moderators (instructions for that included).

Hack version: v0.2.2

For version: vB2 RC2

Files needed: online.php

Files to edit: admin/sessions.php, possibly admin/index.php and mod/index.php

Templates to edit/create: online, online_userbits, online_guestbits, possibly forumhome_loggedinusers

Instructions are included in the zip file.

Feedback wanted. :)
Please do not PM or IM me about this hack. Please post it in this thread. Thanks! :)

eva2000
07 May 2001, 06:28
:cool: i'll let you know how it goes soon :D

nuno
07 May 2001, 06:45
tubedogg
i'm getting this message when going to cp after making changes in sessions.php

There seems to have been a slight problem with the database. Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.

tubedogg
07 May 2001, 06:46
View the source of the page and copy and paste the error here, or copy and paste the email you got from it, please.

Freddie Bingham
07 May 2001, 06:47
I took a quick glance at your work and I don't see where you told anyone to create the location field in the session table :eek:

tubedogg
07 May 2001, 06:51
I think I need to go smack my head against a wall for a while.

Wow. I cannot believe I forgot that. The file is right here, waiting for inclusion.

OK let's back up a step. Anyone who has already done so, please redownload the zip file and make sure you run the mysql.php file included. (See the instructions for more on what do to.)

:o

Thank you, Freddie! :)

nuno
07 May 2001, 07:23
now its working but when i go to online.php in location field i get this url:

http://127.0.0.1/vb2rc2/upload/vb2rc2uploadindex.php

it should be

http://127.0.0.1/vb2rc2/upload/vb2rc2/upload/index.php

tubedogg
07 May 2001, 07:44
nuno, do me a favor and try something. In online.php, find
$location=str_replace("/","",$location);and replace it with
if (strrpos($location,"/")!==false) {
$num = strrpos($location,"/");
$location = substr_replace($location,"/",$num,1);
}
and tell me if that fixes it.

nuno
07 May 2001, 07:52
fixed Kevin
thank you so much ;)

nuno
07 May 2001, 08:15
Kevin its not showing Guests location :confused:
And i need to refresh page to see my location when viewing who's online, if i dont refresh page i get that i'm seeing Board Main page

tubedogg
07 May 2001, 08:20
I hadn't thought about guests...I suppose I could include them. Let me do a little work on it and I'll post the results.

tubedogg
07 May 2001, 08:22
Originally posted by nuno
And i need to refresh page to see my location when viewing who's online, if i dont refresh page i get that i'm seeing Board Main page

That I can't fix. It's the same as when you first surf in, you don't always appear as being online on the list on the front page. In this case it's because your location is updated at the same time the page is prepared, or slightly after (by a few milliseconds). If that's the worst problem the script presents, I think we're doing pretty good, eh? ;)

nuno
07 May 2001, 08:30
That I can't fix :(
ok, np.
Could you please fix it for Guests?
thank you ;)

tubedogg
07 May 2001, 09:25
I updated the zip file above with v0.2.0. You can now see what guests are doing on your board as well.

nuno
07 May 2001, 09:32
Done :)
Thank you Kevin

bokhalifa
07 May 2001, 09:42
Thanks tubedogg for Update:)

nuno
07 May 2001, 09:51
Kevin
something is wrong m8
After modifying sessions.php i run mysql.php and i always get this message:

There seems to have been a slight problem with the database. Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience

Why??

tubedogg
07 May 2001, 09:55
First, you *have* to post the error message itself (view the source of the page and copy that here, or copy the email you should get, here). The message you keep posting is just vB's nice way of presenting the error.

But in this case I have a pretty good idea what your problem is. Are you upgrading? If so, you need to ONLY DO the upgrade instructions in online.txt. If you already installed the hack, running mysql.php will give you an error every time because it's trying to add a column that already exists. If you are upgrading. go back and reread the upgrade instructions in online.txt (it's 3 or 4 lines, that's it).

nuno
07 May 2001, 10:00
i see
i know what you mean
but my problem is that i dont get any emails i dunno why :confused:

nuno
07 May 2001, 10:12
I'd just deleted 3 new templates and run mysql.php and i'm getting same message

tubedogg
07 May 2001, 10:14
Did you read the upgrade instructions in online.txt?

It sounds like you did not. Once again, you cannot rerun mysql.php. It will give you the same error again and again. It has nothing to do with templates.

At this point, recreate the 3 templates, and make sure you have uploaded online.php. It should work then.

bokhalifa
07 May 2001, 10:17
my also i have this error


vBulletin (cp) Database error!

mysql error number: 1054

mysql error: Unknown column 'location' in 'field list'
:confused:

tubedogg
07 May 2001, 10:20
You did not run mysql.php, did you?

You must read the instructions very carefully and make sure you follow them exactly.

nuno
07 May 2001, 10:30
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/user/s/l/b/slb2001/www/online.php(250) : eval()'d code on line 36

tubedogg
07 May 2001, 10:45
I'm not quite sure why you're just getting this error now, but regardless, I have made an adjustment and updated the zip file in the first post. Download it and just reupload online.php from it.

nuno
07 May 2001, 10:58
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/user/s/l/b/slb2001/www/online.php(241) : eval()'d code on line 36

Kevin, i dunno whats wrong, i read upgrade instructions, uploaded latest online.php and that message is all i get

tubedogg
07 May 2001, 11:24
Nuno, I'm really not sure what to tell you.

Can you do me a favor? Rename your online.php file to online.phps on the server. Let me know when you've done this and I'll take a look at it.

nuno
07 May 2001, 11:26
done

tubedogg
07 May 2001, 11:29
Crap...didn't work. Can you email me your online.php file to kevin@tubescan.com ?

nuno
07 May 2001, 11:32
its working now :)
guess what
i switched templates :D
sorry Kevin ;)
Thanks

tubedogg
07 May 2001, 11:34
glad you got it working...i had no idea what was wrong. there was nothing else i could fix! :)

nuno
07 May 2001, 11:38
Kevin one last question:
When i'm seeing a thread or replying to a thread, shouldnt online.php show me exactly that message instead of Browsing Board??

tubedogg
07 May 2001, 11:47
If you are viewing or replying to a thread, yes it should (and did in all my testing). Maybe have someone else go around the board while you look at online.php - you may be seeing that message because you are looking at online.php (although it should be saying Viewing Who's Online then anyway...).

fruitsalad
07 May 2001, 12:39
works wonderfully

any thoughts on how i can get it to work with non-vb pages which i have required global.php
at the moment it just says browsing the board for people on the non vb pages.

tubedogg
07 May 2001, 13:00
My system is very, very crude. It doesn't actually figure out which page the person is on, it just looks for clues in the file name (e.g. if the filename is memberlist.php, they must be looking at the memberlist, etc.). If you look through the online.php, you'll see the different places I've planned for, and you'll also see where it defaults to "Browsing Board".

One thought that just came to me is you could make a list of all the vB files. From that list, remove any that I've accounted for already in the script. Then, do a big if(strpos()===false) statement with all of those names. If it's none of those names, then they're not browsing the board. However, this is also awkward. You might also try following the "clue-and-result" system. If they're looking at a page called "mail" with the variables "send=yes" then they're sending mail. That kind of thing.

Someday I'll figure out a better way to do this. :) Just not today.

fruitsalad
07 May 2001, 13:37
oh dats cool..


i already felt lost looking at the code, what you just said confused me more lol

when i had this working for vB 1.1x they actually wrote the url to the location field if i remember correctly.

Freddie Bingham
07 May 2001, 15:31
Kevin did this hack in the same style that the hack for 1.1.x was done.

JJR512
07 May 2001, 22:23
Tubedogg, I'm looking forward to getting this hack on my site...except I can't, I'm having a little trouble. I've modified sessions.php as prescribed, and I've uploaded that file, mysql.php and online.php, again as per the instructions. However, when I try the next step, running mysql.php, I get an error message.

This is the meat of the error:
<!-- Database error in vBulletin Control Panel: Invalid SQL: INSERT INTO session (sessionhash,userid,host,useragent,lastactivity,location) VALUES ('a70bf25218fcc096dc225ee88971d1c9','384','63.208.191.85','Mozilla/4.0 (compatible; MSIE 6.0b; Windows NT 5.0','','989269645')
mysql error: Unknown column 'location' in 'field list'
mysql error number: 1054
Date: Monday 07th of May 2001 05:07:25 PM
Script: /forums/admin/mysql.php
Referer:
-->

Any suggestions/ideas/etc.? You can hit me on ICQ if you want.

Dioxin
07 May 2001, 22:34
very very nice hack :D

thanx a lot from germany, but i have one problem:

some links in my online.php page look like this:

http://www.aktienboard.com/vb/showthread.php?postid=20348#post20348post20348post20348

i think this is a bug. this link contains the string "post20348" three times...

perhaps you forgot to initialize a variable?? i could not resolve the bug...perhaps you have an idea.. thanx a lot

greets, dioxin!! :)

the link: http://www.aktienboard.com/vb/online.php

fruitsalad
08 May 2001, 01:02
Originally posted by JJR512
Tubedogg, I'm looking forward to getting this hack on my site...except I can't, I'm having a little trouble. I've modified sessions.php as prescribed, and I've uploaded that file, mysql.php and online.php, again as per the instructions. However, when I try the next step, running mysql.php, I get an error message.

This is the meat of the error:


Any suggestions/ideas/etc.? You can hit me on ICQ if you want.

I had that problem when trying to run mysql.php too. I just opened it and cut and paste the command in that file to phpmyadmin and created the location field from there.

tubedogg
08 May 2001, 02:16
I should have seen this one coming. The problem is sessions.php is already modified to look for the location field, and not finding it, it errors out when running mysql.php. I have revised the directions to account for this.

JJR, can you run that query via Telnet or phpMyAdmin? That should solve your problem. Just continue with the instructions from there (go to your Admin CP and create the templates).

Everyone else, please redownload the zip file (if you have already downloaded it) and make sure your instructions say "v0.2.1" at the top. Those are the updated instructions.

nuno
08 May 2001, 02:53
Thank you Kevinhttps://www.vbulletin.org/forum/

tubedogg
08 May 2001, 02:57
Originally posted by Dioxin
some links in my online.php page look like this:
http://www.aktienboard.com/vb/showthread.php?postid=20348#post20348post20348post20348

Is this happening for just logged-in members, just guests, or both? I mean, in the list, are the members with the triple repeated post number members, guests, or both?

nuno
08 May 2001, 03:04
Originally posted by tubedogg


That I can't fix. It's the same as when you first surf in, you don't always appear as being online on the list on the front page. In this case it's because your location is updated at the same time the page is prepared, or slightly after (by a few milliseconds). If that's the worst problem the script presents, I think we're doing pretty good, eh? ;)

Kevin, would it be possible to fix this by doing an automatically refresh when users see online.php?

Dioxin
08 May 2001, 10:09
Originally posted by tubedogg


Is this happening for just logged-in members, just guests, or both? I mean, in the list, are the members with the triple repeated post number members, guests, or both?

mhmm, strange. i looked at the script this morning and now it seems to generate correct links. sorry for my bug report.

but i have another problem:

the session variable in each link is different. i think it's a better way to change the variable to the viewers session-id, or??

another enhancement idea: include a profile link in the name and make a pm link nearby, perhaps an icon or so...

just ideas :) greets dioxin

Mas*Mind
08 May 2001, 14:25
Great hack tubedogg :)

It would be great if vb would officially support the location field again in 2.0 so that we don't have to edit sessions.php everytime we upgrade.

JJR512
08 May 2001, 18:41
Thanks tubedogg. Since I had to use the non-edited original version of sessions.php as long as I couldn't get mysql.php to work, basically the hack was not installed at all. So I just downloaded your new version and installed it as per the new instructions, and it worked fine. Thanks!

furious
08 May 2001, 19:42
very nice hack :)
but sometimes when i click on the link for a thread on the who's online page i get this error message :

Fatal error: Unable to open showthread.php in Unknown on line 0


do you know why?

tubedogg
08 May 2001, 22:50
Originally posted by insdel
After installing this hack the loggedin members are no properly shown any more (as you can see in the pic I've attached)
Only after refreshing the page some 3 times it works.
Any suggestions?

This should not affect that at all. If you are the only user on the board, you may not show up on the list at first. If it shows more than one member, but they are not showing up on the list, then you may indeed have a problem but I really don't see how this could affect it.

tubedogg
08 May 2001, 22:56
Originally posted by furious
but sometimes when i click on the link for a thread on the who's online page i get this error message :

Fatal error: Unable to open showthread.php in Unknown on line 0

This is a problem with your server's PHP. It means for whatever reason it decided to take a break. ;) But seriously, unknown at line 0 isn't anything to do with my hack, and it's nothing that can really be fixed in terms of the scripts.

Hooper
08 May 2001, 23:03
Anyone have this up and running correctly? Please post your sites. Ben working on a server move, glad to see this one.
If I missed a working site forgive me.

tubedogg
08 May 2001, 23:05
JJR has it up and running.

http://www.jjr512.com/forums/online.php

Hooper
08 May 2001, 23:26
Oh Me Gosh Tubbey,


I beta tested the heck out of Borgs WOL before the purchase of vB. I am so grateful. Cannot wait to get that installed looks great.


Thanks for the hard work.
Hooper

fruitsalad
09 May 2001, 01:39
Originally posted by insdel
After installing this hack the loggedin members are no properly shown any more (as you can see in the pic I've attached)
Only after refreshing the page some 3 times it works.
Any suggestions?

insDEL

I had this same problem, so i've removed this hack for the meantime. it was doing funny things with my sessions and logged in users.

has anyone tried this on a very busy forum?

out of curiosity i took a look at jjr's implementation and noticed the same discrepancies which i was noticing. please see attached file. I suspect the session table is not being updated properly??

Hooper
09 May 2001, 01:41
ok....... We're back to waiting.:eek:

tubedogg
09 May 2001, 02:09
fruitsalad: Are you missing members from the list on the main page, or are you noticing the members appearing multiple times on the Who's Online page? Those would be two different problems. The first has nothing to do with my hack, I'm quite sure, as it does not have any control over the main listing.

The second thing I'm working on. I don't understand how it happens because it should be selecting distinct records from the DB based on the userid, meaning pull one record per time it sees a particular number...I'll see what I can do.

Mas*Mind
09 May 2001, 02:28
just a question:

What kind of events will be listed? Eg: Will 'user is replying on thread 'bla'' also be listed etc..?

tubedogg
09 May 2001, 02:30
Good question :) I should probably have given a list anyway. Let me put one together and I'll post it.

tubedogg
09 May 2001, 02:48
If they are on this page This list will say this
newthread.php User is starting a new thread in forumtitle forum
showthread.php
--Using a post # Viewing post #n in thread threadtitle
--Using a post # that has a title Viewing post posttitle (post #n) in thread threadtitle
--Without a post number Viewing thread threadtitle
forumdisplay.php Viewing forumtitle forum
online.php Viewing Who's Online
index.php Viewing the Main Page
newreply.php Posting a reply to threadtitle
editing a post Editing their post in thread threadtitle
search.php?action=showresults Viewing search results
search.php Using Search
memberlist Viewing the Memberlist
calender.php Viewing the calendar
misc.php?action=faq Viewing the FAQ
usercp.php In their User CP
private.php or private2.php Viewing private messages
anywhere else Browsing Board

This only applies to members listed. Guests listed are basically the same, except without the members-only functions (replying, etc.)

fruitsalad
09 May 2001, 06:21
Originally posted by tubedogg
fruitsalad: Are you missing members from the list on the main page, or are you noticing the members appearing multiple times on the Who's Online page? Those would be two different problems. The first has nothing to do with my hack, I'm quite sure, as it does not have any control over the main listing.

The second thing I'm working on. I don't understand how it happens because it should be selecting distinct records from the DB based on the userid, meaning pull one record per time it sees a particular number...I'll see what I can do.

I cant say for sure, cos my board is not that busy, but with the edited sessions.php running my board always said 0 members, 0 guests when i first logged in to the main page. it was only refreshing it that i would then be able to see myself.

However i opened up and browed the sessions table in phpmyadmin and there are alot more sessions recorded in that table than are showing on the board. but i dont think this was related to your script issit? the sessions table didnt seem to be updating.

as for the problems i witnessed first hand. My guest count was always zero and also the problem of more than 1 entry for the members on the who's online page as on the screenshot of jjr page i included earlier

Hooper
09 May 2001, 21:22
Hey Tube,

Is this hack ready then.... Looks like the above errors were installation errors. Any reason not to install this yet?

Thank You,
Hooper

furious
10 May 2001, 02:17
Originally posted by tubedogg


This is a problem with your server's PHP. It means for whatever reason it decided to take a break. ;) But seriously, unknown at line 0 isn't anything to do with my hack, and it's nothing that can really be fixed in terms of the scripts.

k :)
nice hack, big brother is watching you ;)

Hooper
11 May 2001, 17:54
Tube,

I've installed RC3 and your WOL hack. It works fantastic. I am real happy to have this one. If you would like to see it let me know. I have access blocked at this point.

Thank You,
Great work.
Hooper

Hooper
13 May 2001, 03:09
OOps,

Spoke to soon.

I am having problems. I need help with WOL. Each time you log in with one browser session, you close without logging off, go back and you are still logged in. (disabled in cp auto log cookie). If you log in again it shows 2 of you and so on. Then you cannot log out of the session you closed out. I have had 2 of myself on at one time. and a guest that was also me.

If you use just one browser session, login, log out, it works fine.

I reinstalled the hack and had the same thing. I did notice that there was a new string added to the sessions in RC3, or at least the line numbering changed since RC2.

on 111 $DB_site->query("UPDATE session SET lastactivity=".time()."$styleup WHERE sessionhash='".addslashes($session['sessionhash'])."'");

This one was not mentioned in your instructions. I didn't know if maybe this had something to do with it or not.

Something else is that you have to refresh to see WOL. If you don't hit refresh, everyone is viewing main page.


Any help appreciated.
Hooper

tubedogg
13 May 2001, 03:13
Hooper, you know the drill. I'm gonna need more info than "I'm having problems".

Hooper
13 May 2001, 03:18
I was just making sure the posting was working. It didn't work for me all day. I was having IP probs. That's fixed now so if I coould only get this working. :(

Anyhow I was adding to the above when you posted response.
Look above please.

Thanks Tube,
Hooper

tubedogg
13 May 2001, 08:10
Hooper, try this.

In online.php, find
$loggedins=$DB_site->query("SELECT DISTINCT session.userid,username,invisible,location
FROM session
LEFT JOIN user ON (user.userid=session.userid)
WHERE session.userid>0 AND session.lastactivity>$datecut
ORDER BY invisible, username");
Replace it with
$loggedins=$DB_site->query("SELECT DISTINCT username,session.userid,invisible,location FROM session
LEFT JOIN user ON (user.userid=session.userid)
WHERE session.userid>0 AND session.lastactivity>$datecut
ORDER BY invisible, username");

Hooper
13 May 2001, 08:15
I'm up. I'll go try this.......zoooom..

Hooper
13 May 2001, 08:25
Still the same thing... I'm not sure what to do. I go to the forums and it always shows that there is guest from the get go. Then if I log in and out I'm back to guest as should be. But if I close the browser and come back in, I am a guest, a member, etc..
Now If I log in and out It straightens up somewhat in the forums, but when I go to the show where online I am in there twice as the administrator.

I'm all for you checking this out for yourself so you can see first hand what it is doing. Everything else seems to work. If you decide you would like to see this let me know and set a time in here so I can turn off .htaccess. Or you could give me your IP and I'll add you to the user list.

This hack is going to work if it kills me. ;)


Hooper;)

Mitrofan
14 May 2001, 03:03
If I'm not mistaken the session table is HEAP type, meaning that it's completely in RAM, and is lost when mySQL server is shutdown

Does this mean that I will have to run the mysql sctipt included in this hack every time after I restart mySQL database?

Hooper
14 May 2001, 03:20
My server move and restore from a CP backup is totally trashed.
This was my answer.
Thank You,

Mitrofan
14 May 2001, 03:26
Do you think it had something to do with this hack?

I don't do cp backups, I only do it from telnet, either mysqldump or complete copy of forum database.

I just installed this hack and it seems to be working so far, I hope there will be a new version with more intelligent way to guess what users are doing, and to also I would like the way to split the output into several pages because my board usually has over 140 members/guests and the who's online page gets really long.

Just a suggestion.

I also using this hack together with the first who's online hack which I am using to display the number of users online on non-vb page and then have a link to this new script for more info on users online.

tubedogg
14 May 2001, 03:26
Originally posted by Mitrofan
If I'm not mistaken the session table is HEAP type, meaning that it's completely in RAM, and is lost when mySQL server is shutdown

Does this mean that I will have to run the mysql sctipt included in this hack every time after I restart mySQL database?

Yes. The trick is to not shut down the MySQL server. ;)

Mitrofan
14 May 2001, 03:36
It's a good thing I asked. I shut down the server often before backing up and when running myisamchk

The other way around it would be to change the session table type to MYISAM, this way the changes will not be lost. This is what it used to be before they changed it to HEAP some versions back.

There must be a way to edit some other script to make the session table created the way it should for this hack to word.

Please look into that.

Tubedogg, will you be adding more features to this hack soon?

Also please respond to my question for you in the other who's online hack" thread.

Thanks.

I do have both of your hacks working now.

tubedogg
14 May 2001, 03:46
I'm not sure exactly what changes I could make so that shutting it down wouldn't affect it. I'm currently looking into it though.

As for other features, I'm not sure exactly what you'd want. Some ideas would help. :)

Mitrofan
14 May 2001, 14:40
One nice feature I would really like to see is to link the names of users online to their profile.

I think it a must have!

Other than that the hack is great, and together with the first who's online it's exactly what I was looking to add to my site.

I also removed the part that shows what guests are doing because on my board it is not uncommon to have over 150 (I have 170 guests right now) guests at a time and the list gets really long.

Also I read in your previous post about the idea to add more intelligence to the hack as far as guessing what users are doing.

tubedogg
14 May 2001, 16:36
[QUOTE]Originally posted by Mitrofan
I also removed the part that shows what guests are doing because on my board it is not uncommon to have over 150 (I have 170 guests right now) guests at a time and the list gets really long.[QUOTE]

To me that completely defeats the point of the hack. If you just want a list of who's online then there is a list on the main page (the names are linked to their profiles). The whole point of this hack is to provide info about where they are.

Mitrofan
14 May 2001, 16:47
I only removed the part for guests

I still have the part that shows what members are doing.

Right now I have 68 members and 280 guests on my board. Imagine how long the list of who's online would be if I show what guests are doing in addition to what members are doing.

Still, how about linking the usernames to their profiles?

tubedogg
15 May 2001, 08:24
Sorry misread your first post.

Looking into it.

kesha1
16 May 2001, 14:46
I have to confess:
I'm the one who emailed you twice list night about the IP and stuff.
And as if it was not enough :) I'm writing here as well :)

Firs of all - THANK YOU KEVIN, nice job!

Second: I'm comparing how it works with the one from UBB, and couple of things look ...different.
Whole thing is working a little slow: you can try these experiments: close all your browsers after being on WOL page, and go back to that page, - the chances are - you'll see your self printed twice there.
Close your browser again (or just click quickly to different parts of the forum, or open cp and change smtn) and most likely you'll see your self 3 times being printed there, e.t.c.
I've had 5 instances of my self on that WOL page , and it showed that I was at different pages at the same time.
Third: If you are inactive for a while and then click on refresh, you might find that there's nobody on (even you are not there).
My question is: has anyone else observe this kind of problems?
Thank you.

Mitrofan
16 May 2001, 14:53
Its normal to see some people more than once in whose online and it was not intended to be a exact real-time statistics of where the users are.

If you don't log-out, the session table has no way of updating itself.

If you don't logout and just close the browser, you still going to be listed in users online on forum home page for the duration of the time-out set in admin CP

The same with who's online, if user closed the browser, then comes back to forum it will list him twice for some time untill his first session times out.

There must be the way to improve this hack to only show the latest session info for the user.

I think this hack needs at least one or two more improvement, Kevin knows what it is.

tubedogg
16 May 2001, 14:54
Unfortunately I'm not entirely sure how to fix this. I'm already pulling the records as distinct from the session table, so it should only pull one record per userid.

The other thing you mentioned,
If you are inactive for a while and then click on refresh, you might find that there's nobody on
this can happen if you are inactive for 15 minutes (or however long the cookie timeout is set in the Admin CP) and then refresh the page. Your session has expired and when your refresh the page, it creates a new session for you, however it happens while the page is loading so it won't find that session and display it. That also applies to the other things you mentioned (being seen as other places). This does not apply to the problem of appearing multiple times.

I'll keep looking into it.

tubedogg
16 May 2001, 15:06
I have released the latest version (v0.2.2) of Who's Online. You can download it from the first post in this thread. To upgrade, just reupload online.php to your server.

kesha1
17 May 2001, 06:22
It's me again, your critic :)
No, actually I'm your admierer. I just want this thing to work perfectly, therefor I think I'm helpful.
BTW, thank you very much for your email, I think you are an exceptionally nice guy.
Another problem: If you leave the Who's Online window open and your IP (I think this is the reason) changes, because of re-connecting a dile-up, for example,
refreshing of the page will show that you are not there.
It is kinda important for me, and I hope there is a solution to that.
Thank you in advance.

Hooper
17 May 2001, 09:41
Not sure if anyone is interested, but I've installed a javascript that will allow for manual and automatic page refresh that can be set to a certain number of seconds. This pretty much solves the refresh as far as I'm concerned. Not that most people wouldn't refresh by their browser anyhow, but.....some won't.

http://www.gimmetech.com/wol.gif

Javascript Code: for auto refresh..

<head>
<title></title>
<script language="JavaScript">
<!--

var sURL = unescape(window.location.pathname);

function doLoad()
{

setTimeout( "refresh()", 60*1000 );
}

function refresh()
{

window.location.href = sURL;
}
//-->
</script>

<script language="JavaScript1.1">
<!--
function refresh()
{

window.location.replace( sURL );
}
//-->
</script>

<script language="JavaScript1.2">
<!--
function refresh()
{

window.location.reload( false );
}
//-->
</script>
</head>
<body onload="doLoad()">
</body>
</html>

Javascript code for manual refresh:..

<html>
<head>
<script language="JavaScript">

var sURL = unescape(window.location.pathname);

function refresh()
{
window.location.href = sURL;
}
//-->
</script>

<script language="JavaScript1.1">
<!--
function refresh()
{
window.location.replace( sURL );
}
//-->
</script>

<script language="JavaScript1.2">
<!--
function refresh()
{
window.location.reload( false );
}
//-->
</script>
</head>

<body>

<p><a href="javascript:refresh()"><img src="images/wolbutton.gif" border="0"
align="middle" width="71" height="70"></a>image as a button</p>

</body>
</html>


I have both manual and auto installed. Both work fine together. I would install the auto above the manual in the header. And of course be sure to put everything in its proper place.
This is installed in the online template. Also I wouldn't advise installing a metatag refresh. These can cause problems. ;)

If you decide to use this for your WOL and have problems with it, PM me instead of posting in here unless Kevin states otherwise. ;)

SeeYa....

kesha1
17 May 2001, 16:04
Very helpful script,
Thanks a lot

kesha1
17 May 2001, 16:21
As far as I've noticed, the visitors are not doubled in the small table version of Who's Online in a front page.
I don't really know how it's done, but hope this observation might help.

tubedogg
17 May 2001, 16:34
Kesha: Yes, that's why I'm at such a loss. The code that pulls the records from the database is basically identical to the code that is used on the front page. I'm going to continue trying various things. Hopefully I'll get it worked out soon.

kesha1
18 May 2001, 11:32
2 things:
1. The IP displayed in Who's Online is the one that belongs to the person who's looking at it. All the users have the same IP. So, I believe that variable $ipaddress is not the one that should be used there.
2. How can I change the title underneath the boards name from Who's Online to Who's On or Who's Alive, and place a pic to the right from it.
Thank you in advance

Mas*Mind
22 May 2001, 00:46
Couple of 'bugs'

1) I'm still listed twice

2) Some links are displayed as: Viewing post #128099#post128099 in thread "Dudek bedankt" and the url is then:

htp://feyenoord.messagebase.nl/showthread.php?postid=128099#post128099post128099post128099

(with http instead of htp ofcourse, otherwise he wouldn't printed the whole url)

Mas*Mind
22 May 2001, 01:19
I think that the users are listed twice (or multiple's) because you now also select the location...

When you have 2 sessions from the same user now everything will be the same (session.userid,username,invisible) except for the location...

So DISTINCT doesn't work then, because he 'sees' those 2 records as two different ones because of the locationfield...

There could be a workaround on this...Make an array or something; New record -> userid allready in the array? skip it...otherwise -> add userid to array -> list user

Only troubles would be with guests then...or you can check on the ipaddress if (s)he's allready listed

c-pr0mpt
23 May 2001, 08:28
Hi. I installed this hack today and my prob is that when someone comes on, they pop on whos online quickly. But when they leave the site it takes around 15 minutes before it knows they left.

How can I fix this?

c-pr0mpt
23 May 2001, 09:04
I lowered my cookie timeout to 60 seconds to "cover up" this problem. But I would really appreciate a true fix to this problem.

tubedogg
23 May 2001, 12:23
This is the exact same way the Who's Online on the front page of your forums works, and there's no way around it unless you leave your cookie timeout at a very low number (which I would not suggest). Hence, there's really no "fix", although I don't consider it a problem.

c-pr0mpt
23 May 2001, 19:09
How come normally it works though? Before I did this, it worked right a way. Is there anything I may have accidentally done, that would make it take so long?

Thanks for advice on Cookie Timeout. I will put it back at a higher number.

eva2000
24 May 2001, 20:28
just installed this and found there are two instances of this found in sessions.php



Around line 237, find
$DB_site->query("UPDATE session SET lastactivity=".time()."$styleup WHERE sessionhash='".addslashes($session['sessionhash'])."'");
and replace it with
$DB_site->query("UPDATE session SET lastactivity=".time().",location='".addslashes($scriptpath)."'$styleup WHERE sessionhash='".addslashes($session['sessionhash'])."'");



i replaced both any problems with that ?

Hooper
24 May 2001, 20:56
Maybe what Eva posted above is the problem. :cool:

eva2000
24 May 2001, 20:59
Originally posted by Hooper
Maybe what Eva posted above is the problem. :cool: maybe but i'm a bit confused as to what the exact problem is hehe

tubedogg
24 May 2001, 23:01
Sorry, in that other thread I meant what line number...but anyway actually you should be putting it in both places - the first one should be covered by finding line 195 and the second line 237. :)

Hooper
24 May 2001, 23:09
Ok, I have this correct then.

Thanks Kevin.

eva2000
24 May 2001, 23:34
Originally posted by tubedogg
Sorry, in that other thread I meant what line number...but anyway actually you should be putting it in both places - the first one should be covered by finding line 195 and the second line 237. :) great :) although it still shows username more than once

Hooper
25 May 2001, 00:34
Originally posted by eva2000
great :) although it still shows username more than once

Eva,

Not that it takes much, but you are confusing the heck out of me.
:D

catocom
25 May 2001, 07:39
well I think I installed everything right...
I'm double checking now.
I don't get any error messages, and the board
seems the same.
I'm doing the admin viewing only option.
When I click the link in cp it says loading for a minute,
then it's done, but there is nothing there.

Got any ideas???

oh yeah I've also got several styles.
do I have to put the new templates in all of them?

eva2000
25 May 2001, 07:53
Originally posted by Hooper


Eva,

Not that it takes much, but you are confusing the heck out of me.
:D don't worry get use to it :D

i did notice when i first visited my forum for today i couldn't see my own username on the forumhome current active user list could of been my eyes playing with me or an effect of this hack ?

Hooper
25 May 2001, 07:58
I haven't got it to work correctly either. Still a detail or two to work out I believe. I'm having the same situations as you.

Do like it though. Shouldn't be to much to fix for the Kevin the Hack Pro. ;)

catocom
25 May 2001, 08:08
oh I almost forgot
I made a mod to this line

<a href="../online.php?s=<?php echo $session[sessionhash]; ?>&action=move"> View Online Users </a>

I took out the ../
if I put it in it does give an error that says
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:


I've got it in this way now, since it was the original.

I have double checked everyting and it is as it should be
according to the instructions.
also I was doing a new install.

catocom
25 May 2001, 16:52
Geezus
I can't believe I did that !

LOL
I put the online.php in the admin dir insted of the root.

Works like a charm now :D

eva2000
27 May 2001, 09:18
had to remove the hack seems my Current Active User figure get's misreported and even myself don't show up on the list until i browse around my forum for a while and refresh the main page...

i have 59 sessions via phpmyadmin but only 17 members/guests showed up

Hooper
27 May 2001, 09:28
Hope this one gets figured out soooon.... This is my all time favorite hack. :D

max
27 May 2001, 21:05
Is there a way to make this online.php file show the # or members/posts/threads too?

Freddie Bingham
27 May 2001, 21:14
The session table is updated at the completion of a page output so if you go to index.php as the first page of your visit you will not see yourself until you refresh.

catocom
28 May 2001, 01:03
Originally posted by max
Is there a way to make this online.php file show the # or members/posts/threads too?

Yeah That would be nice.

max
28 May 2001, 05:49
Originally posted by max
Is there a way to make this online.php file show the # or members/posts/threads too?

This post here solved most of my problems and answered the questions I had on this topic: http://www.vbulletin.com/forum/showthread.php?threadid=2658

Thanks alot to eva2000 and TechTalk :D

The only other thing I wanted to know, is to get a separate page to show all Online Members, and where exactly they are browsing. To have it looking sort of like this:

Screenshot http://www.studenten-city.de/stf/pmstats.jpg

I don't know if this hack Online hack can do something like this, or would it be another separate hack?

tubedogg
28 May 2001, 17:25
That's what this hack does...?

Hooper
28 May 2001, 17:29
Wow, check it out TubeDogg is a Moderator. Congrats Tube.:D

max
28 May 2001, 18:00
Originally posted by tubedogg
That's what this hack does...?

tubedogg, but it's not formatted anyway.. it just displays this info in the wide open unless you <include> it someplace..

and it also doesn't show you where they're browsing exactly, which i'm not sure if this hack can do..

Actually, let me show you exactly what I mean:

Click here to see the perfect example (http://www.examnotes.net/forums/online2.php)

catocom
28 May 2001, 21:48
Oh
in that case I retract my earlier statement. :D

I meant something like the
members page + online + some stats + ip addys....
like a sizable spread sheet that you could see everything
at once, with maybe the buttons like are in the members page,
but only show all this for the members that are online,
and have a button like the pm that would popup a
windows just like pm, but work like icq.

Now is that asking for the world or what...:D

daydreamer
01 Jun 2001, 01:32
Hello,

After carefully following the instructions, I get the following error:

Warning: Variable $loggedins is not an array or string in /home/noc/dre-www/board/online.php3 on line 29

Parse error: parse error in /home/noc/dre-www/board/online.php3 on line 44

Thanks
dd

daydreamer
01 Jun 2001, 13:33
:( Anyone? :(

Hooper
01 Jun 2001, 21:20
Did you backup your sessions.php? If you did you may opt to rename the hacked sessions.php and put your backed up sessions back on the server. If you don't get the error, then you need to go through your hack or rehack.

;)

daydreamer
01 Jun 2001, 21:44
Hooper,
Thanks for the reply!
I should have given more info. I get the error when calling "online.php3".

This is my first hack on the script so my default sessions.php3 file will work. I am usually pretty good at hacking Java so I was very careful in editing the sessions file. I even started from scratch several times and still get the errors.:(

Maybe there is someone that can email me a stock sessions with only this hack.:D randy@dreamsweb.net

From what you are saying, I have messed something up in the sessions file. hmmm

Thanks for your time...

dd

Hooper
01 Jun 2001, 21:48
Originally posted by daydreamer
Hooper,
Thanks for the reply!
I should have given more info. I get the error when calling "online.php3".

This is my first hack on the script so my default sessions.php3 file will work. I am usually pretty good at hacking Java so I was very careful in editing the sessions file. I even started from scratch several times and still get the errors.:(

Maybe there is someone that can email me a stock sessions with only this hack.:D randy@dreamsweb.net

From what you are saying, I have messed something up in the sessions file. hmmm

Thanks for your time...

dd

Welcome,
Something else you might try is renaming your .php3 extensions to just .php. Then try calling something from the browser.

It's against your vBulletin license agreement to hand out code, hacked or not. That is out of the question. Sorry.

daydreamer
01 Jun 2001, 21:52
They have to be .php3 on this server...

Hooper
01 Jun 2001, 22:00
Originally posted by daydreamer
They have to be .php3 on this server...

This very well may be true. Some do some don't . I have .php4 installed and can use .php,.php3,.etc... I would try it anyhow. Unless of course you would have to rename all of your files. I would suppose this would be the case. If you are sure your hacking is up to par, the only suggestions are what I mentioned. You do need to make sure that you are hacking correctly or you will most definitley get errors. At this time, the WOL hack's line numbers do not match up with the code changes. The changes are 5 or 6 lines down. Make sure you are modifying by code and this bit of info and not by exact line number. If I remember correctly, the only file that gets modified is the sessions.php. You may try your original sessions.php as I mentioned and see if your forums work again, if they do, your problem is in your hacking.

Btw, I have PHP4 installed and use just the .php extension.

daydreamer
01 Jun 2001, 23:36
Yea but with my server if you use .php, it will show the code.
I get the exact same error with the default sessions uploaded. I'm thinking it's in the online.php3 file.:confused:

You can take a look at them at the following links. Maybe someone could take a look at them for me.:D

www.dreamsweb.net/php/sessions.php
www.dreamsweb.net/php/online.php


Thanks
dd

Hooper
01 Jun 2001, 23:50
This is what I recommend. First get your forums working properly. Without any hacks. Then backup the files you are going to hack. Then Hack. You should always be able to go back to the working version without the hack within a matter of seconds. The online.php3 file should not keep your forums from working as far as I know. I would suggest you back track and re hack. If this doesn't work after you attempt another hack installation from fresh working vBulliten files, then post again and maybe TubeDogg will come up with some ideas for you.

Best Wishes,

daydreamer
02 Jun 2001, 00:19
Thanks for your time Hooper.

The forum continues to work fine, just the Who's Online doesn't.

Thanks again....

dd

ThomasP
02 Jun 2001, 17:01
Hi there,

I get the following error when browsing the online.php on my server:


Warning: Variable $loggedins is not an array or string in /home/usr/(...)/forum/online.php on line 29

Parse error: parse error in /home/usr/(...)/forum/online.php on line 44

I tried to redo my steps several times - w/o repeating the mysql insert, phpMyAdmin shows me the new 'location' bit in the db, so this seems to be okay...

Templates are there, online.php is in /forum, session in /admin...

Am a little bit in the wild in the moment :rolleyes:
Any hints?
Thanks,
-Tom

ThomasP
03 Jun 2001, 11:29
Hmmm, I can't figure it out :(

Maybe it's because I'm using PHP3 on the server ?
thx,
-Tom

daydreamer
03 Jun 2001, 12:03
Tom,

I am having the exact same problem you are. And have been waiting for a reply now for days. I think there is something wrong with the online file???

Please let me know if you figure it out.

PS. I've been to Munich and I love Germany...

ThomasP
03 Jun 2001, 14:58
Hi daydreamer :)

I just compared my files with yours, they are identical as far as I can see... sorry, I'm lost.

@tubedog: Does it possibly has something to do with php3?

greetings from Munich ;)
-Tom

P.S.: Unfortunately we have not the best weather at the moment, but maybe in some days will be the right weather for the beergarden :D

daydreamer
03 Jun 2001, 15:30
Thomas,

I have been messing with the online file and found only three instantses(sp?) of $loggedins, the rest were $loggedin. So, I renamed them $loggedin. That got rid of the first error.

Now if we could figure put what a parse error is... :confused:

dd

Hooper
03 Jun 2001, 15:35
Originally posted by daydreamer
Thomas,

I guess the $160 didn't include support :(

I have been messing with the online file and found only three instantses(sp?) of $loggedins, the rest were $loggedin. So, I renamed them $loggedin. That got rid of the first error.

Now if we could figure put what a parse error is... :confused:

dd

DayDreamer,

Not to be disrespectful in any way but we are talking about a hack here. Not vBulletin. You will need to have patience. TubeDogg as well as others program these hacks for us but he and the others also moderate the forums. He is a very busy guy and I'm sure he is doing the best he can. The Hacks are "free for you to try" and there is never a guarantee that they will work in any way shape or form. Most hacks are in a perpetual state of developement. They are not part of vBulletin or the vBulletin program nor are they supported as such by vBulletin. The $160.00 you paid does include support. If you have a problem with the vBulletin program, please post in the appropriate forum.
Although TubeDogg tries to answer questions and support his addons, it may take a day or two to get a response. If I could have helped you I would. I didn't have the answer. There very well could be a situation with the .php3 extension but I just don't know what it would be other than maybe a path statement being incorrect somewhere. But I assure you, set aside a few small items that could be improved, this script hack does indeed work.
I don't know if anything else was mentioned on it, you may go back and read the entire thread.

daydreamer
03 Jun 2001, 15:45
Hooper,

You are so right... and I do apologize :)

It's been a late night and a early morning here.

Thank you Hooper for showing me the error of my ways. :(

dd

Freddie Bingham
04 Jun 2001, 18:53
In my research for creating the official version of this for v2.1 (or perhaps even an earlier version if I get it finished soon) I have found that this is the query you need if you want to only have the latest entry for each user. That being said this query is not very nice and I will let you know that I have found others way to achieve what I need without using this resource hog:$users = $DB_site->query("SELECT s1.userid, username, s1.location, s1.host, invisible
FROM session s1, session s2, user
WHERE s1.userid = s2.userid AND user.userid = s1.userid
GROUP BY s1.userid, s1.lastactivity
HAVING Max(s1.lastactivity) = Max(s2.lastactivity)
ORDER BY username
")Remember you can not grab the guests with this since the GROUP BY would compact them all into one record. You have to use a second query to get them. Just something for you to play around if you want the easiest way to squash multiple users, though not the most efficient way.

daydreamer
04 Jun 2001, 21:38
Hello,

After carefully following the instructions, I get the following error:

Warning: Variable $loggedins is not an array or string in /home/noc/dre-www/board/online.php3 on line 29

Parse error: parse error in /home/noc/dre-www/board/online.php3 on line 44

Thanks
dd

tubedogg
05 Jun 2001, 02:43
Just so everyone knows I haven't died and I'm not ignoring you, I'll post a little update.

Thanks, Freddie, for the point in the right direction. :)

For those of you getting parse errors, I'm working on it. Not sure why as it's still running cleanly on my server, might have something to do with php3.

webhost
05 Jun 2001, 14:29
Is there a board somewhere that I can see this hack in action?


Joey

Johnny
05 Jun 2001, 15:13
in the template forumhome_loggedinusers i can't find this: <b>Currently Active Users</b>

in my template i well can find this: <b>Currently Active Users: $totalonline</b>

but this is not the same i guess..
what can i do....??

help me!

johnny

janw
05 Jun 2001, 15:15
You use a newer version of Vbulletin. This hack is based on RC2

catocom
05 Jun 2001, 15:54
I'm trying to reset everything to get rid of the
hack on mine, because it says there are x amount
of users online, but doesn't show all the names on the
main index page anymore.

I've restored all the original files but it still does it

How do I set MySQL back yo the way it was???

ThomasP
05 Jun 2001, 17:55
Thanks tubedogg, that sounds great,
thank you for your support! :)
-Tom

tubedogg
05 Jun 2001, 18:22
Originally posted by catocom
How do I set MySQL back yo the way it was???

Run this query:

ALTER session DROP location;

and it should be back to normal.

Johnny
05 Jun 2001, 18:22
Originally posted by janw
You use a newer version of Vbulletin. This hack is based on RC2

but how must i place than the code?
can someone maybe post or pm me his forumhome_loggedinusers template here??

i don't know what i must change... because i have vb 2.0 and the hack is for vb 2.0 RC 2

Johnny

tubedogg
05 Jun 2001, 19:16
You must upgrade to 2.0.0 to receive support from me or anyone else. Regardless, that exists in 2.0 RC2, so you are obviously not running RC2 or you did not revert a template somewhere along the way.

lichtflits
06 Jun 2001, 11:47
every time when I try to see the online members I see this error:

Warning: Variable $loggedins is not an array or string in /home/l/lichtfli/www/forums/online.php on line 29

Parse error: parse error in /home/l/lichtfli/www/forums/online.php on line 44

does anybody now what it is?

Johnny
07 Jun 2001, 10:17
Originally posted by tubedogg
You must upgrade to 2.0.0 to receive support from me or anyone else. Regardless, that exists in 2.0 RC2, so you are obviously not running RC2 or you did not revert a template somewhere along the way.

when i post my quetion i've 2.0.0!!!
so..... but the hack is now working!!

does anybody know the problem that lichtflits have posted???

Johnny

Prezident
08 Jun 2001, 02:09
This hack worked for me on the first try.

Thanks for the great instructions, although I did find the line number references to be off somewhat, I was still able to stumble my way through this one.

Works good, looks good. Thanks a bunch.

SFishy
09 Jun 2001, 18:51
I install this hack last night and it works great!

One question -- I noticed some of my members show up twice on the list... did I do something wrong or is that actually accurate? It seems a bit odd...

Thanks!

SFishy
11 Jun 2001, 19:57
anyone?

tubedogg
11 Jun 2001, 21:22
It works that way until I have time (and figure out how) to fix it.

Mas*Mind
11 Jun 2001, 21:56
Originally posted by tubedogg
It works that way until I have time (and figure out how) to fix it.

tubedogg > have you read my solution a couple of posts back?

I can help you if you want...

catocom
12 Jun 2001, 21:31
I've been dabling alittle with a little asp
forum too, and was just thinking how it
would be nice if this hack could do something
like this....
http://24.181.7.75/aspforum/active_users.asp

TheProfessor
15 Jun 2001, 03:06
Hello!

Just wanted to tell those ones, who want to have a link at the usernames to to the following:

Edit the template online_userbits:
Replace $username with <a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$userid">$username</a> ...

That's all ...

Greetings, The Professor!

Cold Steel
18 Jun 2001, 06:41
Great hack. Keep up the good work!

daydreamer
18 Jun 2001, 14:40
What about the PHP3 bug? Can we please get it fixed?

Thankx for your time...

dd

kdog316
19 Jun 2001, 22:09
i get t hat erorr you must refresh when i try to run mysql.php adn i have not added this specific who is online and i am running 2.01 whats heres the source

Database error in vBulletin Control Panel: Invalid SQL: INSERT INTO session (sessionhash,userid,host,useragent,lastactivity,location) VALUES ('19be5cce704b80c44554bfab15efb9e9','1','24.177.166.109','Mozilla/4.0 (compatible; MSIE 6.0b; Windows 98; Wi','','992984419')
mysql error: Unknown column 'location' in 'field list'
mysql error number: 1054
Date: Tuesday 19th of June 2001 05:00:19 PM
Script: /admin/index.php
Referer: http://tmbps.allaroundsite.com/admin/mysql.php

kdog316
20 Jun 2001, 06:35
ok i fixed it but now its not showing where people are really at

SeanD
21 Jun 2001, 01:34
If you read my recent post on the lastxx.php script I said that I got it working on an entirly differnt server/ip than the server that has our MySQL db.

Well I just tried this script and it worked just as well as assumed. Question though, Instead of just showing the names/numbers in plain text do you have any plans of making it look exactly like how it shows up in the boards? Where you have it say:

----------------------------------------------------------------------------------
| Currently Active Users: # |
----------------------------------------------------------------------------------
There are currently # members and # guests on the boards.
Most users ever online was # on mm-dd-yyyy at hh:mm AM/PM.

Name1, Name2, Name3, Name4, ..... , NameN
----------------------------------------------------------------------------------

And for the config file you can turn on/off the Name listing line, as well as the Most users ever line


Just wondering, no pressure here. Thanks again =)

tubedogg
21 Jun 2001, 10:48
OK about the php3 bug first I have to figure out what it is. Then I'll fix it.

Sean: You're asking for a different hack that I already made. :) http://161.58.84.213/forum/showthread.php?threadid=12010

SeanD
21 Jun 2001, 22:04
Tube, sorry thats the one that I downloaded, I just posted in the wrong thread, mainly this on. But All I see is the text that says how many people are on, I dont see any of the fancy tables and colors.

Im guessing all this stuff im talking about should go in

echo("Member(s) on: $regmemberson. Guest(s) on: $guestson.");

Also, ive been noticing that the results dont seem to match. Our boards say 23 online with 7 guests currently, and your script outputs: Member(s) on: 40. Guest(s) on: 8.

You can look at our boards at http://chat.goosehead.com/forums/index.php

And the script is all the way at the bottom at http://www.goosehead.com/pie.html

realyn
22 Jun 2001, 07:53
i have a question!
i have used this hack, and when i'm online, everything is ok. but someone tell me, he can't explore vbb, show:
Fatal error: Call to a member function on a non-object in ./admin/sessions.php on line 265

and i loginout ,still can't see this.

when i replace "session.php", he can login and explore.

so ,can u tell me why?

i used version 2.2, and do everything carefully!

my vbb's version is 2.0.

ztsky
24 Jun 2001, 01:55
Originally posted by lichtflits
every time when I try to see the online members I see this error:

Warning: Variable $loggedins is not an array or string in /home/l/lichtfli/www/forums/online.php on line 29

Parse error: parse error in /home/l/lichtfli/www/forums/online.php on line 44

does anybody now what it is?

Me too!
who can help us?

realyn
25 Jun 2001, 03:40
Originally posted by ztsky


Me too!
who can help us?

ztsky! i have tested , and everthing ok!

just what i say had showed!

Nocturnal
25 Jun 2001, 16:43
Great hack one small adjustment to online.php was needed to me that was

error_reporting(7);

at the top of the code. Just like all other VB pages. Without this it was giving me a lot of warning messages. Maybe you should add this code to the hack ? :)

I'm pretty pleased with myself for that lol I ain't really a php expert but I fixed something *claps*

Nocturnal
25 Jun 2001, 23:23
Hmm seems to of broke the amount of users that are online. It is now stuck at 0 even when I am on the board. It never did this before. Did i do something wrong someplace?

maverick1236
26 Jun 2001, 02:05
Nicely Done TubeDogg!!
Thank You!

Christian
26 Jun 2001, 16:41
Can someone post the strings to replace for 2.0.1?

The lines are TOTALLY different!
Also do some strings exist twice or even more!

Thx!

learner
30 Jun 2001, 18:51
Hey, I'm new here and I need your help.
I've tried the who'sonline hack and I'm really thankful for the one who did it. But I had a problem. first, I installed it successfully but when I go to the page where I can see the users and the visitors I see a table with two culoms in it. The first one for the users and the visitors and the other one is for where they are. Unfortunately, it doesn't give me where they really are..!!! instead it only gives me that they are (browsing the Board) ...How can I fix this problem so that it gives me what they exactly are doing????

Thanks again for everyone here....Specially to tubedogg

tubedogg
01 Jul 2001, 02:54
Unless they are on specific pages they will show up as browsing the board. If you take a look through the online.php file you will see the various instances of where they must be to trigger a page name.

learner
01 Jul 2001, 14:38
Thank you so much tubedogg...
I did what you told me and the problem was fixed...thanks again...:D

RobAC
02 Jul 2001, 05:23
For some reason, I'm getting nothing but binary text spit back. I'm calling online.php on the homepage and it's full of binary text. I've gone back and made sure that the files were uploaded in ascii and tried running the mysql.php file again. When I do that, I get a database error message:

Database error in vBulletin Control Panel: Invalid SQL: ALTER TABLE session ADD location VARCHAR(225) not null
mysql error: Duplicate column name 'location'
mysql error number: 1060
Date: Monday 02nd of July 2001 12:12:44 AM
Script: /forums/admin/mysql.php
Referer:


Any ideas what I should do?

SFishy
02 Jul 2001, 06:13
Hola hola,

I'm going to ask two questions (and I'll feel really dumb if it IS in fact covered within all the replies -- I've looked through them and couldn't find it)...

Uno: Is is possible to change how the logged in users are sorted? I'd love to see mine sorted by latest activity first.

Dos: Has the duplicated listing of users things been resolved and I missed it? It's not a huge problem, but it would make for a much tidier list if users weren't listed two, three or even four time. Is it possible that hitting "refresh" or "reload" has something to do with this (might be a dumb questions, but I'm no .php wizard, so be nice!)

Thanks!

Mutt
02 Jul 2001, 21:38
I'm working on a cleaned up version of this hack but need a little help. I've gotten rid of the bad urls and and duplicate listings but I'd like to make it even better

see this thread
http://www.vbulletin.com/forum/showthread.php?threadid=21516

my main problem is that the sessions table will list the same person more than once. I've told the script to ignore these duplicates, but I'd perfer to get rid of the duplicates. If you have any knowledge of sessions.php, the sessions table and how it's used please check out the above thread. I don't want to edit the code so it cleans out the duplicates if they are needed elsewhere by another script.

Thank in advance

RobAC
02 Jul 2001, 21:52
Mutt,

Keep us posted on your progress. I'd just be happy to get this cool hack working again.

-Rob

99SIVTEC
03 Jul 2001, 01:05
I have a quick question that should be easy. I have this on my site and am using an SSI call to show it on my main page. The problem is the text color. Its black by default which makes it invisible in my table. Where would I change the color. I'm not sure if its using a forum color from the templates or if its imbedded into the code or what...

My site is at www.highaltitudeimports.com you can see the problem after you enter the site..

Mutt
05 Jul 2001, 14:19
I have a beta version that could use some testing. If you already have the who's online hack installed and working, install is a snap. follow the link to a thread with details


http://www.vbulletin.com/forum/showthread.php?threadid=21935

Ruth
05 Jul 2001, 23:28
thanks for this script, i have some questions before installing:

(1) will this work for vb version 2 ?

(2) most importantly: if i use a Mod_Auth_MySQL with .htaccess, and the user logs into my site, but not into any of the vB forums...will i get to see the online members? if not, can the script recall the members from the .htaccess, i'm not familiar with php and MySQL, please help.

(3) if #2 is achieved, can you be able to track the users?

Thanks

dwh
10 Jul 2001, 01:32
1. There are multiple instances in v 2.01 that we aren't told to replace. Do we replace each instance?
2. This hack would be more expandable if the list of programs -> Title (e.g. } elseif (strpos($location,"private")!==false) {
$locationtitle="Viewing private messages";
$location="index.php?s=$session[sessionhash]";
$f="1";
} else {
$location="index.php?s=$session[sessionhash]";
$locationtitle="Browsing Board";
would be placed in a template or in phpinclude or a text file modified in the CP, so we can change the wording, add new scripts etc...

otherwise, nice hack!

Christian
10 Jul 2001, 11:58
I also asked before what exactly has to be replaced in vB 2.0.1, because the lines don't fit anymore!
Also some pieces of code are there now more than once!

Anyone uses it with 2.0.1?

What did you replace and what not?

goku2k
10 Jul 2001, 18:13
i'm using it with v2.0.1, i think it works pretty well

Christian
10 Jul 2001, 20:29
Then please tell us which code parts you replaced and which not!

Thx! :)

rmusic
11 Jul 2001, 01:50
i installed on 2.0.1 with no problems just in logedin users template had to add in : $totalonline other than that there was nothing diffrent

www.r-music.net/forums

Afterburner
11 Jul 2001, 16:49
I downloaded the hack from the first page and get the same problem than many others in this posting

Users (same Username) are shown more than 1 times
( http://www.the-afterburner.com/vbulletin/online.php )

Anyone ?

I am running the newest version of VB

Christian
11 Jul 2001, 16:57
Add THIS HACK (http://vbulletin.com/forum/showthread.php?s=&threadid=21935) additionally!
Works like a charm, and the double entries are away! :)

Christian
11 Jul 2001, 17:15
Here are the corrected lines for (unedited) sessions.php in vB 2.0.1:


##########################################

Around line 175, find

$DB_site->query("INSERT INTO session (sessionhash,userid,host,useragent,lastactivity".$styleupf.") VALUES ('".addslashes($session['sessionhash'])."','$bbuserinfo[userid]','".addslashes($session['host'])."','".addslashes($session['useragent'])."','".time()."'".$styleupv.")");

and replace it with

$DB_site->query("INSERT INTO session (sessionhash,userid,host,useragent,lastactivity,location".$styleupf.") VALUES ('".addslashes($session['sessionhash'])."','$bbuserinfo[userid]','".addslashes($session['host'])."','".addslashes($session['useragent'])."','".addslashes($scriptpath)."','".time()."'".$styleupv.")");


Around line 209, find

$DB_site->query("UPDATE session SET lastactivity=".time()."$styleup WHERE sessionhash='".addslashes($session['sessionhash'])."'");

and replace it with

$DB_site->query("UPDATE session SET lastactivity=".time().",location='".addslashes($scriptpath)."'$styleup WHERE sessionhash='".addslashes($session['sessionhash'])."'");


Around line 211, find

$shutdownqueries[]="UPDATE session SET lastactivity=".time()."$styleup WHERE sessionhash='".addslashes($session['sessionhash'])."'";

and replace it with

$shutdownqueries[]="UPDATE session SET lastactivity=".time().",location='".addslashes($scriptpath)."'$styleup WHERE sessionhash='".addslashes($session['sessionhash'])."'";


Around line 276, find

$DB_site->query("INSERT INTO session (sessionhash,userid,host,useragent,lastactivity".$styleupf.") VALUES ('".addslashes($session['sessionhash'])."',0,'".addslashes($session['host'])."','".addslashes($session['useragent'])."','".time()."'".$styleupv.")");

and replace it with

$DB_site->query("INSERT INTO session (sessionhash,userid,host,useragent,lastactivity,location".$styleupf.") VALUES ('".addslashes($session['sessionhash'])."',0,'".addslashes($session['host'])."','".addslashes($session['useragent'])."','".time()."','".addslashes($scriptpath)."'".$styleupv.")");


Around line 80, find

$DB_site->query("UPDATE session SET lastactivity=".time()."$styleup WHERE sessionhash='".addslashes($sessionhash)."'");

and replace it with

$DB_site->query("UPDATE session SET lastactivity=".time().",location='".addslashes($scriptpath)."'$styleup WHERE sessionhash='".addslashes($sessionhash)."'");


Around line 82, find

$shutdownqueries[]="UPDATE session SET lastactivity=".time()."$styleup WHERE sessionhash='".addslashes($sessionhash)."'";

and replace it with

$shutdownqueries[]="UPDATE session SET lastactivity=".time().",location='".addslashes($scriptpath)."'$styleup WHERE sessionhash='".addslashes($sessionhash)."'";


Around line 255, find

$DB_site->query("UPDATE session SET lastactivity=".time()."$styleup WHERE sessionhash='".addslashes($session['sessionhash'])."'");

and replace it with

$DB_site->query("UPDATE session SET lastactivity=".time().",location='".addslashes($scriptpath)."'$styleup WHERE sessionhash='".addslashes($session['sessionhash'])."'");


Around line 257, find

$shutdownqueries[]="UPDATE session SET lastactivity=".time()."$styleup WHERE sessionhash='".addslashes($session['sessionhash'])."'";

and replace it with

$shutdownqueries[]="UPDATE session SET lastactivity=".time().",location='".addslashes($scriptpath)."'$styleup WHERE sessionhash='".addslashes($session['sessionhash'])."'";


##########################################

Afterburner
11 Jul 2001, 17:17
thx
great hack and works fine
congratulation

markrt
20 Jul 2001, 21:57
I am using v2.0.0 the hack works ok if I go to http://www.carponline.com/Forum/online.php

I cant get the link to work??

My forumhome_loggedinusers template read as below.

<tr id="cat">
<td bgcolor="#606096" colspan="6"><normalfont color="#FFF788"><b>Currently Active Users: $totalonline</b></normalfont></td>
</tr>
<tr>
<td bgcolor="#F1F1F1" colspan="6"><smallfont>
<nobr>There are currently $numberregistered members and $numberguest guests on the boards.</nobr> |
<nobr>Most users ever online was $recordusers on $recorddate at $recordtime.</nobr><br>
$activeusers
$birthdaybits</smallfont></td>
</tr>


Where dose the link
<b><a href="online.php?s=$session[sessionhash]">Currently Active Users</a></b> go in this script?????????

Thanks
Mark

ztsky
20 Jul 2001, 22:46
in your forumhome_loggedinusers template
FIND:
Currently Active Users

REPLACE IT WITH:
<a href="online.php?s=$session[sessionhash]">Currently Active Users</a>

markrt
21 Jul 2001, 00:04
Thank You Works well.

Mark

SystemLogic
23 Jul 2001, 17:34
I have this hack installed and working perfect at:

http://www.systemlogic.net/boards/online.php?s=

BUT, ever since I've installed the hack my members lose their cookies while browsing the site. Any ideas why that would happen?

tubedogg
27 Jul 2001, 06:50
This hack is being withdrawn. Run the following query to restore your session table to the default:

DROP location FROM session;

and just delete online.php and the custom templates (they are online, online_guestbits and online_userbits).

Sorry about the problems it caused.