Commit 90bfc235 authored by Nico Schallehn's avatar Nico Schallehn

Funktion für Cronjob hinzugefügt

parent d53773fe
......@@ -109,4 +109,17 @@ function AdminLogAdd($nachricht, $ID, $userchange)
{
mysql_query("INSERT INTO chat (`nachricht` ,`user_id` ,`userchange` ,`hideuser` ,`admin` ,`chat_time` ,`hidden` ,`privat`) VALUES ('$nachricht', '$ID', '$userchange', '1', '0', '".time()."', '1', '0')");
}
function offtimeout()
{
$result = mysql_query("SELECT id, name FROM user WHERE refresh_time < '".(time()-60)."' AND online = '1'");
$counter = 0;
while($user = mysql_fetch_array($result))
{
mysql_query("INSERT INTO chat (nachricht, user_id, hideuser, userchange, chat_time) VALUES ('<b>{$user['name']}</b> verl&auml;sst den Chat durch <b>TimeOut</b>', '{$user['id']}', '1', '1', '".time()."')");
$text .= $user['name']." wurde Ausgelogt!\r\n";
$counter++;
}
mysql_query("UPDATE user SET online = '0' WHERE refresh_time < '".(time()-60)."' AND online = '1'");
return $text;
}
?>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment