PDA

View Full Version : Who's online on non-vB page (with usernames)


tubedogg
03-21-2001, 10:00 PM
LAST UPDATED: 3.24.01 10:40 PM Eastern

Hack version: 0.0.2

Changes since last version: New option to display either usernames or a total number of registered members.

For version: 2.0.0 beta 3 (possibly beta 1 and beta 2 also, but it's untested on those versions).

Files needed: online.php (see zip file attached below).

Files to edit: Possibly online.php (see instructions below).

Possible file locations: Anywhere, as long as the relative path to config.php is correct (see instructions below).

Instructions
1] Download the zip file online002.zip below. It has online.php in it; unzip this file to a location on your hard drive.
2] Open online.php in Notepad (Windows) or Simpletext (Mac) or another ASCII text editor (EditPlus, UltraEdit, TextPad, etc. Dreamweaver, FrontPage, and other HTML editors are not ASCII text editors and will in all likelyhood screw the file up.)
3] Check the path to config.php in the $path variable (in the CONFIG section). Figure out where you're gonna put the file online.php, and then edit the path accordingly. For example, if you put it in your document root (e.g. yoursite.com/) and your board files are in a directory called forum, your path is "forum/admin" (no quotes, no trailing slash).
4] If you want usernames of registered members displayed, then leave the $usernames option alone. If you want a number instead of a list of names, set this to "off" (no quotes).
5] Edit the second-to-last line (the "echo" line). Change it to say what you want. The list of registered members is $regmemberson and the number of guests is $guestson - you can use these anywhere in that line.
6] Save the file and upload it your server.
7] You can include it on another page one of two basic ways:
First, by a PHP include:
<? include("online.php"); ?>
The file that you are going to be including online.php in must then have a .php, .php3, .phtml or other extension that makes your web server recognize it as a file to be parsed as PHP.
Secondly, by an SSI include:
<!--#include file="online.php"-->
The file that you are going to be including online.php in must then have a .shtml, .shtm or other extension that makes your web server recognize it as a file to be server-parsed.

Instructions are also included in the zip file (online002.txt) and brief notes are in the online.php file itself.

FEEDBACK WANTED! :D Likes/dislikes/modification requests all gladly accepted!

03-22-2001, 01:50 AM
your the man dude

this is pop and just what i was looking for :)

03-22-2001, 08:05 PM
hey thanx ure gr8! now time for bdays to work :)

03-24-2001, 08:11 PM
Okay sorry for asking this, I am not that knowledgeable when it comes to things like this...

Okay... I have http://tech.hytekcomputer.com/online.php working and everything. Now how can I integrate that into http://tech.hytekcomputer.com on the main page so it shows that? If it helps, I am using Front Page 2000 to edit the site...

Thanks in advance!

03-24-2001, 10:24 PM
You must "include" it as described in the instructions above. I would *not* use FrontPage to do it as it will probably screw up the code. Open your page in notepad, find where you want to include it, and put the code in that way. Your page must have an extension of .php or .shtml for it to work, and depending on the extension depends on how you include it.

03-24-2001, 11:48 PM
tubedogg,

Great hack! It's the first one I have seen that does not require visitors to visit the forum first before they can see the "online" usercount.

I am trying to change the above hack so instad of showing the usernames of the "Members" it will only show a count of the members online (like the "Guests" count for this hack).

I am trying to figure out where VB get's the $numberregistered variable from but cannot find it in any of the php files.

Any hints?

03-25-2001, 01:20 AM
vB gets the $numberregistered from index.php.

<snipped info about how to change hack - see EDIT below>

EDIT: I revised the hack (updated to version 0.0.2) to allow you to choose whether to show usernames or a number, so the code that was in this post is now standard-issue. See the first post in this thread.

03-25-2001, 02:14 PM
Nice job tubedogg. I implemented this hack on to my homepage and will be updating it to the new release from yesterday. Thanks.

03-25-2001, 03:08 PM
Wiil update it on
www.ishparentsboards.com :)

DroppedAtBirth
05-05-2001, 11:12 PM
I am trying to use your online script thru a template. But the template doesn't seem to pickup the variables from the page. How do I make the template see the variables?

badmeetsevil
05-13-2001, 12:22 AM
I seem to be getting "oops1"... what is that, and how do I fix it?

tubedogg
05-13-2001, 12:34 AM
It can't complete the first query for some reason.

Try replacing
$db=mysql_connect($servername,$dbusername,$dbpassw ord);
mysql_select_db($dbname);
with
$db=mysql_connect($servername,$dbusername,$dbpassw ord) or die("can't connect");
mysql_select_db($dbname) or die("can't get db");
and tell me if you still get the same error or a different error.

badmeetsevil
05-13-2001, 01:39 AM
Yes.. I'm still getting the same error message.. "oops1".

badmeetsevil
05-13-2001, 01:40 AM
I'm also not running on VB 2.. but, it should work, shouldn't it?

tubedogg
05-13-2001, 01:54 AM
You must be running vB2 of some variety (beta 1, 2, 3, 4, or 5, or RC1, 2, or 3). It will not work with v1.1.x. Sorry.

Byron
05-13-2001, 06:58 AM
Hi Kevin,

Thanks for this useful hack.

Do you think it is possible to further customise the message shown?

Re: 1 guest/member
instead of showing the message as 1 guests online.
notice the pural for guest?
show msg as "There is 1 guest online."
same thing for 0 members

Re: 0 guest/member
So if's it O members online and 2 guests online.
Instead of showing msg as "0 members and 2 guests online"
Show message as: "2 guests online" and don't show the o members part.

same thing for 0 guest.

And don't show any message if there are o member and o guest online.

Re: warning msg
I have a few layers of includes for my site, when i use the script
it shows

Warning: MySQL Connection Failed: Access denied for user: 'XXXXXXX@localhost' (Using password: NO) in /home/XXXXX/public_html/online.php on line 46

It works after i added the two following lines just above $db=mysql_connect($servername,$dbusername,$dbpassw ord);

$dbusername="myusername";
$dbpassword="mypassword";

Mitrofan
05-13-2001, 02:47 PM
I just installed this hack and it works well, I also added a small code to also show the total number of registered members:

$usernum = mysql_query("Select count(*) from user");
$users = mysql_fetch_array($usernum);

Then just put $users[0] where you want to display total members

Anyway, my problem is that when I turn off the usernames and want to only display the number of members online, the number of members seems to be much higher than what is says on the forum home page under logged in members.

For example on my forum home page it may say 34 members and 80 guests, and using this hack it would say 70 members and 80 guests online

It seems that it correctly reports the number of guests online, but the number of members is too high.

When I set $usernames to 'on', then it shows the same users as on the forum home page under users online, so the only incosistency with the total users online is when I turn the $usernames off.

What can I do to fix this?

Hooper
05-14-2001, 10:26 PM
I have a fresh install with no hacks. I am trying to figure out why when this SSI'd to the front page always shows (1) Guest online no matter what. Then if I log in it goes to (0)guests (1)Member.

This is what I was having a problem with before. Should it not have (0) for both when noone is in the forums?

Update: It does go back to (0)'s for both after about a half hour or so. What causes the delay?

Thanks
Hooper

Byron
05-24-2001, 02:31 PM
feedback:

The script is showing 8 members and 2 guests online

while forums is showing

currently 3 members and 2 guests on the boards.

Degen
05-25-2001, 07:34 PM
Great hack! I have the same problem as Byron. It is because of the cookies. Not sure if anything can be done about that.

Joshs
06-21-2001, 02:50 AM
When I include this in a .shtml file I get this when viewing it...

$datecut AND invisible='0' ORDER BY username ASC") or die("oops2"); while($regmember = mysql_fetch_array($regmembers)): ++$regmembercomma; if ($regmember[invisible] == 0) { $regmemberson .= $regmember[username]; } else { ++$regmembercomma; } if ($regmembercomma < mysql_num_rows($regmembers)): $regmemberson .= ", "; endif; endwhile; $guests = mysql_query("SELECT COUNT(userid) AS guestsonline FROM session WHERE userid=0 AND session.lastactivity>$datecut") or die("oops3"); while($guest = mysql_fetch_array($guests)): $guestson = number_format($guest[guestsonline]); endwhile; echo("Member(s) on: $regmemberson. Guest(s) on: $guestson."); ?>

jarvis
06-21-2001, 03:18 AM
Joshs,

Are you using WinNT/2k and IIS?

Joshs
06-21-2001, 03:21 AM
Yes!

jarvis
06-21-2001, 03:27 AM
Well, you and I are out of luck. Apparently IIS does not know how to handle multiple layers of translation.

Trying to include a .PHP document in IIS confuses it and IIS does not apply the filter. :(

Sorry to be the bearer if bad news.

Joshs
06-21-2001, 03:30 AM
Oh s***! I was planning on integrating some of this stuff with my site!!!! So there is no way to get this working?!

jarvis
06-21-2001, 03:33 AM
I've heard mixed reports with .asp pages, but I really don't have time to learn ASP.

I'm browsing through MS again to see if there are any white papers on this. :(

Grover
06-24-2001, 01:14 PM
Great 'hack', this Tubedogg. Just what I was looking for.

Is it possible that you could include some of the suggestions of us - the VERY satisfied users of your work- in a future release of this hack?

I would LOVE to see some extenions on this, for example the suggestion of Mitrofan to include just the number of registered members, regardless of their online status.
Instead of including the suggestions of Mitrofan or doing the adaptions ourselves, it would be nice to include it in a future release?

Thank you very much, again. (none of my bussiness really, but do you actually get PAID for all the great support you do on Vb? Ofcourse, it must be....nevertheless I'm willing to start a Poll to get you a raise ;)

Grover.

(PS: I guess this hack works on 2.0.0 and 2.0.1 as well? 'cause it says ' v2 beta 3 in the subjectline)

VirtueTech
07-22-2001, 04:58 AM
nevermind

nice hack :)

Cygnus
08-01-2001, 04:28 PM
Originally posted by tubedogg
LAST UPDATED: 3.24.01 10:40 PM Eastern

Hack version: 0.0.2

Will there be an upgrade to this soon? With vB 2.0.3 out, the sessions.php file has changed. Further, I have always seen two or three entries for some people. I have read the thread and understand the problem, but I am sure that there must be a fix. As I only picked up a PHP book yesterday, I am not quite qualified to do it and hope that some coder here (maybe even tubedogg himself) to fix up what could be the most useful hack for a board.

Thanks in advance!
Cygnus

Cygnus
08-14-2001, 02:10 AM
bump.

Tubedogg? You out there? Anyone else?

Cygnus

Cygnus
08-15-2001, 02:13 AM
the hack is not currently working as the changes in 2.0.3 changed the sessions.php file. All people on the boards are currently listed as "browsing the boards" which kind of defeats the purpose of the hack, no? I mean... obviously they're browsing the boards...

Cygnus

tubedogg
08-15-2001, 04:23 AM
The hack does not list where anyone is, it never has.

I may update it for 2.0.3 in the future, I may not. I don't know at this point.

tubedogg
08-15-2001, 04:36 AM
Now that I think about it, the session table was barely changed, and nothing that was changed would affect this hack in the least...Are you sure you're talking about the right hack???

Cygnus
08-16-2001, 07:17 PM
Originally posted by tubedogg
Are you sure you're talking about the right hack???

Uh... I believe so. Is this the hack which shows who is online and doing what (i.e. Reading this post in this thread)? If not intended to do so - and seeing that this is the only hack that I have installed - it would be pretty odd if it was doing it, no?

Cygnus

amykhar
08-16-2001, 10:16 PM
Cygnus,
What you are describing is a bug in 2.0.3 itself. A fix is in the bugs forum.

Amy

Evoir
08-16-2001, 11:07 PM
Tubedogg,

Thanks for the great hack. One question: is there a way to make the script simply output the total number of people on the boards, rather than seperating the members from the guests?

I'd like it to say: "there are currently x people on our boards."

Thanks again,
Evoir

Cygnus
08-22-2001, 04:49 PM
Originally posted by amykhar
What you are describing is a bug in 2.0.3 itself. A fix is in the bugs forum.

Are you talking about this one: http://vbulletin.com/forum/showthread.php?threadid=25832

If so... I fixed this just now and see no changes yet. I will give it a few minutes so that the sessions table can be filled with new data...

Cygnus

Cygnus
08-22-2001, 05:20 PM
OK... tried that one... no luck. I switched it back.

I also tried this one...
http://vbulletin.com/forum/showthread.php?threadid=25521

Still no luck.

Any chance you could tell me which bug? :)

Thanks,
Cygnus

Cygnus
08-24-2001, 05:24 AM
Bueller?

Bueller?

Bueller?

I have uninstalled this now useless hack. Thanks for all of the attention that I... well... didn't get.

Cygnus, who would service hacks he writes... otherwise... why write them?

tubedogg
08-24-2001, 05:26 AM
This hack never showed where people are and in fact it works perfectly for me on 2.0.3...

LuBi
08-26-2001, 01:46 PM
Is 2.0.3 Version 2.0.0 beta 3? or version 2.0 beta 3? Because I have been looking for hacks and I have like all for for 2.0.3 and i mean so many others have so many more. thanks

tubedogg
08-26-2001, 03:29 PM
2.0.3 == 2.0.3

This hack was released at the time of 2.0 beta 3 which was...erm...8? versions ago.

However it works fine with v2.0.3.

LuBi
08-26-2001, 03:31 PM
lol thanks, well I never knew that. do all 2.0 beta 3 hacks work with 2.0.3 by any chance?

tweak
08-28-2001, 03:17 AM
hmm i hope there will be one for VBB 2.0.1 or .3 Anyone here anything?

I tryed to add this hack to 2.0.3 but could find alot of the Code to replace.

tubedogg
08-28-2001, 03:23 AM
There's no code to replace with this one...

tweak
08-28-2001, 03:54 AM
Oppps sorry tubedogg let me reword that... I tryed to install the code.. but couldnt find where to add the New code..

I would look fo a Line and it wouldnt show up.. so i didnt know where to add it.

Sorry man

tubedogg
08-28-2001, 03:59 AM
That's what I meant too - there's no code to add/replace/remove/anything, just two variables to set in the script itself and add a link to it from somewhere.

tweak
08-28-2001, 04:43 AM
:p :D

BBInsider
08-28-2001, 06:50 PM
Very new to this, you guys talk over my head, lol.
Would anyone be willing to give it a try on my board?
http://www.buffalobillsinsider.com/graffitiboard/index.php3

BilzD@aol.com
Thanks all!
:)

Ruth
08-29-2001, 06:49 PM
what is the difference between this hack and the current active users in 2.0.3?

jcroft
08-29-2001, 08:42 PM
Has anyone modified this hack for use in a sidebar...with like a vertical list of the online users, with links to their profiles? If so, would you mind sharing your code? :D

Thanks,
Jeff Croft
forums.newbeetle.org

Bytes
08-30-2001, 12:31 AM
Just installed your online.php. Works like a charm!!!!!!!! ;)

Thanks!

Mike Gaidin
08-30-2001, 01:00 AM
Yes, I'm looking for a sidebar version as well. :)

Robouk
09-05-2001, 02:09 PM
ok what happns if the path to your admin is on another server?
so you want to include who's online from your forum which is hosted elsewhere to your homepage, you see?

Robouk
09-05-2001, 02:13 PM
its ok, i just insatlled the hack ontio the forums server and use php includes to include it onto my homepage, thanks!

Oliver
09-07-2001, 04:12 PM
how`d u do that robouk <sp> exactly?

please tell cause our board is on a completly different host, and i want online users on our main website.

i tried diferent variations, but to no avail.

what should the ssi call be?
where do i upload online.php, which server?

cheers
oli

Robouk
09-07-2001, 09:44 PM
upload online.php to the forums server and make it all work ok, then on you other website, use PHP INCLUDES to include it into your website...
you can see my version here:
http://robouk.gdesign.nl/v3/page.php

Oliver
09-08-2001, 10:49 AM
Can SSI calls include files from another server,

<--!include file="http://anotherhost.com/online.php"-->

OR

<--!include virtual="http://anotherhost.com/online.php"-->

the page i want online members to be on is *.shtml on a different server.

Help anyone?

oli

Robouk
09-08-2001, 12:22 PM
As far as i know SSI can only be used with files on the same server, but Includes can include files from anywhere..

James Cridland
09-08-2001, 02:24 PM
Originally posted by jcroft
Has anyone modified this hack for use in a sidebar...with like a vertical list of the online users, with links to their profiles? If so, would you mind sharing your code? :D

Not running this - yet, at any rate. But looking at the code...

FIND
$regmemberson .= ", ";
REPLACE WITH
$regmemberson .= "<br>";

FIND
echo("Member(s) on: $regmemberson. Guest(s) on: $guestson.");
REPLACE WITH
echo("Member(s) on:<BR>$regmemberson.<BR>Guest(s) on:<BR>$guestson.");

My understanding of the code is that this should produce:

Member(s) on:
Hammer
Friend
JDoe
JBloggs.
Guest(s) on:
8.

Should be easy to program that as a configuration option; I'd fix "Member(s)" to work properly too, to be honest... not a difficult thing.

J

Oliver
09-09-2001, 10:07 PM
i tried that and it worked, you can even put the info into a table

Is there anyway to turn the name to a hyperlink to that users last post?

AND

have an alternate colour for each name, as if you place the code in a sidebar, 120 px wide, some names wrap?

oli

kamrad.ru
10-01-2001, 04:12 AM
I have a problem:

Warning: Undefined variable: regmembercomma in d:\usr\www\online.php on line 59

Warning: Use of undefined constant invisible - assumed 'invisible' in d:\usr\www\online.php on line 60

Warning: Use of undefined constant username - assumed 'username' in d:\usr\www\online.php on line 61

Warning: Undefined variable: regmemberson in d:\usr\www\online.php on line 61

Warning: Use of undefined constant guestsonline - assumed 'guestsonline' in d:\usr\www\online.php on line 78
Member(s) on: Admin. Guest(s) on: 0.

YourHostSucks
10-01-2001, 08:03 AM
Thats Not a problem, it should still owrk fine ;)
(hehe)

your site is at d:\usr\www\?
Just doesn't look right..

kamrad.ru
10-01-2001, 09:20 AM
<i>your site is at d:\usr\www\? </i>
It`s localhost

kamrad.ru
10-01-2001, 01:00 PM
Why then there are these mistakes
How to me to get rid of them?

Dez_U
10-13-2001, 04:27 PM
This may have been covered. But.

Can anyone tell me what to do to get the users on line on my forum at www.clanram.com/forum to show on my index page at www.clanram.com ??

I would like to do the same as http://www.finheaven.com

but I canny get the guy to answer me :)

Help much needed, thanks

Hooper
10-14-2001, 01:51 AM
anyone know if this still works with 2.03?

Thank You.

paulsjv
10-18-2001, 02:37 PM
does anyone have the template that vBulletin uses for their currently online page? Cause I would love to use it if possible.

Thanks...

codyrush
10-25-2001, 04:31 AM
There should be the ability to edit the HTML within the last echo string. I want to just bold the numbers, but not the words "Guests" or "Members"... any way to do this? Everytime I try editing the code in online.php, I get a Parse Error.

Talk to me.

Thanks,
Cody Rush

Russ
11-05-2001, 03:44 AM
anyone else having excessively large users online using this with 2.2.0?

Steve_S
11-05-2001, 05:56 AM
Thanks much Dr. Tube :) Works fine with 2.2.0

See at:

http://www.geekvillage.com/last_25_posts.html

Note: This is another way to do an SSI include assuming your server is set up properly:

<!--#include virtual="/online.php"-->

Can I beg for more features :)

Lesane
11-06-2001, 04:17 PM
Just installed the hack. Works perfect! Thnx Tube.

Kumaro
11-08-2001, 01:23 AM
Can somebody please help me?

My site is ran by "Post-Nuke 6.4" and I chooce to 'include' the online.php, but it what it shows is all the coding inside online.php instead...help?

Logtenberg
11-10-2001, 01:39 AM
Is there an easy way to just have the number of online users on any page of the forum? (just like what they did for vbulletin.org? look up)

twix
12-02-2001, 12:36 PM
Great work, I just installed it, a demo can be seen on the bottom of the http://www.tosbaga.com]main page (sorry, its in turkish, but you get the idea).

Lionel
12-19-2001, 03:50 AM
Can this be made so when you click on member name being displayed you go either to profile page or you send a PM?

EJMack
01-10-2002, 05:44 AM
it would be nice for the names to link to there profile, but also would there be a way to have a scrollbar at the side?

FWC
01-10-2002, 06:07 AM
Originally posted by EJMack
it would be nice for the names to link to there profile, but also would there be a way to have a scrollbar at the side? Change the $regmemberperson line to:$regmemberson .= "<a href=\"http://www.yoursite.com/yourforums/member.php?action=getinfo&username=$regmember[username]\">$regmember[username]</a>";That will give you links. Can't help you with the scrollbar. :)

EJMack
01-10-2002, 05:45 PM
man i tried everything i could and its still not workin....

importmix
01-12-2002, 03:51 AM
Originally posted by Evoir
Tubedogg,

Thanks for the great hack. One question: is there a way to make the script simply output the total number of people on the boards, rather than seperating the members from the guests?

I'd like it to say: "there are currently x people on our boards."

Thanks again,
Evoir

I would like this too.

MomofThree
01-21-2002, 08:04 PM
I tried this hack and got an "oops1" on the page.

Can someone please help me? :(

Thank you.

MomofThree
01-21-2002, 11:52 PM
*bump*

pretty please, help me? :)

Chamber
01-25-2002, 01:31 PM
Will this work across sub-domains?

I have my forums @ http://forum.northants-chamber.co.uk and would like to add this hack to http://www.northants-chamber.co.uk

Can you see any problems with trying that ?

snack
01-25-2002, 04:05 PM
Im on a NT machine... when i try it i get this error message ...


Fatal error: Failed opening required '/sng.net/www/vb/admin/config.php' (include_path='') in E:\nthc-spc\seandan\sngnet\sng.net\www\online.php on line 46


anyone know whats the problem? tubedog???


http://www.sng.net/

Ninth Dimension
02-03-2002, 05:58 PM
Fantastic hack, just what I needed, thank you.

Rapclick
02-05-2002, 01:34 AM
any chance of this working with Vb 2.2.1 ?

FWC
02-05-2002, 02:01 AM
Originally posted by Rapclick
any chance of this working with Vb 2.2.1 ? It works with both 2.2.1 and 2.2.2.

MomofThree
02-05-2002, 04:22 PM
Originally posted by MomofThree
I tried this hack and got an "oops1" on the page.

Can someone please help me? :(

Thank you.

Does anyone know why I'm getting this error? :(

Lucky
02-06-2002, 08:15 PM
Does anyone know if this works with vbportal3.0pr7 with vb2.2.2?

waddy
02-07-2002, 02:45 PM
Works great !!

Thanks

But i would really just like a total number - members and guests added together .... example Users on Forum :

Can anyone do this please ?

waddy
02-07-2002, 07:09 PM
To have the total of both Member and Guest put this code

$somenumber=$regmemberson+$guestson;
endwhile;
echo("Users on forums: $somenumber.");
?>

Under:

while($guest = mysql_fetch_array($guests)):
$guestson = number_format($guest[guestsonline]);

Lucky
02-07-2002, 07:39 PM
will this hack work with the variable to show online users numbers with fireflys hack?

SaintDog
02-13-2002, 12:33 AM
Hello TubeDogg, I was wondering if you would please help me out if possible? I am using this hack and for some reason, when I leave the main page to goto the forums, then come back to the main page it will double the amount of people one.

Take for instance (right now), I am online on my forums and then I went back to the main page and it said their were 7 members online, when I was the only one online (I checked, no invisible users either).

Could the reason be me browsing the board with cookies? If so, I will not worry about it, if that is not the reason, maybe you or someone else could help me out and tell me what is the problem.

Thanks,

- SaintDog

lordofgun
02-13-2002, 03:59 AM
i'm also having the problem in v 2.2.2 where the number of users on my seperate page is more than the number of users shown on the message boards.

anyone help please? :D

SaintDog
02-13-2002, 06:54 AM
Good to know I am not the only one having this small problem :)

Lucky
02-13-2002, 09:52 AM
Any support here?

monaarts
03-07-2002, 03:10 PM
Originally posted by J-OST
Yes, I'm looking for a sidebar version as well. :)


What exactly do you mean???


-Joe

monaarts
03-07-2002, 03:20 PM
The problem is that the people are stored in a Database called Session... In session, there can be multiple people and sometimes people not logged into teh forums but thier session is there..
I am working on a nice 'ipgrade' for this hack.. It will be available later on today! :D


-Joe

monaarts
03-07-2002, 05:17 PM
<a href="https://vborg.vbsupport.ru/showthread.php?threadid=35832" target="_blank">https://vborg.vbsupport.ru/showt...threadid=35832</a>

lowlight
03-20-2002, 09:00 PM
How do I put a line break between "Member(s) On" and "Guest(s) On" ?

I don't know PHP :o

Ninth Dimension
03-20-2002, 09:09 PM
find
echo("Member(s) on: $regmemberson. Guest(s) on: $guestson.");
replace with
echo("Member(s) on: $regmemberson.<br>Guest(s) on: $guestson.");

lowlight
03-20-2002, 09:13 PM
Duh... I thought of that, but I didn't even try it... Thanks! :D

Ninth Dimension
03-20-2002, 09:41 PM
did it work? (it should have)

lowlight
03-21-2002, 12:40 AM
Yup it worked

Now my next question:

Which is faster, PHP includes, or SSI? I have the option of both...

Ninth Dimension
03-21-2002, 12:48 AM
i personally use PHP includes, due to the simple fact that all of my pages are built using PHP, however, if you are running a series of normal shtml pages, and only using PHP on some of them, it might be easier to use the SSI.

But it's up to you at the end of the day really :)

lowlight
03-21-2002, 09:22 AM
Well my whole site is going to be PHP based soon, so I thought I would use PHP includes... But I seem to be having a problem...

Say I am using the includes on my home page (index.php)....

I want to use includes in a subdir (say /included/)

The problem is, my IMG tags aren't right when I include... If I use IMG SRC ="image.gif", the references on the included page all point to root (root/image.gif), rather than /included/image.gif

If the page is on another subdir (say /reviews/), the img tags all change to that subdir... (/reviews/image.php)

So what should I do? I think SSI would work for now, and if that's the case I can just use .inc on the included pages (I assume both SSI and PHP will include those files just fine)...

But to keep things simple for my programmer, I'd like to use PHP includes all the way through...

Ideas?

monaarts
03-21-2002, 04:17 PM
Hey,
When you post an image do it liek this:

../image.gif

That will bring you back one directory.. :) if you want to go back two directorys do this:

../../image.gif...

Or if you want to go back a directory and into one do somethign like this:

../images/image.gif

I hope that helps you..


-Joe

lowlight
03-22-2002, 06:21 AM
Originally posted by monaarts
Hey,
When you post an image do it liek this:

../image.gif

That will bring you back one directory.. :) if you want to go back two directorys do this:

../../image.gif...

Or if you want to go back a directory and into one do somethign like this:

../images/image.gif

I hope that helps you..


-Joe That's what I did... it doesn't work

ice!~neko
03-23-2002, 07:27 AM
what code do i put into the main page to get it to show up?

E
03-23-2002, 08:05 AM
ill definetly use it when my page is up

lowlight
03-25-2002, 09:00 PM
OK I fixed the problem by using true html for the image and links... IE rather than use /img/image.gif I use http://www.domain.com/img/image.gif

It works now! :D

Xube
04-13-2002, 03:07 PM
Can a few of you who have got this hack working post links to examples of your pages where it works? I'd like to see what this looks like when functioning and the hytek.com link provided doesn't show a page at all. Thanks.

ixian
05-23-2002, 03:38 AM
Originally posted by Xube
Can a few of you who have got this hack working post links to examples of your pages where it works? I'd like to see what this looks like when functioning and the hytek.com link provided doesn't show a page at all. Thanks.

I wouldn't get worked up about it. I certainly appreciate Tubedogg - he has done some killer hacks and I use them - but this one doesn't work, for the simple fact that if you include it on another page it will display many more people being on then there actually are. For example, your who's online in the forums might say 22, but the hack will say 40 (or whatever).

And before you get excited and think it's reflecting total people on your site, not just forums - no it isn't. It's double-counting some logins. Don't know why - no one has answered that one.

The modified hack another member posted does the same thing. Personally, I think a hack that's supposed to show how many people are online that doesn't get the correct number is fairly useless. Not being insulting, just stating the facts.

Steve St.Lauren
05-29-2002, 05:54 PM
I just finished getting this script up and running on our site. I ran into the same problems many of you did with the script reporting far more members than the forums did. I've got a fix that's working for me and my version of the hack reports the same number of members and guests as the forums do. I replaced lines 69-74 of the script that read like this:

} else {
$regmembers = mysql_query("SELECT DISTINCT COUNT(userid) AS membersonline FROM session WHERE userid>0 AND lastactivity>$datecut") or die("oops2");
while($members = mysql_fetch_array($regmembers)) {
$regmemberson = number_format($members[membersonline]);
}
}

and I replaced them with these lines:
} else {

// Added by SS
$regmemberson=0;
$loggedins=mysql_query("SELECT DISTINCT session.userid,username,invisible,usergroupid
FROM session
LEFT JOIN user ON (user.userid=session.userid)
WHERE session.userid>0 AND session.lastactivity>$datecut
ORDER BY invisible ASC, username ASC");
while ($loggedin=mysql_fetch_array($loggedins)) {
$regmemberson++;}



// $regmembers = mysql_query("SELECT DISTINCT COUNT(*) AS membersonline FROM session WHERE userid>0 AND lastactivity>$datecut") or die("oops2");
// while($members = mysql_fetch_array($regmembers)) {
// $regmemberson = number_format($members[membersonline]);
// }
}

I'm also attaching a copy of the full script as I'm running it (except with the admin directory name changed at the top. My version is in a vertical table approximately 95 pixels wide that I put on the side of the site. I've only done that for the list of statistics only - I didn't mess with the username list part.

Basically all I did was take the code out of the index.php file that was used for counting up the users and modified the variables and plugged it in there. Hopefully this will help you guys get it up and running and useful. I suppose there's a possibility that more errors will show up but I've been watching mine for 45 minutes now and it's been consistent that entire time.

-Steve St.Laurent
Webmaster of http://www.turbodieselregister.com

Steve St.Lauren
05-29-2002, 06:01 PM
Xube - here's a few examples.

The original hack with usernames listed - http://www.turbodieselregister.com/forums/online3.php

The original hack with usernames turned off - http://www.turbodieselregister.com/forums/online2.php

and my version with usernames off and displayed vertically in a table - http://www.turbodieselregister.com/forums/online.php

Lethal
06-01-2002, 04:15 AM
cool i'll use this one, thanks

Webmasta XT
06-09-2002, 05:35 PM
How can I add an Image b4 every username? since how these things show up, don't match my layout, I have a arrow b4 every username, and Image Arrow, HOW CAN I ADD THAT???

Webmasta XT
06-09-2002, 05:41 PM
I added this code
in the online.php

echo(" &nbsp; <img src="http://xtreme-gods.net/layout/icon.jpg"> $regmemberson");


But I get this error

Parse error: parse error in /home/virtual/site24/fst/var/www/html/online1.php on line 81

importmix
06-21-2002, 08:31 AM
I don't mean to both you Steve St.Lauren, but is there any way you can tell me how to use your code...but to just show total (members + guest) as one number?

Steve St.Lauren
06-21-2002, 02:06 PM
Here you go importmix. Attached is an online.php that will do what you're looking for. Simply edit this file and put the path to your admin directory (full path) near the top and then replace your online.php with this one (backup your old one first). I replaced the two lines that say members and guest with one line that says online and combine the two.

importmix
06-21-2002, 06:32 PM
thanks will try

dreamhost
07-27-2002, 09:23 AM
Originally posted by MomofThree
oops1

Does anyone know why I'm getting this error? :(


I am getting same error, not sure if this thread is still alive, but would like to find out why?


error oops1

yetdog11
08-01-2002, 04:59 PM
Originally posted by Webmasta XT
I added this code
in the online.php

echo(" &nbsp; <img src="http://xtreme-gods.net/layout/icon.jpg"> $regmemberson");


But I get this error

Parse error: parse error in /home/virtual/site24/fst/var/www/html/online1.php on line 81


Try this:


echo(" &nbsp; <img src='http://xtreme-gods.net/layout/icon.jpg'> $regmemberson");


(Note single quotes instead of doube inside the img tag)

Matthew Yette
matt@antsmarching.org

LOD-squa
12-22-2002, 11:51 PM
is there a way I can make the usernames link to the profile?

Sakura Online
12-24-2002, 08:46 PM
is it possible to run this script on two different domains? meaning

the forums are on BLUEBERRY.COM and i want the users online to appear on STRAWBERRY.COM, is that possible with this hack or no?

does anyone know how I can do that?

LOD-squa
12-24-2002, 08:58 PM
On the path try putting the url for the site where the forum is directly to the config.php

Sakura Online
12-24-2002, 09:27 PM
okay thank you i will try it right now and tell you what happens!

thank you

Sakura Online
12-24-2002, 09:45 PM
wait, one question

on the path of when the online.php is being included

or on the path in the online.php file?

Sakura Online
12-24-2002, 09:53 PM
ok in the online.php file where it said something like $path/config.php i replaced it with the url of the config file of the board

and when i include it on the site i get:

oops1

which i checked is near the thing i changed on the online.php file.. so i am guessing that won't work..

BUT my friend has done it before , but she does not remember anymore... lol

PLEASE HELP!

LOD-squa
12-26-2002, 04:58 PM
Not get $path back andlook for the other $path a little before it and find it.

boiboi
03-12-2003, 08:08 PM
works for vb 3?

stark427
03-17-2003, 03:38 PM
12-24-02 at 11:53 PM Sakura Online said this in Post #129 (https://vborg.vbsupport.ru/showthread.php?postid=334585#post334585)
ok in the online.php file where it said something like $path/config.php i replaced it with the url of the config file of the board

and when i include it on the site i get:

oops1

which i checked is near the thing i changed on the online.php file.. so i am guessing that won't work..

BUT my friend has done it before , but she does not remember anymore... lol

PLEASE HELP!

I cannot even get online.php to work at my case :(

http://www.synthpopavenue.gr/online.php

glo
04-29-2003, 01:58 PM
this hack looks interesting!

Just to clarify; we can add Tubedogs 2 line code onto any number of our non vB pages so that all the users browsing the forum and the tagged pages will be shown in total on another non-vBpage!

Does that sound right?

sbryan
05-04-2003, 12:09 PM
i get this error, can anyone help?

Member(s) on: 33. Guest(s) on: 3.
Warning: Cannot send session cache limiter - headers already sent (output started at /home/xboxworld/public_html/online.php:81) in /home/xboxworld/public_html/config/connect.php on line 3

mIRCnet
06-07-2003, 10:29 AM
thnx for this hack , I want to ask you how can implament it in php-nuke ??

mIRCnet
06-07-2003, 10:29 AM
thnx for this hack , I want to ask you how can implament it in php-nuke ??

M4g!k
06-26-2003, 07:51 AM
no matter what i try to do, i still get these erors,

'Warning: main(home/public_html/forums/admin/config.php) [function.main]: failed to create stream: No such file or directory in /home/indeathw/public_html/online.php on line 46

Fatal error: main() [function.main]: Failed opening required 'home/public_html/forums/admin/config.php' (include_path='.:/usr/local/lib/php') in /home/indeathw/public_html/online.php on line 46'


any ideas?

My forums are located at http://www.indeathwefall.co.uk/forums can anyone help? Thanks :)

Splitfyre
06-26-2003, 05:00 PM
Anyone get it working with 2.30?

codewebs
07-11-2003, 06:11 AM
i added and changed some stuff in this hack to make it so i can load a page and it will put the users online and stuff in my aim away message every 30 seconds :) it worked nicely.. thanks for this hack

agamer
07-17-2003, 08:21 PM
06-26-03 at 01:00 PM Splitfyre said this in Post #138 (https://vborg.vbsupport.ru/showthread.php?postid=413025#post413025)
Anyone get it working with 2.30?




to the creator: very nice hack, i am very glad you took the time to make this :)

to splitfyre: i am running vb 2.3.0 and the hack installed perfectly on my site ( http://clandot.com ). (i am not running any other hacks though on it)

Oblivion Knight
07-17-2003, 09:44 PM
All seems to be running fine on 2.3.0 :)

Thanks.

Sylvus
08-27-2003, 09:51 PM
Verify. 2.3.0 works like a charm, just installed it.

Syl...

Jargon
06-03-2004, 09:17 AM
whats the code for posts and threads?

MarkyLeonard
01-21-2005, 03:34 PM
Works great on 2.3.4!