PDA

View Full Version : Hack: "Currently are x users online!" nearby $fivelinks ???


05-25-2000, 02:45 AM
Hi,

i've found a nice little script what displays active users by logging the ip into a mySQL-Database - take a look:


<?
/////////////////////////
// Online - User //
/////////////////////////

$IP=$REMOTE_ADDR;
$HOST= gethostbyaddr($IP);
$time= explode( " ", microtime());
$userusec= (double)$time[0];
$usersec= (double)$time[1];

$database= "userlog";
$table= "userlog";
$sqlhost= "localhost";
$sqluser= "root";
$sqlpass= "";

mysql_connect($sqlhost,$sqluser,$sqlpass) OR DIE( "Couldn't connect to MySQL server!");
mysql_select_db($database) OR DIE( "Couldn't select database!");


$deleteuser= mysql_query( "delete from userlog where DATE < $usersec -300");
$userlog= mysql_fetch_row(MYSQL_QUERY( "SELECT * FROM userlog where IP like '$IP'"));

$User_ID=md5(str_replace(".","",$REMOTE_ADDR) + mt_rand(10000,999999));

if($userlog == false)
{
$ok= @mysql_query( "insert INTO userlog (ID,IP,NAME,DATE) VALUES('$User_Id','$IP','$HOST','$usersec')")or die( "Unable to query db!");
}


$resultlogtab = mysql_query( "SELECT Count(*) as total FROM userlog");
$numberlogtab = mysql_fetch_array($resultlogtab);

print "<b><p align=\"left\"><font size=\"2\" face=\"Verdana\" color=\"#000000\">$numberlogtab[total] User online!</font></p></b>";

?>


Would be nice if we could add this in the area of $fivelinks and using the same database as vB ... what do you think?

05-26-2000, 12:13 PM
HAs anyone tried this yet?

01-31-2001, 04:34 AM
i'm a little shady on where this is posted.. anyone help me out with this ?

01-31-2001, 05:06 AM
This hack has already been made.

[UPDATED] Users Online Hack
http://www.vbulletin.com/forum/showthread.php?s=&threadid=6787

[Users Online]
Is a default part of the vB which can be turned on or off using control panel.

01-31-2001, 05:52 AM
hmm.. didn't realize that those were the same hack.. this one has the ip posted multiple times in the code as the other one doesn't seem to worry about the ip at all.. i'll look into that code though.. thx :)