By romagromov on Saturday, 04 October 2014
Posted in Technical Issues
Replies 11
Likes 0
Views 541
Votes 0
Hi!

In "Gender" field setting I have only 2 options "Man" and "Woman"
but in advanced and dating searches it displays 3 options "Man", "Woman" and "Other"



How to remove "Other" option?

Thanks.
Edit the file /modules/mod_easysocial_dating_search/tmpl/default.php and remove the codes below,


<label class="radio-inline">
<input type="radio" name="search-gender" value="3" <?php echo ($userData == "3") ? 'checked="checked"' : ''; ?> data-gender-radio /> <?php echo JText::_('MOD_EASYSOCIAL_DATING_SEARCH_GENDER_OTHERS'); ?>
</label>
·
Monday, 06 October 2014 21:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Currently this is not configurable but if you want to hack it, remove the codes below from the file /administrator/components/com_easysocial/includes/advancedsearch/helpers/user.php


$obj = new stdClass();
$obj->title = JText::_('COM_EASYSOCIAL_ADVANCED_SEARCH_GENDER_OTHERS');
$obj->value = '3';
$options[] = $obj;
·
Sunday, 05 October 2014 02:32
·
0 Likes
·
0 Votes
·
0 Comments
·
Great point. Allowing users to search up information that will always bring up no results should be hidden. If the field/option doesn't display, it doesn't make sense for it to be searchable.
·
Sunday, 05 October 2014 03:23
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Josh,

There is no way before hand to know if "other" is used in profile type or not unless advanced search is associated with profile types. In other words, the interface would then require the user to select a profile type first before adding additional search criteria's.
·
Sunday, 05 October 2014 13:56
·
0 Likes
·
0 Votes
·
0 Comments
·
The admin is the one who activates "other" for gender type. So if an admin does not activate "other", couldn't the advanced search field pull the options that are currently available to the user? I admit that I'm not well versed in how the drop down filter data is being pulled from the gender field. Because it's a preset field (as in one that is created/managed by the stacked team) I would think it would be easier to insert a ifelse statment that displays it based on the condition. But perhaps there is something I'm missing?

Edit: I looked through the code, looks a bit tricky.
·
Sunday, 05 October 2014 14:14
·
0 Likes
·
0 Votes
·
0 Comments
·
This is why, we are programmers and you are not Yes, like you said the admin activates which profile type has the "other" gender but what if only 1 profile type has "gender" and when you are on the advanced search, you are actually searching for everyone in general and not just from a specific profile type.
·
Sunday, 05 October 2014 14:23
·
0 Likes
·
0 Votes
·
0 Comments
·
Mark wrote:

This is why, we are programmers and you are not


Don't doubt a passionate person. Some day I will be scripting cool stuff as I progress in the web world. When that time comes I plan on writing some stuff for ES.

Mark wrote:

Yes, like you said the admin activates which profile type has the "other" gender but what if only 1 profile type has "gender" and when you are on the advanced search, you are actually searching for everyone in general and not just from a specific profile type.


Right, that scenario came to mind. But if neither profile type works with "other gender" the profile type issue in theory shouldn't be too much of a problem. If a custom field displays on a single profile type it should always display in the advanced search regardless to profile type selected as you say. Mark, if I'm ever annoying you, feel free to let me know.
·
Monday, 06 October 2014 15:21
·
0 Likes
·
0 Votes
·
0 Comments
·
Haha not doubting you Josh I believe you will someday be a great programmer and probably working with StackIdeas too! I think the problem here is the way the params are being stored in the database but we'll see what we can do about this in the future.
·
Monday, 06 October 2014 15:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks Mark, but this hack works only in advanced search.

How to remove option "Others" from Dating search module?

·
Monday, 06 October 2014 21:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks Mark. I appreciate the kind words. The tongue face made your comment appear as if I would never be a programmer.
·
Tuesday, 07 October 2014 08:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Oh, no don't get me wrong it wasn't meant to be sarcastic haha
·
Tuesday, 07 October 2014 13:11
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post