diff --git a/content/konto/nickpage.php b/content/konto/nickpage.php index d2b6ea3d1104318685127c4e4c779e9ca46797e1..de590cd894d10c37e64d526cbe3dd5963c82bc5d 100644 --- a/content/konto/nickpage.php +++ b/content/konto/nickpage.php @@ -99,7 +99,7 @@ if($esc['bdate'] == 0){ if($nickpage['ava'] == ''){ echo '<div class="alert alert-info">Kein Avatar gewählt</div>'; }else{ - echo '<a href="#" class="thumbnail"><img src="'. $nickpage['ava'] .'" alt="'. $_SESSIOn['uid'] .'"></a>'; + echo '<a href="#" class="thumbnail"><img src="'. $nickpage['ava'] .'" alt="'. $_SESSION['uid'] .'"></a>'; } ?> </td> diff --git a/lib/class/chat.class.php b/lib/class/chat.class.php index fc9d9c6e5c0ce9fc155fda50fb51aea827aec34c..0dba0a49383dc3169e0bd0d79f6f78337ea213e9 100644 --- a/lib/class/chat.class.php +++ b/lib/class/chat.class.php @@ -1,41 +1,40 @@ <?php -class chatClass - { - public static function getRestChatLines($id) - { - global $db_host,$db_user,$db_pass,$db_base; - $arr = array(); - $jsonData = '{"results":['; - $db_connection = new mysqli( $db_host, $db_user, $db_pass, $db_base); - $db_connection->query( "SET NAMES 'UTF8'" ); - $statement = $db_connection->prepare( "SELECT id, absender, nachricht, time FROM vms_chat WHERE id > ? "); - $statement->bind_param( 'i', $id); - $statement->execute(); - $statement->bind_result( $id, $usrname, $chattext, $chattime); - $line = new stdClass; - while ($statement->fetch()) { - $line->id = $id; - $line->usrname = $usrname; - $line->chattext = $chattext; - $line->chattime = date('H:i:s', $chattime); - $arr[] = json_encode($line); - } - $statement->close(); - $db_connection->close(); - $jsonData .= implode(",", $arr); - $jsonData .= ']}'; - return $jsonData; +class chatClass{ + public static function getRestChatLines($id){ + global $db_host,$db_user,$db_pass,$db_base; + $arr = array(); + $jsonData = '{"results":['; + $db_connection = new mysqli( $db_host, $db_user, $db_pass, $db_base); + $db_connection->query( "SET NAMES 'UTF8'" ); + $statement = $db_connection->prepare( "SELECT id, absender, nachricht, time FROM vms_chat WHERE id > ? "); + $statement->bind_param( 'i', $id); + $statement->execute(); + $statement->bind_result( $id, $usrname, $chattext, $chattime); + $line = new stdClass; + while ($statement->fetch()) { + $line->id = $id; + $line->usrname = $usrname; + $line->chattext = $chattext; + $line->chattime = date('H:i:s', $chattime); + $arr[] = json_encode($line); + } + $statement->close(); + $db_connection->close(); + $jsonData .= implode(",", $arr); + $jsonData .= ']}'; + return $jsonData; } public static function setChatLines( $chattext, $usrname, $color) { - $db_connection = new mysqli( mysqlServer, mysqlUser, mysqlPass, mysqlDB); - $db_connection->query( "SET NAMES 'UTF8'" ); - $statement = $db_connection->prepare( "INSERT INTO chat( usrname, color, chattext) VALUES(?, ?, ?)"); - $statement->bind_param( 'sss', $usrname, $color, $chattext); - $statement->execute(); - $statement->close(); - $db_connection->close(); + global $db_host,$db_user,$db_pass,$db_base; + $db_connection = new mysqli( $db_host, $db_user, $db_pass, $db_base); + $db_connection->query( "SET NAMES 'UTF8'" ); + $statement = $db_connection->prepare( "INSERT INTO chat( usrname, color, chattext) VALUES(?, ?, ?)"); + $statement->bind_param( 'sss', $usrname, $color, $chattext); + $statement->execute(); + $statement->close(); + $db_connection->close(); } - } +} ?> \ No newline at end of file