Option to search 'Select Box' custom profile field options on Memberlist

Started by GL700Wing, August 21, 2019, 10:29:30 AM

Previous topic - Next topic

GL700Wing

Note: This tip works well in conjunction with the Custom Fields On Memberlist mod which enables the displaying of custom profile fields on the Memberlist.

This tip enables the searching of 'Select Box' custom profile field options on the Memberlist.

In ./Themes/default/Admin.template.php

Find:
document.getElementById("can_search_dt").style.display = curType == "text" || curType == "textarea" ? "" : "none";
document.getElementById("can_search_dd").style.display = curType == "text" || curType == "textarea" ? "" : "none";


Replace With:
document.getElementById("can_search_dt").style.display = curType == "text" || curType == "textarea" || curType == "select" ? "" : "none";
document.getElementById("can_search_dd").style.display = curType == "text" || curType == "textarea" || curType == "select" ? "" : "none";



In ./Sources/Memberlist.php

Find:
AND (field_type = {string:field_type_text} OR field_type = {string:field_type_textarea})',

Replace With:
AND (field_type = {string:field_type_text} OR field_type = {string:field_type_textarea} OR field_type = {string:field_type_select})',


Find:
'field_type_textarea' => 'textarea',

Add After:
'field_type_select' => 'select',



The attached images show 'Before' and 'After' screenshots for the 'Custom Profile Field' screen and the 'Search For Members' screen.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Advertisement: