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 In Admin CP (https://vborg.vbsupport.ru/showthread.php?t=43060)

sreedchi 02-08-2003 08:18 PM

Just to add... when a 'Guest' is online, it shows the actual thread/location. Anyone registered though, it just shows "Control Panel"

Red Blaze 02-11-2003 06:50 PM

Out of all the hacks I've seen, I don't really like this one. Basically because

1) It doesn't show the actual location
2) I don't like the fact that the user is repeated 2 to 3 times.

Sorry guy. *shrugs* It may be good to others, but not me.

Good work though. At least others do like it. ;)

sreedchi 02-12-2003 01:34 AM

If it showed the actual location, it would be great. I get the sense that it is intended to. It shows actual location for "guests."

Is there a better hack I should know about?

amykhar 03-16-2003 06:49 PM

Bug Fix!

Code:

if ($online[location] = " ") {
Should be:

Code:

if ($online[location] == " ") {

vB-Host.com 05-14-2003 12:31 PM

I also have admin stats installed and since installing your hack. It now gives me "Resources ID #24" instead of total online.. here is a screenshot

http://www.thesportsforum.net/adminscreen.gif

OmaniMan 05-21-2003 10:26 PM

Great Hacks...
OmaniMan .. Install It

AllMadden.net 07-03-2003 03:18 PM

I am also curious as to why it shows everyone in control panel rather than where they really are...

Till 08-04-2003 08:58 AM

Works perfectly, way to go. :)

mccollin 08-22-2003 07:12 PM

This is the solution to all your registered users being in the Control Panel... which is a bit alarming at first glance. ;)

The online location when you are in the Control Panel is null, not blank, so this solves it.


PHP Code:

if ($online[location] = " ") { 


PHP Code:

if (!$online[location]) { 


OK, now someone want to trade me and show how what you did to show the IP address?

By the way, NTLDR is the GREATEST! I am a person who likes simplicity, and your hacks make things that appear to be complex, end up being simple. Thanks for contributing your work!

mccollin 08-22-2003 07:31 PM

OK, scratch my last trade comment... here is the code WITH the location fixed for registered users, and the IP address added...there are too many changes to list them, given the total size. I'm going to make a final edit that I won't upload, because it deviates from the spirit of the original code. If anyone wants it, let me know. I'm going to kill the IP column, and just replace "Guest" with their IP address. That will eliminate a column, and I don't care about IP addresses for registered users anyway. If anyone wants it, i'll post it.

PHP Code:


$datecut 
time()-$cookietimeout;

$onlineusers mysql_query("SELECT DISTINCT username,location,session.lastactivity,session.host,usergroupid FROM user,session WHERE session.userid=user.userid AND session.lastactivity>$datecut ORDER BY username ASC");
           echo 
"<br><br><table width=\"90%\" align=\"center\" border='0' cellpadding='0' cellspacing='0' class='tblborder'><tr><td>";
           echo 
"<table width=\"100%\" border=0 cellspacing=1 cellpadding=4><tr class='tblhead'><td align=\"center\" colspan=4 width=\"100%\"><b><span class='tblhead'>Who's Online</span></b></td></tr>\n";
    echo 
"<tr class='".getrowbg()."'><td nowrap align=\"center\"><font size='1'><b>Username</b></font></td><td align=\"center\" nowrap><font size='1'><b>Location</b></font></td><td align=\"center\" nowrap><font size='1'><b>Host IP</b></font></td><td align=\"center\" nowrap><font size='1'><b>Last Active</b></font></td></tr>\n";
        while (
$online=$DB_site->fetch_array($onlineusers)) {       
        if (!
$online[location]) {
        
$online[location] = "Control Panel";
       }
        if (
$online['usergroupid'] == 6) {
       
$username "<b><i>$online[username]</i></b>";
       } else if (
$online['usergroupid'] == 5) {
           
$uusername "<b>$user[username]</b></font>";
       } else {
        
$username $online[username];
        }
        
$lastactivity=vbdate($timeformat,$online[lastactivity]);
        echo 
"<tr class='".getrowbg()."'><td nowrap><a href=\"../member.php?s=$session[sessionhash]&action=getinfo&username=$online[username]\" target=_blank>$username</a></td><td nowrap>$online[location]</td><td nowrap>$online[host]</td><td nowrap>$lastactivity</td></tr>";
    }
$onlineguests mysql_query("SELECT DISTINCT location,lastactivity, host FROM session WHERE userid=0 AND session.lastactivity>$datecut ORDER BY host ASC");
        while (
$onlineg=$DB_site->fetch_array($onlineguests)) {       
        
$lastguestactivity=vbdate($timeformat,$onlineg[lastactivity]);
        echo 
"<tr class='".getrowbg()."'><td nowrap>Guest</td><td nowrap>$onlineg[location]</td><td nowrap>$onlineg[host]</td><td nowrap>$lastguestactivity</td></tr>";
    }
echo 
"</table></td></tr></table>"



All times are GMT. The time now is 05:00 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.01131 seconds
  • Memory Usage 1,761KB
  • 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
  • (2)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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