Woooo its probably a tiny error but i dont care, and can ya try and tidy up the coding whilst ya there pwease + rep

Unexpected $end on 289

PHP Code:
<html>
<head>
<title>Home</title>
<style type="text/css">
a {
font-size: 10px;
color: #000000;
}
a:link {
text-decoration: none;
color: #000000;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
color: #000000;
}
a:active {
text-decoration: none;
color: #000000;
}
body,td,th,p {
font-family: Verdana;
font-size: 10px;
color: #000000;
}
.12 { color: red; }
.11 { color: navy; }
.10 { color: ; }
.9 { color: darkorchid; }
.8 { color: darkorchid; }
.7 { color: darkorchid; }
.6 { color: darkorchid; }
.5 { color: green; }
.4 { color: green; }
.3 { color: green; }
.2 { color: green; }
.1 { color: black; }
input {
 font-family: Tahoma, Arial;
 font-size: 8pt;
 font-weight: bold;
 color: #000000;
 background-color: #FFFFFF;
 border: 1px solid #000000;
}
select {
 background-color: #ffffff;
 font-family: Arial, Helvetica, sans-serif;
 font-size: 8pt;
 color: #000000;
 width: 200;
 border: 1px solid #000000;
}
textarea {
background-color: #ffffff;
 font-family: Arial, Helvetica, sans-serif;
 font-size: 8pt;
 color: #000000;
 width: 200;
 border: 1px solid #000000;
}
</style>
<link href="ourhabbo.css" rel="stylesheet" type="text/css">
</head>
<BODY bgcolor="#ffffff">
<p align="center"><img src='images/ohchat.gif'></p>
<?php
include ('config.php');
if(
$logged[username]){ 
$catid=$_GET['id'];
if(
$_POST['submit']){ //checks if the form was submitted
$name $logged[username]; //posts the username
$face $logged[display_badge]; //posts the users face
$shout addslashes(htmlspecialchars($_POST['shout'])); //posts the shout
$day date("d");
$days $day 1;
$date date("m-Y");
$shout $_POST[shout]; 
if(
$logged[username] && $logged[username] == $owner1 || $logged[username] == $owner2 || $logged[username] == $siteman || 
$logged[username] == $support1 || $logged[username] == $support2 || $logged[username] == $comman || $logged[username] == $comman2 || $checked_mod >= 1){
if (
stristr($shout":ban ")) 
    { 
 
$ban explode(" "$shout); 
// the explode implode is more for when concatinaginng an undefined string length, since the syntax of the input of known its far easy just to drag the second chunk, 1 in this case. 
$usertoban $ban['1']; 
$userquery mysql_query("SELECT * FROM `users` WHERE `username` = '$usertoban'") or die ('Error during the execution of the MySQL query : ' mysql_error());
$user mysql_fetch_array($userquery);
$banon $user[bans];
$bans $banon 1;
$update mysql_query("Update `users` set `banned` = '$banned', `bans` = '$bans' where `username` = '$usertoban'") or die ('Error during the execution of the MySQL query : ' mysql_error());
$time time();
$da date(dmy);
$year 1400;
$query mysql_query("INSERT INTO `ban` (`username` , `datebanned` ,`time`, `reason`, `user`,`bantil`) VALUES ('$usertoban', '$da', '$time','Banned for violating Chatroom Rules', '$logged[username]', '$year')") or die ('Error during the execution of the MySQL query : ' mysql_error());
$alert mysql_query("UPDATE `users` SET `alert` = 'You have been banned and can no longer use the Site' WHERE `username` = '$usetoban'") or die ('Error during the execution of the MySQL query : ' mysql_error());
}else{
if (
stristr($shout":warnmod ")){ 
$warnmod explode(" "$shout);
$modtowarn $warnmod['1']; 
$alert mysql_query("UPDATE `users` SET `alert` = 'Please do not socialize in the Chatrooms' WHERE `username` = '$modtowarn'") or die ('Error during the execution of the MySQL query : ' mysql_error());
}else{
if (
stristr($shout":mute ")) 
    { 
//since they have banning permission (im guesing) and "ban: " is in the input, we must be banning someone 
//Exsplode the space in shout 
 
$mute explode(" "$shout); 
// the explode implode is more for when concatinaginng an undefined string length, since the syntax of the input of known its far easy just to drag the second chunk, 1 in this case. 
$usertomute $mute['1']; 
$result mysql_query("UPDATE `users` SET `chat` = 'No' WHERE `username` = '$usertomute'") or die ('Error during the execution of the MySQL query : ' mysql_error());
$alert mysql_query("UPDATE `users` SET `alert` = 'You have been muted, and can no longer use the Chatrooms' WHERE `username` = '$usertomute'") or die ('Error during the execution of the MySQL query : ' mysql_error());
$date =  date("j F / G:i");
$username $logged[username];
mysql_query("INSERT INTO `logs` (`id` , `description`, `user`, `date` ) VALUES (NULL , 'Muted $usertomute', '$logged[username]', '$date')"); //Inserts into the D.B 
}else{
if (
stristr($shout":unmute ")) 
    { 
//since they have banning permission (im guesing) and "ban: " is in the input, we must be banning someone 
//Exsplode the space in shout 
 
$unmute explode(" "$shout); 
// the explode implode is more for when concatinaginng an undefined string length, since the syntax of the input of known its far easy just to drag the second chunk, 1 in this case. 
$usertounmute $unmute['1']; 
$result mysql_query("UPDATE `users` SET `chat` = 'Yes' WHERE `username` = '$usertounmute'") or die ('Error during the execution of the MySQL query : ' mysql_error());
$alert mysql_query("UPDATE `users` SET `alert` = 'You have been unmuted, and can now use the Chatrooms' WHERE `username` = '$usertounmute'") or die ('Error during the execution of the MySQL query : ' mysql_error());
$date =  date("j F / G:i");
$username $logged[username];
mysql_query("INSERT INTO `logs` (`id` , `description`, `user`, `date` ) VALUES (NULL , 'Unmuted $usertounmute', '$logged[username]', '$date')"); //Inserts into the D.B 
}else{
if(
$shout == ':clearroom'){
mysql_query("DELETE FROM `shout` WHERE `cat` = '$catid'");   
$date =  date("j F  G : i");
mysql_query("INSERT INTO `logs` (`id` , `description`, `user`, `date` ) VALUES (NULL , 'Cleared the Chatroom', '$logged[username]', '$date')");
$insert MYSQL_QUERY("INSERT INTO shout (name,shout,face,level,cat)".
"VALUES ('System', 'This room has been cleared by an Administrator', 'http://www.ourhabbo.net/images/BADGES/admin.gif', '12','$catid')");
}else{
$insert MYSQL_QUERY("INSERT INTO shout (name,shout,face,level,cat)".
"VALUES ('$name', '$shout', '$face', '$logged[level]','$catid')");
$points=$logged['points'];
$newpoints=$points 5;
$sql2 mysql_query("UPDATE `users` set points = '$newpoints' where username = '$logged[username]'");
}
}
}
}
}
}
}
$rooommysql_query("SELECT * FROM chatrooms WHERE id = '$catid'"); //finds the shouts order by id
$room=mysql_fetch_array($rooom);
$amountu mysql_query("SELECT * FROM `users` WHERE `page` = '/site/chatroom.php?id=$catid'");
$amount mysql_num_rows($amountu);
if(
$room[pass]){
if(!
$_POST[enter]){
echo(
"<table width='100%' height='150' align='center' class='contentTable'>
<tr class='contentTableHeader'>
<td width='100%' align='center'>Chatroom Protected</td>
</tr>
<tr>
<td width='100%' bgcolor='ffffff' align='center'>
<form method='POST'>
Password:<br>
<input name='pass' type='password'><br>
<input name='id' value='
$catid' type='hidden'>
</td></tr>
<tr class='contentTableHeader'>
<td width='100%' align='center'><input type='submit' width='50' name='enter' value='Enter'></form></td>
</tr>
</table>"
);
}
if(
$_POST[enter]){
$password $_POST[enter];
$pass md5($password);
$id $_POST[id];
$room mysql_query("SELECT * from `chatrooms` where `id` = '$id'");
$room mysql_fetch_array($room); 
if(
$room[pass] != $pass){
?>
<script>
alert ('The password you entered was incorrect') 
</script>
<?
echo("<meta http-equiv=\"Refresh\" content=\"2; URL=rooms.php\"/>");
}else{
echo(
"<table width='90%' align='center' class='contentTable'><tr class='contentTableHeader'><td colspan='2'><center>$room[name] - $amount Users Online</center></td></tr>");
$find mysql_query("SELECT * FROM shout WHERE cat = '$catid' ORDER BY id DESC"); //finds the shouts order by id
while($r=mysql_fetch_array($find)){ 
$name $r[name]; //name
$level $r[level]; //level
$shout htmlspecialchars(addslashes($r[shout])); //shout
$id $r[id]; //id
    
$query mysql_query("SELECT * FROM `users` WHERE username = '$name'"); 
    
$user mysql_fetch_array($query); //loop's the shouts
$face $user[display_badge];
echo 
"<tr class='contentTableAltRow'><td width='5%'>";
if(
$face){
echo(
"<img src='$face' align='left'>");
}
echo
"</td><td width='95%'><a href='members.php?user=$name'><span class='$level'><b>$name</span></a> ";
echo 
"</b></span><br>".$shout." ";
if(
$logged[level] == 11 || $logged[level] == 12){
echo 
"<br><b><a href = \"delete_shout.php?id=$id\">Delete</a> || ";
    
$query mysql_query("SELECT * FROM `users` WHERE username = '$name'"); 
    
$user mysql_fetch_array($query); 
if(
$user[banned] == 'banned'){
echo
"<a href = \"unbanuser.php?name=$name&cat=$catid\">Unban User</a> || ";
}else{
echo
"<a href = \"banuser.php?name=$name&cat=$catid\">Ban User</a> || ";
}
if(
$user[chat] == 'Yes'){
echo
"<a href = \"muteuser.php?name=$name&cat=$catid\">Mute User</b>";
}else{
echo
"<a href = \"unmuteuser.php?name=$name&cat=$catid\">Unmute User</b>";
}
}
echo 
"</td></tr>";
}
echo(
"</table>");
if(
$logged[username] && $logged[chat] == 'Yes'){ //if the user is logged in display the form
echo "
<br><center><form method=post>
Shout: <input type=text name=shout size=50> <input type=submit value=Shout width=25 name=submit><br/>
</form></center>"
;
echo(
"<br><b>Users in this Chatroom:</b><br>");
$onlines mysql_query("SELECT * FROM `users` WHERE `page` = '/site/chatroom.php?id=$catid'");
while(
$online mysql_fetch_array($onlines)){
echo(
"<a href='members.php?user=$online[username]'>$online[username]</a>, ");
}
}
if(!
$room[pass]){
echo(
"<table width='90%' align='center' class='contentTable'><tr class='contentTableHeader'><td colspan='2'><center>$room[name] - $amount Users Online</center></td></tr>");
$find mysql_query("SELECT * FROM shout WHERE cat = '$catid' ORDER BY id DESC"); //finds the shouts order by id
while($r=mysql_fetch_array($find)){ 
$name $r[name]; //name
$level $r[level]; //level
$shout htmlspecialchars(addslashes($r[shout])); //shout
$id $r[id]; //id
    
$query mysql_query("SELECT * FROM `users` WHERE username = '$name'"); 
    
$user mysql_fetch_array($query); //loop's the shouts
$face $user[display_badge];
echo 
"<tr class='contentTableAltRow'><td width='5%'>";
if(
$face){
echo(
"<img src='$face' align='left'>");
}
echo
"</td><td width='95%'><a href='members.php?user=$name'><span class='$level'><b>$name</span></a> ";
echo 
"</b></span><br>".$shout." ";
if(
$logged[level] == 11 || $logged[level] == 12){
echo 
"<br><b><a href = \"delete_shout.php?id=$id\">Delete</a> || ";
    
$query mysql_query("SELECT * FROM `users` WHERE username = '$name'"); 
    
$user mysql_fetch_array($query); 
if(
$user[banned] == 'banned'){
echo
"<a href = \"unbanuser.php?name=$name&cat=$catid\">Unban User</a> || ";
}else{
echo
"<a href = \"banuser.php?name=$name&cat=$catid\">Ban User</a> || ";
}
if(
$user[chat] == 'Yes'){
echo
"<a href = \"muteuser.php?name=$name&cat=$catid\">Mute User</b>";
}else{
echo
"<a href = \"unmuteuser.php?name=$name&cat=$catid\">Unmute User</b>";
}
}
echo 
"</td></tr>";
}
echo(
"</table>");
if(
$logged[username] && $logged[chat] == 'Yes'){ //if the user is logged in display the form
echo "
<br><center><form method=post>
Shout: <input type=text name=shout size=50> <input type=submit value=Shout width=25 name=submit><br/>
</form></center>"
;
echo(
"<br><b>Users in this Chatroom:</b><br>");
$onlines mysql_query("SELECT * FROM `users` WHERE `page` = '/site/chatroom.php?id=$catid'");
while(
$online mysql_fetch_array($onlines)){
echo(
"<a href='members.php?user=$online[username]'>$online[username]</a>, ");
}
}
}
?>
</body>
</html><?
if ($logged[banned] == 'banned'){
echo (
"<meta http-equiv=\"Refresh\" content=\"0; URL=banned.php\"/>");
}
?>