könnte mir da jemand bitte helfen.
Also ich hab ein Script das anzeigt wie viele user online sind und bei jedem user eintragt die zeit und nach ner weile wenn er nichts tut wieder automatisch als offline macht
Code: Alles auswählen
//time: is user online
$zeit = time() - 3600;
$befehl = "UPDATE pjfuserlogin SET last_action='$zeit' where UID='$__my_id'";
mysql_query($befehl, $mysql);
$i = 0;
$offline = time() - 3900;
$befehl = "SELECT UName, last_action from pjfuserlogin";
$resid = mysql_query($befehl, $mysql);
while ($daten = mysql_fetch_array ($resid)) {
if($daten[1] > $offline) {
$i++;
$online[$i] = $daten[0];
}
}
$anzahlp[online] = $i;
function show_online() {
global $anzahlp;
global $online;
//echo "Online Users: ";
if($anzahlp[online] > 0) {
$i=1;
for($i=1;$i <$anzahlp[online];$i++) {
echo "$online[$i],";
}
echo "$online[$i]";
}
else {
//echo ($lan)? "Sorry, no users are online." : "Leider sind keine User Online";
}
}
//show users/numbers
function show_online_anz() {
global $anzahlp;
echo "$anzahlp[online]";
}
wie mache ich das ?