PDA

View Full Version : A Request


Mike Gaidin
09-01-2002, 12:30 AM
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
09-01-2002, 12:45 AM
Open admin/index.php

Find:makenavselect("Announcements");
Under it add:// ***
makenavoption("Who's Online?","../online.php?s=");
makenavselect("Who's Online?");

;)

Mike Gaidin
09-01-2002, 02: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, 08:29 AM
Then just open up admin/index.php, and find :

<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 :

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

Satan

Logician
09-01-2002, 10:05 AM
This small trick can work if you are IE user: ;)

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

Chris M
09-01-2002, 10:19 AM
Yey!:)

I frames:D

Satan

Mike Gaidin
09-01-2002, 06: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, 07:54 PM
I think I understand what you want.

Open Admin/index.php and find :

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

Add this either before of after it, or maybe replace the above text. With this 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, 08:14 PM
Thanks, I will test it now. :D

joecool
09-01-2002, 08: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. :)

Mike Gaidin
09-01-2002, 08:38 PM
I get this error.

Parse error: parse error, unexpected T_STRING in /home/*****/public_html/forums/admin/index.php on line 163

line 163 is:

echo("No members on-line");

Any ideas?

joecool
09-01-2002, 08:43 PM
The last few lines should look like this::

echo("<a href=\"forum/board/member.php?s=$session[sessionhash]&action=getinfo&userid=$bbuserinfo[userid]\"><b>$regmemberson</b></a>");

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

?>


Also i think i might have put a <br> on line 160 at the end take this out and all should be ok. ;)

Let me know... thanks

joecool
09-01-2002, 08:45 PM
Hey..

If no luck just delete :

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

This is pointless anyway..

Mike Gaidin
09-01-2002, 08:50 PM
Excellent!!! It worked. Thank you so much for this. :D :D

joecool
09-01-2002, 08:52 PM
No problem... :) That will be $100 thanks. lol. Cya..

Mike Gaidin
09-01-2002, 08:54 PM
LOL. Thanks again.