Jelajahi Sumber

Order the fields by their newly created order row...

Signed-off-by: Suki <[email protected]>
Suki 10 tahun lalu
induk
melakukan
6d83014c82

+ 4 - 2
Sources/Profile.php

@@ -857,10 +857,11 @@ function loadCustomFields($memID, $area = 'summary')
 	// Load all the relevant fields - and data.
 	$request = $smcFunc['db_query']('', '
 		SELECT
-			col_name, field_name, field_desc, field_type, show_reg, field_length, field_options,
+			col_name, field_name, field_desc, field_type, field_order, show_reg, field_length, field_options,
 			default_value, bbc, enclose, placement
 		FROM {db_prefix}custom_fields
-		WHERE ' . $where,
+		WHERE ' . $where .'
+		ORDER BY field_order',
 		array(
 			'area' => $area,
 		)
@@ -946,6 +947,7 @@ function loadCustomFields($memID, $area = 'summary')
 			'name' => $row['field_name'],
 			'desc' => $row['field_desc'],
 			'type' => $row['field_type'],
+			'order' => $row['field_order'],
 			'input_html' => $input_html,
 			'output_html' => $output_html,
 			'placement' => $row['placement'],

+ 2 - 1
Sources/Register.php

@@ -418,7 +418,8 @@ function Register2($verifiedOpenID = false)
 	$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}',
+		WHERE active = {int:is_active}
+		ORDER BY field_order',
 		array(
 			'is_active' => 1,
 		)

+ 0 - 4
Themes/default/languages/ManageSettings.english.php

@@ -269,10 +269,6 @@ $txt['custom_edit_mask_regex'] = 'Regex (Advanced)';
 $txt['custom_edit_enclose'] = 'Show Enclosed Within Text (Optional)';
 $txt['custom_edit_enclose_desc'] = 'We <strong>strongly</strong> recommend to use an input mask to validate the input supplied by the user.';
 
-$txt['custom_edit_order'] = 'Choose Order';
-$txt['custom_edit_order_unchanged'] = 'Unchanged';
-$txt['custom_edit_order_after'] = 'After';
-$txt['custom_edit_order_before'] = 'Before';
 $txt['custom_edit_placement'] = 'Choose Placement';
 $txt['custom_edit_placement_standard'] = 'Standard (with title)';
 $txt['custom_edit_placement_withicons'] = 'With Icons';