Danke, nur leider zeigt der meinen Nick als Unbekannt an ... net so das gelbe vom ei :)
Vielleicht hat ja jemand ne Ahnung und könnte das mal kurz testen. Ansonsten ist hier der Source davon:
<?php
/*
Plugin Name: Who is Online
Plugin URI: http://www.mcmike.nl/english
Description: Who is online script (duh)
Author: McMike
Version: 3.5
Author URI: http://www.mcmike.nl/english
*/
function wo_lastvisit() {
$nu = time();
$naam = $_COOKIE['comment_author_'.COOKIEHASH];
$line = mysql_query("SELECT wo_id,tijd FROM wieonline WHERE wie = '$naam' LIMIT 1");
$temp = @mysql_fetch_array($line);
$wo_id = $temp['wo_id'];
$wo_tijd = $temp['tijd'];
if ($naam != NULL && $wo_tijd != NULL && $wo_id != NULL)
?> Willkommen zurueck <? echo $naam;?>, <br>dein letzter Besuch war am: <? echo date('d-m-Y H:i:s', $wo_tijd);?> <BR /><?
//Alter this line above to change the output. If you know what you are doing you can alter the date display
// It's simple the PHP DATE function (more info php.net)
}
function wieisonline() {
$nu = time();
$naam = $_COOKIE['comment_author_'.COOKIEHASH];
$line = mysql_query("SELECT wo_id FROM wieonline WHERE wie = '$naam' LIMIT 1");
$temp = @mysql_fetch_array($line);
$wo_id = $temp['wo_id'];
//Check to see if the user is in the DB or not...
if ($wo_id != NULL) {
mysql_query("UPDATE wieonline SET tijd = '$nu', ip = '$ip',cookie='$cookie' WHERE wo_id = '$wo_id'");
} else {
mysql_query("INSERT INTO wieonline (wie, tijd, ip,cookie) VALUES ('$naam','$nu','$ip','$cookie')");
}
//Change this setting for how much time you want to see the last users (in minutes)
if ($tijd == "")
$tijd = 5;
//Minutes, but we need time in seconds :)
$tijd = $tijd * 60;
$zoekop = $nu - $tijd;
//Getting the last 5, change LIMIT 5 to LIMIT 10 to see the last 10 etc.
$info = mysql_query("SELECT * FROM wieonline where tijd > '$zoekop' ORDER BY tijd DESC LIMIT 5");
while ($line = @mysql_fetch_array($info)) {
$geleden = $nu - $line[tijd];
if ($geleden > 60) {
$geleden = sprintf("%.1f", $geleden / 60);
$zegtijd = $geleden." (mins)";
} elseif ($geleden > 10 ) {
$zegtijd = $geleden." (secs)";
} else {
$zegtijd = " (Online)";
}
if ($line['wie'] == "") {
//Anoniem is Dutch for anonymous :)
$wie = "Unbekannt";
} else {
$wie = $line['wie'];
}
//Comment this line to NOT show anything !!!
//This is the actual OUTPUT, edit this just the way you like it :)
echo $wie." ".$zegtijd."<BR>";
}
}
?>
Alles anzeigen
Das einzige was ich so net anzeigen kann sind halt die Einträge in der SQL Datenbank. Davon abgesehen wird auch nur ein User zur Zeit online angezeigt und dieser trägt halt den Nick: Unbekannt :P