1
majortom
New Members Block - Display RealName
  • 2004/1/23 1:38

  • majortom

  • Just popping in

  • Posts: 7

  • Since: 2003/11/6


I am trying to change the display on the New Members block to display the realname of the member instead of the username. I have tried modifing the template code but without any success, which I am sure is related to my lack of php code knowlege.

Quote:
<table cellspacing="1" class="outer">
<{foreach item=user from=$block.users}>
<tr class="<{cycle values="even,odd"}>" valign="middle">
<td align="center">
<{if $user.avatar != ""}>
<img src="<{$user.avatar}>" alt="" width="32" /><br />
<{/if}>
<a href="<{$xoops_url}>/userinfo.php?uid=<{$user.id}>"><{$user.name}></a>
</td>
<td align="center"><{$user.joindate}></td>
</tr>
<{/foreach}>
</table>


Thanks in advance for your help!

2
Dave_L
Re: New Members Block - Display RealName
  • 2004/1/23 2:22

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


You can't do that by changing the template, since the real name is not being provided to the template.

Edit modules/system/blocks/system_blocks.php, and in the function b_system_newmembers_show (line 269 in version 2.0.5.2), change:

$block['users'][$i]['name'] = $newmembers[$i]->getVar('uname');

to:

$block['users'][$i]['name'] = $newmembers[$i]->getVar('name');

3
majortom
Re: New Members Block - Display RealName
  • 2004/1/23 17:44

  • majortom

  • Just popping in

  • Posts: 7

  • Since: 2003/11/6


Thanks Dave_L, it worked like a charm!!

4
pmhoran
Re: New Members Block - Display RealName
  • 2004/1/23 20:34

  • pmhoran

  • Not too shy to talk

  • Posts: 115

  • Since: 2003/2/21


While on the topic ... sort of ...

I would like the Real Name to show ALL the time in every module etc. But am concerned because some people don't complete that box in their info.

So could someone share a "common" line to use that might work everywhere that (except when logging in) their Real Name shows up ... except when that block is empty in their info in which case it would revert to their login name?

Did that make sense? Oh well ...

Thanks
Peter

Login

Who's Online

244 user(s) are online (174 user(s) are browsing Support Forums)


Members: 0


Guests: 244


more...

Donat-O-Meter

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

Latest GitHub Commits