Version: , by tubedogg
Developer Last Online: Dec 2016
Version: 2.2.x
Rating:
Released: 03-21-2001
Last Update: Never
Installs: 101
No support by the author.
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:
Code:
<? 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:
Code:
<!--#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! Likes/dislikes/modification requests all gladly accepted!
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
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);
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.
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?