Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Yuna Scatari Edition (YSE) (http://www.bvlist.com/forumdisplay.php?f=22)
-   -   Shoutbox problem (http://www.bvlist.com/showthread.php?t=4491)

mat22 12th February 2010 14:07

Shoutbox problem
 
I have problem with my shoutbox. I inserted script for chat disable for users but now when i look at my chat i get this:

Code:

Parse error:  syntax error, unexpected $end in /home/skylineh/public_html/shoutbox.php on line 183
:scratch:

Here's my shoutbox.php

Code:

/*****************************

Hannes' ShoutBox v1.0

*****************************/

require_once("include/bittorrent.php");
dbconn(false);

loggedinorreturn();

//deleting messages

if (isset($_GET['del']))
{
if (is_numeric($_GET['del']))
{
$query = "SELECT * FROM shoutbox WHERE id=".$_GET['del'];
$result = mysql_query($query);
}
else {echo "invalid msg id STOP TRYING TO INJECT SQL TIT HEAD";exit;
}

$row = mysql_fetch_row($result);

if ( (get_user_class() >= UC_USER) )
{
$query = "DELETE FROM shoutbox WHERE id=".$_GET['del'];
mysql_query($query);
}
}
// EDIT SHOUT ?
if (isset($_GET['edit']) && get_user_class() >= UC_MODERATOR && is_valid_id($_GET['edit']))
{   
    $sql=sql_query("SELECT id,text FROM shoutbox WHERE id=".sqlesc($_GET['edit']));
    $res=mysql_fetch_array($sql);
    ?>
   
   
   
   
   
   
   
   
   
        if ($CURUSER["chatpost"] === 'no'){
echo'

Tev ir atslēgts čats.

';
die();
}
else
{
    echo '
';
    echo '';
    echo '';
    echo '';
    echo '
';
    die;
}
// UPDATE SHOUT?
if (isset($_POST['text']) && get_user_class() >= UC_MODERATOR && is_valid_id($_POST['id']))
{
    $text = trim($_POST['text']);
    $id = (int)$_POST['id'];
    if (isset($text) && isset($id) && is_valid_id($id))
        sql_query("UPDATE shoutbox SET text = ".sqlesc($text)." WHERE id=".sqlesc($id));
}

?>

Čats







/*
if ($CURUSER["chatpost"] == 'no')
{
print("

You are banned.

");
exit;
}
else
{
*/

if($_GET["sent"]=="yes")
{
$userid=$CURUSER["id"];
$username=$CURUSER["username"];
$date=time();
$text=trim($_GET["shbox_text"]);
$text = stripslashes($text);

mysql_query("INSERT INTO shoutbox (id, userid, username, date, text) VALUES ('id'," . sqlesc($userid) . ", " . sqlesc($username) . ", $date, " . sqlesc($text) . ")") or sqlerr(__FILE__, __LINE__);
}

$res = mysql_query("SELECT * FROM shoutbox ORDER BY date DESC LIMIT 35") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) == 0)
print("\n");
else
{
print("\n");

while ($arr = mysql_fetch_assoc($res))
{
$res2 = mysql_query("SELECT username,class,avatar,donor, title,enabled,warned FROM users WHERE id=$arr[userid]") or sqlerr(__FILE__, __LINE__);
$arr2 = mysql_fetch_assoc($res2);
$resowner = mysql_query("SELECT id, username, class FROM users WHERE id=$arr[userid]") or print(mysql_error());
$rowowner = mysql_fetch_array($resowner);


if ($rowowner["class"] == "7")
$usercolor= "" .htmlspecialchars($rowowner["username"]). "";
elseif ($rowowner["class"] == "6")
$usercolor= "" .htmlspecialchars($rowowner["username"]). "";
elseif ($rowowner["class"] == "5")
$usercolor= "" .htmlspecialchars($rowowner["username"]). "";
elseif ($rowowner["class"] == "4")
$usercolor= "" .htmlspecialchars($rowowner["username"]). "";
elseif ($rowowner["class"] == "3")
$usercolor= "" .htmlspecialchars($rowowner["username"]). "";
elseif ($rowowner["class"] == "1")
$usercolor= "" .htmlspecialchars($rowowner["username"]). "";
elseif ($rowowner["class"] == "0")
$usercolor= "" .htmlspecialchars($rowowner["username"]). "";
elseif ($rowowner["class"] == "2")
$usercolor= "" .htmlspecialchars($rowowner["username"]). "";

if (get_user_class() >= UC_MODERATOR) {
$del="[D] $edit="[E]\n";
}
$pm = "[PM]\n";
print("
\n");
}
print("
|".strftime("%H:%M",$arr["date"])."|
$del$edit$pm

$usercolor" .
($arr2["donor"] == "yes" ? "DONOR" : "") .
($arr2["warned"] == "yes" ? "Warned" : "") .
" ".format_comment($arr["text"])."
");


}

?>


I know $end is this:
Code:

}
but even when i delete it or insert one more i have same error.

joeroberts 14th February 2010 05:08

looks ike you need a } at line 84

mat22 14th February 2010 09:13

I tried to insert it but didn't help.Well, however when I took out this part:
Code:

if ($CURUSER["chatpost"] === 'no'){
echo'

Tev ir atslēgts čats.

';
die();
}
else
{
    echo '
';
    echo '';
    echo '';
    echo '';
    echo '
';
    die;
}

Everything started to work.


All times are GMT +2. The time now is 16:32.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.