Gossamer
Active member
Hello! I've been going through some tutorials and decided to try and tackle my first little modification. Basically, I created a page using a php callback. I've setup a template that displays all users in a specific usergroup. My final goal is to basically group them by a custom field.
Right now, I'm struggling with pulling in the custom field. I'm trying to display a certain custom user field using {$user.customFields.fandom}, but that data isn't being pulled in with the $users object.
This is the code of my php file:
Any advice for a newbie?
Right now, I'm struggling with pulling in the custom field. I'm trying to display a certain custom user field using {$user.customFields.fandom}, but that data isn't being pulled in with the $users object.
This is the code of my php file:
PHP:
<?php
class Goss_CanonList_CanonList
{
public static function respond(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract $response)
{
// fetch recent registrations
$userModel = $controller->getModelFromCache('Xenforo_Model_User');
$response->params['users'] = $userModel->getUsers(array(
'user_group_id' => 5,
'user_state' => 'valid'
), array('limit'=>5));
$response->templateName = 'goss_canonlist';
}
}