I've clarified your code.
It's extremely recommended to put brackets for if, else, loops, and functions under the statement. Also, when verifying if a variable exists, use isset(). If you just want to see if a variable has a value, check with the ! (bang) operator in a boolean statement. For strings, use empty().
Here is your code. I'm not sure what you're trying to achieve with the empty IFs, but you were missing the last bracket.
PHP Code:
if (!$conf_userid)
{
$conf_userid = $bbuserinfo['userid'];
}
else
{
$conf_userid = "NULL";
}
if (vboptions(guest confession == 1))
{
if ('confess' && $confession_submit && trim($message) && $bbuserinfo[userid] >= 0)
{
// whatever you're trying to achieve
}
else
{
if ('confess' && $confession_submit && trim($message) && $bbuserinfo[userid] > 0)
{
// whatever you're trying to achieve
}
$flood = $DB_site->query("
SELECT timestamp
FROM confessions
ORDER BY timestamp
WHERE userid = $bbuserinfo[userid]
DESC LIMIT 1
");
$check = $DB_site->fetch_array($flood);
if (empty($nousername))
{
$conf_userid = "$bbuserinfo[userid]";
}
else
{
$conf_userid = "NULL";
}
if ((time() - $check[timestamp]) <= 15)
{
eval("standarderror(\"".fetch_template("confession_error_flood")."\");");
}
$DB_site->query("
INSERT INTO confessions SET
text = '".addslashes($message)."',
userid = '$conf_userid',
timestamp = '".time()."'
");
}
} // was missing