Disclaimer / Notice: This was done because my post was not answered and I needed a solution. If there are problems in the code, please do step in and point them out. I am not a coder. I have no idea if this is inefficient or causes undue strain on the server/database.
Please use at your own risk and be sure to back up any files (db, template, system, etc.) before modifying them.
System New Members block mod/clone -
In modules/system/blocks/system_blocks.php, add this code after the b_system_topposters_edit block of code (not sure if it matters where it's placed):
function b_system_yourvariable_show($options)
{
$block = array();
$criteria = new CriteriaCompo(new Criteria('level', 0, '>'));
$criteria->add(new Criteria('fieldname', 1));
$limit = (!empty($options[0])) ? $options[0] : 10;
$criteria->setOrder('ASC');
$criteria->setSort('uname');
$criteria->setLimit($limit);
$profile_handler =& xoops_gethandler('profile');
$fields =& $profile_handler->loadFields();
$member_handler =& xoops_gethandler('member');
$yourvariable =& $member_handler->getUsers($criteria);
$count = count($yourvariable);
for ($i = 0; $i < $count; $i++) {
if ($options[1] == 1 ) {
$block['users'][$i]['avatar'] = $yourvariable[$i]->getVar('user_avatar') != 'blank.gif' ? XOOPS_UPLOAD_URL.'/'.$yourvariable[$i]->getVar('user_avatar') : '';
} else {
$block['users'][$i]['avatar'] = '';
}
$block['users'][$i]['id'] = $yourvariable[$i]->getVar('uid');
$block['users'][$i]['name'] = $yourvariable[$i]->getVar('uname');
$block['users'][$i]['field_title'] = $yourvariable[$i]->getVar('field_name');
$block['users'][$i]['field_title2'] = $yourvariable[$i]->getVar('field_name2');
}
return $block;
}
Replace all instances of "yourvariable" with your own title. Replace all instances of field_name field_title with the name/title of your custom field(s) used in extended profiles module. Along with other criteria, it pulls users meeting this:
$criteria->add(new Criteria('fieldname', 1));
Which is a yes/no radio button I set as a custom field.
After function b_system_newmembers_edit($options) code block add:
function b_system_yourvariable_edit($options)
{
$inputtag = ".$options[0]."' />";
$form = sprintf(_MB_SYSTEM_DISPLAY,$inputtag);
$form .= "
"._MB_SYSTEM_DISPLAYA." ;
if ( $options[1] == 1 ) {
$form .= " checked='checked'";
}
$form .= " /> "._YES.";
if ( $options[1] == 0 ) {
$form .= " checked='checked'";
}
$form .= " /> "._NO."";
return $form;
}
Next in - system/xoops_version.php above the comment // Profile fields - add:
// Your_title Block
$modversion['blocks'][14]['file'] = "system_blocks.php";
$modversion['blocks'][14]['name'] = _MI_SYSTEM_BNAME15;
$modversion['blocks'][14]['description'] = "Your Description";
$modversion['blocks'][14]['show_func'] = "b_system_yourvariable_show";
$modversion['blocks'][14]['options'] = "10|1";
$modversion['blocks'][14]['edit_func'] = "b_system_yourvariable_edit";
$modversion['blocks'][14]['template'] = 'system_block_yourvariable.html';
Make sure the _MI_SYSTEM_BNAME is the correct # for your system then modify the system/language/english/modinfo.php file to incorporate _MI_SYSTEM_BNAME#.
Add the system_block_yourvariable.html to modules/system/templates/blocks/ directory. If I remember correctly, I copied system_block_newusers.html and modified it to suit my needs - using <{$user.field_title}> in the template.
Update the system module.
You should now be able to add and set the parameters of the new block in your blocks admin.
Good luck!