diff options
author | Philip Häusler <msquare@notrademark.de> | 2011-07-12 16:17:18 +0200 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2011-07-12 16:17:18 +0200 |
commit | 02e187a4ec8db5094789d124e3f069dea85a5076 (patch) | |
tree | 2d702a6d71bbf78f38ac0b455c2277546c32a93c /includes | |
parent | 11f599891748f65bdb5478c6d932087c22124e19 (diff) |
#24 made t-shirt-size optional for angels
Diffstat (limited to 'includes')
-rw-r--r-- | includes/pages/guest_login.php | 150 | ||||
-rw-r--r-- | includes/pages/user_settings.php | 38 |
2 files changed, 84 insertions, 104 deletions
diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php index ecfcde20..30dbaf55 100644 --- a/includes/pages/guest_login.php +++ b/includes/pages/guest_login.php @@ -3,8 +3,8 @@ // Engel registrieren function guest_register() { - global $SubscribeMailinglist; - + global $SubscribeMailinglist, $enable_tshirt_size; + $html = ""; $success = "none"; @@ -18,24 +18,17 @@ function guest_register() { $Ergans = sql_select("SELECT UID FROM `User` WHERE `Nick`='" . sql_escape($_POST["Nick"]) . "'"); if (strlen($_POST["Nick"]) < 2) - $error = Get_Text("makeuser_error_nick1") - . $_POST["Nick"] . Get_Text("makeuser_error_nick2"); + $error = Get_Text("makeuser_error_nick1") . $_POST["Nick"] . Get_Text("makeuser_error_nick2"); - elseif (count($Ergans) > 0) - $error = Get_Text("makeuser_error_nick1") - . $_POST["Nick"] . Get_Text("makeuser_error_nick3"); + elseif (count($Ergans) > 0) $error = Get_Text("makeuser_error_nick1") . $_POST["Nick"] . Get_Text("makeuser_error_nick3"); - elseif (strlen($_POST["email"]) <= 6 && strstr($_POST["email"], "@") == FALSE && strstr($_POST["email"], ".") == false) - $error = Get_Text("makeuser_error_mail"); + elseif (strlen($_POST["email"]) <= 6 && strstr($_POST["email"], "@") == FALSE && strstr($_POST["email"], ".") == false) $error = Get_Text("makeuser_error_mail"); - elseif (!is_numeric($_POST["Alter"])) - $error = Get_Text("makeuser_error_Alter"); + elseif (!is_numeric($_POST["Alter"])) $error = Get_Text("makeuser_error_Alter"); - elseif ($_POST["Passwort"] != $_POST["Passwort2"]) - $error = Get_Text("makeuser_error_password1"); + elseif ($_POST["Passwort"] != $_POST["Passwort2"]) $error = Get_Text("makeuser_error_password1"); - elseif (strlen($_POST["Passwort"]) < 6) - $error = Get_Text("makeuser_error_password2"); + elseif (strlen($_POST["Passwort"]) < 6) $error = Get_Text("makeuser_error_password2"); else { $_POST["Passwort"] = PassCrypt($_POST["Passwort"]); @@ -50,26 +43,7 @@ function guest_register() { "`Size`, " . "`Passwort`, " . "`Art` , " . "`kommentar`, " . "`Hometown`," . "`CreateDate`, `Sprache` ) " . - "VALUES ( '" - . sql_escape($_POST["Nick"]) . "', " . "'" - . sql_escape($_POST["Name"]) . "', " . "'" - . sql_escape($_POST["Vorname"]) . "', " . "'" - . sql_escape($_POST["Alter"]) . "', " . "'" - . sql_escape($_POST["Telefon"]) . "', " . "'" - . sql_escape($_POST["DECT"]) . "', " . "'" - . sql_escape($_POST["Handy"]) . "', " . "'" - . sql_escape($_POST["email"]) . "', " . "'" - . sql_escape($_POST["ICQ"]) . "', " . "'" - . sql_escape($_POST["jabber"]) . "', " . "'" - . sql_escape($_POST["Size"]) . "', " . "'" - . sql_escape($_POST["Passwort"]) . "', " . "'" - . sql_escape($_POST["Art"]) . "', " . "'" - . sql_escape($_POST["kommentar"]) . "', " . "'" - . sql_escape($_POST["Hometown"]) . "'," - . "NOW(), '" - . sql_escape($_SESSION["Sprache"]) - . "')" - ); + "VALUES ( '" . sql_escape($_POST["Nick"]) . "', " . "'" . sql_escape($_POST["Name"]) . "', " . "'" . sql_escape($_POST["Vorname"]) . "', " . "'" . sql_escape($_POST["Alter"]) . "', " . "'" . sql_escape($_POST["Telefon"]) . "', " . "'" . sql_escape($_POST["DECT"]) . "', " . "'" . sql_escape($_POST["Handy"]) . "', " . "'" . sql_escape($_POST["email"]) . "', " . "'" . sql_escape($_POST["ICQ"]) . "', " . "'" . sql_escape($_POST["jabber"]) . "', " . "'" . sql_escape($_POST["Size"]) . "', " . "'" . sql_escape($_POST["Passwort"]) . "', " . "'" . sql_escape($_POST["Art"]) . "', " . "'" . sql_escape($_POST["kommentar"]) . "', " . "'" . sql_escape($_POST["Hometown"]) . "'," . "NOW(), '" . sql_escape($_SESSION["Sprache"]) . "')"); if ($Erg != 1) { $html .= Get_Text("makeuser_error_write1") . "<br />\n"; @@ -137,58 +111,60 @@ function guest_register() { $html .= "<tr><td>ICQ</td><td><input type=\"text\" size=\"40\" name=\"ICQ\" value=\"" . $_POST["ICQ"] . "\"></td></tr>\n"; $html .= "<tr><td>jabber</td><td><input type=\"text\" size=\"40\" name=\"jabber\" value=\"" . $_POST["jabber"] . "\"></td></tr>\n"; - $html .= "<tr><td>" . Get_Text("makeuser_T-Shirt") . " Grösse*</td><td align=\"left\">\n"; - $html .= "<select name=\"Size\">\n"; - $html .= "<option value=\"S\""; - if ($_POST["Size"] == "S") - $html .= " selected"; - $html .= ">S</option>\n"; - $html .= "<option value=\"M\""; - if ($_POST["Size"] == "M") - $html .= " selected"; - $html .= ">M</option>\n"; - $html .= "<option value=\"L\""; - if ($_POST["Size"] == "L") - $html .= " selected"; - $html .= ">L</option>\n"; - $html .= "<option value=\"XL\""; - if ($_POST["Size"] == "XL") - $html .= " selected"; - $html .= ">XL</option>\n"; - $html .= "<option value=\"2XL\""; - if ($_POST["Size"] == "2XL") - $html .= " selected"; - $html .= ">2XL</option>\n"; - $html .= "<option value=\"3XL\""; - if ($_POST["Size"] == "3XL") - $html .= " selected"; - $html .= ">3XL</option>\n"; - $html .= "<option value=\"4XL\""; - if ($_POST["Size"] == "4XL") - $html .= " selected"; - $html .= ">4XL</option>\n"; - $html .= "<option value=\"5XL\""; - if ($_POST["Size"] == "5XL") - $html .= " selected"; - $html .= ">5XL</option>\n"; - $html .= "<option value=\"S-G\""; - if ($_POST["Size"] == "S-G") - $html .= " selected"; - $html .= ">S Girl</option>\n"; - $html .= "<option value=\"M-G\""; - if ($_POST["Size"] == "M-G") - $html .= " selected"; - $html .= ">M Girl</option>\n"; - $html .= "<option value=\"L-G\""; - if ($_POST["Size"] == "L-G") - $html .= " selected"; - $html .= ">L Girl</option>\n"; - $html .= "<option value=\"XL-G\""; - if ($_POST["Size"] == "XL-G") - $html .= " selected"; - $html .= ">XL Girl</option>\n"; - $html .= "</select>\n"; - $html .= "</td></tr>\n"; + if ($enable_tshirt_size) { + $html .= "<tr><td>" . Get_Text("makeuser_T-Shirt") . " Grösse*</td><td align=\"left\">\n"; + $html .= "<select name=\"Size\">\n"; + $html .= "<option value=\"S\""; + if ($_POST["Size"] == "S") + $html .= " selected"; + $html .= ">S</option>\n"; + $html .= "<option value=\"M\""; + if ($_POST["Size"] == "M") + $html .= " selected"; + $html .= ">M</option>\n"; + $html .= "<option value=\"L\""; + if ($_POST["Size"] == "L") + $html .= " selected"; + $html .= ">L</option>\n"; + $html .= "<option value=\"XL\""; + if ($_POST["Size"] == "XL") + $html .= " selected"; + $html .= ">XL</option>\n"; + $html .= "<option value=\"2XL\""; + if ($_POST["Size"] == "2XL") + $html .= " selected"; + $html .= ">2XL</option>\n"; + $html .= "<option value=\"3XL\""; + if ($_POST["Size"] == "3XL") + $html .= " selected"; + $html .= ">3XL</option>\n"; + $html .= "<option value=\"4XL\""; + if ($_POST["Size"] == "4XL") + $html .= " selected"; + $html .= ">4XL</option>\n"; + $html .= "<option value=\"5XL\""; + if ($_POST["Size"] == "5XL") + $html .= " selected"; + $html .= ">5XL</option>\n"; + $html .= "<option value=\"S-G\""; + if ($_POST["Size"] == "S-G") + $html .= " selected"; + $html .= ">S Girl</option>\n"; + $html .= "<option value=\"M-G\""; + if ($_POST["Size"] == "M-G") + $html .= " selected"; + $html .= ">M Girl</option>\n"; + $html .= "<option value=\"L-G\""; + if ($_POST["Size"] == "L-G") + $html .= " selected"; + $html .= ">L Girl</option>\n"; + $html .= "<option value=\"XL-G\""; + if ($_POST["Size"] == "XL-G") + $html .= " selected"; + $html .= ">XL Girl</option>\n"; + $html .= "</select>\n"; + $html .= "</td></tr>\n"; + } $html .= "<tr><td>" . Get_Text("makeuser_Engelart") . "</td><td align=\"left\">\n"; $html .= "<select name=\"Art\">\n"; diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php index 97c8626f..1b039f0c 100644 --- a/includes/pages/user_settings.php +++ b/includes/pages/user_settings.php @@ -1,25 +1,29 @@ <?php function user_settings() { + global $enable_tshirt_size; global $user; if (!isset ($_REQUEST['action'])) { - $tshirt_html = template_render('../templates/user_settings_tshirt.html', array ( - 'label_size' => Get_Text("makeuser_T-Shirt"), - 'size_select' => ($user['Tshirt'] == 0) ? html_select_key('size', array ( - 'S' => "S", - 'M' => "M", - 'L' => "L", - 'XL' => "XL", - '2XL' => "2XL", - '3XL' => "3XL", - '4XL' => "4XL", - '5XL' => "5XL", - 'S-G' => "S Girl", - 'M-G' => "M Girl", - 'L-G' => "L Girl", - 'XL-G' => "XL Girl" - ), $user['Size']) : $user['Size'] - )); + if ($enable_tshirt_size) + $tshirt_html = template_render('../templates/user_settings_tshirt.html', array ( + 'label_size' => Get_Text("makeuser_T-Shirt"), + 'size_select' => ($user['Tshirt'] == 0) ? html_select_key('size', array ( + 'S' => "S", + 'M' => "M", + 'L' => "L", + 'XL' => "XL", + '2XL' => "2XL", + '3XL' => "3XL", + '4XL' => "4XL", + '5XL' => "5XL", + 'S-G' => "S Girl", + 'M-G' => "M Girl", + 'L-G' => "L Girl", + 'XL-G' => "XL Girl" + ), $user['Size']) : $user['Size'] + )); + else + $tshirt_html = ""; return template_render('../templates/user_settings.html', array ( 'link' => page_link_to("user_settings"), |