Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Tutorials and Tips

Notices

Reply
 
Thread Tools Display Modes
  #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: 63,669
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
  #2  
Old 09-19-2016, 05:51 AM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,095
parayna is on a distinguished road
Default

This is a good idea, but you might also want to change the 'register' file too! That way they can do it straight away, instead of having to go and edit their profile after sign up ^_^ (Or at least that's what I am doing XD)

Thanks for the tip off, though. I think it's a great idea :3 Definitely shows you're/your site is more inclusive!
Reply With Quote
  #3  
Old 09-19-2016, 10:03 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 327,561
Hall of Famer is on a distinguished road
Default

Interesting tutorial, but I wonder what is the use case of having gender as text field rather than radio button list. To my understanding genders are fixed constants, not like your name and age which can vary greatly. If you dont like 'other', you can change it to 'unknown' or 'unspecified' anyway.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #4  
Old 09-19-2016, 06:59 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 63,669
Dinocanid is on a distinguished road
Default

Parayna - I actually forgot about editing the register file! I opened it up too when I was editing; I guess it slipped my mind somehow.

HoF - I was originally going to keep the radio list and just add options for a few common gender identities (besides male and female, like nonbinary, bigender, the list goes on and on) people might have; but then there's the chance that someone's identity isn't on the list, in which I would still need to keep "other"/"unknown" anyway and it kind of defeated the purpose of editing the script in the first place. So basically I came up with this to completely avoid any issues it might cause further down the line, if there happen to be any at all.
Reply With Quote
  #5  
Old 09-26-2016, 06:06 PM
Eagle9615's Avatar
Eagle9615 Eagle9615 is offline
Member
 
Join Date: Jun 2013
Location: Southern US
Posts: 32
Gender: Female
Credits: 5,596
Eagle9615 is on a distinguished road
Default

This is such a small fix that will mean a lot to some people, thank you for posting this!
__________________

Last edited by Eagle9615; 09-28-2016 at 08:30 AM.
Reply With Quote
  #6  
Old 09-28-2016, 07:32 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 111,702
Abronsyth is on a distinguished road
Default

This is great! Will make many users so much more comfortable! I know of people who will not even sign up on a website because of the discomfort it causes if they have to choose from a set list of genders, so this will really help that!
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote
  #7  
Old 09-28-2016, 07:24 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 63,669
Dinocanid is on a distinguished road
Default

Thanks for all the input! I went in to see if I could change the register file too. It's a bit untested, since I haven't set up a new account on my site to see if it works, but I shouldn't cause any errors. Let me know if it does!

Under registerview.php, find these lines (should be 45-53):
PHP Code:
$additionalField->add(new Comment("Gender: "FALSE"b"));
        
$additionalField->add(new Comment("Male, Female or Not specified"));

        
$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("unknown");
        
$additionalField->add($genderList); 
and replace it all with this:

PHP Code:
$additionalField->add(new Comment("Gender: "FALSE"b"));
    
$additionalField->add(new TextField("gender")); 
Reply With Quote
  #8  
Old 07-18-2020, 06:45 PM
Pen's Avatar
Pen Pen is offline
Member
 
Join Date: Feb 2017
Posts: 15
Gender: Male
Credits: 4,962
Pen is on a distinguished road
Default

worked beautifully! As a trans person with many diversely gendered friends I really appreciate this one
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:11 PM.

Currently Active Users: 475 (0 members and 475 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636