Commit 7adffcb5 authored by Nico Schallehn's avatar Nico Schallehn

neue Funkion für das eintragen einer CHatmessage eingebaut

parent 1437503f
...@@ -30,7 +30,9 @@ function ChatNachricht($text, $admin, $userchange ){ ...@@ -30,7 +30,9 @@ function ChatNachricht($text, $admin, $userchange ){
$UserID = UsernametoID($name); $UserID = UsernametoID($name);
$text = substr($text, $end+1); $text = substr($text, $end+1);
} }
mysql_query("INSERT INTO chat (user_id, nachricht, userchange, admin, chat_time, privat) VALUES ('{$_SESSION['chatuserid']}', '$text', '$userchange', '$admin', '" . time() . "', '$UserID')"); /*mysql_query("INSERT INTO chat (user_id, nachricht, userchange, admin, chat_time, privat) VALUES
('{$_SESSION['chatuserid']}', '$text', '$userchange', '$admin', '" . time() . "', '$UserID')");*/
sendMessage( $text, $_SESSION['chatuserid'], $userchange, 0, $admin, time(), 0, $UserID );
//echo "INSERT INTO chat (user_id, nachricht, userchange, admin, chat_time, privat) VALUES ('{$_SESSION['chatuserid']}', '$text', '$userchange', '$admin', '" . time() . "', '$UserID')"; //echo "INSERT INTO chat (user_id, nachricht, userchange, admin, chat_time, privat) VALUES ('{$_SESSION['chatuserid']}', '$text', '$userchange', '$admin', '" . time() . "', '$UserID')";
//mysql_query("UPDATE user SET chat = '".mysql_insert_id()."' WHERE id = '{$_SESSION['chatuserid']}'"); //mysql_query("UPDATE user SET chat = '".mysql_insert_id()."' WHERE id = '{$_SESSION['chatuserid']}'");
if ((preg_match("/James/i",$text)) OR ($UserID == 1)) if ((preg_match("/James/i",$text)) OR ($UserID == 1))
...@@ -46,6 +48,10 @@ function ChatNachricht($text, $admin, $userchange ){ ...@@ -46,6 +48,10 @@ function ChatNachricht($text, $admin, $userchange ){
} }
return $text; return $text;
} }
function sendMessage( $nachricht, $user_id, $userchange, $hideuser, $admin, $chat_time, $hidden, $privat ){
mysql_query('INSERT INTO chat (nachricht, user_id, userchange, hideuser, admin, chat_time, hidden, privat)
VALUES ("'.$nachricht.'", "'.$user_id.'", "'.$userchange.'", "'.$hideuser.'", "'.$admin.'", "'.$chat_time.'", "'.$hidden.'", "'.$privat.'")');
}
function BBcode($text){ function BBcode($text){
# Formatierungen # Formatierungen
$text = preg_replace('#\[b\](.*?)\[/b\]#si', '<b>\1</b>', $text); $text = preg_replace('#\[b\](.*?)\[/b\]#si', '<b>\1</b>', $text);
...@@ -156,7 +162,7 @@ function MessageFormat($hide, $admin, $privat, $name, $time, $nachricht, $vonid) ...@@ -156,7 +162,7 @@ function MessageFormat($hide, $admin, $privat, $name, $time, $nachricht, $vonid)
//return "<p class=\"chatp$style\">".date("H:i:s",$time)." | (Privat) <b>Du an ".IDtoUsername($privat)."</b>: $nachricht</p>"; //return "<p class=\"chatp$style\">".date("H:i:s",$time)." | (Privat) <b>Du an ".IDtoUsername($privat)."</b>: $nachricht</p>";
return '<div class="panel '.$style.' chatpanel"> return '<div class="panel '.$style.' chatpanel">
<div class="panel-heading"> <div class="panel-heading">
<div class="panel-title pull-left">(Privat) Du an '.$name.':</div> <div class="panel-title pull-left">(Privat) Du an '.IDtoUsername($privat).':</div>
<div class="pull-right hidden-xs">'.date("H:i:s",$time).'</div> <div class="pull-right hidden-xs">'.date("H:i:s",$time).'</div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
......
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