lashes(htmlspecialchars($signature));
$signature = nl2br($signature);
$signature = str_replace("<br />", "<BR>", $signature);
}
/* On step 4, clean up the signature */
if ($step == 4)
{
$occupation = htmlspecialchars($occupation);
$signature = htmlspecialchars($signature);
$signature = str_replace("<BR>", "<BR>", $signature);
}
/* Display the current step */
switch ($step)
{
/* Display the current profile */
default:
case 1:
/* Pull the number of accounts with the same username */
$SQL = "SELECT * FROM " . TABLE_PREFIX . "users WHERE user_name='$username';";
$results = ExeSQL($SQL);
/* Grab the data and assign it to variables */
while ($row =
mysql_fetch_array($results))
{
$username = $row["user_name"];
$password = "";
$email = $row["user_email"];
$location = $row["user_location"];
$occupation = $row["user_occupation"];
$homepage = $row["user_homepage"];
$picture = $row["user_picture"];
$interests = $row["user_interests"];
$aim = $row["user_aim"];
$icq = $row["user_icq"];
$yahoo = $row["user_yahoo"];
$signature = $row["user_signature"];
$include_sig = $row["user_usesig"];
}
/* Display the
HTML for the beginning of the form and table */
echo " <FORM action=\"?pid=edit_profile\" method=\"POST\" name=\"profile\">\n"
. " <TABLE cellpadding=\"5\" cellspacing=\"0\" width=\"100%\" border class=\"table_border\">\n"
. " <TR class=\"table_header\">\n"
. " <TD colspan=\"2\">$username's Profile</TD>\n"
. " </TR>\n";
/* Assign the active color to the inactive value */
$the_color = TABLE_COLOR_2;
/* Preview the mandatory fields ... */
PreviewSection ( $password, "Password", &$the_color );
PreviewSection ( $email, "Email", &$the_color );
/* ... and the optional ones */
if ( $location != "" )
PreviewSection( $location, "Location", &$the_color );
if ( $occupation != "" )
PreviewSection( $occupation, "Occupation", &$the_color );
if ( $homepage != "" && $homepage != "http://" )
PreviewSection( $homepage, "Homepage", &$the_color );
if ( $picture != "" && $picture != "http://" )
PreviewSection ( $picture, "Picture", &$the_color );
if ( $interests != "" )
PreviewSection ( $interests, "Interests", &$the_color );
if ( $aim != "" )
PreviewSection ( $aim, "AOL Instant Messenger", &$the_color );
if ( $icq != "" )
PreviewSection ( $icq, "ICQ", &$the_color );
if ( $yahoo != "" )
PreviewSection ( $yahoo, "Yahoo Pager", &$the_color );
/* The signature is a different kind of field, so we handle it differently */
if ( $signature != "" )
{
/* Change to the other color */
if ($the_color == TABLE_COLOR_1)
$the_color = TABLE_COLOR_2;
else
$the_color = TABLE_COLOR_1;
/* Determine if the user is including the signature or not */
if ($include_sig == 1)
$show_include = "You have chosen to include this signature on new posts.";
else
$show_include = "You have chosen to not include this signature on new posts.";
/* Display the signature section