Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: GL700Wing on August 21, 2019, 10:29:30 AM

Title: Option to search 'Select Box' custom profile field options on Memberlist
Post by: GL700Wing on August 21, 2019, 10:29:30 AM
Note: This tip works well in conjunction with the Custom Fields On Memberlist (https://custom.simplemachines.org/mods/index.php?mod=1520) 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.