View Single Post
  #1  
Old 09-16-2016, 09:42 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 65,252
Dinocanid is on a distinguished road
Default How to: Input gender as a text field

I've ran a forum or two in the past and someone who doesn't identify as male or female might not want to just have a simple "other" sitting on their profile. Some didn't even want to sign up because of it. So I went in to do a bit of editing and was able to make it so people could type in the gender themselves, rather than choosing an option.
(TL;DR: This changes the gender option from a radio button to a TextField. I use public_html, so if you don't then just follow from wherever you have Mysidia installed)

Step 1 (The only step)
Go to public_html/view/accountview. See this whole block?:

  Spoiler: code 

$profileForm->add(new Comment("Gender: "));

$genderList = new RadioList("gender");
$genderList->add(new RadioButton("Male", "gender", "male"));
$genderList->add(new RadioButton("Female", "gender", "female"));
$genderList->add(new RadioButton("Unknown", "gender", "unknown"));
$genderList->check($profile->getGender());

$profileForm->add($genderList);


Replace it with:

  Spoiler: newcode 
$profileForm->add(new Comment("Gender: ", FALSE));
$profileForm->add(new TextField("gender", $profile->getGender()));


(Optional) Step 2
Now go to phpMyAdmin and find prefix_users_profile. Change the varchar on gender from 10 to 20, just in case there isn't enough space.

Save and that's it. Pretty basic. I plan to do more tutorials in the future once I figure more stuff out.
Reply With Quote