Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Who's online on non-vB page (with usernames, same rules as Who's Online on forumhome) Details »»
Who's online on non-vB page (with usernames, same rules as Who's Online on forumhome)
Version: 1.00, by Gary King Gary King is offline
Developer Last Online: Jun 2020 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 01-09-2004 Last Update: Never Installs: 64
 
No support by the author.

PLEASE CLICK ON THE INSTALL BUTTON IF YOU INSTALLED THIS! THANKS!

What does this hack do?

Using this hack, you can show who is currently on your forums from anywhere else on your website! The page, though, must be a PHP page.

If you want to display this information on another webpage by integrating it (which you'll probably want to ), just put
PHP Code:
<?php require_once("online.php"); ?>
or
PHP Code:
<?php

require_once("online_external.php");

?>
depending on the location of the online.php file

THE BELOW IS ONLY IF YOU ARE USING ONLINE.PHP

If you are using online.php, then this line of code MUST be at the top of the page!

If you don't want to show the total users online at the top of the page, though, then remove
PHP Code:
print $show
and copy that to wherever you want to show the info instead (remember to surround this with PHP tags, such as:
PHP Code:
<?php

print $show;

?>
THE ABOVE IS ONLY IF YOU ARE USING ONLINE.PHP

Features
  • supports phrases!
  • option to display either usernames or a total number of registered members instead
  • only administrators can see users who choose to be invisible

Instructions

Download the attached online.php if you want to show invisible users to administrators, etc., or download online_external.php if you don't want to worry as much about things , and follow these instructions:
  1. Find
    PHP Code:
    $path "./vb3/"// path to your forums folder, normally /forum/ 
    , change the ./vb3/ to whatever the path is to your forums directory
  2. Find
    PHP Code:
    $showusernames 0// 1 to show usernames online, 0 to only show the number of users online 
    and change $showusernames to 1 if you want to display usernames, instead of the total number of registered members browsing

That's it!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #62  
Old 01-27-2005, 01:49 PM
ryancooper ryancooper is offline
 
Join Date: Jul 2002
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Love it. . Installed It. . . Have One Question,


I am using online.php. The members usernames and guests all show up. . . is it a possability to link each members usernames to there profile?

ThankS!1
Reply With Quote
  #63  
Old 04-15-2005, 11:27 PM
MentaL's Avatar
MentaL MentaL is offline
 
Join Date: Jan 2003
Posts: 550
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyway of having it show total users online rather than say members and guests.. so it appears

Users online: 302
Reply With Quote
  #64  
Old 04-22-2005, 10:40 PM
CrimsonGT CrimsonGT is offline
 
Join Date: Apr 2005
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It worked fine, but it threw off my alignment on the whole page. I have it all centered and when I included the file it made everything left aligned.

Also, is there anyway I can change the way it formats it? I want it to say like...

-Members Online: 23
-Visitors Online: 2

Basically is it possible just to pull the numbers out? Also, would it be possible to find the total number of members?
Reply With Quote
  #65  
Old 05-23-2005, 01:16 PM
JohnBee JohnBee is offline
 
Join Date: Oct 2004
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This works as advertised.

I am hoping to replicate my forum who's online style.
What would it take to get it looking like this:

Quote:
Active users online: 2 (2 members and 0 guests)
JohnBee, testuser

Most users ever online was 20, 05-02-2005 at 02:50 PM.
Any help would be greatly appreciated.
Reply With Quote
  #66  
Old 05-23-2005, 04:56 PM
JohnBee JohnBee is offline
 
Join Date: Oct 2004
Posts: 544
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay I modded the script somewhat to create the above mentioned look but
I'm stuck on the Most users online bit.

heres my code thus far:

Code:
<?php

error_reporting(E_ALL & ~E_NOTICE);
require_once("./global.php");
$datecut = time()-$vboptions['cookietimeout'];

	$regmembername = $DB_site->query("SELECT DISTINCT username,options FROM ".$tableprefix."user,".$tableprefix."session 
		WHERE ".$tableprefix."session.userid=".$tableprefix."user.userid AND ".$tableprefix."session.lastactivity>$datecut 
		ORDER BY username ASC") or exit("oops2");
		
	while($regmember = $DB_site->fetch_array($regmembername))
	{
		$regmember['options'] = intval($regmember['options']);
		
		foreach($_USEROPTIONS as $optionname => $optionval)
		{
			$regmember["$optionname"] = iif($regmember['options'] & $optionval, 1, 0);
		}
		
		if ((($regmember['invisible'] == 0)) and $regmemberson or ($bbuserinfo['usergroupid'] == 6 and $regmember['invisible'] == 1))
		{
			$regmemberson .= ", ";
		}
	
		$regmembercomma++;
		if ($regmember['invisible'] == 0 or $bbuserinfo['usergroupid'] == 6) {
			if ($regmember['invisible'] == 1) {
				$userinvisible = "*";
			}
						
			$regmemberson .= $regmember['username'].$userinvisible;
			
		} else {
			$regmembercomma++;
		}
	}
	
	if (!$regmemberson)
	{
		$regmemberson = "(none)";
	}
	
	$regmembers = $DB_site->query_first("SELECT COUNT(DISTINCT userid) AS membersonline FROM ".$tableprefix."session WHERE userid>0 AND ".$tableprefix."session.lastactivity>$datecut") or exit("oops3");
	$regmembersno = number_format($regmembers['membersonline']);

$guests = $DB_site->query_first("SELECT COUNT(userid) AS guestsonline FROM ".$tableprefix."session WHERE userid=0 AND ".$tableprefix."session.lastactivity>$datecut") or exit("oops4");
$guestson = number_format($guests['guestsonline']);
$totalonline = $regmembersno + $guestson;

print 'Active users online: '.$totalonline.' ('.$regmembersno.' users and '.$guestson.' guests online.)';
echo "<br>$regmemberson";

?>
I removed all the extra's to help clear up things while manipulating the code.
I was thinking of pulling the data from the original /forum/online.php file
but I am uncertain of the approach to use, the code seems fairly long to
me and I'm pretty sure it can be reduced

any help would be greatly appreciated. thx
Reply With Quote
  #67  
Old 06-16-2006, 02:31 PM
hypnoticpimp hypnoticpimp is offline
 
Join Date: Dec 2004
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i get MYSQL errors
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/wshh/public_html/online_external.php on line 14

Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/wshh/public_html/online_external.php on line 15

I use vbulletin 3.5.4
Reply With Quote
  #68  
Old 06-20-2006, 09:55 PM
Zidane007nl's Avatar
Zidane007nl Zidane007nl is offline
 
Join Date: Jul 2004
Location: The Netherlands
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The version doesn't work with vB 3.5.x I think then. You're posting in a topic from more than 1 year old and vB 3.5.x wasn't released back then.
Reply With Quote
  #69  
Old 06-20-2006, 10:24 PM
hypnoticpimp hypnoticpimp is offline
 
Join Date: Dec 2004
Posts: 132
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

do u know any mods for 3.5.4 that can show whos online stats on a non vb page
Reply With Quote
  #70  
Old 07-11-2006, 01:02 PM
napy8gen napy8gen is offline
 
Join Date: Jan 2006
Location: port ++++son
Posts: 519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Gary King ..any plan to update this hack to 3.5.4 or next 3.6 ?
Reply With Quote
  #71  
Old 08-12-2006, 03:41 AM
dstjohn's Avatar
dstjohn dstjohn is offline
 
Join Date: Jul 2006
Location: Colorado
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not sure what happend to Gary since he hasnt posted on this hack
in quite some time, but fixing it to work with 3.5.4 was easy,
below are my changes to online_external.php

search for
PHP Code:
mysql_connect($servername,$dbusername,$dbpassword);
mysql_select_db($dbname); 
and either comment that out or completely replace it with this.

PHP Code:
mysql_connect($config['MasterServer']['servername'],$config['MasterServer']['username'],$config['MasterServer']['password']);
mysql_select_db($config['Database']['dbname']); 
Which will then produce the following output
Member online: X. Guest online: X.

Place the script outside your forums directory obviously
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:15 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07136 seconds
  • Memory Usage 2,325KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (8)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete