• Das Erstellen neuer Accounts wurde ausgesetzt. Bei berechtigtem Interesse bitte Kontaktaufnahme über die üblichen Wege. Beste Grüße der Admin

betrift das spy user script!

xxoes

New member
Also ich bin daran interesseiert das spy user script zu bekommen.
Ich habe zwar schon ein ähnliches programm: user online 1.1 dieses zeigt aber keine ip adressen an aber es funktioniert gut.
Ich will es wenn es geht gerno so haben das man sich auf meiner homepage einlogt und die liste sehen kann wo welcher user(mit eingelogten namen) sich befindet.
Mein script sieht so aus:

userin.php4:
<?
$handler=@mysql_connect($db_server,$db_username,$db_passwort);
@mysql_select_db($db_database,$handler);

$zeit = time();
//$ip = getenv(REMOTE_ADDR);
//$file = $PHP_SELF;

$result=mysql_query("INSERT INTO $db_table VALUES ('$zeit','$ip','$file')",$handler);

mysql_close();
?>



useronline.php4:
//Declaration of Parameters

$zeit = time();

$loeschzeit = $zeit-($timeout*60);

$ip = getenv(REMOTE_ADDR);

$file = $PHP_SELF;

//Database-Connect

$linkfile = $file;

$handler = mysql_connect($db_server,$db_username,$db_passwort);

mysql_select_db($db_database,$handler);



//Database-Commands

//$result = mysql_query("INSERT INTO $db_table VALUES ('$zeit','$ip','$file')",$handler);

$result = mysql_query("DELETE FROM $db_table WHERE zeit<'$loeschzeit'",$handler);

$result = mysql_query("SELECT DISTINCT ip FROM $db_table",$handler);

$anzahl_user= mysql_numrows($result);




//Print Headline

echo "<table width=\"$twidth\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";

echo "<tr>";

echo "<td bgcolor=\"$bghl\" align=\"center\">";

echo "<font face=\"$ffacehl\" size=\"$fsizehl\" color=\"$fcolorhl\">";

echo "<b>";

echo $anzahl_user." ".$texthl;

echo "</font>";

echo "</b>";

echo "</td>";

echo "</tr>";

echo "<tr>";

echo "<td height=\"7\">";

echo "</td>";

echo "</tr>";



//Define Directories for display and sort them

unset($file);

for ($i = 0; $i < $anzahl_user; $i++)

{

$row = mysql_fetch_array($result);

$ip = $row[ip];

$result2 = mysql_query("SELECT file FROM $db_table WHERE ip='$ip' ORDER BY zeit DESC",$handler);

$row2 = mysql_fetch_array($result2);

$datei = $row2[file];

$datei = explode("/",$datei);

for ($xy=0;$xy<count($datei)-1;$xy++)

{

$file .= $datei[$xy];

if ($xy<(count($datei)-2)) $file .= "/";

}

if (count($datei)==2) $file .= $datei[$xy];

$anzahluser[$file]++;

if (count($datei)==2):

$linkuser[$file] = "../".$file;

else:

$linkuser[$file] = $file;

endif;

unset ($file);

}


@arsort($anzahluser);


//Print following Lines

include ("addy.php4");

mysql_close();

?>

</table>


die addy.php4:
<?
while (list ($key, $val) = each ($anzahluser))

{



echo "<tr bgcolor=\"$bgfl\">";

echo "<td align=\"center\">";

echo "<font face=\"$ffacefl\" size=\"$fsizefl\" color=\"$fcolorfl\">";

if($val>1):

echo $val." ".$text2;

else:

echo $val." ".$text1;

endif;

echo "<br>";

echo "<a href=$linkuser[$key]>$key</a>";
echo "</font>";

echo "</td>";

echo "</tr>";

echo "<tr>";

echo "<td height=\"5\">";

echo "</td>";

echo "</tr>";



}
?>

und dann noch die dbconf.php4 wo die einstellung von mysql gespeichert sind.
<?

//Database-Specifications

//Database-Server-Name
$db_server = "127.0.0.1";

//MySQL-Username
$db_username = "gfhhgfhgfgf";

//MySQL-Password
$db_passwort = "hjgsdhdhgfh";

//Database-Name
$db_database = "mysql";

//Database-Table-Name
$db_table = "useronline";



//--------------------------------------------------------------

//Time-Settings

//Timeout to delete Users in Minutes
$timeout = "5";



//--------------------------------------------------------------

//Table-Settings

//Table-Width (in Pixel)
$twidth = "100";

//Background (Headline)
$bghl = "#dddddd";

//Background (following lines)
$bgfl = "#dddddd";



//--------------------------------------------------------------

//Font-Settings

//Font-Face (Headline)
$ffacehl = "Arial";

//Font-Size (Headline)
$fsizehl = "2";

//Font-Color (Headline)
$fcolorhl = "#6666ff";

//Font-Face (following lines)
$ffacefl = "Arial";

//Font-Size (following lines)
$fsizefl = "1";

//Font-Color (following lines)
$fcolorfl = "#6666ff";



//--------------------------------------------------------------

//Text-Settings

//Text for the Headline (xx user-online?)
$texthl = "user online";

//Text for one user on a directory
$text1 = "user is at:";

//Text for more than one user on a directory
$text2 = "users are at:";


?>


ich nehme an das ich nur die addy.php4 ändern muss um zu erreichen das ´der angemeldete benutzername und die zugehörige ip angezeigt wird und es wäre schön wenn auch noch die seite.

Danke xxoes.
 
Zurück
Oben