Customizing SMF > SMF Coding Discussion
Showing Membergroups + Chosen Custom Field(s)?
(1/1)
Xarwin:
Hello everyone.
Lately I've been working on a code to show all members from a certain group.
Currently it is working, showing their name and avatar.
However, I'd really love to show a certain custom field or multiple custom fields below their avatar (most likely one custom field).
Any way how to make it possible? This is the current code that I am using:
--- Code: --- echo '<center><div style="align:center;"><font-size: 14px;><b>Official League of Legends Members</b></font><hr><br>';
$array = ssi_fetchGroupMembers(10, 'array');
foreach ($array as $member)
{
echo '<center>
<div style="float:left;padding:10px; color: #c6c6c6; background: rgba(100, 100, 100, 0.20); border-radius: 8px; -moz-border-radius: 8px; -webkit-border-radius: 8px; border: 1px solid #000000; height: 180px; width: 180px; align:center; margin: 5px;">
',$member['link'],'
<br><br>
', $member['avatar']['image'], '
</center></div>';
}
echo'</center></div>';
--- End code ---
I am using ssi here. Do I require other coding than this?
Help is really appreciated since I'm a rookie at php. I love to figure out stuff but sometimes I just can't find the solution.
Thanks in advance :)
-Xarwin
p.s. I'm not using a mod, I'm using the SMF Advanced Profile Fields.
Xarwin:
Kinda bumping after a while.. ;).
Suki:
Sorry for the late reply.
By default ssi_queryMembers(), which is the generic function alot of SSI functions use, doesn't load the custom profile fields, if you want to do that, Open your SSI.php and find:
// Load the members.
loadMemberData($members);
// Draw the table!
and replace it with
// Load the members.
loadMemberData($members, true);
// Draw the table!
That should do to load the profile fields, now just use a print_r() on $array to see what are the available values.
Navigation
[0] Message Index
Go to full version