Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

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
  #72  
Old 08-12-2006, 03:52 AM
dstjohn's Avatar
dstjohn dstjohn is offline
 
Join Date: Jul 2006
Location: Colorado
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Forgot to mention you need to run through the entire script
and do a search and replace.

search for all instances of $tableprefix

and replace with
$config['Database']['tableprefix']
Reply With Quote
  #73  
Old 08-12-2006, 03:57 AM
dstjohn's Avatar
dstjohn dstjohn is offline
 
Join Date: Jul 2006
Location: Colorado
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
<?php

//VARS, edit to your vb environment
$path "./forums/";             // path to your forums folder, normally /forum/
$showusernames 0;         // valid settings TRUE = yes show usernames FALSE = dont show usernames
//stop vars

chdir($path);
require_once(
"./includes/config.php");

function 
iif($expression$returntrue$returnfalse '') {
    return (
$expression $returntrue $returnfalse);
}

mysql_connect($config['MasterServer']['servername'],$config['MasterServer']['username'],$config['MasterServer']['password']);
mysql_select_db($config['Database']['dbname']);



$settings mysql_query("SELECT * FROM ".$config['Database']['tableprefix']."setting WHERE varname = 'cookietimeout'");
$settings mysql_fetch_array($settings);

$datecut time()-$settings['value'];

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

$howmany substr_count($regmemberson,",");

if ((
$showusernames == and $howmany >= 1) or ($showusernames == and $regmemberson 1))
{
    
$memberstext 'Members';
}
else
{
    
$memberstext 'Member';
}

$guests mysql_query("SELECT COUNT(userid) AS guestsonline FROM ".$config['Database']['tableprefix']."session WHERE userid=0 AND ".$config['Database']['tableprefix']."session.lastactivity>$datecut") or exit("oops4");
$guests mysql_fetch_array($guests);

if (
$guests['guestsonline'] > 1)
{
    
$gueststext 'Guests';
}
else
{
    
$gueststext 'Guest';
}
$guestson number_format($guests['guestsonline']);

$show $memberstext.' online: '.$regmemberson.'. '.$gueststext.' online: '.$guestson.'.';

print 
$show;

?>
Reply With Quote
  #74  
Old 08-21-2006, 02:02 PM
vol_freak vol_freak is offline
 
Join Date: Apr 2005
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dstjohn
PHP Code:
<?php

//VARS, edit to your vb environment
$path "./forums/";             // path to your forums folder, normally /forum/
$showusernames 0;         // valid settings TRUE = yes show usernames FALSE = dont show usernames
//stop vars

chdir($path);
require_once(
"./includes/config.php");

function 
iif($expression$returntrue$returnfalse '') {
    return (
$expression $returntrue $returnfalse);
}

mysql_connect($config['MasterServer']['servername'],$config['MasterServer']['username'],$config['MasterServer']['password']);
mysql_select_db($config['Database']['dbname']);



$settings mysql_query("SELECT * FROM ".$config['Database']['tableprefix']."setting WHERE varname = 'cookietimeout'");
$settings mysql_fetch_array($settings);

$datecut time()-$settings['value'];

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

$howmany substr_count($regmemberson,",");

if ((
$showusernames == and $howmany >= 1) or ($showusernames == and $regmemberson 1))
{
    
$memberstext 'Members';
}
else
{
    
$memberstext 'Member';
}

$guests mysql_query("SELECT COUNT(userid) AS guestsonline FROM ".$config['Database']['tableprefix']."session WHERE userid=0 AND ".$config['Database']['tableprefix']."session.lastactivity>$datecut") or exit("oops4");
$guests mysql_fetch_array($guests);

if (
$guests['guestsonline'] > 1)
{
    
$gueststext 'Guests';
}
else
{
    
$gueststext 'Guest';
}
$guestson number_format($guests['guestsonline']);

$show $memberstext.' online: '.$regmemberson.'. '.$gueststext.' online: '.$guestson.'.';

print 
$show;

?>

Anyone know how to get this to work with 3.6? It will display the number of members and guests online but I cannot get it to list the member names.

Any help would be greatly appreciated.
Reply With Quote
  #75  
Old 08-25-2006, 03:09 AM
shortbus1662 shortbus1662 is offline
 
Join Date: Oct 2004
Location: Enid, OK
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is there any way to get this to work on a non .php page, like asp for instance?

If anyone can do this I'd love to speak with you.
Reply With Quote
  #76  
Old 02-20-2007, 02:18 PM
danward's Avatar
danward danward is offline
 
Join Date: Dec 2006
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great update dstjohn!! Would be great to get the usernames to work on 3.6 aswell!!
Reply With Quote
  #77  
Old 04-25-2007, 11:04 AM
davidallsop's Avatar
davidallsop davidallsop is offline
 
Join Date: Oct 2005
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there anyway of getting the members online to display in the latest version of vBulletin? as Im looking for something a bit more than just the members online count.
Reply With Quote
  #78  
Old 11-14-2007, 08:31 PM
zaraz zaraz is offline
 
Join Date: Feb 2007
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/c/..................../forum/online_external.php on line 19

Reply With Quote
  #79  
Old 01-08-2008, 06:30 PM
Andy92 Andy92 is offline
 
Join Date: Jan 2008
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This wont work in 3.7.

??
Reply With Quote
  #80  
Old 01-08-2008, 06:47 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not a chance, this was written for vb 3.0.
Reply With Quote
  #81  
Old 01-13-2008, 07:01 PM
Andy92 Andy92 is offline
 
Join Date: Jan 2008
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can anyone help me work out how i can display this on a non vbulletin page, with vbulletin 3.7 ??
Reply With Quote
Reply

Thread Tools

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 02:55 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.06482 seconds
  • Memory Usage 2,416KB
  • 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
  • (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
  • (2)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