UPDATE : Deleted null field, but still need help on disabling changing of gender by members themselves.
As stated, how do i delete away the 'null' field on gender?
Also, users are able to change their gender in forum profile.
Or should i create another profile field that mimics gender?
Though, i've totally no idea how to do that.
Can you tell us what database your using and what exactly your trying to achieve?
In /Sources/Profile-Modify find:
),
'gender' => array(
'type' => 'select',
'cast_type' => 'int',
'options' => 'return array(0 => \'\', 1 => $txt[\'male\'], 2 => $txt[\'female\']);',
'label' => $txt['gender'],
'permission' => 'profile_extra',
just remove this: 0 => \'\',
look this:
),
'gender' => array(
'type' => 'select',
'cast_type' => 'int',
'options' => 'return array(1 => $txt[\'male\'], 2 => $txt[\'female\']);',
'label' => $txt['gender'],
'permission' => 'profile_extra',
then in profile, blank field not exist anymore
Edit: don't mind this post.
Thanks for the prompt reply. That will bring away the null field, i see. Thanks!
But, how do i prevent users from changing their gender?
Thanks!
Bumpz
There's no more null field, thanks. But how do i prevent users from changing their gender, and only admins can do it? Please help, urgent. Thanks!
LetterBox please do not bump within 24 hours we are all volunteers and reply if and when we know the answer
Quote from: Illori on September 14, 2011, 05:47:40 AM
LetterBox please do not bump within 24 hours we are all volunteers and reply if and when we know the answer
Opps, sorry. I guess it's after 24 hours now right? Need urgent help. Thanks!
Hi, try changing the "permissions" line to:
'permission' => 'admin_forum',
That should get it to show only for admins.
Hi, thanks, users cannot change it now. But it does not show up in registration form anymore.
And if you would like to know, under admin > configuration > profile fields, 'show on registration' is ticked.
Help please? Thanks.
Try this:
'permission' => 'admin_forum' && isset($_REQUEST['area']) && $_REQUEST['area'] == 'account',
UPDATE : It came back to the form after live627's codes....and i thought it worked.
But users can change them again in their profile section again.
Originally, after Kays instructions, users cannot see the gender field anymore in their profile, only admins can. That's great.
But though, gender cannot be view in the form.
That's the problem.
More help please? Thanks.
Try this then. It might work ???
'permission' => isset($_REQUEST['action']) && $_REQUEST['action'] == 'register' ? 'profile_extra' : 'admin_forum' ,
Woah Kays! That totally helped! Thanks alot alot alot. Yep, it works now. Yay!
Also, thanks illori, branko and live627, and all those who helped.
Thanks alot. I guess it's resolved for now. Thanks alot kays! Your great (: Have a nice one!
Cool, thanks to live627 for the nudge in the right direction. :)
I find it strange that the fields on the register page are profile permission based. Guests shouldn't have permission to edit their profiles since they don't have one to start with. Unless I'm missing something in how thing are handled there. :)