Genders

Started by Jennifer RachaelAnn, April 19, 2017, 07:46:04 PM

Previous topic - Next topic

Jennifer RachaelAnn

The board I run is a transgender support forum. I want to know is there any way to add to or modify the gender section? I would like to give people several options, and have tinkered with the file, but nothing I try works.

Linkjay

#1
Simply? No.

Genders, by default, are done by numbering on the forums. 0 = Other/None and then 1 and 2 are Male and Female. You would have to modify all the sections where a drop-down comes down to set genders and set the values above 2 and then go to all the sections where gender is displayed or edited and then work in the numbers.

If I were to go about this, I might work with titles under the names, groups, or have them put things in their signatures. You could add a custom profile field for this too. All in all, I think messing with the base genders for SMF is a bad idea and quite a challenge.
I play games in my free time and volunteer my knowledge and support to the gaming communities of the internet.

You can contact me by these methods:
Use my Contact Script • PM me here • Add me on Steam

Kindred

there was a mod for it...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

There are two, one will not install in 2.0 (it was updated to RC2, but doesn't install with emulation), the other has been removed from mod list (pink).
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shawnb61

Hmmm...   Sure seems like a pretty basic need.  An odd limitation; I was thinking about that the other day.

Since you're in the Scripting section, looks like you're willing to give it a try.  First suggestion is to look very closely at those old mods for ideas. 

What type of errors are you getting?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

Look under Admin | Features & Options | Profile Fields.

I'd de-activate the default Gender field, and try adding your own. 

Make sure you use a placement like "with icons" so it's up there visible where you want it.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Linkjay

I was just messing around with custom fields the other day too. If you do decide to do this, try what Shawn said and disable default genders then use the custom field. Custom field values are stored in the smf_themes table. I actually did not know that myself and I finally found it and it allowed me to use that value for a little project I was doing.
I play games in my free time and volunteer my knowledge and support to the gaming communities of the internet.

You can contact me by these methods:
Use my Contact Script • PM me here • Add me on Steam

Sir Osis of Liver

If custom fields are used, gender will not be displayed in poster info panel in display template.  Would require some custom coding to do that.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

shawnb61

#8
Some screenshots provided of how you might make it work.

There's even an option to present it upon registration.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

bestnow

FILE: Load.php  LINE: 1140  (Sources file)
find:

// Set things up to be used before hand.
$gendertxt = $profile['gender'] == 2 ? $txt['female'] : ($profile['gender'] == 1 ? $txt['male'] : '');


replace:

$gendertxt = $profile['gender'] == 2 ? $txt['female'] : $profile['gender'] == 1 ? $txt['male'] : ($profile['gender'] == 3 ? $txt['transgender'] : '') ;



FILE: Profile-Modify.php LINE: 305 (Sources file)

find:

'options' => 'return array(0 => \'\', 1 => $txt[\'male\'], 2 => $txt[\'female\']);',

replace:

'options' => 'return array(0 => \'\', 1 => $txt[\'male\'], 2 => $txt[\'female\'],  3 => $txt[\'transgender\']);',


FILE: index.english LINE 170 (Themes/default/languages file)
find:

$txt['female'] = 'Female';

add below

$txt['transgender'] = 'Transgender';










EXTRA INFO PICTURE GENDER if u want to add:



file: load.php LINE: 1180

Ex how the line looks like:

'image' => !empty($profile['gender']) ? '<img class="gender" src="' . $settings['images_url'] . '/' . ($profile['gender'] == 1 ? 'Male' : 'Female') . '.gif" alt="' . $gendertxt . '" />' : ''









picture to see it finish:



Kindred

Actually, this mod
https://custom.simplemachines.org/mods/index.php?mod=2152

will almost install on 2.0.13, if you emulate "SMF 2.0 RC2" (no quotes)
the only failure is in Load.php for the image
The fix?
Install the mod and then make this specific change

Code (in Load.php, find) Select

'image' => !empty($profile['gender']) ? '<img class="gender" src="' . $settings['images_url'] . '/' . ($profile['gender'] == 1 ? 'Male' : 'Female') . '.gif" alt="' . $gendertxt . '" />' : ''
   

Code (replace with ) Select

'image' => !empty($profile['gender']) ? '<img src="' . $settings['images_url'] . '/' . $genderimg . '" alt="' . $gendertxt . '" border="0" />' : ''



the nice thing about this mod is that it becomes fairly easy to change or add the choices -- just change the case statements as were added (see below) and then add additional images for each representation
Code (in Load.php) Select

switch($profile['gender']) {
            case 5:
                $gendertxt = $txt['intersexed'];
                $genderimg = 'intersexed.gif';
                break;
            case 4:
                $gendertxt = $txt['transf2m'];
                $genderimg = 'transexual.gif';
                break;
            case 3:
                $gendertxt = $txt['transm2f'];
                $genderimg = 'transexual.gif';
                break;
            case 2:
                $gendertxt = $txt['female'];
                $genderimg = 'Female.gif';
                break;
            case 1:
                $gendertxt = $txt['male'];
                $genderimg = 'Male.gif';
                break;
            default:
                $gendertxt = '';
                break;
        }
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

Nice fix.  Can you get the mod updated?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Linkjay

Quote from: Sir Osis of Liver on April 20, 2017, 06:00:58 PM
Nice fix.  Can you get the mod updated?

8 years. Unlikely.

Hopefully someone will come in and make the edits and re-release.
I play games in my free time and volunteer my knowledge and support to the gaming communities of the internet.

You can contact me by these methods:
Use my Contact Script • PM me here • Add me on Steam

KriKa

Quote from: bestnow on April 20, 2017, 07:28:35 AM
FILE: Load.php  LINE: 1140  (Sources file)
find:

// Set things up to be used before hand.
$gendertxt = $profile['gender'] == 2 ? $txt['female'] : ($profile['gender'] == 1 ? $txt['male'] : '');


replace:

$gendertxt = $profile['gender'] == 2 ? $txt['female'] : $profile['gender'] == 1 ? $txt['male'] : ($profile['gender'] == 3 ? $txt['transgender'] : '') ;



FILE: Profile-Modify.php LINE: 305 (Sources file)

find:

'options' => 'return array(0 => \'\', 1 => $txt[\'male\'], 2 => $txt[\'female\']);',

replace:

'options' => 'return array(0 => \'\', 1 => $txt[\'male\'], 2 => $txt[\'female\'],  3 => $txt[\'transgender\']);',


FILE: index.english LINE 170 (Themes/default/languages file)
find:

$txt['female'] = 'Female';

add below

$txt['transgender'] = 'Transgender';










EXTRA INFO PICTURE GENDER if u want to add:



file: load.php LINE: 1180

Ex how the line looks like:

'image' => !empty($profile['gender']) ? '<img class="gender" src="' . $settings['images_url'] . '/' . ($profile['gender'] == 1 ? 'Male' : 'Female') . '.gif" alt="' . $gendertxt . '" />' : ''









picture to see it finish:


awesome i was talking about it in another forum(forum of a MMORPG i paly)
i made a sugegstion for it, i will say it in...

Its pretty good to have
Male
Female
Lesbian
Gay
Trans

:D sounds good no?

@Btw i loved it, im lesbian and for long time i was thinking about it.
Good Girl Gone Bad!

Tomorrow comes today.!

Linkjay

Quote from: KriKa on April 24, 2017, 01:39:14 AM
Quote from: bestnow on April 20, 2017, 07:28:35 AM
--snip--
awesome i was talking about it in another forum(forum of a MMORPG i paly)
i made a sugegstion for it, i will say it in...

Its pretty good to have
Male
Female
Lesbian
Gay
Trans

:D sounds good no?

@Btw i loved it, im lesbian and for long time i was thinking about it.

You should always snip away text from a really big quote because it becomes absurdly large when it is really unnecessary to include all that.

I digress.

I think if you were going to add more genders, it should not include Gay or Lesbian because those are not genders but simply sexual preferences. That could be put into another field, however.
I play games in my free time and volunteer my knowledge and support to the gaming communities of the internet.

You can contact me by these methods:
Use my Contact Script • PM me here • Add me on Steam

KriKa

you right but its the point im meaning
Good Girl Gone Bad!

Tomorrow comes today.!

Arantor

Personally I'd disable the inbuilt one and convert it to a custom field then you could add as many as desired.

Going to the previous point of debate, there is a distinction between sex and gender, and there is a difference between gender identity and sexual preference, and without wanting to sound uninclusive, gay and lesbian do not belong in a gender identity choice in this context.

Being gay does not change being male just as being a lesbian does not change being female. It also doesn't affect whether a man or woman identifies with the biology they have, e.g. a straight woman can assume something of a male gender identity because gender fluidity is a massively complex thing.

Linkjay

Quote from: Arantor on April 24, 2017, 02:40:22 AM
Personally I'd disable the inbuilt one and convert it to a custom field then you could add as many as desired.

Going to the previous point of debate, there is a distinction between sex and gender, and there is a difference between gender identity and sexual preference, and without wanting to sound uninclusive, gay and lesbian do not belong in a gender identity choice in this context.

Being gay does not change being male just as being a lesbian does not change being female. It also doesn't affect whether a man or woman identifies with the biology they have, e.g. a straight woman can assume something of a male gender identity because gender fluidity is a massively complex thing.

Could not agree more with quite literally every word said in that passage.
I play games in my free time and volunteer my knowledge and support to the gaming communities of the internet.

You can contact me by these methods:
Use my Contact Script • PM me here • Add me on Steam

Kindred

also, please note that the one you quoted from "best now" does miss at least one location/file that also needs to be changed... hence my suggestion to use the mod with the noted changes - which accounts for all locations and more easily allows your own updates.

finally... yes...  As Arantor says, gender identity is separate and individual from sexual preference.
Additionally, while I may be interested in what gender an individual identifies as within a community (after all, I would like to know what pronoun preference to use, for one thing), unless your community needs that infiormation, sexual preference really has no place in being identified to the world.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Jennifer RachaelAnn

Wow, I think that's the most stuff I didn't understand all at once. I have no idea what any of that coding stuff is. I guess I'm screwed for adding the fields?

Advertisement: