SMF Support > SMF 2.0.x Support

Custom Profile Fields Not Working

<< < (3/3)

designer2012:
Well I changed it the code you posted:

// Maybe it's a text box - very likely!
            elseif (in_array($field['type'], array('int', 'float', 'text', 'password')))
               echo '
                     <input type="', $field['type'] == 'password' ? 'password' : 'text', '" name="', $key, '" id="', $key, '" size="30" value="', $field['value'], '" tabindex="', $context['tabindex']++, '" ', $field['input_attr'], ' class="input_', $field['type'] == 'password' ? 'password' : 'text', '" />';


But that hasn't changed the width


One way too have them all the same size is to change the others to 50, I've done that for now

Arantor:
*headdesk* I keep forgetting that I drastically overhauled that some time ago to be more sane. (Yes, all that stuff in the register template is completely irrelevant), and the code is a mess to trace back through.

Sources/Profile.php:

--- Code: ---$input_html = '<input type="text" name="customfield[' . $row['col_name'] . ']" ' . ($row['field_length'] != 0 ? 'maxlength="' . $row['field_length'] . '"' : '') . ' size="' . ($row['field_length'] == 0 || $row['field_length'] >= 50 ? 50 : ($row['field_length'] > 30 ? 30 : ($row['field_length'] > 10 ? 20 : 10))) . '" value="' . $value . '" class="input_text" />';
--- End code ---

The idea is that the longer the field length as set in the admin panel, the longer the text box should be.


--- Code: ---$input_html = '<input type="text" name="customfield[' . $row['col_name'] . ']" ' . ($row['field_length'] != 0 ? 'maxlength="' . $row['field_length'] . '"' : '') . ' size="' . ($row['field_length'] == 0 || $row['field_length'] >= 50 ? 30 : ($row['field_length'] > 30 ? 30 : ($row['field_length'] > 10 ? 20 : 10))) . '" value="' . $value . '" class="input_text" />';
--- End code ---

As you'll notice I've changed the 50 it would actually use to 30 (not the 50 it's using for testing purposes, important to not get confused)

designer2012:
Worked like a charm, thanks loads :)

Navigation

[0] Message Index

[*] Previous page

Go to full version