Hi
I'm trying to add a gender field "other" to OSSN. I have found some files that need changing, but ultimately, I don't know how to change the appearance of the signup form and user forms so they show more than just male and female.
Thanks!
I wasn't really sure what to do. Do I just need to add the code you provided? You mentioned something about creating a new component.
This is a complete solution provided below , even it is a entire component you just need to place code in your ossn_com.php file of your component.
Can you upload the component here? Half a solution is no good for me :)
Hello, this was extremely useful. Do you know how one may add this third gender (along with a color like the other genders) to the stats on the Admin Dashboard?
Hi, download the HelloWorld component and paste the contents of my below reply in ossncom.php (components/HelloWorld/ossncom.php)
Nevermind...Have to create the component first. lol Trying to work on too many things at once. Sorry about that.
Where is the file located? I seem to be overlooking it.
Create new component and place following code in your ossn_com.php file
<?php
function new_gender_init() {
ossn_add_hook('user', 'default:fields', 'new_gender');
}
function new_gender($hook, $type, $val, $params) {
$toremove = array(
'gender'
);
$return = ossn_remove_field_from_fields($toremove, $val);
$fields['required'] = array(
'radio' => array(
array(
'name' => 'gender',
'options' => array(
'male' => ossn_print('male'),
'female' => ossn_print('female'),
'other' => 'Other'
)
)
)
);
return array_merge($return, $fields);
}
ossn_register_callback('ossn', 'init', 'new_gender_init');
Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)