Finexes
Well-known member
Hey guys,
I'll keep it short. I created a page with a callback, here's the PHP:
And this is the template:
That works great, but now I would like to get the value of a custom user field. I found Jake's solution in a thread: https://xenforo.com/community/threa...message_user_info-template.20792/#post-314978
Unfortunately I have no idea where to put the code into my PHP file, is there anyone who could point me into the right direction?
Thanks in advance!
Moritz
I'll keep it short. I created a page with a callback, here's the PHP:
PHP:
<?php
class TRG_Memberlist_Users
{
public static function getSupporters(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response)
{
$criteria = array(
'secondary_group_ids' => array(9)
);
$options = array(
'join' => XenForo_Model_User::FETCH_USER_FULL,
'order' => 'username'
);
$users = $controller->getModelFromCache('XenForo_Model_User')->getUsers($criteria, $options);
$response->params['users'] = $users;
}
}
And this is the template:
HTML:
<ol class="section memberList">
<xen:foreach loop="$users" value="$user">
<xen:include template="member_list_item">
<xen:set var="$noOverlay">1</xen:set>
</xen:include>
</xen:foreach>
</ol>
That works great, but now I would like to get the value of a custom user field. I found Jake's solution in a thread: https://xenforo.com/community/threa...message_user_info-template.20792/#post-314978
Unfortunately I have no idea where to put the code into my PHP file, is there anyone who could point me into the right direction?
Thanks in advance!
Moritz