PDA

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


tubedogg
21 Mar 2001, 23:31
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!

22 Mar 2001, 02:50
your the man dude

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

22 Mar 2001, 21:05
hey thanx ure gr8! now time for bdays to work :)

24 Mar 2001, 21:11
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!

24 Mar 2001, 23:24
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.

25 Mar 2001, 00:48
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?

25 Mar 2001, 02:20
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.

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

25 Mar 2001, 16:08
Wiil update it on
www.ishparentsboards.com :)

DroppedAtBirth
06 May 2001, 00:12
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
13 May 2001, 01:22
I seem to be getting "oops1"... what is that, and how do I fix it?

tubedogg
13 May 2001, 01:34
It can't complete the first query for some reason.

Try replacing
$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);
with
$db=mysql_connect($servername,$dbusername,$dbpassword) 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
13 May 2001, 02:39
Yes.. I'm still getting the same error message.. "oops1".

badmeetsevil
13 May 2001, 02:40
I'm also not running on VB 2.. but, it should work, shouldn't it?

tubedogg
13 May 2001, 02:54
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
13 May 2001, 07:58
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,$dbpassword);

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

Mitrofan
13 May 2001, 15:47
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
14 May 2001, 23:26
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
24 May 2001, 15:31
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
25 May 2001, 20:34
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
21 Jun 2001, 03:50
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
21 Jun 2001, 04:18
Joshs,

Are you using WinNT/2k and IIS?

Joshs
21 Jun 2001, 04:21
Yes!

jarvis
21 Jun 2001, 04:27
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
21 Jun 2001, 04:30
Oh s***! I was planning on integrating some of this stuff with my site!!!! So there is no way to get this working?!

jarvis
21 Jun 2001, 04:33
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
24 Jun 2001, 14:14
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
22 Jul 2001, 05:58
nevermind

nice hack :)

Cygnus
01 Aug 2001, 17:28
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
14 Aug 2001, 03:10
bump.

Tubedogg? You out there? Anyone else?

Cygnus

Cygnus
15 Aug 2001, 03:13
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
15 Aug 2001, 05:23
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
15 Aug 2001, 05:36
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
16 Aug 2001, 20:17
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
16 Aug 2001, 23:16
Cygnus,
What you are describing is a bug in 2.0.3 itself. A fix is in the bugs forum.

Amy

Evoir
17 Aug 2001, 00:07
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
22 Aug 2001, 17:49
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
22 Aug 2001, 18:20
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
24 Aug 2001, 06:24
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
24 Aug 2001, 06:26
This hack never showed where people are and in fact it works perfectly for me on 2.0.3...

LuBi
26 Aug 2001, 14:46
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
26 Aug 2001, 16:29
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
26 Aug 2001, 16:31
lol thanks, well I never knew that. do all 2.0 beta 3 hacks work with 2.0.3 by any chance?

tweak
28 Aug 2001, 04:17
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
28 Aug 2001, 04:23
There's no code to replace with this one...

tweak
28 Aug 2001, 04:54
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
28 Aug 2001, 04:59
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
28 Aug 2001, 05:43
:p :D

BBInsider
28 Aug 2001, 19:50
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
29 Aug 2001, 19:49
what is the difference between this hack and the current active users in 2.0.3?

jcroft
29 Aug 2001, 21:42
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
30 Aug 2001, 01:31
Just installed your online.php. Works like a charm!!!!!!!! ;)

Thanks!

Mike Gaidin
30 Aug 2001, 02:00
Yes, I'm looking for a sidebar version as well. :)

Robouk
05 Sep 2001, 15:09
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
05 Sep 2001, 15:13
its ok, i just insatlled the hack ontio the forums server and use php includes to include it onto my homepage, thanks!

Oliver
07 Sep 2001, 17:12
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
07 Sep 2001, 22:44
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
08 Sep 2001, 11:49
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
08 Sep 2001, 13:22
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
08 Sep 2001, 15:24
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 Sep 2001, 23:07
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
01 Oct 2001, 05:12
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
01 Oct 2001, 09:03
Thats Not a problem, it should still owrk fine ;)
(hehe)

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

kamrad.ru
01 Oct 2001, 10:20
your site is at d:\usr\www\?
It`s localhost

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

Dez_U
13 Oct 2001, 17:27
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
14 Oct 2001, 02:51
anyone know if this still works with 2.03?

Thank You.

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

Thanks...

codyrush
25 Oct 2001, 05:31
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
05 Nov 2001, 04:44
anyone else having excessively large users online using this with 2.2.0?

Steve_S
05 Nov 2001, 06:56
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
06 Nov 2001, 17:17
Just installed the hack. Works perfect! Thnx Tube.

Kumaro
08 Nov 2001, 02:23
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
10 Nov 2001, 02:39
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
02 Dec 2001, 13:36
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
19 Dec 2001, 04:50
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
10 Jan 2002, 06:44
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
10 Jan 2002, 07:07
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
10 Jan 2002, 18:45
man i tried everything i could and its still not workin....

importmix
12 Jan 2002, 04:51
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
21 Jan 2002, 21:04
I tried this hack and got an "oops1" on the page.

Can someone please help me? :(

Thank you.

MomofThree
22 Jan 2002, 00:52
*bump*

pretty please, help me? :)

Chamber
25 Jan 2002, 14:31
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
25 Jan 2002, 17:05
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
03 Feb 2002, 18:58
Fantastic hack, just what I needed, thank you.

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

FWC
05 Feb 2002, 03:01
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
05 Feb 2002, 17:22
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
06 Feb 2002, 21:15
Does anyone know if this works with vbportal3.0pr7 with vb2.2.2?

waddy
07 Feb 2002, 15:45
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
07 Feb 2002, 20:09
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
07 Feb 2002, 20:39
will this hack work with the variable to show online users numbers with fireflys hack?

SaintDog
13 Feb 2002, 01:33
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
13 Feb 2002, 04:59
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
13 Feb 2002, 07:54
Good to know I am not the only one having this small problem :)

Lucky
13 Feb 2002, 10:52
Any support here?

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


What exactly do you mean???


-Joe

monaarts
07 Mar 2002, 16:20
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
07 Mar 2002, 18:17
http://www.vbulletin.org/forum/showthread.php?threadid=35832

lowlight
20 Mar 2002, 22:00
How do I put a line break between "Member(s) On" and "Guest(s) On" ?

I don't know PHP :o

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

lowlight
20 Mar 2002, 22:13
Duh... I thought of that, but I didn't even try it... Thanks! :D

Ninth Dimension
20 Mar 2002, 22:41
did it work? (it should have)

lowlight
21 Mar 2002, 01:40
Yup it worked

Now my next question:

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

Ninth Dimension
21 Mar 2002, 01:48
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
21 Mar 2002, 10:22
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
21 Mar 2002, 17:17
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
22 Mar 2002, 07:21
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
23 Mar 2002, 08:27
what code do i put into the main page to get it to show up?

E
23 Mar 2002, 09:05
ill definetly use it when my page is up

lowlight
25 Mar 2002, 22:00
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
13 Apr 2002, 16:07
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
23 May 2002, 04:38
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
29 May 2002, 18:54
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
29 May 2002, 19:01
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
01 Jun 2002, 05:15
cool i'll use this one, thanks

Webmasta XT
09 Jun 2002, 18:35
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
09 Jun 2002, 18:41
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
21 Jun 2002, 09:31
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
21 Jun 2002, 15:06
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
21 Jun 2002, 19:32
thanks will try

dreamhost
27 Jul 2002, 10:23
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
01 Aug 2002, 17:59
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
23 Dec 2002, 00:51
is there a way I can make the usernames link to the profile?

Sakura Online
24 Dec 2002, 21:46
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
24 Dec 2002, 21:58
On the path try putting the url for the site where the forum is directly to the config.php

Sakura Online
24 Dec 2002, 22:27
okay thank you i will try it right now and tell you what happens!

thank you

Sakura Online
24 Dec 2002, 22:45
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
24 Dec 2002, 22:53
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
26 Dec 2002, 17:58
Not get $path back andlook for the other $path a little before it and find it.

boiboi
12 Mar 2003, 21:08
works for vb 3?

stark427
17 Mar 2003, 16:38
12-24-02 at 11:53 PM Sakura Online said this in Post #129 (http://www.vbulletin.org/forum/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
29 Apr 2003, 14:58
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
04 May 2003, 13:09
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
07 Jun 2003, 11:29
thnx for this hack , I want to ask you how can implament it in php-nuke ??

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

M4g!k
26 Jun 2003, 08:51
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
26 Jun 2003, 18:00
Anyone get it working with 2.30?

codewebs
11 Jul 2003, 07:11
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
17 Jul 2003, 21:21
06-26-03 at 01:00 PM Splitfyre said this in Post #138 (http://www.vbulletin.org/forum/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
17 Jul 2003, 22:44
All seems to be running fine on 2.3.0 :)

Thanks.

Sylvus
27 Aug 2003, 22:51
Verify. 2.3.0 works like a charm, just installed it.

Syl...

Jargon
03 Jun 2004, 10:17
whats the code for posts and threads?

MarkyLeonard
21 Jan 2005, 16:34
Works great on 2.3.4!