vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Who's online on non-vB page (with usernames) (https://vborg.vbsupport.ru/showthread.php?t=12010)

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:
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! :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
Code:

$db=mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname);

with
Code:

$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 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

Quote:

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

Quote:

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

Quote:

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/showthrea...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/showthrea...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...


All times are GMT. The time now is 03:51 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01421 seconds
  • Memory Usage 1,820KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete