Commit ac1a9a77 authored by Nico Schallehn's avatar Nico Schallehn

kleine Anpassungen an den Automatischen antwort + Bugfix am privaten

chat
parent 96723016
...@@ -19,23 +19,27 @@ $result = mysql_query("SELECT count(*) AS anzahl FROM user WHERE Online = 1"); ...@@ -19,23 +19,27 @@ $result = mysql_query("SELECT count(*) AS anzahl FROM user WHERE Online = 1");
// Funktions // Funktions
// //
function ChatNachricht($text, $admin, $userchange ){ function ChatNachricht($text, $admin, $userchange ){
if($admin != 3) $text = addslashes(htmlspecialchars($text)); if($admin != 2) $text = addslashes(htmlspecialchars($text));
$admin = addslashes(htmlspecialchars($admin)); $admin = addslashes(htmlspecialchars($admin));
$userchange = addslashes(htmlspecialchars($userchange)); $userchange = addslashes(htmlspecialchars($userchange));
$UserID = 0; $UserID = 0;
$time = time()+2; $time = time()+2;
$privateAntwort = false;
if((substr(trim($text), 0, 3) == "/p ") OR (substr(trim($text), 0, 3) == "/w ")) if((substr(trim($text), 0, 3) == "/p ") OR (substr(trim($text), 0, 3) == "/w "))
{ {
$end = strpos($text, ":"); $end = strpos($text, ":");
$privateAntwort =true;
$name = substr($text, 3, $end-3); $name = substr($text, 3, $end-3);
$UserID = UsernametoID($name); $UserID = UsernametoID($name);
$text = substr($text, $end+1); $text = substr($text, $end+1);
if(!($UserID == false)){
$JamesText = "Deine Nachricht an ".$name." konnte ich leider nicht zustellen, da der Benutzer nicht existiert! :-(";
}
} }
if ($UserID == false){ if ($privateAntwort){
sendMessage( "Deine Nachricht an ".$name." konnte ich leider nicht zustellen, da der Benutzer nicht existiert! :-(", 1, 0, 0, $admin, $time, 0, $_SESSION['chatuserid']); sendMessage( $JamesText , 1, 0, 0, $admin, $time, 0, $_SESSION['chatuserid']);
}else{ }else{
sendMessage( $text, $_SESSION['chatuserid'], $userchange, 0, $admin, time(), 0, $UserID ); sendMessage( $text, $_SESSION['chatuserid'], $userchange, 0, $admin, time(), 0, $UserID );
} }
......
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