33
OK, I did not look into cbb because I do not have it installed, but here is one example on how to do it for system/templates/blocks/system_block_topusers.html
Here goes the entire template:
<table cellspacing="1" class="outer">
<{foreach item=user from=$block.users}>
<tr class="<{cycle values="even,odd"}>" valign="middle">
<td><{$user.rank}>td>
<td align="center">
<{if $user.avatar != ""}>
<img src="<{$user.avatar}>" alt="" width="32" /><br />
<{/if}>
<a href="<{$xoops_url}>/userinfo.php?uid=<{$user.id}>" title="<{$user.name}>"><{$user.name}>a>
<br />
<{php}>
global $xoopsTpl;
$myField = '';
$profile_handler =& xoops_getmodulehandler('profile', 'profile');
$profile = $profile_handler->get($xoopsTpl->_tpl_vars['user']['id']);
if (is_object($profile)) {
$myField = $profile->getVar('myfield');
}
$xoopsTpl->assign('myField', $myField);
<{/php}>
<{$myField}>
td>
<td align="center"><{$user.posts}>td>
tr>
<{/foreach}>
table>
I think we can change this to get all profile variables instead on doing it one by one, maybe by using getVars and append instead of assign.
Ideally, we could hack core to provide profile info instead of user info for $xoopsUser, this way we would not need to call profile handler and do this tricks.