3
hello, this worked great for me!
Although one problem! default avatar, blank.gif doesn't show up...
does anyone know how to fix this??
In the same system_block.php there is the code for user ranking
Quote:
function b_system_topposters_show($options)
{
$block = array();
$criteria = new CriteriaCompo(new Criteria('level', 0, '>'));
$limit = (!empty($options[0])) ? $options[0] : 10;
$size = count($options);
for ( $i = 2; $i < $size; $i++) {
$criteria->add(new Criteria('rank', $options[$i], '<>'));
}
$criteria->setOrder('DESC');
// $criteria->setSort('posts');
$criteria->setLimit($limit);
$member_handler =& xoops_gethandler('member');
$topposters =& $member_handler->getUsers($criteria);
$count = count($topposters);
for ($i = 0; $i < $count; $i++) {
$block['users'][$i]['rank'] = $i+1;
if ( $options[1] == 1 ) {
$block['users'][$i]['avatar'] = $topposters[$i]->getVar('user_avatar') != 'blank.gif' ? XOOPS_UPLOAD_URL.'/'.$topposters[$i]->getVar('user_avatar') : '';
} else {
$block['users'][$i]['avatar'] = '';
}
$block['users'][$i]['id'] = $topposters[$i]->getVar('uid');
$block['users'][$i]['name'] = $topposters[$i]->getVar('uname');
$block['users'][$i]['posts'] = $topposters[$i]->getVar('posts');
}
return $block;
}
and it shows the default avatar blank.gif just fine.
but this code doesn't
Quote:
$block['avatar'] = $xoopsUser->getVar('user_avatar') != 'blank.gif' ? XOOPS_URL.'/uploads/'.$xoopsUser->getVar('user_avatar') : '';
What's wrong???
please help figure this little problem out!