1
xfranc
New Members Block
  • 2006/9/12 13:18

  • xfranc

  • Just popping in

  • Posts: 22

  • Since: 2005/8/4 1


Hi all,

Quick Question (I Hope)

I would like to modify the selection criteria for the default new members block to show new members of a particular group.

Is this possible ?

Many Thanks


Xfranc
www.pleqguild.co.uk

2
rplima2004
Re: New Members Block
  • 2006/9/12 14:08

  • rplima2004

  • Just popping in

  • Posts: 70

  • Since: 2004/10/8


Hi xfranc,

Yes, its possible.

Change the function b_system_newmembers_show in the file XOOPS_ROOT_PATH/modules/system/blocks/system_blocks.php like this.

Quote:

function b_system_newmembers_show($options)
{
$block = array();
$criteria = new CriteriaCompo(new Criteria('level', 0, '>'));
$limit = (!empty($options[0])) ? $options[0] : 10;
$criteria->setOrder('DESC');
$criteria->setOrder('DESC');
$criteria->setSort('user_regdate');
$criteria->setLimit($limit);
$member_handler =& xoops_gethandler('member');
$newmembers = $member_handler->getUsers($criteria);
$count = count($newmembers);
//hacked by rplima
$showGroups = array('1'); //Put in this array the ids of groups you want to show. In the example only menbers of admin group will be shown.
for ($i = 0; $i < $count; $i++) {
$groups =& $member_handler->getGroupsByUser($newmembers[$i]->getVar('uid'));
foreach($showGroups as $group){
if (in_array($group,$groups)){
if ( $options[1] == 1 ) {
$block['users'][$i]['avatar'] = $newmembers[$i]->getVar('user_avatar') != 'blank.gif' ? XOOPS_UPLOAD_URL.'/'.$newmembers[$i]->getVar('user_avatar') : '';
} else {
$block['users'][$i]['avatar'] = '';
}
$block['users'][$i]['id'] = $newmembers[$i]->getVar('uid');
$block['users'][$i]['name'] = $newmembers[$i]->getVar('uname');
$block['users'][$i]['joindate'] = formatTimestamp($newmembers[$i]->getVar('user_regdate'), 's');
}
}
}
//end of hack
return $block;
}


att

Rodrigo

3
xfranc
Re: New Members Block
  • 2006/9/12 14:35

  • xfranc

  • Just popping in

  • Posts: 22

  • Since: 2005/8/4 1


This worked a treat,

Many Thanks!

Login

Who's Online

229 user(s) are online (152 user(s) are browsing Support Forums)


Members: 0


Guests: 229


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits