}
//
-function REGISTER_FILL_MUST_CONSTANTS () {
+function registerMustFillout () {
$result = SQL_QUERY("SELECT field_name, field_required FROM `{!_MYSQL_PREFIX!}_must_register` ORDER BY `id`",
__FUNCTION__, __LINE__);
SQL_FREERESULT($result);
// Also fill other constants
+ // @TODO Rewrite these constants, too
define('MUST_GENDER', "<div class=\"guest_failed\"> (*)</div>");
define('MUST_ADDY' , "<div class=\"guest_failed\"> (*)</div>");
define('MUST_BIRTH' , "<div class=\"guest_failed\"> (*)</div>");
if ((empty($value)) && ($chk == 'Y') && (!$country))
{
// Required field not set
- $array[$key] = "!";
+ $array[$key] = '!';
$ret = true;
}
}
//
function REGISTER_OUTPUT_REQUIRE_CHECK (&$array) {
- $result = SQL_QUERY("SELECT field_name, field_required FROM `{!_MYSQL_PREFIX!}_must_register` ORDER BY `id`", __FUNCTION__, __LINE__);
+ $result = SQL_QUERY("SELECT `field_name`, `field_required` FROM `{!_MYSQL_PREFIX!}_must_register` ORDER BY `id`", __FUNCTION__, __LINE__);
while ($content = SQL_FETCHARRAY($result)) {
- if (($array[$content['field_name']] == "!") && ($content['field_required'] == 'Y')) {
+ if (($array[$content['field_name']] == '!') && ($content['field_required'] == 'Y')) {
// Empty entry found
$array[$content['field_name']] = '';
$OUT = constant('REGISTER_'.strtoupper($content['field_name']).'_REQUIRED');
- OUTPUT_HTML("<div class=\"register_failed\">".$OUT."</div>");
+ registerOutputFailedMessage('', $OUT);
} // END - if
} // END - while
SQL_FREERESULT($result);
}
-//
-function REGISTER_ADD_CATEGORY_TABLE ($mode, $return=false) {
+// Generates a 'category table' for the registration form
+function registerGenerateCategoryTable ($mode, $return=false) {
$OUT = '';
// Guests are mostly not interested in how many members has
if (IS_ADMIN()) $AND = '';
// Look for categories
- $result = SQL_QUERY("SELECT id, cat, visible FROM `{!_MYSQL_PREFIX!}_cats` ".$AND." ORDER BY `sort`",
+ $result = SQL_QUERY("SELECT `id`, `cat`, `visible` FROM `{!_MYSQL_PREFIX!}_cats` ".$AND." ORDER BY `sort` ASC",
__FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
$content = array(
'sw' => $SW,
'cat' => $content['cat'],
- 'def_y' => "",
- 'def_n' => "",
+ 'def_y' => '',
+ 'def_n' => '',
'id' => $content['id'],
);
OUTPUT_HTML($OUT);
}
}
+
+// Outputs a 'failed message'
+function registerOutputFailedMessage ($messageId, $extra='') {
+ if (empty($messageId)) {
+ OUTPUT_HTML('<div class="register_failed">' . $extra . '</div>');
+ } else {
+ OUTPUT_HTML('<div class="register_failed">{--' . $messageId . '--}' . $extra . '</div>');
+ }
+}
+
//
?>