vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   A Request (https://vborg.vbsupport.ru/showthread.php?t=43018)

Mike Gaidin 08-31-2002 11:30 PM

A Request
 
Is there a way to make it so make it so the admin can view who's online from within the admin control panel without having to go the the main page? I'd like a feature like this for my admin control panel. Maybe to sit above Freddie's admin cp addition. Thanks!

Link14716 08-31-2002 11:45 PM

Open admin/index.php

Find:
Code:

makenavselect("Announcements");
Under it add:
Code:

// ***
makenavoption("Who's Online?","../online.php?s=");
makenavselect("Who's Online?");

;)

Mike Gaidin 09-01-2002 01:14 AM

Thanks, but that's not what I mean. I already have that setup. I want it to display on the main admin cp page along with the other info, not in the menu.

Chris M 09-01-2002 07:29 AM

Then just open up admin/index.php, and find :

Code:

<p><font size='1'>From here, you can control all aspects of your vBulletin forums.
Please select what you need from the links down the left hand side of this page.</font><p>

And add below :

Code:

<br><a href="../online.php?s=">Who's Online</a>
Satan

Logician 09-01-2002 09:05 AM

This small trick can work if you are IE user: ;)

PHP Code:

<div align=center><iframe name="cwindow" style="border:0" width=600 height=400 src="../online.php"></iframe


Chris M 09-01-2002 09:19 AM

Yey!:)

I frames:D

Satan

Mike Gaidin 09-01-2002 05:55 PM

Thanks everyone, but I'm not looking for links. I'm looking for it to be a part of the display with the default admin cp color scheme.

Logician, I will try yours for now. Thanks!

joecool 09-01-2002 06:54 PM

I think I understand what you want.

Open Admin/index.php and find :

PHP Code:

  <font size='1'>From hereyou can control all aspects of your vBulletin forums.
Please select what you need from the links down the left hand side of this page.</font><p

Add this either before of after it, or maybe replace the above text. With this code ::

PHP Code:

<?php
        
$datecut
=time()-$cookietimeout;
$headerguests=$DB_site->query_first("SELECT COUNT(*) AS count FROM session WHERE userid=0 AND lastactivity>$datecut");
$headerusers=$DB_site->query_first("SELECT COUNT(DISTINCT(userid)) AS count FROM session WHERE session.userid>0 AND session.lastactivity>$datecut");
$headerguests=$headerguests[count];
$headerusers=$headerusers[count];


print(
"<align='center'>Guests Online: $headerguests[count]<br>");
print(
"<align='center'>Members Online: $headerusers[count] who are <br>");


?>
                    <?


$usernames = "on"; 
                   
$path = "path/to/admin"; 



$cookievalue = mysql_query("SELECT value FROM setting WHERE varname = 'cookietimeout'") or die("oops1");
$cookietimeout = mysql_result($cookievalue, 0, 0);
$datecut = time()-$cookietimeout;

$invisibleregmember = "0";

if ($usernames == "on") {
    $regmembers = mysql_query("SELECT DISTINCT username,invisible FROM user,session WHERE session.userid=user.userid AND session.lastactivity>$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;
} else {
    $regmembers = mysql_query("SELECT DISTINCT COUNT(userid) AS membersonline FROM session WHERE userid>0 AND session.lastactivity>$datecut") or die("oops2");
    while($members = mysql_fetch_array($regmembers)) {
        $regmemberson = number_format($members[membersonline]);
    }
}

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

if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
echo("<a href=\"../member.php?s=$session[sessionhash]&action=getinfo&userid=$bbuserinfo[userid]\"><b>$regmemberson</b></a><br>

}else{
echo("No members on-line");
}

?>


Save upload and Wow, this will allow you to see who is online and click them to see profile.. Also it will show how many guests online :)

Let me know if its okay. :) been tested on my 2.26vb)

Mike Gaidin 09-01-2002 07:14 PM

Thanks, I will test it now. :D

joecool 09-01-2002 07:20 PM

Cool, the first step, is optional, i mean you can put it whereever you want but nicely at the top looks noce for my, cos i have no other mods on their. :)


All times are GMT. The time now is 04:55 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.01625 seconds
  • Memory Usage 1,746KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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