Og det er den her kode:
<?php ob_start()
$language = "Danish"; // Default: Danish
$maxinroom = "32"; // Default: 32
$chattitle = "3DChatten"; // Default: 3DChatten
$male_img = "avt_m.png";
$female_img = "avt_f.png";
$indgangen = "1";
$butikken = "2";
$steneren = "3";
mysql_connect('192.168.1.3', 'kek', 'kek');
mysql_select_db('kek');
////////////////////////
// DO NOT EDIT MORE!!!//
////////////////////////
include "languages/" . $language . ".php";
function secure($text) {
$text = stripslashes($text);
$text = strip_tags($text);
$text = htmlspecialchars($text);
return $text;
}
function SaveInfo($username,$password,$user_id) {
setcookie("username", secure($username), time()+3600);
setcookie("password", secure($password), time()+3600);
setcookie("user_id", secure($user_id), time()+3600);
}
function DeleteInfo($username,$password,$user_id) {
setcookie("username", secure($username), time()-3600);
setcookie("password", secure($password), time()-3600);
setcookie("user_id", secure($user_id), time()-3600);
}
function ChangeRoom($id,$room) {
$resultat = mysql_query("SELECT * FROM ".$conf['db']."users WHERE id = '".secure($_COOKIE['user_id'])."'") or die(mysql_error());
$room_info = mysql_fetch_array($resultat);
mysql_query("UPDATE ".$conf['db']."users set room = '".secure($room)."' where id = '".secure($id)."'") or die(mysql_error());
mysql_query("UPDATE ".$conf['db']."users set field = '0' where id = '".secure($id)."'") or die(mysql_error());
}
function ShowUser($user_id,$avatar) {
$resultat = mysql_query("SELECT * FROM ".$conf['db']."users WHERE id = '".secure($user_id)."'") or die(mysql_error());
$user = mysql_fetch_array($resultat) or die(mysql_error());
$username = $user['username'];
echo "<img src=\\"" . $avatar . "\\" width=\\"70\\" height=\\"82\\" alt=\\"" . ucwords($username) . "\\"><br><div style=\\"background-color: #FFFFFF; width: 70px;\\"> <a href=\\"user.php?user_id=" . $user_id . "\\" target=\\"menu\\"><center>";
if($user['access'] >= "100"){
echo "<font color=\\"red\\"><b>" . ucwords($username) . "</b></font>";
} else {
echo ucwords($username);
}
echo "</center></a> </div>";
}
function CheckUser($username,$password) {
$resultat = mysql_query("SELECT * FROM ".$conf['db']."users WHERE username = '".secure($username)."'") or die(mysql_error());
$user = mysql_fetch_array($resultat) or die(mysql_error());
$username = $user['username'];
$password = $user['password'];
$user_id = $user['id'];
if($user['password'] == $password){
SaveInfo($username,$password,$user_id);
return true;
} else {
DeleteInfo($username,$password,$user_id);
return false;
}
}
function CheckAdmin($username,$password) {
$resultat = mysql_query("SELECT * FROM ".$conf['db']."users WHERE username = '".secure($username)."'") or die(mysql_error());
$user = mysql_fetch_array($resultat) or die(mysql_error());
$username = $user['username'];
$password = $user['password'];
$user_id = $user['user_id'];
if($user['password'] == $password){
if($user['access'] >= "100") {
SaveInfo($username,$password,$user_id);
return true;
} else {
SaveInfo($username,$password,$user_id);
return false;
}
} else {
DeleteInfo($username,$password,$user_id);
return false;
}
}
function LogOff() {
$resultat = mysql_query("SELECT * FROM ".$conf['db']."users WHERE username = '".secure($_COOKIE['username'])."'") or die(mysql_error());
$user = mysql_fetch_array($resultat) or die(mysql_error());
$username = $user['username'];
$password = $user['password'];
$user_id = $user['user_id'];
DeleteInfo($username,$password,$user_id);
}
echo "<title>" . $chattitle . "</title>";
echo "
<body topmargin=\\"1\\" leftmargin=\\"1\\" rightmargin=\\"1\\" bottommargin=\\"1\\" marginwidth=\\"1\\" marginheight=\\"1\\">
<style>
body {
font-size: 9;
color: #000000;
FONT-FAMILY: tahoma, verdana, arial;
SCROLLBAR-FACE-COLOR: #FFFFF;
SCROLLBAR-HIGHLIGHT-COLOR: #FFFFFF;
SCROLLBAR-SHADOW-COLOR: #00000;
SCROLLBAR-3DLIGHT-COLOR: #00000;
SCROLLBAR-ARROW-COLOR: #FFFFF;
SCROLLBAR-TRACK-COLOR: #000000;
SCROLLBAR-DARKSHADOW-COLOR: #000000;
background-color: #FFFFFF;
}
a, a:link, a:visited, a:hover, a:active, p, td {
font-size: 8;
color: #000000;
TEXT-DECORATION: none;
FONT-FAMILY: tahoma, verdana, arial;
FONT-SIZE: 8pt;
}
input, textarea, button, .input {
font-size: 9;
color: #000000;
border: 1px solid #000000 dashed;
FONT-FAMILY: tahoma, verdana, arial;
}
SELECT {
font-size: 9;
color: #000000;
border: 1px solid #000000;
FONT-FAMILY: tahoma, verdana, arial;
}
OPTION {
font-size: 9;
color: #000000;
border: 1px solid #000000;
FONT-FAMILY: tahoma, verdana, arial;
}
hr {
BORDER-RIGHT: #c0c0c0 1px dotted;
BORDER-TOP: #c0c0c0 1px dotted;
BORDER-LEFT: #c0c0c0 1px dotted;
BORDER-BOTTOM: #c0c0c0 1px dotted;
}
</style>";
ob_end_flush() ?>