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.
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.
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.
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:
Quote:
} 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:
Quote:
} 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.
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???
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?
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.