require_once( "bracket_connect.php" );
require_once( "bracket_ccode.php" );
extract( $_GET );
extract( $_POST, EXTR_OVERWRITE );
$arrErrors = array( );
$showErrors = FALSE;
// ohooho a new style D: this is so faggy
if ( isset( $addMatchComment ) )
{
$iName = safeString( $iName );
$iBody = safeString( SafeNL2BR( htmlentities( $iBody ) ) );
// errors are allowed to 'add up'
/*
if ( strlen( $iBody ) > 255)
{
$arrErrors []= array( "Error Posting Match Comment", "Your comment is too fucking long, save the speeches for when ur an 80 year old fart u cock smuggler" );
$showErrors = true;
}
*/
if ( ! strlen( $iName ) )
{
$arrErrors []= array( "Error Posting Match Comment", "Your name is too short!");
$showErrors = true;
}
if ( ! strlen( $iBody ) )
{
$arrErrors []= array( "Error Posting Match Comment", "Posting blank messages is not appreciated, now im going to have to fuck your mother, go tell her shes about to get fucked!" );
$showErrors = true;
}
if ( ! isset( $iBracketID ) )
{
$arrErrors []= array( "Error Posting Match Comment", "Invalid database fields in form, this is a bug please report it to putty!" );
$showErrors = true;
}
if ( ! $showErrors )
{
$IP = $_SERVER['REMOTE_ADDR'];
$query = "insert into pbs_comments (BracketID, Author, Body, IP) "
."values ($iBracketID, '$iName', '$iBody', '$IP')";
mysql_query( $query );
if ( mysql_error( ) )
{
$arrErrors [] = array( "Error Posting Match Comment", "Database insertion error:
" . mysql_error() );
$showErrors = true;
}
}
if ( ! $showErrors )
{ // everything went ok
// FIXME: need a better way to keep track of vars incase i change their names or w/e
header( "Location: bracket_view.php?show=match&matchid=$iBracketID" );
exit; // :D
}
}
if ($showErrors)
{ // allows to override some errors or w/e
?>