Version: 1.00, by Gary King
Developer Last Online: Jun 2020
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:
Find
PHP Code:
$path = "./vb3/"; // path to your forums folder, normally /forum/
, change the ./vb3/ to whatever the path is to your forums directory
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.
//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
$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");
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 = "*"; }
} 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);
if (($showusernames == 1 and $howmany >= 1) or ($showusernames == 0 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);
//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
$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");
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 = "*";
}
} 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);
if (($showusernames == 1 and $howmany >= 1) or ($showusernames == 0 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);
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.