<html>
<head>
  <title>[V]ote-auction.com | MessageBoard</title>
</head>
<body bgcolor="#FFFFCC" link="#FF6633" alink"#FFFFFF" vlink="#FF3333">

<table align="center" cellpadding="4" cellspacing="2" width="80%" bgcolor="#000000">
	<tr><td bgcolor="#FF6633"><center><font face="Trebuchet MS" size="4"><b>
	[V]ote-auction.com Message Board</b></font></center>
	</td></tr>
</table>
<br>

<?php
//  require( "../misc.php3" );
  require( "forum_work.php3" );

  // Connect to the database
  $dbh = db_connect( $db );
  $query = "select show_ip,show_info,block_hosts from config where forum_id = 0";

  // Send the query to the database
  $res = mysql_query( $query, $dbh );

  // Make sure the query worked
  if( !$res ) {
    db_err( $dbh, "mysql_query: " . $query );
  }

  list( $show_ip, $show_info, $block_hosts ) = mysql_fetch_row( $res );

  if( $block_hosts == 'YES' ) {
    require( "host_filtering.php3" );
    // OK....we've got host blocking enabled, lets see if this person should
    // be blocked from viewing the forum
    $phear = block( $REMOTE_ADDR ); 
  }

  if( $show_ip == 'YES' ) {
    $remote_addr = $REMOTE_ADDR;
    $remote_host = gethostbyaddr( $remote_addr );
  }

  if( $show_info == 'YES' ) {
    $user_agent = $HTTP_USER_AGENT;
  }

?>


<?php
  if( $phear == 0 ) {
    printf( "<table bgcolor=\"000000\" align=\"center\" width=\"80%%\" cellpadding=\"4\" cellspacing=\"2\"><tr>" );
    printf( "<td bgcolor=\"FFFFFF\"><font face=\"Trebuchet MS\" size=\"2\">" );
    $res = print_list( 0 ) ;
    printf( "</font></td></tr></table>" );
    if( $res == 0 ) {
      printf( "<tr><td bgcolor=\"#FFFFFF\"><center><font face=\"Trebuchet MS\" size=\"4\">No Posts.</font></center></td></tr>" );
    }
  } else {
    printf( "<tr><td bgcolor=\"#FFFFFF\"><center><font face=\"Trebuchet MS\" size=\"4\">\n" );
    printf( "<center>Your hostname or domain has been banned from this<br>\n" );
    printf( "forum.  If you have any further questions, contact the <br>\n" );
    printf( "administrator of this forum<br></font></td></tr>\n" );
  }
  if( $phear == 0 ) {
    printf( "<form action=\"add_post.php3\" method=\"post\">\n" );
    printf( "<input type=hidden name=\"parent\" value=\"0\">\n" );
    printf( "<input type=hidden name=\"root\" value=\"0\">\n" );
    printf( "<input type=hidden name=\"host\" value=\"$remote_host\">\n" );
    printf( "<input type=hidden name=\"hostip\" value=\"$remote_addr\">\n" );
    printf( "<input type=hidden name=\"comp_info\" value=\"$user_agent\">\n" );
    printf( "<table width=\"80%%\" align=\"center\" cellpadding=\"4\" cellspacing=\"2\" bgcolor=\"333333\">\n" );
    printf( "  <tr>\n" );
    printf( "    <td bgcolor=\"#FFFFFF\"><font face=\"Trebuchet MS\" size=\"4\">Name: </font></td>\n" );
    printf( "    <td bgcolor=\"#999999\"><input type=\"text\" name=\"name\"></td>\n" );
    printf( "  </tr>\n" );
    printf( "  <tr>\n" );
    printf( "    <td bgcolor=\"#FFFFFF\"><font face=\"Trebuchet MS\" size=\"4\">Subject: </font></td>\n" );
    printf( "    <td bgcolor=\"#999999\"><input type=\"text\" name=\"subject\"></td>\n" );
    printf( "  </tr>\n" );
    printf( "  <tr>\n" );
    printf( "    <td bgcolor=\"#FFFFFF\"><font face=\"Trebuchet MS\" size=\"4\">Message: </font></td>\n" );
    printf( "    <td bgcolor=\"#999999\"><textarea cols=60 rows=8 name=\"message\" limit=80 wrap=hard></textarea></td>\n" );
    printf( "  </tr>\n" );
    printf( "  <tr>\n" );
    printf( "    <td align=\"center\" colspan=2 bgcolor=\"#999999\">\n" );
    printf( "      <input type=\"submit\" value=\"Post!\">\n" );
    printf( "    </td>\n" );
    printf( "  </tr>\n" );
    printf( "</table>\n" );
    printf( "</form>\n" );
  }
?>

</body>
</html>
