• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How recover username or userId = ...


Well-known member
Hello, how can I retrieve a list of username since their id please ?
And how can I retrieve a the username to owner message in which I am (edition) ?

I use a .php Thank :)


Well-known member
// One user
$user = XenForo_Model::create('XenForo_Model_User')->getUserById($id);
echo $user['username'];

// Many users
$ids = array(1, 2, 3);
$users =  XenForo_Model::create('XenForo_Model_User')->getUsersByIds($ids);
foreach ($users as $id => $user) {
   echo $user['username'];