Sfoglia il codice sorgente

Are there any custom profile fields required during registration?

Signed-off-by: Suki <[email protected]>
Suki 10 anni fa
parent
commit
7d9dea9c7d
2 ha cambiato i file con 21 aggiunte e 1 eliminazioni
  1. 20 0
      Sources/ManageRegistration.php
  2. 1 1
      Sources/Subs-Members.php

+ 20 - 0
Sources/ManageRegistration.php

@@ -90,6 +90,26 @@ function AdminRegister()
 {
 	global $txt, $context, $sourcedir, $scripturl, $smcFunc;
 
+	// Are there any custom profile fields required during registration?
+	$request = $smcFunc['db_query']('', '
+		SELECT col_name, field_name, field_type, field_length, mask, show_reg
+		FROM {db_prefix}custom_fields
+		WHERE active = {int:is_active}
+			AND show_reg = {int:show_reg}
+		ORDER BY field_order',
+		array(
+			'is_active' => 1,
+			'show_reg' => 1,
+		)
+	);
+
+	$context['custom_fields'] = array();
+
+	while ($row = $smcFunc['db_fetch_assoc']($request))
+		$context['custom_fields'][$row['col_name']] = $row;
+
+	$smcFunc['db_free_result']($request);
+
 	if (!empty($_POST['regSubmit']))
 	{
 		checkSession();

+ 1 - 1
Sources/Subs-Members.php

@@ -551,7 +551,7 @@ function registerMember(&$regOptions, $return_errors = false)
 
 	$smcFunc['db_free_result']($request);
 
-	// Perhaps someone else wants to check this user
+	// Perhaps someone else wants to check this user.
 	call_integration_hook('integrate_register_check', array(&$regOptions, &$reg_errors));
 
 	// If we found any errors we need to do something about it right away!