It wouldn't be too hard to modify the xoopsmember module to also integrate with the custom form you would create in Formulize. Since you're looking at a major hack anyway to get any sort of customization in there, I suggest you stick with using Formulize and Reg Codes, and build up some code in the xoopsmember module that works nicely with the custom profile form.
The way it would have to work would be something like this...
// in the area where the form is drawn, comment out the
// unused fields, and add something like this:
// determine which form the "User Profile" is
$module_handler =& xoops_gethandler('module');
$formulizeModule =& $module_handler->getByDirname("formulize");
$formulizeConfig =& $config_handler->getConfigsByCat(0, $formulizeModule->getVar('mid'));
$profileFormID = $formulizeConfig['profileForm'];
// get a series of element objects from that form:
$groups = $xoopsUser ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
$formulize_mgr =& xoops_getmodulehandler('elements', 'formulize');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('ele_display', 1), 'OR');
foreach($groups as $thisgroup) {
$criteria->add(new Criteria('ele_display', '%,'.$thisgroup.',%', 'LIKE'), 'OR');
}
$criteria->setSort('ele_order');
$criteria->setOrder('ASC');
$elements =& $formulize_mgr->getObjects2($criteria,$profileFormID);
// $elements is an array of element objects, one object per
// element in the custom profile form.
// Now simply loop through the elements and add a search box
// to the form for each one:
foreach($elements as $element) {
// put code here to add an HTML textbox to the search form
// for each field that you want to search in the profile
// form.
// You will need to somehow include the element ID number
// of each element so you can search that element later
// when you have received the search form submission.
// example, print 'Search "[element caption]":' and then
// put in a textbox:
print 'Search "' . $element->getVar('ele_caption') . '":';
print '. $element->getVar('ele_id') . '" />';
// Actually, since the xoopsmember search form is
// generated from a XOOPS form object, you couldn't do
// direct HTML like above, you'd have to use that info to
// create an element object to add to the XOOPS form
// object that is going to appear on the screen.
// But the important part is that we assume we're getting
// $_POST['formulize_ele_XX'] back from this form, where
// XX is the ID number of the element in the custom
// profile form that we need to search
}
// So on the receiving end, once a user has submitted a
// search request, you will have to make sure that the
// "formulize_ele_XX" submissions don't mess up the normal
// search parameters. That could be done by looping through
// $_POST right away and sticking all the Formulize-based
// search requests in a separate array:
$formulizeSearches = array();
foreach($_POST as $key=>$value) {
if(substr($key, 0, 14) == "formulize_ele_") {
$elementID = substr($key, 14); // isolate the XX part
$formulizeSearches[$elementID] = $value;
unset($_POST[$key]); // remove this from $_POST
}
}
// Then, you just need to search the profile form with the
// Formulize search data identified above, if any:
// if there actually are searches on the custom fields...
if(count($formulizeSearches) > 0) {
// include the Formulize data extraction layer:
include_once XOOPS_ROOT_PATH . "/modules/formulize/include/extract.php";
// build a filter string compatible with the getData
// function in the extraction layer:
$filterContents = array();
foreach($formulizeSearches as $elementID=>$searchTerm) {
$filterContents[] = $elementID . "/**/" . $searchTerm;
}
if(count($filterContents) > 1) {
$filter = implode("][" . $filterContents);
} else {
$filter = $filterContents[0];
}
// search the user profile form
$userData = getData("", $profileFormID, $filter)
// $userData is now an array of results from the custom
// profile field. You will have to get a list of user IDs
// that correspond to each found entry.
$foundUserID = array();
foreach($userData as $thisUser) {
$foundUserID[] = display($thisUser, "uid");
}
} // end of "if(count($formulizeSearches) > 0)"
// Now you just need to make sure that all the user IDs
// collected in $foundUserID are processed by the normal
// query to the user database table -- the one xoopsmembers
// already does based on the non-custom profile criteria.
// That way, data for these found users will appear on
// screen just like normal.
Lots of text, but mostly comments. Exactly how it gets integrated into the xoopsmembers module, well, that's a bit more work, and why I just wrote this up here instead of actually hacking it into the module. But someone with fair PHP skills should be able to make it work (if we don't bother to do it ourselves first).
I hope this helps.
--Julian